PageSourceSearch

https://app.socialness.ai/assets/index-DsBLc1Xm.js

js socialness.ai collected 2026-10-05 12:39:18 UTC 3,490,815 bytes, 4,001 lines download raw bytes

1var cJ=Object.defineProperty;var wP=e=>{throw TypeError(e)};var uJ=(e,t,r)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vt=(e,t,r)=>uJ(e,typeof t!="symbol"?t+"":t,r),xN=(e,t,r)=>t.has(e)||wP("Cannot "+r);var be=(e,t,r)=>(xN(e,t,"read from private field"),r?r.call(e):t.get(e)),Vt=(e,t,r)=>t.has(e)?wP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),It=(e,t,r,n)=>(xN(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),br=(e,t,r)=>(xN(e,t,"access private method"),r);var Lb=(e,t,r,n)=>({set _(a){It(e,t,a,r)},get _(){return be(e,t,n)}});import{r as b,a as Ly,g as hn,R as U,u as vs,N as Bl,L as Us,e as Wd,b as tF,c as pn,d as ui,f as jg,h as U4,B as dJ,i as jP,j as Cr,O as fJ}from"./vendor-BJS_eMXP.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var rF={exports:{}},Lw={};/**
2 * @license React
3 * react-jsx-runtime.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var mJ=b,hJ=Symbol.for("react.element"),pJ=Symbol.for("react.fragment"),gJ=Object.prototype.hasOwnProperty,yJ=mJ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bJ={key:!0,ref:!0,__self:!0,__source:!0};function nF(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)gJ.call(t,n)&&!bJ.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:hJ,type:e,key:i,ref:o,props:a,_owner:yJ.current}}Lw.Fragment=pJ;Lw.jsx=nF;Lw.jsxs=nF;rF.exports=Lw;var s=rF.exports,aF,NP=Ly;aF=NP.createRoot,NP.hydrateRoot;const sF=Object.prototype.toString;function V4(e){switch(sF.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return qd(e,Error)}}function Hh(e,t){return sF.call(e)===`[object ${t}]`}function W4(e){return Hh(e,"ErrorEvent")}function SP(e){return Hh(e,"DOMError")}function vJ(e){return Hh(e,"DOMException")}function Ul(e){return Hh(e,"String")}function q4(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function G4(e){return e===null||q4(e)||typeof e!="object"&&typeof e!="function"}function Gm(e){return Hh(e,"Object")}function Dw(e){return typeof Event<"u"&&qd(e,Event)}function xJ(e){return typeof Element<"u"&&qd(e,Element)}function wJ(e){return Hh(e,"RegExp")}function Ow(e){return!!(e&&e.then&&typeof e.then=="function")}function jJ(e){return Gm(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function NJ(e){return typeof e=="number"&&e!==e}function qd(e,t){try{return e instanceof t}catch{return!1}}function iF(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function ym(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function CP(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const a=e[n];try{iF(a)?r.push("[VueViewModel]"):r.push(String(a))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function SJ(e,t,r=!1){return Ul(e)?wJ(t)?t.test(e):Ul(t)?r?e===t:e.includes(t):!1:!1}function Dy(e,t=[],r=!1){return t.some(n=>SJ(e,n,r))}function CJ(e,t,r=250,n,a,i,o){if(!i.exception||!i.exception.values||!o||!qd(o.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=kJ(yC(e,t,a,o.originalException,n,i.exception.values,l,0),r))}function yC(e,t,r,n,a,i,o,l){if(i.length>=r+1)return i;let c=[...i];if(qd(n[a],Error)){kP(o,l);const u=e(t,n[a]),d=c.length;MP(u,a,d,l),c=yC(e,t,r,n[a],a,[u,...c],u,d)}
9return Array.isArray(n.errors)&&n.errors.forEach((u,d)=>{if(qd(u,Error)){kP(o,l);const f=e(t,u),m=c.length;MP(f,`errors[${d}]`,m,l),c=yC(e,t,r,u,a,[f,...c],f,m)}}),c}function kP(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function MP(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function kJ(e,t){return e.map(r=>(r.value&&(r.value=ym(r.value,t)),r))}function Db(e){return e&&e.Math==Math?e:void 0}const Ur=typeof globalThis=="object"&&Db(globalThis)||typeof window=="object"&&Db(window)||typeof self=="object"&&Db(self)||typeof global=="object"&&Db(global)||function(){return this}()||{};function H4(){return Ur}function oF(e,t,r){const n=r||Ur,a=n.__SENTRY__=n.__SENTRY__||{};return a[e]||(a[e]=t())}const Y4=H4(),MJ=80;function Rw(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,a=[];let i=0,o=0;const l=" > ",c=l.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||MJ;for(;r&&i++<n&&(u=IJ(r,d),!(u==="html"||i>1&&o+a.length*c+u.length>=f));)a.push(u),o+=u.length,r=r.parentNode;return a.reverse().join(l)}catch{return"<unknown>"}}function IJ(e,t){const r=e,n=[];let a,i,o,l,c;if(!r||!r.tagName)return"";if(Y4.HTMLElement&&r instanceof HTMLElement&&r.dataset&&r.dataset.sentryComponent)return r.dataset.sentryComponent;n.push(r.tagName.toLowerCase());const u=t&&t.length?t.filter(f=>r.getAttribute(f)).map(f=>[f,r.getAttribute(f)]):null;if(u&&u.length)u.forEach(f=>{n.push(`[${f[0]}="${f[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),a=r.className,a&&Ul(a))for(i=a.split(/\s+/),c=0;c<i.length;c++)n.push(`.${i[c]}`);const d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)o=d[c],l=r.getAttribute(o),l&&n.push(`[${o}="${l}"]`);return n.join("")}function EJ(){try{return Y4.document.location.href}catch{return""}}function TJ(e){if(!Y4.HTMLElement)return null;let t=e;const r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}const Oy=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,AJ="Sentry Logger ",bC=["debug","info","warn","error","log","assert","trace"],gx={};function Gd(e){if(!("console"in Ur))return e();const t=Ur.console,r={},n=Object.keys(gx);n.forEach(a=>{const i=gx[a];r[a]=t[a],t[a]=i});try{return e()}finally{n.forEach(a=>{t[a]=r[a]})}}function PJ(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Oy?bC.forEach(r=>{t[r]=(...n)=>{e&&Gd(()=>{Ur.console[r](`${AJ}[${r}]:`,...n)})}}):bC.forEach(r=>{t[r]=()=>{}}),t}const St=PJ(),_J=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function LJ(e){return e==="http"||e==="https"}function Yh(e,t=!1){const{host:r,path:n,pass:a,port:i,projectId:o,protocol:l,publicKey:c}=e;return`${l}://${c}${t&&a?`:${a}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${o}`}function DJ(e){const t=_J.exec(e);if(!t){Gd(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,n,a="",i,o="",l]=t.slice(1);let c="",u=l;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const f=u.match(/^\d+/);f&&(u=f[0])}return lF({host:i,pass:a,path:c,projectId:u,port:o,protocol:r,publicKey:n})}function lF(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function OJ(e){if(!Oy)return!0;const{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(St.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:r.match(/^\d+$/)?LJ(n)?t&&isNaN(parseInt(t,10))?(St.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(St.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(St.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function cF(e){const t=typeof e=="string"?DJ(e):lF(e);if(!(!t||!OJ(t)))return t}class $o extends Error{constructor(t,r="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}}function Ra(e,t,r){if(!(t in e))return;
9const n=e[t],a=r(n);typeof a=="function"&&uF(a,n),e[t]=a}function n0(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{Oy&&St.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function uF(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,n0(e,"__sentry_original__",t)}catch{}}function Q4(e){return e.__sentry_original__}function RJ(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function dF(e){if(V4(e))return{message:e.message,name:e.name,stack:e.stack,...EP(e)};if(Dw(e)){const t={type:e.type,target:IP(e.target),currentTarget:IP(e.currentTarget),...EP(e)};return typeof CustomEvent<"u"&&qd(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function IP(e){try{return xJ(e)?Rw(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function EP(e){if(typeof e=="object"&&e!==null){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function $J(e,t=40){const r=Object.keys(dF(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return ym(r[0],t);for(let n=r.length;n>0;n--){const a=r.slice(0,n).join(", ");if(!(a.length>t))return n===r.length?a:ym(a,t)}return""}function oo(e){return vC(e,new Map)}function vC(e,t){if(FJ(e)){const r=t.get(e);if(r!==void 0)return r;const n={};t.set(e,n);for(const a of Object.keys(e))typeof e[a]<"u"&&(n[a]=vC(e[a],t));return n}if(Array.isArray(e)){const r=t.get(e);if(r!==void 0)return r;const n=[];return t.set(e,n),e.forEach(a=>{n.push(vC(a,t))}),n}return e}function FJ(e){if(!Gm(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const fF=50,TP=/\(error: (.*)\)/,AP=/captureMessage|captureException/;function mF(...e){const t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{const a=[],i=r.split(`
10`);for(let o=n;o<i.length;o++){const l=i[o];if(l.length>1024)continue;const c=TP.test(l)?l.replace(TP,"$1"):l;if(!c.match(/\S*Error: /)){for(const u of t){const d=u(c);if(d){a.push(d);break}}if(a.length>=fF)break}}return BJ(a)}}function zJ(e){return Array.isArray(e)?mF(...e):e}function BJ(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),AP.test(t[t.length-1].function||"")&&(t.pop(),AP.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,fF).map(r=>({...r,filename:r.filename||t[t.length-1].filename,function:r.function||"?"}))}const wN="<anonymous>";function rc(e){try{return!e||typeof e!="function"?wN:e.name||wN}catch{return wN}}const Rv={},PP={};function pf(e,t){Rv[e]=Rv[e]||[],Rv[e].push(t)}function gf(e,t){PP[e]||(t(),PP[e]=!0)}function ho(e,t){const r=e&&Rv[e];if(r)for(const n of r)try{n(t)}catch(a){Oy&&St.error(`Error while triggering instrumentation handler.
11Type: ${e}
12Name: ${rc(n)}
13Error:`,a)}}function UJ(e){const t="console";pf(t,e),gf(t,VJ)}function VJ(){"console"in Ur&&bC.forEach(function(e){e in Ur.console&&Ra(Ur.console,e,function(t){return gx[e]=t,function(...r){ho("console",{args:r,level:e});const a=gx[e];a&&a.apply(Ur.console,r)}})})}function ni(){const e=Ur,t=e.crypto||e.msCrypto;let r=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{const n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function hF(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Uc(e){const{message:t,event_id:r}=e;if(t)return t;const n=hF(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function xC(e,t,r){const n=e.exception=e.exception||{},a=n.values=n.values||[],i=a[0]=a[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function a0(e,t){const r=hF(e);if(!r)return;const n={type:"generic",handled:!0},a=r.mechanism;if(r.mechanism={...n,...a,...t},t&&"data"in t){const i={...a&&a.data,...t.data};r.mechanism.data=i}}function _P(e){if(e&&e.__sentry_captured__)return!0;try{n0(e,"__sentry_captured__",!0)}catch{}return!1}function pF(e){return Array.isArray(e)?e:[e]}const Xf=Ur,WJ=1e3;let LP,wC,jC;function gF(e){const t="dom";pf(t,e),gf(t,qJ)}
13function qJ(){if(!Xf.document)return;const e=ho.bind(null,"dom"),t=DP(e,!0);Xf.document.addEventListener("click",t,!1),Xf.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{const n=Xf[r]&&Xf[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ra(n,"addEventListener",function(a){return function(i,o,l){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const f=DP(e);d.handler=f,a.call(this,i,f,l)}d.refCount++}catch{}return a.call(this,i,o,l)}}),Ra(n,"removeEventListener",function(a){return function(i,o,l){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(a.call(this,i,d.handler,l),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return a.call(this,i,o,l)}}))})}function GJ(e){if(e.type!==wC)return!1;try{if(!e.target||e.target._sentryId!==jC)return!1}catch{}return!0}function HJ(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function DP(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=YJ(r);if(HJ(r.type,n))return;n0(r,"_sentryCaptured",!0),n&&!n._sentryId&&n0(n,"_sentryId",ni());const a=r.type==="keypress"?"input":r.type;GJ(r)||(e({event:r,name:a,global:t}),wC=r.type,jC=n?n._sentryId:void 0),clearTimeout(LP),LP=Xf.setTimeout(()=>{jC=void 0,wC=void 0},WJ)}}function YJ(e){try{return e.target}catch{return null}}const NC=H4();function yF(){if(!("fetch"in NC))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function SC(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function QJ(){if(typeof EdgeRuntime=="string")return!0;if(!yF())return!1;if(SC(NC.fetch))return!0;let e=!1;const t=NC.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=SC(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){Oy&&St.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function bF(e){const t="fetch";pf(t,e),gf(t,KJ)}function KJ(){QJ()&&Ra(Ur,"fetch",function(e){return function(...t){const{method:r,url:n}=JJ(t),a={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return ho("fetch",{...a}),e.apply(Ur,t).then(i=>{const o={...a,endTimestamp:Date.now(),response:i};return ho("fetch",o),i},i=>{const o={...a,endTimestamp:Date.now(),error:i};throw ho("fetch",o),i})}})}function CC(e,t){return!!e&&typeof e=="object"&&!!e[t]}function OP(e){return typeof e=="string"?e:e?CC(e,"url")?e.url:e.toString?e.toString():"":""}function JJ(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[r,n]=e;return{url:OP(r),method:CC(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:OP(t),method:CC(t,"method")?String(t.method).toUpperCase():"GET"}}let Ob=null;function ZJ(e){const t="error";pf(t,e),gf(t,XJ)}function XJ(){Ob=Ur.onerror,Ur.onerror=function(e,t,r,n,a){return ho("error",{column:n,error:a,line:r,msg:e,url:t}),Ob&&!Ob.__SENTRY_LOADER__?Ob.apply(this,arguments):!1},Ur.onerror.__SENTRY_INSTRUMENTED__=!0}let Rb=null;function eZ(e){const t="unhandledrejection";pf(t,e),gf(t,tZ)}function tZ(){Rb=Ur.onunhandledrejection,Ur.onunhandledrejection=function(e){return ho("unhandledrejection",e),Rb&&!Rb.__SENTRY_LOADER__?Rb.apply(this,arguments):!0},Ur.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const $b=H4();function rZ(){const e=$b.chrome,t=e&&e.app&&e.app.runtime,r="history"in $b&&!!$b.history.pushState&&!!$b.history.replaceState;return!t&&r}const qp=Ur;let Fb;function K4(e){const t="history";pf(t,e),gf(t,nZ)}function nZ(){if(!rZ())return;const e=qp.onpopstate;qp.onpopstate=function(...r){const n=qp.location.href,a=Fb;if(Fb=n,ho("history",{from:a,to:n}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(...n){const a=n.length>2?n[2]:void 0;if(a){const i=Fb,o=String(a);Fb=o,ho("history",{from:i,to:o})}return r.apply(this,n)}}Ra(qp.history,"pushState",t),Ra(qp.history,"replaceState",t)}const aZ=Ur,md="__sentry_xhr_v3__";function vF(e){const t="xhr";pf(t,e),gf(t,sZ)}function sZ(){if(!aZ.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Ra(e,"open",function(t){return function(...r){const n=Date.now(),a=Ul(r[0])?r[0].toUpperCase():void 0,i=iZ(r[1]);if(!a||!i)return t.apply(this,r);this[md]={method:a,url:i,request_headers:{}}
13,a==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const l=this[md];if(l&&this.readyState===4){try{l.status_code=this.status}catch{}const c={args:[a,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this};ho("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ra(this,"onreadystatechange",function(l){return function(...c){return o(),l.apply(this,c)}}):this.addEventListener("readystatechange",o),Ra(this,"setRequestHeader",function(l){return function(...c){const[u,d]=c,f=this[md];return f&&Ul(u)&&Ul(d)&&(f.request_headers[u.toLowerCase()]=d),l.apply(this,c)}}),t.apply(this,r)}}),Ra(e,"send",function(t){return function(...r){const n=this[md];if(!n)return t.apply(this,r);r[0]!==void 0&&(n.body=r[0]);const a={args:[n.method,n.url],startTimestamp:Date.now(),xhr:this};return ho("xhr",a),t.apply(this,r)}})}function iZ(e){if(Ul(e))return e;try{return e.toString()}catch{}}function oZ(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function lZ(){return"npm"}function cZ(){return!oZ()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function RP(){return typeof window<"u"&&(!cZ()||uZ())}function uZ(){return Ur.process!==void 0&&Ur.process.type==="renderer"}function dZ(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(a){if(e)return t.has(a)?!0:(t.add(a),!1);for(let i=0;i<t.length;i++)if(t[i]===a)return!0;return t.push(a),!1}function n(a){if(e)t.delete(a);else for(let i=0;i<t.length;i++)if(t[i]===a){t.splice(i,1);break}}return[r,n]}function Lo(e,t=100,r=1/0){try{return kC("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function xF(e,t=3,r=100*1024){const n=Lo(e,t);return pZ(n)>r?xF(e,t-1,r):n}function kC(e,t,r=1/0,n=1/0,a=dZ()){const[i,o]=a;if(t==null||["number","boolean","string"].includes(typeof t)&&!NJ(t))return t;const l=fZ(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(c===0)return l.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const h=u.toJSON();return kC("",h,c-1,n,a)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const m=dF(t);for(const h in m){if(!Object.prototype.hasOwnProperty.call(m,h))continue;if(f>=n){d[h]="[MaxProperties ~]";break}const p=m[h];d[h]=kC(h,p,c-1,n,a),f++}return o(t),d}function fZ(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(iF(t))return"[VueViewModel]";if(jJ(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${rc(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const r=mZ(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function mZ(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function hZ(e){return~-encodeURI(e).split(/%..|./).length}function pZ(e){return hZ(JSON.stringify(e))}var El;(function(e){e[e.PENDING=0]="PENDING";const r=1;e[e.RESOLVED=r]="RESOLVED";const n=2;e[e.REJECTED=n]="REJECTED"})(El||(El={}));function Hm(e){return new Js(t=>{t(e)})}function J4(e){return new Js((t,r)=>{r(e)})}class Js{constructor(t){Js.prototype.__init.call(this),Js.prototype.__init2.call(this),Js.prototype.__init3.call(this),Js.prototype.__init4.call(this),this._state=El.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(r){this._reject(r)}}then(t,r){return new Js((n,a)=>{this._handlers.push([!1,i=>{if(!t)n(i);else try{n(t(i))}catch(o){a(o)}},i=>{if(!r)a(i);else try{n(r(i))}catch(o){a(o)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new Js((r,n)=>{let a,i;return this.then(o=>{i=!1,a=o,t&&t()},o=>{i=!0,a=o,t&&t()}).then(()=>
13{if(i){n(a);return}r(a)})})}__init(){this._resolve=t=>{this._setResult(El.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(El.REJECTED,t)}}__init3(){this._setResult=(t,r)=>{if(this._state===El.PENDING){if(Ow(r)){r.then(this._resolve,this._reject);return}this._state=t,this._value=r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===El.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===El.RESOLVED&&r[1](this._value),this._state===El.REJECTED&&r[2](this._value),r[0]=!0)})}}}function gZ(e){const t=[];function r(){return e===void 0||t.length<e}function n(o){return t.splice(t.indexOf(o),1)[0]}function a(o){if(!r())return J4(new $o("Not adding Promise because buffer limit was reached."));const l=o();return t.indexOf(l)===-1&&t.push(l),l.then(()=>n(l)).then(null,()=>n(l).then(null,()=>{})),l}function i(o){return new Js((l,c)=>{let u=t.length;if(!u)return l(!0);const d=setTimeout(()=>{o&&o>0&&l(!1)},o);t.forEach(f=>{Hm(f).then(()=>{--u||(clearTimeout(d),l(!0))},c)})})}return{$:t,add:a,drain:i}}function jN(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}const yZ=["fatal","error","warning","log","info","debug"];function bZ(e){return e==="warn"?"warning":yZ.includes(e)?e:"log"}const wF=1e3;function Ry(){return Date.now()/wF}function vZ(){const{performance:e}=Ur;if(!e||!e.now)return Ry;const t=Date.now()-e.now(),r=e.timeOrigin==null?t:e.timeOrigin;return()=>(r+e.now())/wF}const jF=vZ(),xZ=(()=>{const{performance:e}=Ur;if(!e||!e.now)return;const t=3600*1e3,r=e.now(),n=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,i=a<t,o=e.timing&&e.timing.navigationStart,c=typeof o=="number"?Math.abs(o+r-n):t,u=c<t;return i||u?a<=c?e.timeOrigin:o:n})();function yf(e,t=[]){return[e,t]}function wZ(e,t){const[r,n]=e;return[r,[...n,t]]}function $P(e,t){const r=e[1];for(const n of r){const a=n[0].type;if(t(n,a))return!0}return!1}function MC(e,t){return(t||new TextEncoder).encode(e)}function jZ(e,t){const[r,n]=e;let a=JSON.stringify(r);function i(o){typeof a=="string"?a=typeof o=="string"?a+o:[MC(a,t),o]:a.push(typeof o=="string"?MC(o,t):o)}for(const o of n){const[l,c]=o;if(i(`
14${JSON.stringify(l)}
15`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(Lo(c))}i(u)}}return typeof a=="string"?a:NZ(a)}function NZ(e){const t=e.reduce((a,i)=>a+i.length,0),r=new Uint8Array(t);let n=0;for(const a of e)r.set(a,n),n+=a.length;return r}function SZ(e,t){const r=typeof e.data=="string"?MC(e.data,t):e.data;return[oo({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}const CZ={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function FP(e){return CZ[e]}function Z4(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function NF(e,t,r,n){const a=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:Yh(n)},...a&&{trace:oo({...a})}}}function kZ(e,t,r){const n=[{type:"client_report"},{timestamp:Ry(),discarded_events:e}];return yf(t?{dsn:t}:{},[n])}const MZ=60*1e3;function IZ(e,t=Date.now()){const r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;const n=Date.parse(`${e}`);return isNaN(n)?MZ:n-t}function EZ(e,t){return e[t]||e.all||0}function SF(e,t,r=Date.now()){return EZ(e,t)>r}function CF(e,{statusCode:t,headers:r},n=Date.now()){const a={...e},i=r&&r["x-sentry-rate-limits"],o=r&&r["retry-after"];if(i)for(const l of i.trim().split(",")){const[c,u,,,d]=l.split(":",5),f=parseInt(c,10),m=(isNaN(f)?60:f)*1e3;if(!u)a.all=n+m;else for(const h of u.split(";"))h==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(a[h]=n+m):a[h]=n+m}else o?a.all=n+IZ(o,n):t===429&&(a.all=n+60*1e3);return a}function TZ(e,t){return e??t()}function NN(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}const On=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$w="production";function X4(){return oF("globalEventProcessors",()=>[])}function AZ(e){X4().push(e)}function yx(e,t,r,n=0){return new Js((a,i)=>{const o=e[n];if(t===null||typeof o!="function")a(t);else{const l=o({...t},r);On&&o.id&&l===null&&St.log(`Event processor "${o.id}" dropped event`),Ow(l)?l.then(c=>yx(e,c,r,n+1).then(a)).then(null,i):yx(e,l,r,n+1).then(a).then(null,i)}})}function kF(e){const t=jF(),r={sid:ni(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>PZ(r)};return e&&Hd(r,e),r}function Hd(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||jF(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ni()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),t
15ypeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function MF(e,t){let r={};e.status==="ok"&&(r={status:"exited"}),Hd(e,r)}function PZ(e){return oo({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}const _Z=1;function LZ(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:a,parent_span_id:i,status:o,tags:l,origin:c}=Yd(e);return oo({data:n,op:a,parent_span_id:i,span_id:t,status:o,tags:l,trace_id:r,origin:c})}function Yd(e){return DZ(e)?e.getSpanJSON():typeof e.toJSON=="function"?e.toJSON():{}}function DZ(e){return typeof e.getSpanJSON=="function"}function OZ(e){const{traceFlags:t}=e.spanContext();return!!(t&_Z)}function IF(e,t,r,n,a,i){const{normalizeDepth:o=3,normalizeMaxBreadth:l=1e3}=e,c={...t,event_id:t.event_id||r.event_id||ni(),timestamp:t.timestamp||Ry()},u=r.integrations||e.integrations.map(y=>y.name);RZ(c,e),zZ(c,u),t.type===void 0&&$Z(c,e.stackParser);const d=UZ(n,r.captureContext);r.mechanism&&a0(c,r.mechanism);const f=a&&a.getEventProcessors?a.getEventProcessors():[],m=tX().getScopeData();if(i){const y=i.getScopeData();WP(m,y)}if(d){const y=d.getScopeData();WP(m,y)}const h=[...r.attachments||[],...m.attachments];h.length&&(r.attachments=h),DF(c,m);const p=[...f,...X4(),...m.eventProcessors];return yx(p,c,r).then(y=>(y&&FZ(y),typeof o=="number"&&o>0?BZ(y,o,l):y))}function RZ(e,t){const{environment:r,release:n,dist:a,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?r:$w),e.release===void 0&&n!==void 0&&(e.release=n),e.dist===void 0&&a!==void 0&&(e.dist=a),e.message&&(e.message=ym(e.message,i));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=ym(o.value,i));const l=e.request;l&&l.url&&(l.url=ym(l.url,i))}const zP=new WeakMap;function $Z(e,t){const r=Ur._sentryDebugIds;if(!r)return;let n;const a=zP.get(t);a?n=a:(n=new Map,zP.set(t,n));const i=Object.keys(r).reduce((o,l)=>{let c;const u=n.get(l);u?c=u:(c=t(l),n.set(l,c));for(let d=c.length-1;d>=0;d--){const f=c[d];if(f.filename){o[f.filename]=r[l];break}}return o},{});try{e.exception.values.forEach(o=>{o.stacktrace.frames.forEach(l=>{l.filename&&(l.debug_id=i[l.filename])})})}catch{}}function FZ(e){const t={};try{e.exception.values.forEach(n=>{n.stacktrace.frames.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.keys(t).forEach(n=>{r.push({type:"sourcemap",code_file:n,debug_id:t[n]})})}function zZ(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function BZ(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(a=>({...a,...a.data&&{data:Lo(a.data,t,r)}}))},...e.user&&{user:Lo(e.user,t,r)},...e.contexts&&{contexts:Lo(e.contexts,t,r)},...e.extra&&{extra:Lo(e.extra,t,r)}};return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=Lo(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(a=>{const i=Yd(a).data;return i&&(a.data=Lo(i,t,r)),a})),n}function UZ(e,t){if(!t)return e;const r=e?e.clone():new Vl;return r.update(t),r}function VZ(e){if(e)return WZ(e)?{captureContext:e}:GZ(e)?{captureContext:e}:e}function WZ(e){return e instanceof Vl||typeof e=="function"}const qZ=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function GZ(e){return Object.keys(e).some(t=>qZ.includes(t))}function Fw(e,t){return Vi().captureException(e,VZ(t))}function EF(e,t){return Vi().captureEvent(e,t)}function Nu(e,t){Vi().addBreadcrumb(e,t)}function HZ(e,t){Vi().setContext(e,t)}function BP(e){Vi().setUser(e)}function TF(...e){const t=Vi();if(e.length===2){const[r,n]=e;return r?t.withScope(()=>(t.getStackTop().scope=r,n(r))):t.withScope(n)}return t.withScope(e[0])}function Vn(){return Vi().getClient()}function $u(){return Vi().getScope()}function UP(e){const t=Vn(),r=$y(),n=$u(),{release:a,environment:i=$w}=t&&t.getOptions()||{},{userAgent:o}=Ur.navigator||{},l=kF({release:a,environment:i,user:n.getUser()||r.getUser(),...o&&{userAgent:o},...e}),c=r.getSession();return c&&c.status==="ok"&&Hd(c,{status:"exited"}),AF(),r.setSession(l),n.setSession(l),l}function AF(){const e=$y(),t=$u(),r=t.getSession()||e.getSession();r&&MF(r),PF(),e.setSession(),t.setSession()}function PF(){const e=$y(),t=$u(),r=Vn(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function VP(e=!1){if(e){AF();return}PF()}function _F(e){return e.transaction}function LF(e,t,r){const n=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:i}=r&&r.getUser()||{},o=oo({environment:n.environment||$w,release:n.release,user_segment:i,public_key:a,trace_id:e});return t.emit&&t.emit("createDsc",o),o}function YZ(e){const t=Vn();if(!t)return{};const r=LF(Yd(e).trace_id||"",t,$u()),n=_F(e);if(!n)return r;const a=n&&n._frozenDynamicSamplingContext;if(a)return a;const{sampleRate:i,source:o}=n.metadata;i!=null&&(r.sample_rate=`${i}`);const l=Yd(n);return o&&o!=="url"&&(r.transaction=l.description),r.sampled=String(OZ(n)),t.emit&&t.emit("createDsc",r),r}function DF(e,t){const{fingerprint:r,span:n,breadcrumbs:a,sdkProcessingMetadata:i}=t;QZ(e,t),n&&ZZ(e,n),XZ(e,r),KZ(e,a),JZ(e,i)}function WP(e,t){const{extra:r,tags:n,user:a,contexts:i,level:o,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:m,transactionName:h,span:p}=t;Gp(e,"extra",r),Gp(e,"tags",n),Gp(e,"user",a),Gp(e,"contexts",i),Gp(e,"sdkProcessingMetadata",l),o&&(e.level=o),h&&(e.transactionName=h),p&&(e.span=p),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...m}}function Gp(e,t,r){if(r&&Object.keys(r).length){e[t]={...e[t]};
vendor: 5,031 bytes, line 15
15for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[t][n]=r[n])}}function QZ(e,t){const{extra:r,tags:n,user:a,contexts:i,level:o,transactionName:l}=t,c=oo(r);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const u=oo(n);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});const d=oo(a);d&&Object.keys(d).length&&(e.user={...d,...e.user});const f=oo(i);f&&Object.keys(f).length&&(e.contexts={...f,...e.contexts}),o&&(e.level=o),l&&(e.transaction=l)}function KZ(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function JZ(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function ZZ(e,t){e.contexts={trace:LZ(t),...e.contexts};const r=_F(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:YZ(t),...e.sdkProcessingMetadata};const n=Yd(r).description;n&&(e.tags={transaction:n,...e.tags})}}function XZ(e,t){e.fingerprint=e.fingerprint?pF(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}const eX=100;let SN;class Vl{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=qP()}static clone(t){return t?t.clone():new Vl}clone(){const t=new Vl;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._span=this._span,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t}setClient(t){this._client=t}getClient(){return this._client}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Hd(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this._tags={...this._tags,[t]:r},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this._span;return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r=typeof t=="function"?t(this):t;if(r instanceof Vl){const n=r.getScopeData();this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&Object.keys(n.user).length&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint.length&&(this._fingerprint=n.fingerprint),r.getRequestSession()&&(this._requestSession=r.getRequestSession()),n.propagationContext&&(this._propagationContext=n.propagationContext)}else if(Gm(r)){const n=t;this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint&&(this._fingerprint=n.fingerprint),n.requestSession&&(this._requestSession=n.requestSession),n.propagationContext&&(this._propagationContext=n.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=qP(),this}addBreadcrumb(t,r){const n=typeof r=="number"?r:eX;if(n<=0)return this;const a={timestamp:Ry(),...t},i=this._breadcrumbs;return i.push(a),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}
15getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:t,_attachments:r,_contexts:n,_tags:a,_extra:i,_user:o,_level:l,_fingerprint:c,_eventProcessors:u,_propagationContext:d,_sdkProcessingMetadata:f,_transactionName:m,_span:h}=this;return{breadcrumbs:t,attachments:r,contexts:n,tags:a,extra:i,user:o,level:l,fingerprint:c||[],eventProcessors:u,propagationContext:d,sdkProcessingMetadata:f,transactionName:m,span:h}}applyToEvent(t,r={},n=[]){DF(t,this.getScopeData());const a=[...n,...X4(),...this._eventProcessors];return yx(a,t,r)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){const n=r&&r.event_id?r.event_id:ni();if(!this._client)return St.warn("No client configured on scope - will not capture exception!"),n;const a=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:a,...r,event_id:n},this),n}captureMessage(t,r,n){const a=n&&n.event_id?n.event_id:ni();if(!this._client)return St.warn("No client configured on scope - will not capture message!"),a;const i=new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:i,...n,event_id:a},this),a}captureEvent(t,r){const n=r&&r.event_id?r.event_id:ni();return this._client?(this._client.captureEvent(t,{...r,event_id:n},this),n):(St.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function tX(){return SN||(SN=new Vl),SN}function qP(){return{traceId:ni(),spanId:ni().substring(16)}}const IC="7.120.4",OF=parseFloat(IC),rX=100;class RF{constructor(t,r,n,a=OF){this._version=a;let i;r?i=r:(i=new Vl,i.setClient(t));let o;n?o=n:(o=new Vl,o.setClient(t)),this._stack=[{scope:i}],t&&this.bindClient(t),this._isolationScope=o}isOlderThan(t){return this._version<t}bindClient(t){const r=this.getStackTop();r.client=t,r.scope.setClient(t),t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(t){const r=this.pushScope();let n;try{n=t(r)}catch(a){throw this.popScope(),a}return Ow(n)?n.then(a=>(this.popScope(),a),a=>{throw this.popScope(),a}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,r){const n=this._lastEventId=r&&r.event_id?r.event_id:ni(),a=new Error("Sentry syntheticException");return this.getScope().captureException(t,{originalException:t,syntheticException:a,...r,event_id:n}),n}captureMessage(t,r,n){const a=this._lastEventId=n&&n.event_id?n.event_id:ni(),i=new Error(t);return this.getScope().captureMessage(t,r,{originalException:t,syntheticException:i,...n,event_id:a}),a}captureEvent(t,r){const n=r&&r.event_id?r.event_id:ni();return t.type||(this._lastEventId=n),this.getScope().captureEvent(t,{...r,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(t,r){const{scope:n,client:a}=this.getStackTop();if(!a)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=rX}=a.getOptions&&a.getOptions()||{};if(o<=0)return;const c={timestamp:Ry(),...t},u=i?Gd(()=>i(c,r)):c;u!==null&&(a.emit&&a.emit("beforeAddBreadcrumb",u,r),n.addBreadcrumb(u,o))}setUser(t){this.getScope().setUser(t),this.getIsolationScope().setUser(t)}setTags(t){this.getScope().setTags(t),this.getIsolationScope().setTags(t)}setExtras(t){this.getScope().setExtras(t),this.getIsolationScope().setExtras(t)}setTag(t,r){this.getScope().setTag(t,r),this.getIsolationScope().setTag(t,r)}
15setExtra(t,r){this.getScope().setExtra(t,r),this.getIsolationScope().setExtra(t,r)}setContext(t,r){this.getScope().setContext(t,r),this.getIsolationScope().setContext(t,r)}configureScope(t){const{scope:r,client:n}=this.getStackTop();n&&t(r)}run(t){const r=GP(this);try{t(this)}finally{GP(r)}}getIntegration(t){const r=this.getClient();if(!r)return null;try{return r.getIntegration(t)}catch{return On&&St.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,r){const n=this._callExtensionMethod("startTransaction",t,r);return On&&!n&&(this.getClient()?St.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
16Sentry.addTracingExtensions();
17Sentry.init({...});
18`):St.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const r=this.getStackTop().scope,n=r.getSession();n&&MF(n),this._sendSessionUpdate(),r.setSession()}startSession(t){const{scope:r,client:n}=this.getStackTop(),{release:a,environment:i=$w}=n&&n.getOptions()||{},{userAgent:o}=Ur.navigator||{},l=kF({release:a,environment:i,user:r.getUser(),...o&&{userAgent:o},...t}),c=r.getSession&&r.getSession();return c&&c.status==="ok"&&Hd(c,{status:"exited"}),this.endSession(),r.setSession(l),l}shouldSendDefaultPii(){const t=this.getClient(),r=t&&t.getOptions();return!!(r&&r.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:r}=this.getStackTop(),n=t.getSession();n&&r&&r.captureSession&&r.captureSession(n)}_callExtensionMethod(t,...r){const a=zw().__SENTRY__;if(a&&a.extensions&&typeof a.extensions[t]=="function")return a.extensions[t].apply(this,r);On&&St.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function zw(){return Ur.__SENTRY__=Ur.__SENTRY__||{extensions:{},hub:void 0},Ur}function GP(e){const t=zw(),r=EC(t);return $F(t,e),r}function Vi(){const e=zw();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return nX(e)}function $y(){return Vi().getIsolationScope()}function nX(e=zw()){return(!aX(e)||EC(e).isOlderThan(OF))&&$F(e,new RF),EC(e)}function aX(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function EC(e){return oF("hub",()=>new RF,e)}function $F(e,t){if(!e)return!1;const r=e.__SENTRY__=e.__SENTRY__||{};return r.hub=t,!0}const sX="sentry.source";function iX(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function oX(e,t,r,n){const a=Z4(r),i={sent_at:new Date().toISOString(),...a&&{sdk:a},...!!n&&t&&{dsn:Yh(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return yf(i,[o])}function lX(e,t,r,n){const a=Z4(r),i=e.type&&e.type!=="replay_event"?e.type:"event";iX(e,r&&r.sdk);const o=NF(e,a,n,t);return delete e.sdkProcessingMetadata,yf(o,[[{type:i},e]])}const cX="7";function FF(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function uX(e){return`${FF(e)}${e.projectId}/envelope/`}function dX(e,t){return RJ({sentry_key:e.publicKey,sentry_version:cX,...t&&{sentry_client:`${t.name}/${t.version}`}})}function fX(e,t={}){const r=typeof t=="string"?t:t.tunnel,n=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return r||`${uX(e)}?${dX(e,n)}`}function mX(e,t){const r=cF(e);if(!r)return"";const n=`${FF(r)}embed/error-page/`;let a=`dsn=${Yh(r)}`;for(const i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){const o=t.user;if(!o)continue;o.name&&(a+=`&name=${encodeURIComponent(o.name)}`),o.email&&(a+=`&email=${encodeURIComponent(o.email)}`)}else a+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${n}?${a}`}const HP=[];function hX(e){const t={};return e.forEach(r=>{const{name:n}=r,a=t[n];a&&!a.isDefaultInstance&&r.isDefaultInstance||(t[n]=r)}),Object.keys(t).map(r=>t[r])}function pX(e){const t=e.defaultIntegrations||[],r=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let n;Array.isArray(r)?n=[...t,...r]:typeof r=="function"?n=pF(r(t)):n=t;const a=hX(n),i=yX(a,o=>o.name==="Debug");if(i!==-1){const[o]=a.splice(i,1);a.push(o)}return a}function gX(e,t){const r={};return t.forEach(n=>
18{n&&zF(e,n,r)}),r}function YP(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function zF(e,t,r){if(r[t.name]){On&&St.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,HP.indexOf(t.name)===-1&&(t.setupOnce(AZ,Vi),HP.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),e.on&&typeof t.preprocessEvent=="function"){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(a,i)=>n(a,i,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){const n=t.processEvent.bind(t),a=(i,o)=>n(i,o,e);a.id=t.name,e.addEventProcessor(a)}On&&St.log(`Integration installed: ${t.name}`)}function yX(e,t){for(let r=0;r<e.length;r++)if(t(e[r])===!0)return r;return-1}function bX(e){let t="";for(const r of e){const n=Object.entries(r.tags),a=n.length>0?`|#${n.map(([i,o])=>`${i}:${o}`).join(",")}`:"";t+=`${r.name}@${r.unit}:${r.metric}|${r.metricType}${a}|T${r.timestamp}
19`}return t}function vX(e,t,r,n){const a={sent_at:new Date().toISOString()};r&&r.sdk&&(a.sdk={name:r.sdk.name,version:r.sdk.version}),n&&t&&(a.dsn=Yh(t));const i=xX(e);return yf(a,[i])}function xX(e){const t=bX(e);return[{type:"statsd",length:t.length},t]}const QP="Not capturing exception because it's already been captured.";class wX{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=cF(t.dsn):On&&St.warn("No DSN provided, client will not send events."),this._dsn){const r=fX(this._dsn,t);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}}captureException(t,r,n){if(_P(t)){On&&St.log(QP);return}let a=r&&r.event_id;return this._process(this.eventFromException(t,r).then(i=>this._captureEvent(i,r,n)).then(i=>{a=i})),a}captureMessage(t,r,n,a){let i=n&&n.event_id;const o=q4(t)?t:String(t),l=G4(t)?this.eventFromMessage(o,r,n):this.eventFromException(t,n);return this._process(l.then(c=>this._captureEvent(c,n,a)).then(c=>{i=c})),i}captureEvent(t,r,n){if(r&&r.originalException&&_P(r.originalException)){On&&St.log(QP);return}let a=r&&r.event_id;const o=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(t,r,o||n).then(l=>{a=l})),a}captureSession(t){typeof t.release!="string"?On&&St.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),Hd(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const r=this._transport;return r?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(t).then(n=>r.flush(t).then(a=>n&&a))):Hm(!0)}close(t){return this.flush(t).then(r=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(t){return this.getIntegrationByName(t)}getIntegrationByName(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return On&&St.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){const r=this._integrations[t.name];zF(this,t,this._integrations),r||YP(this,[t])}sendEvent(t,r={}){this.emit("beforeSendEvent",t,r);let n=lX(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of r.attachments||[])n=wZ(n,SZ(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const a=this._sendEnvelope(n);a&&a.then(i=>this.emit("afterSendEvent",t,i),null)}sendSession(t){const r=oX(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}recordDroppedEvent(t,r,n){if(this._options.sendClientReports){const a=typeof n=="number"?n:1,i=`${t}:${r}`;On&&St.log(`Recording outcome: "${i}"${a>1?` (${a} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+a}}captureAggregateMetrics(t){On&&St.log(`Flushing aggregated metrics, number of metrics: ${t.length}`);const r=vX(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}on(t,r){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(r)}emit(t,...r){this._hooks[t]&&this._hooks[t].forEach(n=>n(...r))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=gX(this,t),YP(this,t),this._integrationsInitialized=!0}_updateSessionFromEvent(t,r){let n=!1,a=!1;const i=r.exception&&r.exception.values;if(i){a=!0;for(const c of i){const u=c.mechanism;if(u&&u.handled===!1){n=!0;break}}}const o=t.status==="ok";(o&&t.errors===0||o&&n)&&(Hd(t,{...n&&{status:"crashed"},errors:t.errors||Number(a||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Js(r=>{let n=0;const a=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=a,t&&n>=t&&(clearInterval(i),r(!1)))},a)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,r,n,a=$y()){const i=this.getOptions(),o=Object.keys(this._integrations);return!r.integrations&&o.length>
190&&(r.integrations=o),this.emit("preprocessEvent",t,r),IF(i,t,r,n,this,a).then(l=>{if(l===null)return l;const c={...a.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(l.contexts&&l.contexts.trace)&&c){const{traceId:d,spanId:f,parentSpanId:m,dsc:h}=c;l.contexts={trace:{trace_id:d,span_id:f,parent_span_id:m},...l.contexts};const p=h||LF(d,this,n);l.sdkProcessingMetadata={dynamicSamplingContext:p,...l.sdkProcessingMetadata}}return l})}_captureEvent(t,r={},n){return this._processEvent(t,r,n).then(a=>a.event_id,a=>{if(On){const i=a;i.logLevel==="log"?St.log(i.message):St.warn(i)}})}_processEvent(t,r,n){const a=this.getOptions(),{sampleRate:i}=a,o=UF(t),l=BF(t),c=t.type||"error",u=`before send for type \`${c}\``;if(l&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),J4(new $o(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const d=c==="replay_event"?"replay":c,m=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(t,r,n,m).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",d,t),new $o("An event processor returned `null`, will not send event.","log");if(r.data&&r.data.__sentry__===!0)return h;const g=NX(a,h,r);return jX(g,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",d,t),o){const v=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",v)}throw new $o(`${u} returned \`null\`, will not send event.`,"log")}const p=n&&n.getSession();if(!o&&p&&this._updateSessionFromEvent(p,h),o){const y=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,v=h.spans?h.spans.length:0,x=y-v;x>0&&this.recordDroppedEvent("before_send","span",x)}const g=h.transaction_info;if(o&&g&&h.transaction!==t.transaction){const y="custom";h.transaction_info={...g,source:y}}return this.sendEvent(h,r),h}).then(null,h=>{throw h instanceof $o?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new $o(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
20Reason: ${h}`))})}_process(t){this._numProcessing++,t.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,r=>{On&&St.error("Error while sending event:",r)});On&&St.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map(r=>{const[n,a]=r.split(":");return{reason:n,category:a,quantity:t[r]}})}}function jX(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Ow(e))return e.then(n=>{if(!Gm(n)&&n!==null)throw new $o(r);return n},n=>{throw new $o(`${t} rejected with ${n}`)});if(!Gm(e)&&e!==null)throw new $o(r);return e}function NX(e,t,r){const{beforeSend:n,beforeSendTransaction:a}=e;if(BF(t)&&n)return n(t,r);if(UF(t)&&a){if(t.spans){const i=t.spans.length;t.sdkProcessingMetadata={...t.sdkProcessingMetadata,spanCountBeforeProcessing:i}}return a(t,r)}return t}function BF(e){return e.type===void 0}function UF(e){return e.type==="transaction"}function SX(e){const t=Vn();!t||!t.addEventProcessor||t.addEventProcessor(e)}function CX(e,t){t.debug===!0&&(On?St.enable():Gd(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),$u().update(t.initialScope);const n=new e(t);kX(n),MX(n)}function kX(e){const r=Vi().getStackTop();r.client=e,r.scope.setClient(e)}function MX(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}const IX=30;function VF(e,t,r=gZ(e.bufferSize||IX)){let n={};const a=o=>r.drain(o);function i(o){const l=[];if($P(o,(f,m)=>{const h=FP(m);if(SF(n,h)){const p=KP(f,m);e.recordDroppedEvent("ratelimit_backoff",h,p)}else l.push(f)}),l.length===0)return Hm();const c=yf(o[0],l),u=f=>{$P(c,(m,h)=>{const p=KP(m,h);e.recordDroppedEvent(f,FP(h),p)})},d=()=>t({body:jZ(c,e.textEncoder)}).then(f=>(f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&On&&St.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),n=CF(n,f),f),f=>{throw u("network_error"),f});return r.add(d).then(f=>f,f=>{if(f instanceof $o)return On&&St.error("Skipped sending event because buffer is full."),u("queue_overflow"),Hm();throw f})}return i.__sentry__baseTransport__=!0,{send:i,flush:a}}function KP(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function EX(e,t){const r=t&&PX(t)?t.getClient():t,n=r&&r.getDsn(),a=r&&r.getOptions().tunnel;return AX(e,n)||TX(e,a)}function TX(e,t){return t?JP(e)===JP(t):!1}function AX(e,t){return t?e.includes(t.host):!1}function JP(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function PX(e){return e.getClient!==void 0}function WF(e,t,r=[t],n="npm"){const a=e._metadata||{};a.sdk||(a.sdk={name:`sentry.javascript.${t}`,packages:r.map(i=>({name:`${n}:@sentry/${i}`,version:IC})),version:IC}),e._metadata=a}const _X=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],LX=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],DX="InboundFilters",OX=(e={})=>({name:DX,setupOnce(){},processEvent(t,r,n){const a=n.getOptions(),i=$X(e,a);return FX(t,i)?null:t}}),RX=OX;function $X(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:_X],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:LX],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function FX(e,t){return t.ignoreInternal&&qX(e)?(On&&St.warn(`Event dropped due to being internal Sentry Error.
21Event: ${Uc(e)}`),!0):zX(e,t.ignoreErrors)?(On&&St.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
22Event: ${Uc(e)}`),!0):BX(e,t.ignoreTransactions)?(On&&St.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
23Event: ${Uc(e)}`),!0):UX(e,t.denyUrls)?(On&&St.warn(`Event dropped due to being matched by \`denyUrls\` option.
24Event: ${Uc(e)}.
25Url: ${bx(e)}`),!0):VX(e,t.allowUrls)?!1:(On&&St.warn(`Event dropped due to not being matched by \`allowUrls\` option.
26Event: ${Uc(e)}.
27Url: ${bx(e)}`),!0)}function zX(e,t){return e.type||!t||!t.length?!1:WX(e).some(r=>Dy(r,t))}function BX(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;const r=e.transaction;return r?Dy(r,t):!1}
27function UX(e,t){if(!t||!t.length)return!1;const r=bx(e);return r?Dy(r,t):!1}function VX(e,t){if(!t||!t.length)return!0;const r=bx(e);return r?Dy(r,t):!0}function WX(e){const t=[];e.message&&t.push(e.message);let r;try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),On&&t.length===0&&St.error(`Could not extract message for event ${Uc(e)}`),t}function qX(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function GX(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function bx(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?GX(t):null}catch{return On&&St.error(`Cannot extract url for event ${Uc(e)}`),null}}let ZP;const HX="FunctionToString",XP=new WeakMap,YX=()=>({name:HX,setupOnce(){ZP=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Q4(this),r=XP.has(Vn())&&t!==void 0?t:this;return ZP.apply(r,e)}}catch{}},setup(e){XP.set(e,!0)}}),QX=YX,KX=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zs=Ur,JX=(e,t,r)=>{let n,a;return i=>{t.value>=0&&(i||r)&&(a=t.value-(n||0),(a||n===void 0)&&(n=t.value,t.delta=a,e(t)))}},ZX=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,XX=()=>{const e=zs.performance.timing,t=zs.performance.navigation.type,r={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(const n in e)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(e[n]-e.navigationStart,0));return r},qF=()=>zs.__WEB_VITALS_POLYFILL__?zs.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||XX()):zs.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],GF=()=>{const e=qF();return e&&e.activationStart||0},eee=(e,t)=>{const r=qF();let n="navigate";return r&&(zs.document&&zs.document.prerendering||GF()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:e,value:-1,rating:"good",delta:0,entries:[],id:ZX(),navigationType:n}},HF=(e,t,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(a=>{t(a.getEntries())});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},YF=(e,t)=>{const r=n=>{(n.type==="pagehide"||zs.document.visibilityState==="hidden")&&(e(n),removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0))};zs.document&&(addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0))};let vx=-1;const tee=()=>{zs.document&&zs.document.visibilityState&&(vx=zs.document.visibilityState==="hidden"&&!zs.document.prerendering?0:1/0)},ree=()=>{YF(({timeStamp:e})=>{vx=e})},nee=()=>(vx<0&&(tee(),ree()),{get firstHiddenTime(){return vx}}),e_={},aee=e=>{const t=nee(),r=eee("LCP");let n;const a=o=>{const l=o[o.length-1];if(l){const c=Math.max(l.startTime-GF(),0);c<t.firstHiddenTime&&(r.value=c,r.entries=[l],n())}},i=HF("largest-contentful-paint",a);if(i){n=JX(e,r);const o=()=>{e_[r.id]||(a(i.takeRecords()),i.disconnect(),e_[r.id]=!0,n(!0))};return["keydown","click"].forEach(l=>{zs.document&&addEventListener(l,o,{once:!0,capture:!0})}),YF(o),o}},Og={},xx={};let QF;function see(e,t=!1){return lee("lcp",e,oee,QF,t)}function iee(e,t){return JF(e,t),xx[e]||(cee(e),xx[e]=!0),ZF(e,t)}function KF(e,t){const r=Og[e];if(!(!r||!r.length))for(const n of r)try{n(t)}catch(a){KX&&St.error(`Error while triggering instrumentation handler.
28Type: ${e}
29Name: ${rc(n)}
30Error:`,a)}}function oee(){return aee(e=>{KF("lcp",{metric:e}),QF=e})}function lee(e,t,r,n,a=!1){JF(e,t);let i;return xx[e]||(i=r(),xx[e]=!0),n&&t({metric:n}),ZF(e,t,a?i:void 0)}function cee(e){const t={};e==="event"&&(t.durationThreshold=0),HF(e,r=>{KF(e,{entries:r})},t)}function JF(e,t){Og[e]=Og[e]||[],Og[e].push(t)}function ZF(e,t,r){return()=>{r&&r();const n=Og[e];if(!n)return;const a=n.indexOf(t);a!==-1&&n.splice(a,1)}}const Qr=Ur;let TC=0;function XF(){return TC>0}function uee(){TC++,setTimeout(()=>{TC--})}function Ym(e,t={},r){if(typeof e!="function")return e;try{const a=e.__sentry_wrapped__;if(a)return typeof a=="function"?a:e;if(Q4(e))return e}catch{return e}const n=function(){const a=Array.prototype.slice.call(arguments);try{const i=a.map(o=>Ym(o,t));return e.apply(this,i)}catch(i){throw uee(),TF(o=>{o.addEventProcessor(l=>(t.mechanism&&(xC(l,void 0),a0(l,t.mechanism)),l.extra={...l.extra,arguments:a},l)),Fw(i)}),i}};try{for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a])}catch{}uF(n,e),n0(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}const Mi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ez(e,t){const r=eI(e,t),n={type:t&&t.name,value:hee(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function dee(e,t,r,n){const a=Vn(),i=a&&a.getOptions().normalizeDepth,o={exception:{values:[{type:Dw(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:yee(t,{isUnhandledRejection:n})}]},extra:{__serialized__:xF(t,i)}};if(r){const l=eI(e,r);l.length&&(o.exception.values[0].stacktrace={frames:l})}return o}function CN(e,t){return{exception:{values:[ez(e,t)]}}}function eI(e,t){const r=t.stacktrace||t.stack||"",n=mee(t);try{return e(r,n)}catch{}return[]}const fee=/Minified React error #\d+;/i;function mee(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(fee.test(e.message))return 1}return 0}function hee(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function pee(e,t,r,n){const a=r&&r.syntheticException||void 0,i=tI(e,t,a,n);return a0(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),Hm(i)}function gee(e,t,r="info",n,a){const i=n&&n.syntheticException||void 0,o=AC(e,t,i,a);
30return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Hm(o)}function tI(e,t,r,n,a){let i;if(W4(t)&&t.error)return CN(e,t.error);if(SP(t)||vJ(t)){const o=t;if("stack"in t)i=CN(e,t);else{const l=o.name||(SP(o)?"DOMError":"DOMException"),c=o.message?`${l}: ${o.message}`:l;i=AC(e,c,r,n),xC(i,c)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return V4(t)?CN(e,t):Gm(t)||Dw(t)?(i=dee(e,t,r,a),a0(i,{synthetic:!0}),i):(i=AC(e,t,r,n),xC(i,`${t}`),a0(i,{synthetic:!0}),i)}function AC(e,t,r,n){const a={};if(n&&r){const i=eI(e,r);i.length&&(a.exception={values:[{value:t,stacktrace:{frames:i}}]})}if(q4(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return a.logentry={message:i,params:o},a}return a.message=t,a}function yee(e,{isUnhandledRejection:t}){const r=$J(e),n=t?"promise rejection":"exception";return W4(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Dw(e)?`Event \`${bee(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function bee(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function vee(e,{metadata:t,tunnel:r,dsn:n}){const a={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!r&&!!n&&{dsn:Yh(n)}},i=xee(e);return yf(a,[i])}function xee(e){return[{type:"user_report"},e]}class wee extends wX{constructor(t){const r=Qr.SENTRY_SDK_SOURCE||lZ();WF(t,"browser",["browser"],r),super(t),t.sendClientReports&&Qr.document&&Qr.document.addEventListener("visibilitychange",()=>{Qr.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,r){return pee(this._options.stackParser,t,r,this._options.attachStacktrace)}eventFromMessage(t,r="info",n){return gee(this._options.stackParser,t,r,n,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){Mi&&St.warn("SDK not enabled, will not capture user feedback.");return}const r=vee(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(r)}_prepareEvent(t,r,n){return t.platform=t.platform||"javascript",super._prepareEvent(t,r,n)}_flushOutcomes(){const t=this._clearOutcomes();if(t.length===0){Mi&&St.log("No outcomes to send");return}if(!this._dsn){Mi&&St.log("No dsn provided, will not send outcomes");return}Mi&&St.log("Sending outcomes:",t);const r=kZ(t,this._options.tunnel&&Yh(this._dsn));this._sendEnvelope(r)}}let Ng;function jee(){if(Ng)return Ng;if(SC(Qr.fetch))return Ng=Qr.fetch.bind(Qr);const e=Qr.document;let t=Qr.fetch;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);const n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(r){Mi&&St.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return Ng=t.bind(Qr)}function Nee(){Ng=void 0}function See(e,t=jee()){let r=0,n=0;function a(i){const o=i.body.length;r+=o,n++;const l={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{return t(e.url,l).then(c=>(r-=o,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Nee(),r-=o,n--,J4(c)}}return VF(e,a)}const Cee=4;function kee(e){function t(r){return new Js((n,a)=>{const i=new XMLHttpRequest;i.onerror=a,i.onreadystatechange=()=>{i.readyState===Cee&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const o in e.headers)Object.prototype.hasOwnProperty.call(e.headers,o)&&i.setRequestHeader(o,e.headers[o]);i.send(r.body)})}return VF(e,t)}const Bw="?",Mee=30,Iee=40,Eee=50;function rI(e,t,r,n){const a={filename:e,function:t,in_app:!0};return r!==void 0&&(a.lineno=r),n!==void 0&&(a.colno=n),a}const Tee=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Aee=/\((\S*)(?::(\d+))(?::(\d+))\)/,Pee=e=>{const t=Tee.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){const i=Aee.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}const[n,a]=tz(t[1]||Bw,t[2]);return rI(a,n,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},_ee=[Mee,Pee],Lee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Dee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Oee=e=>{const t=Lee.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=Dee.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let n=t[3],a=t[1]||Bw;return[a,n]=tz(a,n),rI(n,a,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ree=[Eee,Oee],$ee=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Fee=e=>{const t=$ee.exec(e);return t?rI(t[2],t[1]||Bw,+t[3],t[4]?+t[4]:void 0):void 0},zee=[Iee,Fee],Bee=[_ee,Ree,zee],Uee=mF(...Bee),tz=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:Bw,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},zb=1024,Vee="Breadcrumbs",Wee=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Vee,setupOnce(){},setup(r){t.console&&UJ(Yee(r)),t.dom&&gF(Hee(r,t.dom)),t.xhr&&vF(Qee(r)),t.fetch&&bF(Kee(r)),t.history&&K4(Jee(r)),t.sentry&&r.on&&r.on("beforeSendEvent",Gee(r))}}},qee=Wee;function Gee(e){return function(r){Vn()===e&&Nu({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Uc(r)},{event:r})}}function Hee(e,t){return function(n){if(Vn()!==e)return;let a,i,o=typeof t=="object"?t.serializeAttribute:void 0,l=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;l&&l>zb&&(Mi&&St.warn(`\`dom.maxStringLength\` cannot exceed ${zb}, but a value of ${l} was configured. Sentry will use ${zb}
30 instead.`),l=zb),typeof o=="string"&&(o=[o]);try{const u=n.event,d=Zee(u)?u.target:u;a=Rw(d,{keyAttrs:o,maxStringLength:l}),i=TJ(d)}catch{a="<unknown>"}if(a.length===0)return;const c={category:`ui.${n.name}`,message:a};i&&(c.data={"ui.component_name":i}),Nu(c,{event:n.event,name:n.name,global:n.global})}}function Yee(e){return function(r){if(Vn()!==e)return;const n={category:"console",data:{arguments:r.args,logger:"console"},level:bZ(r.level),message:CP(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${CP(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Nu(n,{input:r.args,level:r.level})}}function Qee(e){return function(r){if(Vn()!==e)return;const{startTimestamp:n,endTimestamp:a}=r,i=r.xhr[md];if(!n||!a||!i)return;const{method:o,url:l,status_code:c,body:u}=i,d={method:o,url:l,status_code:c},f={xhr:r.xhr,input:u,startTimestamp:n,endTimestamp:a};Nu({category:"xhr",data:d,type:"http"},f)}}function Kee(e){return function(r){if(Vn()!==e)return;const{startTimestamp:n,endTimestamp:a}=r;if(a&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.error){const i=r.fetchData,o={data:r.error,input:r.args,startTimestamp:n,endTimestamp:a};Nu({category:"fetch",data:i,level:"error",type:"http"},o)}else{const i=r.response,o={...r.fetchData,status_code:i&&i.status},l={input:r.args,response:i,startTimestamp:n,endTimestamp:a};Nu({category:"fetch",data:o,type:"http"},l)}}}function Jee(e){return function(r){if(Vn()!==e)return;let n=r.from,a=r.to;const i=jN(Qr.location.href);let o=n?jN(n):void 0;const l=jN(a);(!o||!o.path)&&(o=i),i.protocol===l.protocol&&i.host===l.host&&(a=l.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),Nu({category:"navigation",data:{from:n,to:a}})}}function Zee(e){return!!e&&!!e.target}const Xee="Dedupe",ete=()=>{let e;return{name:Xee,setupOnce(){},processEvent(t){if(t.type)return t;try{if(rte(t,e))return Mi&&St.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},tte=ete;function rte(e,t){return t?!!(nte(e,t)||ate(e,t)):!1}function nte(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!nz(e,t)||!rz(e,t))}function ate(e,t){const r=t_(t),n=t_(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!nz(e,t)||!rz(e,t))}function rz(e,t){let r=r_(e),n=r_(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let a=0;a<n.length;a++){const i=n[a],o=r[a];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function nz(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function t_(e){return e.exception&&e.exception.values&&e.exception.values[0]}function r_(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}const ste="GlobalHandlers",ite=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ste,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(lte(r),n_("onerror")),t.onunhandledrejection&&(cte(r),n_("onunhandledrejection"))}}},ote=ite;function lte(e){ZJ(t=>{const{stackParser:r,attachStacktrace:n}=sz();if(Vn()!==e||XF())return;const{msg:a,url:i,line:o,column:l,error:c}=t,u=c===void 0&&Ul(a)?fte(a,i,o,l):az(tI(r,c||a,void 0,n,!1),i,o,l);u.level="error",EF(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function cte(e){eZ(t=>{const{stackParser:r,attachStacktrace:n}=sz();if(Vn()!==e||XF())return;const a=ute(t),i=G4(a)?dte(a):tI(r,a,void 0,n,!0);i.level="error",EF(i,{originalException:a,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function ute(e){if(G4(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}function dte(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function fte(e,t,r,n){const a=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=W4(e)?e.message:e,o="Error";const l=i.match(a);return l&&(o=l[1],i=l[2]),az({exception:{values:[{type:o,value:i}]}},t,r,n)}function az(e,t,r,n){const a=e.exception=e.exception||{},i=a.values=a.values||[],o=i[0]=i[0]||{},l=o.stacktrace=o.stacktrace||{},c=l.frames=l.frames||[],u=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,f=Ul(t)&&t.length>0?t:EJ();
30return c.length===0&&c.push({colno:u,filename:f,function:"?",in_app:!0,lineno:d}),e}function n_(e){Mi&&St.log(`Global Handler attached: ${e}`)}function sz(){const e=Vn();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const mte="HttpContext",hte=()=>({name:mte,setupOnce(){},preprocessEvent(e){if(!Qr.navigator&&!Qr.location&&!Qr.document)return;const t=e.request&&e.request.url||Qr.location&&Qr.location.href,{referrer:r}=Qr.document||{},{userAgent:n}=Qr.navigator||{},a={...e.request&&e.request.headers,...r&&{Referer:r},...n&&{"User-Agent":n}},i={...e.request,...t&&{url:t},headers:a};e.request=i}}),pte=hte,gte="cause",yte=5,bte="LinkedErrors",vte=(e={})=>{const t=e.limit||yte,r=e.key||gte;return{name:bte,setupOnce(){},preprocessEvent(n,a,i){const o=i.getOptions();CJ(ez,o.stackParser,o.maxValueLength,r,t,n,a)}}},xte=vte,wte=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],jte="TryCatch",Nte=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:jte,setupOnce(){t.setTimeout&&Ra(Qr,"setTimeout",a_),t.setInterval&&Ra(Qr,"setInterval",a_),t.requestAnimationFrame&&Ra(Qr,"requestAnimationFrame",Cte),t.XMLHttpRequest&&"XMLHttpRequest"in Qr&&Ra(XMLHttpRequest.prototype,"send",kte);const r=t.eventTarget;r&&(Array.isArray(r)?r:wte).forEach(Mte)}}},Ste=Nte;function a_(e){return function(...t){const r=t[0];return t[0]=Ym(r,{mechanism:{data:{function:rc(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Cte(e){return function(t){return e.apply(this,[Ym(t,{mechanism:{data:{function:"requestAnimationFrame",handler:rc(e)},handled:!1,type:"instrument"}})])}}function kte(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(a=>{a in r&&typeof r[a]=="function"&&Ra(r,a,function(i){const o={mechanism:{data:{function:a,handler:rc(i)},handled:!1,type:"instrument"}},l=Q4(i);return l&&(o.mechanism.data.handler=rc(l)),Ym(i,o)})}),e.apply(this,t)}}function Mte(e){const t=Qr,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ra(r,"addEventListener",function(n){return function(a,i,o){try{typeof i.handleEvent=="function"&&(i.handleEvent=Ym(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:rc(i),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[a,Ym(i,{mechanism:{data:{function:"addEventListener",handler:rc(i),target:e},handled:!1,type:"instrument"}}),o])}}),Ra(r,"removeEventListener",function(n){return function(a,i,o){const l=i;try{const c=l&&l.__sentry_wrapped__;c&&n.call(this,a,c,o)}catch{}return n.call(this,a,l,o)}}))}const Ite=[RX(),QX(),Ste(),qee(),ote(),xte(),tte(),pte()];function Ete(e){return[...Ite]}function Tte(e={}){e.defaultIntegrations===void 0&&(e.defaultIntegrations=Ete()),e.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(e.release=__SENTRY_RELEASE__),Qr.SENTRY_RELEASE&&Qr.SENTRY_RELEASE.id&&(e.release=Qr.SENTRY_RELEASE.id)),e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0);const t={...e,stackParser:zJ(e.stackParser||Uee),integrations:pX(e),transport:e.transport||(yF()?See:kee)};CX(wee,t),e.autoSessionTracking&&Ate()}const s_=(e={},t=Vi())=>{if(!Qr.document){Mi&&St.error("Global document not defined in showReportDialog call");return}const{client:r,scope:n}=t.getStackTop(),a=e.dsn||r&&r.getDsn();if(!a){Mi&&St.error("DSN not configured for showReportDialog call");return}n&&(e.user={...n.getUser(),...e.user}),e.eventId||(e.eventId=t.lastEventId());const i=Qr.document.createElement("script");i.async=!0,i.crossOrigin="anonymous",i.src=mX(a,e),e.onLoad&&(i.onload=e.onLoad);const{onClose:o}=e;if(o){const c=u=>{if(u.data==="__sentry_reportdialog_closed__")try{o()}finally{Qr.removeEventListener("message",c)}};Qr.addEventListener("message",c)}const l=Qr.document.head||Qr.document.body;l?l.appendChild(i):Mi&&St.error("Not injecting report dialog. No injection point found in HTML")};function Ate(){if(typeof Qr.document>"u"){Mi&&St.warn("Session tracking in non-browser environment with @
30sentry/browser is not supported.");return}UP({ignoreDuration:!0}),VP(),K4(({from:e,to:t})=>{e!==void 0&&e!==t&&(UP({ignoreDuration:!0}),VP())})}const Ln=Ur,nI="sentryReplaySession",Pte="replay_event",aI="Unable to send Replay",_te=3e5,Lte=9e5,Dte=5e3,Ote=5500,Rte=6e4,$te=5e3,Fte=3,i_=15e4,Bb=5e3,zte=3e3,Bte=300,sI=2e7,Ute=4999,Vte=15e3,o_=36e5;function Wte(e,t){return e??t()}function wx(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}var Ia;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(Ia||(Ia={}));function qte(e){return e.nodeType===e.ELEMENT_NODE}function Rg(e){const t=wx([e,"optionalAccess",r=>r.host]);return wx([t,"optionalAccess",r=>r.shadowRoot])===e}function $g(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Gte(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function Hte(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function jx(e){try{const t=e.rules||e.cssRules;return t?Gte(Array.from(t,iz).join("")):null}catch{return null}}function iz(e){let t;if(Qte(e))try{t=jx(e.styleSheet)||Hte(e)}catch{}else if(Kte(e)&&e.selectorText.includes(":"))return Yte(e.cssText);return t||e.cssText}function Yte(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Qte(e){return"styleSheet"in e}function Kte(e){return"selectorText"in e}class oz{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const r=wx([this,"access",n=>n.getMeta,"call",n=>n(t),"optionalAccess",n=>n.id]);return Wte(r,()=>-1)}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const a=this.nodeMetaMap.get(n);a&&this.nodeMetaMap.set(r,a)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Jte(){return new oz}function Uw({maskInputOptions:e,tagName:t,type:r}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||r&&e[r]||r==="password"||t==="INPUT"&&!r&&e.text)}function s0({isMasked:e,element:t,value:r,maskInputFn:n}){let a=r||"";return e?(n&&(a=n(a,t)),"*".repeat(a.length)):a}function Qm(e){return e.toLowerCase()}function PC(e){return e.toUpperCase()}const l_="__rrweb_original__";function Zte(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let a=0;a<e.height;a+=r){const i=t.getImageData,o=l_ in i?i[l_]:i;if(new Uint32Array(o.call(t,n,a,Math.min(r,e.width-n),Math.min(r,e.height-a)).data.buffer).some(c=>c!==0))return!1}return!0}function iI(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Qm(t):null}function Nx(e,t,r){return t==="INPUT"&&(r==="radio"||r==="checkbox")?e.getAttribute("value")||"":e.value}let Xte=1;const ere=new RegExp("[^a-z0-9-_:]"),i0=-2;function oI(){return Xte++}function tre(e){if(e instanceof HTMLFormElement)return"form";const t=Qm(e.tagName);return ere.test(t)?"div":t}function rre(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let zf,c_;const nre=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,are=/^(?:[a-z+]+:)?\/\//i,sre=/^www\..*/i,ire=/^(data:)([^,]*),(.*)/i;function Sx(e,t){return(e||"").replace(nre,(r,n,a,i,o,l)=>{const c=a||o||l,u=n||i||"";if(!c)return r;if(are.test(c)||sre.test(c))return`url(${u}${c}${u})`;if(ire.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${rre(t)+c}${u})`;const d=t.split("/"),f=c.split("/");d.pop();for(const m of f)m!=="."&&(m===".."?d.pop():d.push(m));return`url(${u}${d.join("/")}${u})`})}const ore=/^[^ \t\n\r\u000c]+/,lre=/^[, \t\n\r\u000c]+/;function cre(e,t){if(t.trim()==="")return t;let r=0;function n(i){let o;const l=i.exec(t.substring(r));return l?(o=l[0],r+=o.length,o):""}const a=[];for(;n(lre),!(r>=t.length);){let i=n(ore);if(i.slice(-1)===",")i=lm(e,i.substring(0,i.length-1)),a.push(i);else{let o="";i=lm(e,i);let l=!1;for(;;){const c=t.charAt(r);if(c===""){a.push((i+o).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){r+=1,a.push((i+o).trim());break}else c==="("&&(l=!0);o+=c,r+=1}}}return a.join(", ")}function lm(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function ure(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function lI(){const e=document.createElement("a");return e.href="",e.href}
30function lz(e,t,r,n,a,i){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?lm(e,n):r==="srcset"?cre(e,n):r==="style"?Sx(n,lI()):t==="object"&&r==="data"?lm(e,n):typeof i=="function"?i(r,n,a):n)}function cz(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function dre(e,t,r,n){try{if(n&&e.matches(n))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let a=e.classList.length;a--;){const i=e.classList[a];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function fre(e,t){for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!1}function hd(e,t,r=1/0,n=0){return!e||e.nodeType!==e.ELEMENT_NODE||n>r?-1:t(e)?n:hd(e.parentNode,t,r,n+1)}function cm(e,t){return r=>{const n=r;if(n===null)return!1;try{if(e){if(typeof e=="string"){if(n.matches(`.${e}`))return!0}else if(fre(n,e))return!0}return!!(t&&n.matches(t))}catch{return!1}}}function Km(e,t,r,n,a,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let l=-1,c=-1;if(i){if(c=hd(o,cm(n,a)),c<0)return!0;l=hd(o,cm(t,r),c>=0?c:1/0)}else{if(l=hd(o,cm(t,r)),l<0)return!1;c=hd(o,cm(n,a),l>=0?l:1/0)}return l>=0?c>=0?l<=c:!0:c>=0?!1:!!i}catch{}return!!i}function mre(e,t,r){const n=e.contentWindow;if(!n)return;let a=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){const l=setTimeout(()=>{a||(t(),a=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),a=!0,t()});return}const o="about:blank";if(n.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function hre(e,t,r){let n=!1,a;try{a=e.sheet}catch{return}if(a)return;const i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function pre(e,t){const{doc:r,mirror:n,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:l,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:m,inlineStylesheet:h,maskInputOptions:p={},maskTextFn:g,maskInputFn:y,dataURLOptions:v={},inlineImages:x,recordCanvas:j,keepIframeSrcFn:C,newlyAddedElement:N=!1}=t,S=gre(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ia.Document,childNodes:[],compatMode:e.compatMode}:{type:Ia.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ia.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return bre(e,{doc:r,blockClass:a,blockSelector:i,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:c,maskInputOptions:p,maskInputFn:y,dataURLOptions:v,inlineImages:x,recordCanvas:j,keepIframeSrcFn:C,newlyAddedElement:N,rootId:S,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:m});case e.TEXT_NODE:return yre(e,{maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:m,maskTextFn:g,maskInputOptions:p,maskInputFn:y,rootId:S});case e.CDATA_SECTION_NODE:return{type:Ia.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Ia.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function gre(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function yre(e,t){const{maskAllText:r,maskTextClass:n,unmaskTextClass:a,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:l,maskInputOptions:c,maskInputFn:u,rootId:d}=t,f=e.parentNode&&e.parentNode.tagName;let m=e.textContent;const h=f==="STYLE"?!0:void 0,p=f==="SCRIPT"?!0:void 0,g=f==="TEXTAREA"?!0:void 0;if(h&&m){try{e.nextSibling||e.previousSibling||wx([e,"access",v=>v.parentNode,"access",v=>v.sheet,"optionalAccess",v=>v.cssRules])&&(m=jx(e.parentNode.sheet))}catch(v){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${v}`,e)}m=Sx(m,lI())}p&&(m="SCRIPT_PLACEHOLDER");const y=Km(e,n,i,a,o,r);if(!h&&!p&&!g&&m&&y&&(m=l?l(m,e.parentElement):m.replace(/[\S]/g,"*")),g&&m&&(c.textarea||y)&&(m=u?u(m,e.parentNode):m.replace(/[\S]/g,"*")),f==="OPTION"&&m){const v=Uw({type:null,tagName:f,maskInputOptions:c});m=s0({isMasked:Km(e,n,i,a,o,v),element:e,value:m,maskInputFn:u})}return{type:Ia.Text,textContent:m||"",isStyle:h,rootId:d}}function bre(e,t){const{doc:r,blockClass:n,blockSelector:a,unblockSelector:i,inlineStylesheet:o,maskInputOptions:l={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:f,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:g,maskTextClass:y,unmaskTextClass:v,maskTextSelector:x,unmaskTextSelector:j}=t,C=dre(e,n,a,i),N=tre(e);let S={};const M=e.attributes.length;for(let I=0;I<M;I++){const T=e.attributes[I];T.name&&!cz(N,T.name,T.value)&&(S[T.name]=lz(r,N,Qm(T.name),T.value,e,c))}if(N==="link"&&o){const I=Array.from(r.styleSheets).find(L=>L.href===e.href);let T=null;I&&(T=jx(I)),T&&(delete S.rel,delete S.href,S._cssText=Sx(T,I.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const I=jx(e.sheet);I&&(S._cssText=Sx(I,lI()))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const I=e,T=iI(I),L=Nx(I,PC(N),T),R=I.checked;if(T!=="submit"&&T!=="button"&&L){const _=Km(I,y,x,v,j,Uw({type:T,tagName:PC(N),maskInputOptions:l}));S.value=s0({isMasked:_,element:I,value:L,maskInputFn:u})}R&&(S.checked=R)}if(N==="option"&&(e.selected&&!l.select?S.selected=!0:delete S.selected),N==="canvas"&&m){if(e.__context==="2d")Zte(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const I=e.toDataURL(d.type,d.quality),T=d
30ocument.createElement("canvas");T.width=e.width,T.height=e.height;const L=T.toDataURL(d.type,d.quality);I!==L&&(S.rr_dataURL=I)}}if(N==="img"&&f){zf||(zf=r.createElement("canvas"),c_=zf.getContext("2d"));const I=e,T=I.crossOrigin;I.crossOrigin="anonymous";const L=()=>{I.removeEventListener("load",L);try{zf.width=I.naturalWidth,zf.height=I.naturalHeight,c_.drawImage(I,0,0),S.rr_dataURL=zf.toDataURL(d.type,d.quality)}catch(R){console.warn(`Cannot inline img src=${I.currentSrc}! Error: ${R}`)}T?S.crossOrigin=T:I.removeAttribute("crossorigin")};I.complete&&I.naturalWidth!==0?L():I.addEventListener("load",L)}if((N==="audio"||N==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),p||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),C){const{width:I,height:T}=e.getBoundingClientRect();S={class:S.class,rr_width:`${I}px`,rr_height:`${T}px`}}N==="iframe"&&!h(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src);let k;try{customElements.get(N)&&(k=!0)}catch{}return{type:Ia.Element,tagName:N,attributes:S,childNodes:[],isSVG:ure(e)||void 0,needBlock:C,rootId:g,isCustom:k}}function _n(e){return e==null?"":e.toLowerCase()}function vre(e,t){if(t.comment&&e.type===Ia.Comment)return!0;if(e.type===Ia.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(_n(e.attributes.name).match(/^msapplication-tile(image|color)$/)||_n(e.attributes.name)==="application-name"||_n(e.attributes.rel)==="icon"||_n(e.attributes.rel)==="apple-touch-icon"||_n(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&_n(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(_n(e.attributes.property).match(/^(og|twitter|fb):/)||_n(e.attributes.name).match(/^(og|twitter):/)||_n(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(_n(e.attributes.name)==="robots"||_n(e.attributes.name)==="googlebot"||_n(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(_n(e.attributes.name)==="author"||_n(e.attributes.name)==="generator"||_n(e.attributes.name)==="framework"||_n(e.attributes.name)==="publisher"||_n(e.attributes.name)==="progid"||_n(e.attributes.property).match(/^article:/)||_n(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(_n(e.attributes.name)==="google-site-verification"||_n(e.attributes.name)==="yandex-verification"||_n(e.attributes.name)==="csrf-token"||_n(e.attributes.name)==="p:domain_verify"||_n(e.attributes.name)==="verify-v1"||_n(e.attributes.name)==="verification"||_n(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function um(e,t){const{doc:r,mirror:n,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,skipChild:m=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOMOptions:x,dataURLOptions:j={},inlineImages:C=!1,recordCanvas:N=!1,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:k=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:L=()=>!1,newlyAddedElement:R=!1}=t;let{preserveWhiteSpace:_=!0}=t;const B=pre(e,{doc:r,mirror:n,blockClass:a,blockSelector:i,maskAllText:l,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,dataURLOptions:j,inlineImages:C,recordCanvas:N,keepIframeSrcFn:L,newlyAddedElement:R});if(!B)return console.warn(e,"not serialized"),null;let z;n.hasNode(e)?z=n.getId(e):vre(B,x)||!_&&B.type===Ia.Text&&!B.isStyle&&!B.textContent.replace(/^\s+|\s+$/gm,"").length?z=i0:z=oI();const D=Object.assign(B,{id:z});if(n.add(e,D),z===i0)return null;S&&S(e);let A=!m;if(D.type===Ia.Element){A=A&&!D.needBlock,delete D.needBlock;const P=e.shadowRoot;P&&$g(P)&&(D.isShadowHost=!0)}if((D.type===Ia.Document||D.type===Ia.Element)&&A){x.headWhitespace&&D.type===Ia.Element&&D.tagName==="head"&&(_=!1);const P={doc:r,mirror:n,blockClass:a,blockSelector:i,maskAllText:l,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,skipChild:m,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOMOptions:x,dataURLOptions:j,inlineImages:C,recordCanvas:N,preserveWhiteSpace:_,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:k,onStylesheetLoad:I,stylesheetLoadTimeout:T,keepIframeSrcFn:L};for(const E of Array.from(e.childNodes)){const F=um(E,P);F&&D.childNodes.push(F)}if(qte(e)&&e.shadowRoot)for(const E of Array.from(e.shadowRoot.childNodes)){const F=um(E,P);F&&($g(e.shadowRoot)&&(F.isShadow=!0),D.childNodes.push(F))}}return e.parentNode&&Rg(e.parentNode)&&$g(e.parentNode)&&(D.isShadow=!0),D.type===Ia.Element&&D.tagName==="iframe"&&mre(e,()=>{const P=e.contentDocument;if(P&&M){const E=um(P,{doc:P,mirror:n,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOMOptions:x,dataURLOptions:j,inlineImages:C,recordCanvas:N,preserveWhiteSpace:_,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:k,onStylesheetLoad:I,stylesheetLoadTimeout:T,keepIframeSrcFn:L});E&&M(e,E)}},k),D.type===Ia.Element&&D.tagName==="link"&&D.attributes.rel==="stylesheet"&&hre(e,()=>{if(I){const P=um(e,{doc:r,mirror:n,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOMOptions:x,dataURLOptions:j,inlineImages:C,recordCanvas:N,preserveWhiteSpace:_,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:k,onStylesheetLoad:I,stylesheetLoadTimeout:T,keepIframeSrcFn:L});P&&I(e,P)}},T),D}
30function xre(e,t){const{mirror:r=new oz,blockClass:n="rr-block",blockSelector:a=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:l="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:f=!0,inlineImages:m=!1,recordCanvas:h=!1,maskAllInputs:p=!1,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOM:x=!1,dataURLOptions:j,preserveWhiteSpace:C,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:M,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:T=()=>!1}=t||{};return um(e,{doc:e,mirror:r,blockClass:n,blockSelector:a,unblockSelector:i,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:p===!1?{}:p,maskAttributeFn:g,maskTextFn:y,maskInputFn:v,slimDOMOptions:x===!0||x==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:x==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:x===!1?{}:x,dataURLOptions:j,inlineImages:m,recordCanvas:h,preserveWhiteSpace:C,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:M,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:T,newlyAddedElement:!1})}function Dc(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}function Is(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const em=`Please stop import mirror directly. Instead of that,\r
31now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
32or you can use record.mirror to access the mirror instance during recording.`;let u_={map:{},getId(){return console.error(em),-1},getNode(){return console.error(em),null},removeNodeFromMap(){console.error(em)},has(){return console.error(em),!1},reset(){console.error(em)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(u_=new Proxy(u_,{get(e,t,r){return t==="map"&&console.error(em),Reflect.get(e,t,r)}}));function o0(e,t,r={}){let n=null,a=0;return function(...i){const o=Date.now();!a&&r.leading===!1&&(a=o);const l=t-(o-a),c=this;l<=0||l>t?(n&&(Mre(n),n=null),a=o,e.apply(c,i)):!n&&r.trailing!==!1&&(n=Vw(()=>{a=r.leading===!1?0:Date.now(),n=null,e.apply(c,i)},l))}}function uz(e,t,r,n,a=window){const i=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,n?r:{set(o){Vw(()=>{r.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>uz(e,t,i||{},!0)}function cI(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],a=r(n);return typeof a=="function"&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=a,()=>{e[t]=n}}catch{return()=>{}}}let Cx=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Cx=()=>new Date().getTime());function dz(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:Dc([t,"optionalAccess",r=>r.documentElement,"access",r=>r.scrollLeft])||Dc([t,"optionalAccess",r=>r.body,"optionalAccess",r=>r.parentElement,"optionalAccess",r=>r.scrollLeft])||Dc([t,"optionalAccess",r=>r.body,"optionalAccess",r=>r.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:Dc([t,"optionalAccess",r=>r.documentElement,"access",r=>r.scrollTop])||Dc([t,"optionalAccess",r=>r.body,"optionalAccess",r=>r.parentElement,"optionalAccess",r=>r.scrollTop])||Dc([t,"optionalAccess",r=>r.body,"optionalAccess",r=>r.scrollTop])||0}}function fz(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function mz(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function hz(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function so(e,t,r,n,a){if(!e)return!1;const i=hz(e);
32if(!i)return!1;const o=cm(t,r);if(!a){const u=n&&i.matches(n);return o(i)&&!u}const l=hd(i,o);let c=-1;return l<0?!1:(n&&(c=hd(i,cm(null,n))),l>-1&&c<0?!0:l<c)}function wre(e,t){return t.getId(e)!==-1}function kN(e,t){return t.getId(e)===i0}function pz(e,t){if(Rg(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?pz(e.parentNode,t):!0:!0}function _C(e){return!!e.changedTouches}function jre(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function gz(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function yz(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function LC(e){return!!Dc([e,"optionalAccess",t=>t.shadowRoot])}class Nre{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return TZ(this.styleIDMap.get(t),()=>-1)}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function bz(e){let t=null;return Dc([e,"access",r=>r.getRootNode,"optionalCall",r=>r(),"optionalAccess",r=>r.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Sre(e){let t=e,r;for(;r=bz(t);)t=r;return t}function Cre(e){const t=e.ownerDocument;if(!t)return!1;const r=Sre(e);return t.contains(r)}function vz(e){const t=e.ownerDocument;return t?t.contains(e)||Cre(e):!1}const d_={};function uI(e){const t=d_[e];if(t)return t;const r=window.document;let n=window[e];if(r&&typeof r.createElement=="function")try{const a=r.createElement("iframe");a.hidden=!0,r.head.appendChild(a);const i=a.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(a)}catch{}return d_[e]=n.bind(window)}function kre(...e){return uI("requestAnimationFrame")(...e)}function Vw(...e){return uI("setTimeout")(...e)}function Mre(...e){return uI("clearTimeout")(...e)}var vr=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(vr||{}),wr=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(wr||{}),js=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(js||{}),Ml=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ml||{});function Ire(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}function f_(e){return"__ln"in e}class Ere{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=Ire([r,"optionalAccess",a=>a.next])||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&f_(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&f_(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const m_=(e,t)=>
vendor: 4,537 bytes, line 32
32`${e}@${t}`;class Tre{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new Ere,a=c=>{let u=c,d=i0;for(;d===i0;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=c=>{if(!c.parentNode||!vz(c))return;const u=Rg(c.parentNode)?this.mirror.getId(bz(c)):this.mirror.getId(c.parentNode),d=a(c);if(u===-1||d===-1)return n.addNode(c);const f=um(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{gz(m,this.mirror)&&this.iframeManager.addIframe(m),yz(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),LC(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(m,h)=>{this.iframeManager.attachIframe(m,h),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,h)=>{this.stylesheetManager.attachLinkElement(m,h)}});f&&(t.push({parentId:u,nextId:d,node:f}),r.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)h_(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||i(c);for(const c of this.addedSet)!p_(this.droppedSet,c)&&!h_(this.removes,c,this.mirror)||p_(this.movedSet,c)?i(c):this.droppedSet.add(c);let o=null;for(;n.length;){let c=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=a(o.value);u!==-1&&d!==-1&&(c=o)}if(!c){let u=n.tail;for(;u;){const d=u;if(u=u.previous,d){const f=this.mirror.getId(d.value.parentNode);if(a(d.value)===-1)continue;if(f!==-1){c=d;break}else{const h=d.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=h.parentNode.host;if(this.mirror.getId(p)!==-1){c=d;break}}}}}}if(!c){for(;n.head;)n.removeNode(n.head.value);break}o=c.previous,n.removeNode(c.value),i(c.value)}const l={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!r.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const d=JSON.stringify(c.styleDiff),f=JSON.stringify(c._unchangedStyles);d.length<u.style.length&&(d+f).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!r.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!kN(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!so(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Km(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&r?this.maskTextFn?this.maskTextFn(r,hz(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,a=t.target.getAttribute(n);if(n==="value"){const o=iI(r),l=r.tagName;a=Nx(r,l,o);const c=Uw({maskInputOptions:this.maskInputOptions,tagName:l,type:o}),u=Km(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);a=s0({isMasked:u,element:r,value:a,maskInputFn:this.maskInputFn})}if(so(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||a===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(a))if(!r.contentDocument)n="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}
32,this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!cz(r.tagName,n)&&(i.attributes[n]=lz(this.doc,Qm(r.tagName),Qm(n),a,r,this.maskAttributeFn),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?i.styleDiff[l]=c:i.styleDiff[l]=[c,u]:i._unchangedStyles[l]=[c,u]}for(const l of Array.from(o.style))r.style.getPropertyValue(l)===""&&(i.styleDiff[l]=!1)}break}case"childList":{if(so(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),a=Rg(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);so(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||kN(r,this.mirror)||!wre(r,this.mirror)||(this.addedSet.has(r)?(DC(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||pz(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[m_(n,a)]?DC(this.movedSet,r):this.removes.push({parentId:a,id:n,isShadow:Rg(t.target)&&$g(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(kN(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[m_(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);so(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),LC(t)&&t.shadowRoot.childNodes.forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function DC(e,t){e.delete(t),t.childNodes.forEach(r=>DC(e,r))}function h_(e,t,r){return e.length===0?!1:xz(e,t,r)}function xz(e,t,r){const{parentNode:n}=t;if(!n)return!1;const a=r.getId(n);return e.some(i=>i.id===a)?!0:xz(e,n,r)}function p_(e,t){return e.size===0?!1:wz(e,t)}function wz(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:wz(e,r):!1}let Fg;function Are(e){Fg=e}function Pre(){Fg=void 0}const Br=e=>Fg?(...r)=>{try{return e(...r)}catch(n){if(Fg&&Fg(n)===!0)return()=>{};throw n}}:e;function Do(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}const dm=[];function Fy(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function jz(e,t){const r=new Tre;dm.push(r),r.init(e);let n=window.MutationObserver||window.__rrMutationObserver;const a=Do([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);
vendor: 4,375 bytes, line 32
32a&&window[a]&&(n=window[a]);const i=new n(Br(o=>{e.onMutation&&e.onMutation(o)===!1||r.processMutations.bind(r)(o)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function _re({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const a=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],l;const c=o0(Br(f=>{const m=Date.now()-l;e(o.map(h=>(h.timeOffset-=m,h)),f),o=[],l=null}),i),u=Br(o0(Br(f=>{const m=Fy(f),{clientX:h,clientY:p}=_C(f)?f.changedTouches[0]:f;l||(l=Cx()),o.push({x:h,y:p,id:n.getId(m),timeOffset:Cx()-l}),c(typeof DragEvent<"u"&&f instanceof DragEvent?wr.Drag:f instanceof MouseEvent?wr.MouseMove:wr.TouchMove)}),a,{trailing:!1})),d=[Is("mousemove",u,r),Is("touchmove",u,r),Is("drag",u,r)];return Br(()=>{d.forEach(f=>f())})}function Lre({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const l=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let u=null;const d=f=>m=>{const h=Fy(m);if(so(h,n,a,i,!0))return;let p=null,g=f;if("pointerType"in m){switch(m.pointerType){case"mouse":p=Ml.Mouse;break;case"touch":p=Ml.Touch;break;case"pen":p=Ml.Pen;break}p===Ml.Touch?js[f]===js.MouseDown?g="TouchStart":js[f]===js.MouseUp&&(g="TouchEnd"):Ml.Pen}else _C(m)&&(p=Ml.Touch);p!==null?(u=p,(g.startsWith("Touch")&&p===Ml.Touch||g.startsWith("Mouse")&&p===Ml.Mouse)&&(p=null)):js[f]===js.Click&&(p=u,u=null);const y=_C(m)?m.changedTouches[0]:m;if(!y)return;const v=r.getId(h),{clientX:x,clientY:j}=y;Br(e)({type:js[g],id:v,x,y:j,...p!==null&&{pointerType:p}})};return Object.keys(js).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&l[f]!==!1).forEach(f=>{let m=Qm(f);const h=d(f);if(window.PointerEvent)switch(js[f]){case js.MouseDown:case js.MouseUp:m=m.replace("mouse","pointer");break;case js.TouchStart:case js.TouchEnd:return}c.push(Is(m,h,t))}),Br(()=>{c.forEach(f=>f())})}function Nz({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,unblockSelector:i,sampling:o}){const l=Br(o0(Br(c=>{const u=Fy(c);if(!u||so(u,n,a,i,!0))return;const d=r.getId(u);if(u===t&&t.defaultView){const f=dz(t.defaultView);e({id:d,x:f.left,y:f.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return Is("scroll",l,t)}function Dre({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const a=Br(o0(Br(()=>{const i=fz(),o=mz();(r!==i||n!==o)&&(e({width:Number(o),height:Number(i)}),r=i,n=o)}),200));return Is("resize",a,t)}const Ore=["INPUT","TEXTAREA","SELECT"],g_=new WeakMap;function Rre({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,unblockSelector:i,ignoreClass:o,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:f,maskTextClass:m,unmaskTextClass:h,maskTextSelector:p,unmaskTextSelector:g}){function y(M){let k=Fy(M);const I=M.isTrusted,T=k&&PC(k.tagName);if(T==="OPTION"&&(k=k.parentElement),!k||!T||Ore.indexOf(T)<0||so(k,n,a,i,!0))return;const L=k;if(L.classList.contains(o)||l&&L.matches(l))return;const R=iI(k);let _=Nx(L,T,R),B=!1;const z=Uw({maskInputOptions:c,tagName:T,type:R}),D=Km(k,m,p,h,g,z);(R==="radio"||R==="checkbox")&&(B=k.checked),_=s0({isMasked:D,element:k,value:_,maskInputFn:u}),v(k,f?{text:_,isChecked:B,userTriggered:I}:{text:_,isChecked:B});const A=k.name;R==="radio"&&A&&B&&t.querySelectorAll(`input[type="radio"][name="${A}"]`).forEach(P=>{if(P!==k){const E=s0({isMasked:D,element:P,value:Nx(P,T,R),maskInputFn:u});v(P,f?{text:E,isChecked:!B,userTriggered:!1}:{text:E,isChecked:!B})}})}function v(M,k){const I=g_.get(M);if(!I||I.text!==k.text||I.isChecked!==k.isChecked){g_.set(M,k);const T=r.getId(M);Br(e)({...k,id:T})}}const j=(d.input==="last"?["change"]:["input","change"]).map(M=>Is(M,Br(y),t)),C=t.defaultView;if(!C)return()=>{j.forEach(M=>M())};const N=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),S=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return N&&N.set&&j.push(...S.map(M=>uz(M[0],M[1],{set(){Br(y)({target:this,isTrusted:!1})}},!1,C))),Br(()=>
vendor: 3,124 bytes, line 32
32{j.forEach(M=>M())})}function kx(e){const t=[];function r(n,a){if(Ub("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ub("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ub("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ub("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const o=Array.from(n.parentRule.cssRules).indexOf(n);a.unshift(o)}else if(n.parentStyleSheet){const o=Array.from(n.parentStyleSheet.cssRules).indexOf(n);a.unshift(o)}return a}return r(e,t)}function Oc(e,t,r){let n,a;return e?(e.ownerNode?n=t.getId(e.ownerNode):a=r.getId(e),{styleId:a,id:n}):{}}function $re({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const a=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Br((d,f,m)=>{const[h,p]=m,{id:g,styleId:y}=Oc(f,t,r.styleMirror);return(g&&g!==-1||y&&y!==-1)&&e({id:g,styleId:y,adds:[{rule:h,index:p}]}),d.apply(f,m)})});const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Br((d,f,m)=>{const[h]=m,{id:p,styleId:g}=Oc(f,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,removes:[{index:h}]}),d.apply(f,m)})});let o;n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Br((d,f,m)=>{const[h]=m,{id:p,styleId:g}=Oc(f,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,replace:h}),d.apply(f,m)})}));let l;n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Br((d,f,m)=>{const[h]=m,{id:p,styleId:g}=Oc(f,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,replaceSync:h}),d.apply(f,m)})}));const c={};Vb("CSSGroupingRule")?c.CSSGroupingRule=n.CSSGroupingRule:(Vb("CSSMediaRule")&&(c.CSSMediaRule=n.CSSMediaRule),Vb("CSSConditionRule")&&(c.CSSConditionRule=n.CSSConditionRule),Vb("CSSSupportsRule")&&(c.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(c).forEach(([d,f])=>{u[d]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(u[d].insertRule,{apply:Br((m,h,p)=>{const[g,y]=p,{id:v,styleId:x}=Oc(h.parentStyleSheet,t,r.styleMirror);return(v&&v!==-1||x&&x!==-1)&&e({id:v,styleId:x,adds:[{rule:g,index:[...kx(h),y||0]}]}),m.apply(h,p)})}),f.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:Br((m,h,p)=>{const[g]=p,{id:y,styleId:v}=Oc(h.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||v&&v!==-1)&&e({id:y,styleId:v,removes:[{index:[...kx(h),g]}]}),m.apply(h,p)})})}),Br(()=>{n.CSSStyleSheet.prototype.insertRule=a,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([d,f])=>{f.prototype.insertRule=u[d].insertRule,f.prototype.deleteRule=u[d].deleteRule})})}function Sz({mirror:e,stylesheetManager:t},r){let n=null;r.nodeName==="#document"?n=e.getId(r):n=e.getId(r.host);const a=r.nodeName==="#document"?Do([r,"access",o=>
32o.defaultView,"optionalAccess",o=>o.Document]):Do([r,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),i=Do([a,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(Do([a,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return Do([i,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const l=Do([i,"access",c=>c.set,"optionalAccess",c=>c.call,"call",c=>c(this,o)]);if(n!==null&&n!==-1)try{t.adoptStyleSheets(o,n)}catch{}return l}}),Br(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Fre({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:a}){const i=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Br((l,c,u)=>{const[d,f,m]=u;if(r.has(d))return i.apply(c,[d,f,m]);const{id:h,styleId:p}=Oc(Do([c,"access",g=>g.parentRule,"optionalAccess",g=>g.parentStyleSheet]),t,n.styleMirror);return(h&&h!==-1||p&&p!==-1)&&e({id:h,styleId:p,set:{property:d,value:f,priority:m},index:kx(c.parentRule)}),l.apply(c,u)})});const o=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Br((l,c,u)=>{const[d]=u;if(r.has(d))return o.apply(c,[d]);const{id:f,styleId:m}=Oc(Do([c,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,remove:{property:d},index:kx(c.parentRule)}),l.apply(c,u)})}),Br(()=>{a.CSSStyleDeclaration.prototype.setProperty=i,a.CSSStyleDeclaration.prototype.removeProperty=o})}function zre({mediaInteractionCb:e,blockClass:t,blockSelector:r,unblockSelector:n,mirror:a,sampling:i,doc:o}){const l=Br(u=>o0(Br(d=>{const f=Fy(d);if(!f||so(f,t,r,n,!0))return;const{currentTime:m,volume:h,muted:p,playbackRate:g}=f;e({type:u,id:a.getId(f),currentTime:m,volume:h,muted:p,playbackRate:g})}),i.media||500)),c=[Is("play",l(0),o),Is("pause",l(1),o),Is("seeked",l(2),o),Is("volumechange",l(3),o),Is("ratechange",l(4),o)];return Br(()=>{c.forEach(u=>u())})}function Bre({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(c,u,d){const f=new i(c,u,d);return a.set(f,{family:c,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),f};const o=cI(t.fonts,"add",function(l){return function(c){return Vw(Br(()=>{const u=a.get(c);u&&(e(u),a.delete(c))}),0),l.apply(this,[c])}});return n.push(()=>{r.FontFace=i}),n.push(o),Br(()=>{n.forEach(l=>l())})}function Ure(e){const{doc:t,mirror:r,blockClass:n,blockSelector:a,unblockSelector:i,selectionCb:o}=e;let l=!0;const c=Br(()=>{const u=t.getSelection();if(!u||l&&Do([u,"optionalAccess",m=>m.isCollapsed]))return;l=u.isCollapsed||!1;const d=[],f=u.rangeCount||0;for(let m=0;m<f;m++){const h=u.getRangeAt(m),{startContainer:p,startOffset:g,endContainer:y,endOffset:v}=h;so(p,n,a,i,!0)||so(y,n,a,i,!0)||d.push({start:r.getId(p),startOffset:g,end:r.getId(y),endOffset:v})}o({ranges:d})});return c(),Is("selectionchange",c)}function Vre({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:cI(r.customElements,"define",function(a){return function(i,o,l){try{t({define:{name:i}})}catch{}return a.apply(this,[i,o,l])}})}function Wre(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};const n=jz(e,e.doc),a=_re(e),i=Lre(e),o=Nz(e),l=Dre(e,{win:r}),c=Rre(e),u=zre(e),d=$re(e,{win:r}),f=Sz(e,e.doc),m=Fre(e,{win:r}),h=e.collectFonts?Bre(e):()=>{},p=Ure(e),g=Vre(e),y=[];for(const v of e.plugins)y.push(v.observer(v.callback,r,v.options));return Br(()=>{dm.forEach(v=>v.reset()),n.disconnect(),a(),i(),o(),l(),c(),u(),d(),f(),m(),h(),p(),g(),y.forEach(v=>v())})}function Ub(e){return typeof window[e]<"u"}function Vb(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class OC{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,a){const i=n||this.getIdToRemoteIdMap(t),o=a||this.getRemoteIdToIdMap(t);let l=i.get(r);return l||(l=this.generateIdFn(),i.set(r,l),o.set(l,r)),l}getIds(t,r){const n=this.getIdToRemoteIdMap(t),a=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,a))}getRemoteId(t,r,n){const a=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const i=a.get(r);return i||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(a=>this.getRemoteId(t,a,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}function y_(e){let t,r=e[0],n=1;for(;n<e.length;){const a=e[n],i=e[n+1];if(n+=2,(a==="optionalAccess"||a==="optionalCall")&&r==null)return;a==="access"||a==="optionalAccess"?(t=r,r=i(r)):(a==="call"||a==="optionalCall")&&(r=i((...o)=>r.call(t,...o)),t=void 0)}return r}
vendor: 5,360 bytes, line 32
32class qre{constructor(){this.crossOriginIframeMirror=new OC(oI),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Gre{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new OC(oI),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new OC(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),y_([this,"access",n=>n.loadListener,"optionalCall",n=>n(t)]),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const a=this.crossOriginIframeMap.get(t.source);if(!a)return;const i=this.transformCrossOriginEvent(a,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){switch(r.type){case vr.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const n=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(r.data.node,n),{timestamp:r.timestamp,type:vr.IncrementalSnapshot,data:{source:wr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case vr.Meta:case vr.Load:case vr.DomContentLoaded:return!1;case vr.Plugin:return r;case vr.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case vr.IncrementalSnapshot:switch(r.data.source){case wr.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,t);const a=this.crossOriginIframeRootIdMap.get(t);a&&this.patchRootIdOnNode(n.node,a)}),r.data.removes.forEach(n=>{this.replaceIds(n,t,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,t,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case wr.Drag:case wr.TouchMove:case wr.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case wr.ViewportResize:return!1;case wr.MediaInteraction:case wr.MouseInteraction:case wr.Scroll:case wr.CanvasMutation:case wr.Input:return this.replaceIds(r.data,t,["id"]),r;case wr.StyleSheetRule:case wr.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case wr.Font:return r;case wr.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,t,["start","end"])}),r;case wr.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),y_([r,"access",n=>n.data,"access",n=>n.styles,"optionalAccess",n=>n.forEach,"call",n=>n(a=>{this.replaceStyleIds(a,t,["styleId"])})]),r}}return!1}replace(t,r,n,a){for(const i of a)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==Ia.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class Hre{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Yre{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!$g(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=jz({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Nz({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Vw(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Sz({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(cI(t.prototype,"attachShadow",function(a){return function(i){const o=a.call(this,i);return this.shadowRoot&&vz(this)&&n.addShadowRoot(this.shadowRoot,r),o}}))}
32reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class b_{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class Qre{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Nre,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},a=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),a.push({styleId:o,rules:Array.from(i.rules||CSSRule,(l,c)=>({rule:iz(l),index:c}))})),n.styleIds.push(o)}a.length>0&&(n.styles=a),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Kre{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){kre(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(a=>a!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let ra,Mx;const Ji=Jte();function cu(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:a="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:l="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:f=null,maskTextSelector:m=null,unmaskTextSelector:h=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:v,maskAttributeFn:x,maskInputFn:j,maskTextFn:C,maxCanvasSize:N=null,packFn:S,sampling:M={},dataURLOptions:k={},mousemoveWait:I,recordCanvas:T=!1,recordCrossOriginIframes:L=!1,recordAfter:R=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:_=!1,collectFonts:B=!1,inlineImages:z=!1,plugins:D,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:E,onMutation:F,getCanvasManager:$}=e;Are(E);const H=L?window.parent===window:!0;let X=!1;if(!H)try{window.parent.document&&(X=!1)}catch{X=!0}if(H&&!t)throw new Error("emit function is required");I!==void 0&&M.mousemove===void 0&&(M.mousemove=I),Ji.reset();const ue=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:y!==void 0?y:{},le=v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v==="all",headMetaDescKeywords:v==="all"}:v||{};jre();let ae,te=0;const ne=ie=>{for(const ye of D||[])ye.eventProcessor&&(ie=ye.eventProcessor(ie));return S&&!X&&(ie=S(ie)),ie};ra=(ie,ye)=>{const pe=ie;if(pe.timestamp=Cx(),NN([dm,"access",ce=>ce[0],"optionalAccess",ce=>ce.isFrozen,"call",ce=>ce()])&&pe.type!==vr.FullSnapshot&&!(pe.type===vr.IncrementalSnapshot&&pe.data.source===wr.Mutation)&&dm.forEach(ce=>ce.unfreeze()),H)NN([t,"optionalCall",ce=>ce(ne(pe),ye)]);else if(X){const ce={type:"rrweb",event:ne(pe),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(ce,"*")}if(pe.type===vr.FullSnapshot)ae=pe,te=0;else if(pe.type===vr.IncrementalSnapshot){if(pe.data.source===wr.Mutation&&pe.data.isAttachIframe)return;te++;const ce=n&&te>=n,xe=r&&ae&&pe.timestamp-ae.timestamp>r;(ce||xe)&&he(!0)}};const J=ie=>{ra({type:vr.IncrementalSnapshot,data:{source:wr.Mutation,...ie}})},G=ie=>ra({type:vr.IncrementalSnapshot,data:{source:wr.Scroll,...ie}}),Q=ie=>ra({type:vr.IncrementalSnapshot,data:{source:wr.CanvasMutation,...ie}}),W=ie=>ra({type:vr.IncrementalSnapshot,data:{source:wr.AdoptedStyleSheet,...ie}}),Y=new Qre({mutationCb:J,adoptedStyleSheetCb:W}),q=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new qre:new Gre({mirror:Ji,mutationCb:J,stylesheetManager:Y,recordCrossOriginIframes:L,wrappedEmit:ra});for(const ie of D||[])ie.getMirror&&ie.getMirror({nodeMirror:Ji,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const Z=new Kre,me=Zre($,{mirror:Ji,win:window,mutationCb:ie=>ra({type:vr.IncrementalSnapshot,data:{source:wr.CanvasMutation,...ie}}),recordCanvas:T,blockClass:a,blockSelector:i,unblockSelector:o,maxCanvasSize:N,sampling:M.canvas,dataURLOptions:k,errorHandler:E}),we=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Hre:new Yre({mutationCb:J,scrollCb:G,bypassOptions:{onMutation:F,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:ue,dataURLOptions:k,maskAttributeFn:x,maskTextFn:C,maskInputFn:j,recordCanvas:T,inlineImages:z,sampling:M,slimDOMOptions:le,iframeManager:q,stylesheetManager:Y,canvasManager:me,keepIframeSrcFn:A,processedNodeManager:Z},mirror:Ji}),he=(ie=!1)=>{ra({type:vr.Meta,data:{href:window.location.href,width:mz(),height:fz()}},ie),Y.reset(),we.init(),dm.forEach(pe=>pe.lock());const ye=xre(document,{mirror:Ji,blockClass:a,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:h,inlineStylesheet:p,maskAllInputs:ue,maskAttributeFn:x,maskInputFn:j,maskTextFn:C,slimDOM:le,dataURLOptions:k,recordCanvas:T,inlineImages:z,onSerialize:pe=>{gz(pe,Ji)&&q.addIframe(pe),yz(pe,Ji)&&Y.trackLinkElement(pe),LC(pe)&&we.addShadowRoot(pe.shadowRoot,document)},onIframeLoad:(pe,ce)=>{q.attachIframe(pe,ce),we.observeAttachShadow(pe)},onStylesheetLoad:(pe,ce)=>{Y.attachLinkElement(pe,ce)},keepIframeSrcFn:A});if(!ye)return console.warn("Failed to snapshot the document");ra({type:vr.FullSnapshot,data:{node:ye,initialOffset:dz(window)}}),dm.forEach(pe=>pe.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Ji.getId(document))};Mx=he;try{const ie=[],ye=ce=>Br(Wre)({onMutation:F,mutationCb:J,mousemoveCb:(xe,Ee)=>ra({type:vr.IncrementalSnapshot,data:{source:Ee,positions:xe}}),mouseInteractionCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.MouseInteraction,...xe}}),scrollCb:G,viewportResizeCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.ViewportResize,...xe}}),inputCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.Input,...xe}}),mediaInteractionCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.MediaInteraction,...xe}}),styleSheetRuleCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.StyleSheetRule,...xe}}),styleDeclarationCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.StyleDeclaration,...xe}}),canvasMutationCb:Q,fontCb:xe=>ra({type:vr.IncrementalSnapshot,data:{source:wr.Font,...xe}}),selectionCb:xe=>{ra({type:vr.IncrementalSnapshot,data:{source:wr.Selection,...xe}})},customElementCb:xe=>{ra({type:vr.IncrementalSnapshot,data:{source:wr.CustomElement,...xe}})},blockClass:a,ignoreClass:l,ignoreSelector:c,maskAllText:u,maskTextClass:d,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:h,maskInputOptions:ue,inlineStylesheet:p,sampling:M,recordCanvas:T,inlineImages:z,userTriggeredOnInput:_,collectFonts:B,doc:ce,maskAttributeFn:x,maskInputFn:j,maskTextFn:C,keepIframeSrcFn:A,blockSelector:i,unblockSelector:o,slimDOMOptions:le,dataURLOptions:k,mirror:Ji,iframeManager:q,stylesheetManager:Y,shadowDomManager:we,processedNodeManager:Z,canvasManager:me,ignoreCSSAttributes:P,plugins:NN([D,"optionalAccess",xe=>xe.filter,"call",xe=>xe(Ee=>Ee.observer),"optionalAccess",xe=>xe.map,"call",xe=>xe(Ee=>({observer:Ee.observer,options:Ee.options,callback:Ye=>ra({type:vr.Plugin,data:{plugin:Ee.name,payload:Ye}})}))])||[]},{});q.addLoadListener(ce=>{try{ie.push(ye(ce.contentDocument))}catch(xe){console.warn(xe)}});const pe=()=>{he(),ie.push(ye(document))};return document.readyState==="interactive"||document.readyState==="complete"?pe():(ie.push(Is("DOMContentLoaded",()=>{ra({type:vr.DomContentLoaded,data:{}}),R==="DOMContentLoaded"&&pe()})),ie.push(Is("load",()=>{ra({type:vr.Load,data:{}}),R==="load"&&pe()}
32,window))),()=>{ie.forEach(ce=>ce()),Z.destroy(),Mx=void 0,Pre()}}catch(ie){console.warn(ie)}}function Jre(e){if(!Mx)throw new Error("please take full snapshot after start recording");Mx(e)}cu.mirror=Ji;cu.takeFullSnapshot=Jre;function Zre(e,t){try{return e?e(t):new b_}catch{return console.warn("Unable to initialize CanvasManager"),new b_}}const Xre=3,ene=5;function dI(e){return e>9999999999?e:e*1e3}function MN(e){return e>9999999999?e/1e3:e}function zy(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:vr.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Lo(t,10,1e3)}}),t.category==="console")))}const tne="button,a";function Cz(e){return e.closest(tne)||e}function kz(e){const t=Mz(e);return!t||!(t instanceof Element)?t:Cz(t)}function Mz(e){return rne(e)?e.target:e}function rne(e){return typeof e=="object"&&!!e&&"target"in e}let Rc;function nne(e){return Rc||(Rc=[],ane()),Rc.push(e),()=>{const t=Rc?Rc.indexOf(e):-1;t>-1&&Rc.splice(t,1)}}function ane(){Ra(Ln,"open",function(e){return function(...t){if(Rc)try{Rc.forEach(r=>r())}catch{}return e.apply(Ln,t)}})}function sne(e,t,r){e.handleClick(t,r)}class ine{constructor(t,r,n=zy){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=r.timeout/1e3,this._threshold=r.threshold/1e3,this._scollTimeout=r.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=r.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const t=nne(()=>{this._lastMutation=v_()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,r){if(lne(r,this._ignoreSelector)||!cne(t))return;const n={timestamp:MN(t.timestamp),clickBreadcrumb:t,clickCount:0,node:r};this._clicks.some(a=>a.node===n.node&&Math.abs(a.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=MN(t)}registerScroll(t=Date.now()){this._lastScroll=MN(t)}registerClick(t){const r=Cz(t);this._handleMultiClick(r)}_handleMultiClick(t){this._getClicks(t).forEach(r=>{r.clickCount++})}_getClicks(t){return this._clicks.filter(r=>r.node===t)}_checkClicks(){const t=[],r=v_();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=r&&t.push(n)});for(const n of t){const a=this._clicks.indexOf(n);a>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(a,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const r=this._replay,n=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,a=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!n&&!a,{clickCount:o,clickBreadcrumb:l}=t;if(i){const c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.slowClickDetected",data:{...l.data,url:Ln.location.href,route:r.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(r,d);return}if(o>1){const c={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.multiClick",data:{...l.data,url:Ln.location.href,route:r.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(r,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const one=["A","BUTTON","INPUT"];function lne(e,t){return!!(!one.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function cne(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function v_(){return Date.now()/1e3}function une(e,t){try{if(!dne(t))return;const{source:r}=t.data;if(r===wr.Mutation&&e.registerMutation(t.timestamp),r===wr.Scroll&&e.registerScroll(t.timestamp),fne(t)){const{type:n,id:a}=t.data,i=cu.mirror.getNode(a);i instanceof HTMLElement&&n===js.Click&&e.registerClick(i)}}catch{}}function dne(e){return e.type===Xre}function fne(e){return e.data.source===wr.MouseInteraction}function Uo(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Ix;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(Ix||(Ix={}));const mne=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function hne(e){const t={};for(const r in e)if(mne.has(r)){let n=r;
32(r==="data-testid"||r==="data-test-id")&&(n="testId"),t[n]=e[r]}return t}const pne=e=>t=>{if(!e.isEnabled())return;const r=gne(t);if(!r)return;const n=t.name==="click",a=n?t.event:void 0;n&&e.clickDetector&&a&&a.target&&!a.altKey&&!a.metaKey&&!a.ctrlKey&&!a.shiftKey&&sne(e.clickDetector,r,kz(t.event)),zy(e,r)};function Iz(e,t){const r=cu.mirror.getId(e),n=r&&cu.mirror.getNode(r),a=n&&cu.mirror.getMeta(n),i=a&&bne(a)?a:null;return{message:t,data:i?{nodeId:r,node:{id:r,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===Ix.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:hne(i.attributes)}}:{}}}function gne(e){const{target:t,message:r}=yne(e);return Uo({category:`ui.${e.name}`,...Iz(t,r)})}function yne(e){const t=e.name==="click";let r,n=null;try{n=t?kz(e.event):Mz(e.event),r=Rw(n,{maxStringLength:200})||"<unknown>"}catch{r="<unknown>"}return{target:n,message:r}}function bne(e){return e.type===Ix.Element}function vne(e,t){if(!e.isEnabled())return;e.updateUserActivity();const r=xne(t);r&&zy(e,r)}function xne(e){const{metaKey:t,shiftKey:r,ctrlKey:n,altKey:a,key:i,target:o}=e;if(!o||wne(o)||!i)return null;const l=t||n||a,c=i.length===1;if(!l&&c)return null;const u=Rw(o,{maxStringLength:200})||"<unknown>",d=Iz(o,u);return Uo({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:r,ctrlKey:n,altKey:a,key:i}})}function wne(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const x_={resource:kne,paint:Sne,navigation:Cne};function jne(e){return e.map(Nne).filter(Boolean)}function Nne(e){return x_[e.entryType]?x_[e.entryType](e):null}function Jm(e){return((xZ||Ln.performance.timeOrigin)+e)/1e3}function Sne(e){const{duration:t,entryType:r,name:n,startTime:a}=e,i=Jm(a);return{type:r,name:n,start:i,end:i+t,data:void 0}}function Cne(e){const{entryType:t,name:r,decodedBodySize:n,duration:a,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:l,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:d,loadEventEnd:f,redirectCount:m,startTime:h,transferSize:p,type:g}=e;return a===0?null:{type:`${t}.${g}`,start:Jm(h),end:Jm(i),name:r,data:{size:p,decodedBodySize:n,encodedBodySize:o,duration:a,domInteractive:u,domContentLoadedEventStart:l,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:f,domComplete:i,redirectCount:m}}}function kne(e){const{entryType:t,initiatorType:r,name:n,responseEnd:a,startTime:i,decodedBodySize:o,encodedBodySize:l,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(r)?null:{type:`${t}.${r}`,start:Jm(i),end:Jm(a),name:n,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:l}}}function Mne(e){const t=e.entries,r=t[t.length-1],n=r?r.element:void 0,a=e.value,i=Jm(a);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:i,end:i,data:{value:a,size:a,nodeId:n?cu.mirror.getId(n):void 0}}}function Ine(e){function t(a){e.performanceEntries.includes(a)||e.performanceEntries.push(a)}function r({entries:a}){a.forEach(t)}const n=[];return["navigation","paint","resource"].forEach(a=>{n.push(iee(a,r))}),n.push(see(({metric:a})=>{e.replayPerformanceEntries.push(Mne(a))})),()=>{n.forEach(a=>a())}}const Tn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ene='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))}
vendor: 4,465 bytes, line 32
32,M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;
32++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function Tne(){const e=new Blob([Ene]);return URL.createObjectURL(e)}function Ms(e,t){Tn&&(St.info(e),t&&Ez(e))}function bm(e,t){Tn&&(St.info(e),t&&setTimeout(()=>{Ez(e)},0))}function Ez(e){Nu({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}
32class fI extends Error{constructor(){super(`Event buffer exceeded maximum size of ${sI}.`)}}class Tz{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const r=JSON.stringify(t).length;if(this._totalSize+=r,this._totalSize>sI)throw new fI;this.events.push(t)}finish(){return new Promise(t=>{const r=this.events;this.clear(),t(JSON.stringify(r))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(r=>r.timestamp).sort()[0];return t?dI(t):null}}class Ane{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,r)=>{this._worker.addEventListener("message",({data:n})=>{n.success?t():r()},{once:!0}),this._worker.addEventListener("error",n=>{r(n)},{once:!0})}),this._ensureReadyPromise)}destroy(){Ms("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,r){const n=this._getAndIncrementId();return new Promise((a,i)=>{const o=({data:l})=>{const c=l;if(c.method===t&&c.id===n){if(this._worker.removeEventListener("message",o),!c.success){Tn&&St.error("[Replay]",c.response),i(new Error("Error in compression worker"));return}a(c.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:n,method:t,arg:r})})}_getAndIncrementId(){return this._id++}}class Pne{constructor(t){this._worker=new Ane(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const r=dI(t.timestamp);(!this._earliestTimestamp||r<this._earliestTimestamp)&&(this._earliestTimestamp=r);const n=JSON.stringify(t);return this._totalSize+=n.length,this._totalSize>sI?Promise.reject(new fI):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{Tn&&St.warn('[Replay] Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class _ne{constructor(t){this._fallback=new Tz,this._compression=new Pne(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{Ms("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:r}=this._fallback,n=[];for(const a of t)n.push(this._compression.addEvent(a));this._compression.hasCheckout=r,this._used=this._compression;try{await Promise.all(n)}catch(a){Tn&&St.warn("[Replay] Failed to add events when switching buffers.",a)}}}function Lne({useCompression:e,workerUrl:t}){if(e&&window.Worker){const r=Dne(t);if(r)return r}return Ms("[Replay] Using simple buffer"),new Tz}function Dne(e){try{const t=e||One();if(!t)return;Ms(`[Replay] Using compression worker${e?` from ${e}`:""}`);const r=new Worker(t);return new _ne(r)}catch{Ms("[Replay] Failed to create compression worker")}}function One(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Tne():""}function mI(){try{return"sessionStorage"in Ln&&!!Ln.sessionStorage}catch{return!1}}function Rne(e){$ne(),e.session=void 0}function $ne(){if(mI())try{Ln.sessionStorage.removeItem(nI)}catch{}}function Az(e){return e===void 0?!1:Math.random()<e}function Pz(e){const t=Date.now(),r=e.id||ni(),n=e.started||t,a=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,l=e.previousSessionId;return{id:r,started:n,lastActivity:a,segmentId:i,sampled:o,previousSessionId:l}}function hI(e){if(mI())try{Ln.sessionStorage.setItem(nI,JSON.stringify(e))}catch{}}function Fne(e,t){return Az(e)?"session":t?"buffer":!1}function w_({sessionSampleRate:e,allowBuffering:t,stickySession:r=!1},{previousSessionId:n}={}){const a=Fne(e,t),i=Pz({sampled:a,previousSessionId:n});return r&&hI(i),i}function zne(e){if(!mI())return null;try{const t=Ln.sessionStorage.getItem(nI);if(!t)return null;const r=JSON.parse(t);return bm("[Replay] Loading existing session",e),Pz(r)}catch{return null}}function RC(e,t,r=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=r}function _z(e,{maxReplayDuration:t,sessionIdleExpire:r,targetTime:n=Date.now()}){return RC(e.started,t,n)||RC(e.lastActivity,r,n)}function Lz(e,{sessionIdleExpire:t,maxReplayDuration:r}){return!(!_z(e,{sessionIdleExpire:t,maxReplayDuration:r})||e.sampled==="buffer"&&e.segmentId===0)}function IN({traceInternals:e,sessionIdleExpire:t,maxReplayDuration:r,previousSessionId:n},a){const i=a.stickySession&&zne(e);return i?Lz(i,{sessionIdleExpire:t,maxReplayDuration:r})?(bm("[Replay] Session in sessionStorage is expired, creating new one..."),w_(a,{previousSessionId:i.id})):i:(bm("[Replay] Creating new session",e),w_(a,{previousSessionId:n}))}function Bne(e){return e.type===vr.Custom}function pI(e,t,r){return Oz(e,t)?(Dz(e,t,r),!0):!1}function Une(e,t,r){return Oz(e,t)?Dz(e,t,r):Promise.resolve(null)}async function Dz(e,t,r){if(!e.eventBuffer)return null;try{r&&e.recordingMode==="buffer"&&e.eventBuffer.clear(),r&&(e.eventBuffer.hasCheckout=!0);const n=e.getOptions(),a=Vne(t,n.beforeAddRecordingEvent);return a?await e.eventBuffer.addEvent(a):void 0}catch(n){const a=n&&n instanceof fI?"addEventSizeExceeded":"addEvent";Tn&&St.error(n),await e.stop({reason:a});const i=Vn();i&&i.recordDroppedEvent("internal_sdk_error","replay")}}
32function Oz(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const r=dI(t.timestamp);return r+e.timeouts.sessionIdlePause<Date.now()?!1:r>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Ms(`[Replay] Skipping event with timestamp ${r} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1):!0}function Vne(e,t){try{if(typeof t=="function"&&Bne(e))return t(e)}catch(r){return Tn&&St.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",r),null}return e}function gI(e){return!e.type}function $C(e){return e.type==="transaction"}function Wne(e){return e.type==="replay_event"}function j_(e){return e.type==="feedback"}function Rz(e){const t=Hne();return(r,n)=>{if(!e.isEnabled()||!gI(r)&&!$C(r))return;const a=n&&n.statusCode;if(!(t&&(!a||a<200||a>=300))){if($C(r)){qne(e,r);return}Gne(e,r)}}}function qne(e,t){const r=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&r.traceIds.size<100&&r.traceIds.add(t.contexts.trace.trace_id)}function Gne(e,t){const r=e.getContext();if(t.event_id&&r.errorIds.size<100&&r.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:n}=e.getOptions();typeof n=="function"&&!n(t)||setTimeout(()=>{e.sendBufferedReplayOrFlush()})}function Hne(){const e=Vn();if(!e)return!1;const t=e.getTransport();return t&&t.send.__sentry__baseTransport__||!1}function Yne(e){return t=>{!e.isEnabled()||!gI(t)||Qne(e,t)}}function Qne(e,t){const r=t.exception&&t.exception.values&&t.exception.values[0].value;if(typeof r=="string"&&(r.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||r.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const n=Uo({category:"replay.hydrate-error"});zy(e,n)}}function Kne(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function Jne(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:vr.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function Zne(e,t){return e.recordingMode!=="buffer"||t.message===aI||!t.exception||t.type?!1:Az(e.getOptions().errorSampleRate)}function Xne(e,t=!1){const r=t?Rz(e):void 0;return Object.assign((n,a)=>e.isEnabled()?Wne(n)?(delete n.breadcrumbs,n):!gI(n)&&!$C(n)&&!j_(n)||!e.checkAndHandleExpiredSession()?n:j_(n)?(e.flush(),n.contexts.feedback.replay_id=e.getSessionId(),Jne(e,n),n):Kne(n,a)&&!e.getOptions()._experiments.captureExceptions?(Tn&&St.log("[Replay] Ignoring error from rrweb internals",n),null):((Zne(e,n)||e.recordingMode==="session")&&(n.tags={...n.tags,replayId:e.getSessionId()}),r&&r(n,{statusCode:200}),n):n,{id:"Replay"})}function Ww(e,t){return t.map(({type:r,start:n,end:a,name:i,data:o})=>{const l=e.throttledAddEvent({type:vr.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:r,description:i,startTimestamp:n,endTimestamp:a,data:o}}});return typeof l=="string"?Promise.resolve(null):l})}function eae(e){const{from:t,to:r}=e,n=Date.now()/1e3;return{type:"navigation.push",start:n,end:n,name:r,data:{previous:t}}}function tae(e){return t=>{if(!e.isEnabled())return;const r=eae(t);r!==null&&(e.getContext().urls.push(r.name),e.triggerUserActivity(),e.addUpdate(()=>(Ww(e,[r]),!1)))}}function rae(e,t){return Tn&&e.getOptions()._experiments.traceInternals?!1:EX(t,Vn())}function qw(e,t){e.isEnabled()&&t!==null&&(rae(e,t.name)||e.addUpdate(()=>(Ww(e,[t]),!0)))}function nae(e){const{startTimestamp:t,endTimestamp:r,fetchData:n,response:a}=e;if(!r)return null;const{method:i,url:o}=n;return{type:"resource.fetch",start:t/1e3,end:r/1e3,name:o,data:{method:i,statusCode:a?a.status:void 0}}}function aae(e){return t=>{if(!e.isEnabled())return;const r=nae(t);qw(e,r)}}function sae(e){const{startTimestamp:t,endTimestamp:r,xhr:n}=e,a=n[md];if(!t||!r||!a)return null;const{method:i,url:o,status_code:l}=a;return o===void 0?null:{type:"resource.xhr",name:o,start:t/1e3,end:r/1e3,data:{method:i,statusCode:l}}
32}function iae(e){return t=>{if(!e.isEnabled())return;const r=sae(t);qw(e,r)}}function Gw(e,t){if(e)try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const r=Bz(e);return t.encode(r).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function $z(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Fz(e){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Bz(e)];if(!e)return[void 0]}catch{return Tn&&St.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Tn&&St.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ex(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const r={...e._meta},n=r.warnings||[];return r.warnings=[...n,t],e._meta=r,e}function zz(e,t){if(!t)return null;const{startTimestamp:r,endTimestamp:n,url:a,method:i,statusCode:o,request:l,response:c}=t;return{type:e,start:r/1e3,end:n/1e3,name:a,data:oo({method:i,statusCode:o,request:l,response:c})}}function l0(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function uu(e,t,r){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!r)return{headers:e,size:t};const n={headers:e,size:t},{body:a,warnings:i}=oae(r);return n.body=a,i&&i.length>0&&(n._meta={warnings:i}),n}function FC(e,t){return Object.keys(e).reduce((r,n)=>{const a=n.toLowerCase();return t.includes(a)&&e[n]&&(r[a]=e[n]),r},{})}function Bz(e){return new URLSearchParams(e).toString()}function oae(e){if(!e||typeof e!="string")return{body:e};const t=e.length>i_,r=lae(e);if(t){const n=e.slice(0,i_);return r?{body:n,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${n}…`,warnings:["TEXT_TRUNCATED"]}}if(r)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function lae(e){const t=e[0],r=e[e.length-1];return t==="["&&r==="]"||t==="{"&&r==="}"}function Tx(e,t){const r=cae(e);return Dy(r,t)}function cae(e,t=Ln.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Ln.location.origin))return e;const r=new URL(e,t);if(r.origin!==new URL(t).origin)return e;const n=r.href;return!e.endsWith("/")&&n.endsWith("/")?n.slice(0,-1):n}async function uae(e,t,r){try{const n=await fae(e,t,r),a=zz("resource.fetch",n);qw(r.replay,a)}catch(n){Tn&&St.error("[Replay] Failed to capture fetch breadcrumb",n)}}function dae(e,t,r){const{input:n,response:a}=t,i=n?Uz(n):void 0,o=Gw(i,r.textEncoder),l=a?$z(a.headers.get("content-length")):void 0;o!==void 0&&(e.data.request_body_size=o),l!==void 0&&(e.data.response_body_size=l)}async function fae(e,t,r){const n=Date.now(),{startTimestamp:a=n,endTimestamp:i=n}=t,{url:o,method:l,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,f=Tx(o,r.networkDetailAllowUrls)&&!Tx(o,r.networkDetailDenyUrls),m=f?mae(r,t.input,u):l0(u),h=await hae(f,r,t.response,d);return{startTimestamp:a,endTimestamp:i,url:o,method:l,statusCode:c,request:m,response:h}}function mae({networkCaptureBodies:e,networkRequestHeaders:t},r,n){const a=r?yae(r,t):{};if(!e)return uu(a,n,void 0);const i=Uz(r),[o,l]=Fz(i),c=uu(a,n,o);return l?Ex(c,l):c}async function hae(e,{networkCaptureBodies:t,textEncoder:r,networkResponseHeaders:n},a,i){if(!e&&i!==void 0)return l0(i);const o=a?Vz(a.headers,n):{};if(!a||!t&&i!==void 0)return uu(o,i,void 0);const[l,c]=await gae(a),u=pae(l,{networkCaptureBodies:t,textEncoder:r,responseBodySize:i,captureDetails:e,headers:o});return c?Ex(u,c):u}function pae(e,{networkCaptureBodies:t,textEncoder:r,responseBodySize:n,captureDetails:a,headers:i}){try{const o=e&&e.length&&n===void 0?Gw(e,r):n;return a?t?uu(i,o,e):uu(i,o,void 0):l0(o)}catch(o){return Tn&&St.warn("[Replay] Failed to serialize response body",o),uu(i,n,void 0)}}async function gae(e){const t=bae(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await vae(t)]}catch(r){return Tn&&St.warn("[Replay] Failed to get text body from response",r),[void 0,"BODY_PARSE_ERROR"]}}function Uz(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function Vz(e,t){const r={};return t.forEach(n=>{e.get(n)&&(r[n]=e.get(n))}),r}
32function yae(e,t){return e.length===1&&typeof e[0]!="string"?N_(e[0],t):e.length===2?N_(e[1],t):{}}function N_(e,t){if(!e)return{};const r=e.headers;return r?r instanceof Headers?Vz(r,t):Array.isArray(r)?{}:FC(r,t):{}}function bae(e){try{return e.clone()}catch(t){Tn&&St.warn("[Replay] Failed to clone response body",t)}}function vae(e){return new Promise((t,r)=>{const n=setTimeout(()=>r(new Error("Timeout while trying to read response body")),500);xae(e).then(a=>t(a),a=>r(a)).finally(()=>clearTimeout(n))})}async function xae(e){return await e.text()}async function wae(e,t,r){try{const n=Nae(e,t,r),a=zz("resource.xhr",n);qw(r.replay,a)}catch(n){Tn&&St.error("[Replay] Failed to capture xhr breadcrumb",n)}}function jae(e,t,r){const{xhr:n,input:a}=t;if(!n)return;const i=Gw(a,r.textEncoder),o=n.getResponseHeader("content-length")?$z(n.getResponseHeader("content-length")):Mae(n.response,n.responseType,r.textEncoder);i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}function Nae(e,t,r){const n=Date.now(),{startTimestamp:a=n,endTimestamp:i=n,input:o,xhr:l}=t,{url:c,method:u,status_code:d=0,request_body_size:f,response_body_size:m}=e.data;if(!c)return null;if(!l||!Tx(c,r.networkDetailAllowUrls)||Tx(c,r.networkDetailDenyUrls)){const S=l0(f),M=l0(m);return{startTimestamp:a,endTimestamp:i,url:c,method:u,statusCode:d,request:S,response:M}}const h=l[md],p=h?FC(h.request_headers,r.networkRequestHeaders):{},g=FC(Sae(l),r.networkResponseHeaders),[y,v]=r.networkCaptureBodies?Fz(o):[void 0],[x,j]=r.networkCaptureBodies?Cae(l):[void 0],C=uu(p,f,y),N=uu(g,m,x);return{startTimestamp:a,endTimestamp:i,url:c,method:u,statusCode:d,request:v?Ex(C,v):C,response:j?Ex(N,j):N}}function Sae(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
33`).reduce((r,n)=>{const[a,i]=n.split(": ");return r[a.toLowerCase()]=i,r},{}):{}}function Cae(e){const t=[];try{return[e.responseText]}catch(r){t.push(r)}try{return kae(e.response,e.responseType)}catch(r){t.push(r)}return Tn&&St.warn("[Replay] Failed to get xhr response body",...t),[void 0]}function kae(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch{return Tn&&St.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Tn&&St.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Mae(e,t,r){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Gw(n,r)}catch{return}}function Iae(e){const t=Vn();try{const r=new TextEncoder,{networkDetailAllowUrls:n,networkDetailDenyUrls:a,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:l}=e.getOptions(),c={replay:e,textEncoder:r,networkDetailAllowUrls:n,networkDetailDenyUrls:a,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:l};t&&t.on?t.on("beforeAddBreadcrumb",(u,d)=>Eae(c,u,d)):(bF(aae(e)),vF(iae(e)))}catch{}}function Eae(e,t,r){if(t.data)try{Tae(t)&&Pae(r)&&(jae(t,r,e),wae(t,r,e)),Aae(t)&&_ae(r)&&(dae(t,r,e),uae(t,r,e))}catch{Tn&&St.warn("Error when enriching network breadcrumb")}}function Tae(e){return e.category==="xhr"}function Aae(e){return e.category==="fetch"}function Pae(e){return e&&e.xhr}function _ae(e){return e&&e.response}let S_=null;function Lae(e){return!!e.category}const Dae=e=>t=>{if(!e.isEnabled())return;const r=Oae(t);r&&zy(e,r)};function Oae(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();return S_===t||!t||(S_=t,!Lae(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))?null:t.category==="console"?Rae(t):Uo(t)}function Rae(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return Uo(e);let r=!1;const n=t.map(a=>{if(!a)return a;if(typeof a=="string")return a.length>Bb?(r=!0,`${a.slice(0,Bb)}…`):a;if(typeof a=="object")try{const i=Lo(a,7);return JSON.stringify(i).length>Bb?(r=!0,`${JSON.stringify(i,null,2).slice(0,Bb)}…`):i}catch{}return a});return Uo({...e,data:{...e.data,arguments:n,...r?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function $ae(e){const t=$u(),r=Vn();
33t.addScopeListener(Dae(e)),gF(pne(e)),K4(tae(e)),Iae(e);const n=Xne(e,!C_(r));r&&r.addEventProcessor?r.addEventProcessor(n):SX(n),C_(r)&&(r.on("beforeSendEvent",Yne(e)),r.on("afterSendEvent",Rz(e)),r.on("createDsc",a=>{const i=e.getSessionId();i&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(a.replay_id=i)}),r.on("startTransaction",a=>{e.lastTransaction=a}),r.on("finishTransaction",a=>{e.lastTransaction=a}),r.on("beforeSendFeedback",(a,i)=>{const o=e.getSessionId();i&&i.includeReplay&&e.isEnabled()&&o&&a.contexts&&a.contexts.feedback&&(a.contexts.feedback.replay_id=o)}))}function C_(e){return!!(e&&e.on)}async function Fae(e){try{return Promise.all(Ww(e,[zae(Ln.performance.memory)]))}catch{return[]}}function zae(e){const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}=e,a=Date.now()/1e3;return{type:"memory",name:"memory",start:a,end:a,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}}}}function Bae(e,t,r){let n,a,i;const o=r&&r.maxWait?Math.max(r.maxWait,t):0;function l(){return c(),n=e(),n}function c(){a!==void 0&&clearTimeout(a),i!==void 0&&clearTimeout(i),a=i=void 0}function u(){return a!==void 0||i!==void 0?l():n}function d(){return a&&clearTimeout(a),a=setTimeout(l,t),o&&i===void 0&&(i=setTimeout(l,o)),n}return d.cancel=c,d.flush=u,d}function Uae(e){let t=!1;return(r,n)=>{if(!e.checkAndHandleExpiredSession()){Tn&&St.warn("[Replay] Received replay event after session expired.");return}const a=n||!t;t=!0,e.clickDetector&&une(e.clickDetector,r),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&a&&e.setInitialState(),!pI(e,r,a))return!0;if(!a)return!1;if(Wae(e,a),e.session&&e.session.previousSessionId)return!0;if(e.recordingMode==="buffer"&&e.session&&e.eventBuffer){const i=e.eventBuffer.getEarliestTimestamp();i&&(Ms(`[Replay] Updating session start time to earliest event in buffer to ${new Date(i)}`,e.getOptions()._experiments.traceInternals),e.session.started=i,e.getOptions().stickySession&&hI(e.session))}return e.recordingMode==="session"&&e.flush(),!0})}}function Vae(e){const t=e.getOptions();return{type:vr.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Wae(e,t){!t||!e.session||e.session.segmentId!==0||pI(e,Vae(e),!1)}function qae(e,t,r,n){return yf(NF(e,Z4(e),n,r),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function Gae({recordingData:e,headers:t}){let r;const n=`${JSON.stringify(t)}
34`;if(typeof e=="string")r=`${n}${e}`;else{const i=new TextEncoder().encode(n);r=new Uint8Array(i.length+e.length),r.set(i),r.set(e,i.length)}return r}async function Hae({client:e,scope:t,replayId:r,event:n}){const a=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:r,integrations:a};e.emit&&e.emit("preprocessEvent",n,i);const o=await IF(e.getOptions(),n,i,t,e,$y());if(!o)return null;o.platform=o.platform||"javascript";const l=e.getSdkMetadata&&e.getSdkMetadata(),{name:c,version:u}=l&&l.sdk||{};return o.sdk={...o.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0"},o}async function Yae({recordingData:e,replayId:t,segmentId:r,eventContext:n,timestamp:a,session:i}){const o=Gae({recordingData:e,headers:{segment_id:r}}),{urls:l,errorIds:c,traceIds:u,initialTimestamp:d}=n,f=Vn(),m=$u(),h=f&&f.getTransport(),p=f&&f.getDsn();if(!f||!h||!p||!i.sampled)return;const g={type:Pte,replay_start_timestamp:d/1e3,timestamp:a/1e3,error_ids:c,trace_ids:u,urls:l,replay_id:t,segment_id:r,replay_type:i.sampled},y=await Hae({scope:m,client:f,replayId:t,event:g});if(!y){f.recordDroppedEvent("event_processor","replay",g),Ms("An event processor returned `null`, will not send event.");return}delete y.sdkProcessingMetadata;const v=qae(y,o,p,f.getOptions().tunnel);let x;try{x=await h.send(v)}catch(C){const N=new Error(aI);try{N.cause=C}catch{}throw N}if(!x)return x;if(typeof x.statusCode=="number"&&(x.statusCode<200||x.statusCode>=300))throw new Wz(x.statusCode);const j=CF({},x);if(SF(j,"replay"))throw new qz(j);return x}
34class Wz extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class qz extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function Gz(e,t={count:0,interval:$te}){const{recordingData:r,options:n}=e;if(r.length)try{return await Yae(e),!0}catch(a){if(a instanceof Wz||a instanceof qz)throw a;if(HZ("Replays",{_retryCount:t.count}),Tn&&n._experiments&&n._experiments.captureExceptions&&Fw(a),t.count>=Fte){const i=new Error(`${aI} - max retries exceeded`);try{i.cause=a}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{setTimeout(async()=>{try{await Gz(e,t),i(!0)}catch(l){o(l)}},t.interval)})}}const Hz="__THROTTLED",Qae="__SKIPPED";function Kae(e,t,r){const n=new Map,a=l=>{const c=l-r;n.forEach((u,d)=>{d<c&&n.delete(d)})},i=()=>[...n.values()].reduce((l,c)=>l+c,0);let o=!1;return(...l)=>{const c=Math.floor(Date.now()/1e3);if(a(c),i()>=t){const d=o;return o=!0,d?Qae:Hz}o=!1;const u=n.get(c)||0;return n.set(c,u+1),e(...l)}}class $c{constructor({options:t,recordingOptions:r}){$c.prototype.__init.call(this),$c.prototype.__init2.call(this),$c.prototype.__init3.call(this),$c.prototype.__init4.call(this),$c.prototype.__init5.call(this),$c.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:_te,sessionIdleExpire:Lte},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=r,this._options=t,this._debouncedFlush=Bae(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Kae((o,l)=>Une(this,o,l),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:a}=this.getOptions(),i=n?{threshold:Math.min(zte,n),timeout:n,scrollTimeout:Bte,ignoreSelector:a?a.join(","):""}:void 0;i&&(this.clickDetector=new ine(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:r,sessionSampleRate:n}=this._options;if(!(r<=0&&n<=0)){if(this._initializeSessionForSampling(t),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",bm(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");bm("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const t=IN({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");bm("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=IN({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=cu({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:Rte},emit:Uae(this),onMutation:this._onMutationHandler,...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}async stop({forceFlush:t=!1,reason:r}={}){if(this._isEnabled){this._isEnabled=!1;try{Ms(`[Replay] Stopping Replay${r?` triggered by ${r}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Rne(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Ms("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Ms("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const r=Date.now();
34Ms("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();!t||!n||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(r),this._updateSessionActivity(r),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const r=t();this.recordingMode!=="buffer"&&r!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&RC(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Ln.location.pathname}${Ln.location.hash}${Ln.location.search}`,r=`${Ln.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=r,this._context.initialTimestamp=Date.now(),this._context.urls.push(r)}throttledAddEvent(t,r){const n=this._throttledAddEvent(t,r);if(n===Hz){const a=Uo({category:"replay.throttled"});this.addUpdate(()=>!pI(this,{type:ene,timestamp:a.timestamp||0,data:{tag:"breadcrumb",payload:a,metric:!0}}))}return n}getCurrentRoute(){const t=this.lastTransaction||$u().getTransaction(),n=(t&&Yd(t).data||{})[sX];if(!(!t||!n||!["route","custom"].includes(n)))return Yd(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Lne({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){Tn&&St.error("[Replay]",t),Tn&&this._options._experiments&&this._options._experiments.captureExceptions&&Fw(t)}_initializeSessionForSampling(t){const r=this._options.errorSampleRate>0,n=IN({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:r});this.session=n}_checkSession(){if(!this.session)return!1;const t=this.session;return Lz(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{Ln.document.addEventListener("visibilitychange",this._handleVisibilityChange),Ln.addEventListener("blur",this._handleWindowBlur),Ln.addEventListener("focus",this._handleWindowFocus),Ln.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||($ae(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=Ine(this)}_removeListeners(){try{Ln.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ln.removeEventListener("blur",this._handleWindowBlur),Ln.removeEventListener("focus",this._handleWindowFocus),Ln.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{Ln.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=Uo({category:"ui.blur"});
34this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=Uo({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{vne(this,t)}}_doChangeToBackgroundTasks(t){!this.session||_z(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Ms("[Replay] Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:vr.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){const t=jne(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Ww(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:r}=this;if(!t||!r||t.segmentId)return;const n=r.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){Tn&&St.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await Fae(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),a=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Gz({replayId:t,recordingData:i,segmentId:a,eventContext:n,session:this.session,options:this.getOptions(),timestamp:r})}catch(r){this._handleException(r),this.stop({reason:"sendReplay"});const n=Vn();n&&n.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){Tn&&St.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const r=this.session.started,a=Date.now()-r;this._debouncedFlush.cancel();const i=a<this._options.minReplayDuration,o=a>this._options.maxReplayDuration+5e3;if(i||o){Ms(`[Replay] Session duration (${Math.floor(a/1e3)}s) is too ${i?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),i&&this._debouncedFlush();return}const l=this.eventBuffer;if(l&&this.session.segmentId===0&&!l.hasCheckout&&Ms("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(c){Tn&&St.error(c)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&hI(this.session)}__init6(){this._onMutationHandler=t=>{const r=t.length,n=this._options.mutationLimit,a=this._options.mutationBreadcrumbLimit,i=n&&r>n;if(r>a||i){const o=Uo({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(o)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function Hp(e,t,r,n){const a=typeof n=="string"?n.split(","):[],i=[...e,...a,...t];return typeof r<"u"&&(typeof r=="string"&&i.push(`.${r}`),Gd(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),i.join(",")}function Jae({mask:e,unmask:t,block:r,unblock:n,ignore:a,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,ignoreClass:u}){const d=['base[href="/"]'],f=Hp(e,[".sentry-mask","[data-sentry-mask]"],l,c),m=Hp(t,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:f,unmaskTextSelector:m,blockSelector:Hp(r,[".sentry-block","[data-sentry-block]",...d],i,o),unblockSelector:Hp(n,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Hp(a,[".sentry-ignore","[data-sentry-ignore]",'
34input[type="file"]'],u)};return i instanceof RegExp&&(h.blockClass=i),l instanceof RegExp&&(h.maskTextClass=l),h}function Zae({el:e,key:t,maskAttributes:r,maskAllText:n,privacyOptions:a,value:i}){return!n||a.unmaskTextSelector&&e.matches(a.unmaskTextSelector)?i:r.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const k_='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Xae=["content-length","content-type","accept"];let M_=!1;class Hw{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=Dte,flushMaxDelay:r=Ote,minReplayDuration:n=Ute,maxReplayDuration:a=o_,stickySession:i=!0,useCompression:o=!0,workerUrl:l,_experiments:c={},sessionSampleRate:u,errorSampleRate:d,maskAllText:f=!0,maskAllInputs:m=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:g=1e4,slowClickTimeout:y=7e3,slowClickIgnoreSelectors:v=[],networkDetailAllowUrls:x=[],networkDetailDenyUrls:j=[],networkCaptureBodies:C=!0,networkRequestHeaders:N=[],networkResponseHeaders:S=[],mask:M=[],maskAttributes:k=["title","placeholder"],unmask:I=[],block:T=[],unblock:L=[],ignore:R=[],maskFn:_,beforeAddRecordingEvent:B,beforeErrorSampling:z,blockClass:D,blockSelector:A,maskInputOptions:P,maskTextClass:E,maskTextSelector:F,ignoreClass:$}={}){this.name=Hw.id;const H=Jae({mask:M,unmask:I,block:T,unblock:L,ignore:R,blockClass:D,blockSelector:A,maskTextClass:E,maskTextSelector:F,ignoreClass:$});if(this._recordingOptions={maskAllInputs:m,maskAllText:f,maskInputOptions:{...P||{},password:!0},maskTextFn:_,maskInputFn:_,maskAttributeFn:(X,ue,le)=>Zae({maskAttributes:k,maskAllText:f,privacyOptions:H,key:X,value:ue,el:le}),...H,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:r,minReplayDuration:Math.min(n,Vte),maxReplayDuration:Math.min(a,o_),stickySession:i,sessionSampleRate:u,errorSampleRate:d,useCompression:o,workerUrl:l,blockAllMedia:h,maskAllInputs:m,maskAllText:f,mutationBreadcrumbLimit:p,mutationLimit:g,slowClickTimeout:y,slowClickIgnoreSelectors:v,networkDetailAllowUrls:x,networkDetailDenyUrls:j,networkCaptureBodies:C,networkRequestHeaders:I_(N),networkResponseHeaders:I_(S),beforeAddRecordingEvent:B,beforeErrorSampling:z,_experiments:c},typeof u=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
35This option is deprecated and will be removed soon.
36Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
37Sentry.init({ replaysSessionSampleRate: ${u} })`),this._initialOptions.sessionSampleRate=u),typeof d=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
38This option is deprecated and will be removed soon.
39Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
40Sentry.init({ replaysOnErrorSampleRate: ${d} })`),this._initialOptions.errorSampleRate=d),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${k_}`:k_),this._isInitialized&&RP())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return M_}set _isInitialized(t){M_=t}setupOnce(){RP()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(t)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const t=ese(this._initialOptions);this._replay=new $c({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const r=Vn().getIntegrationByName("ReplayCanvas");if(!r)return;this._replay._canvas=r.getOptions()}catch{}}}Hw.__initStatic();function ese(e){const t=Vn(),r=t&&t.getOptions(),n={sessionSampleRate:0,errorSampleRate:0,...oo(e)};return r?(e.sessionSampleRate==null&&e.errorSampleRate==null&&r.replaysSessionSampleRate==null&&r.replaysOnErrorSampleRate==null&&Gd(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof r.replaysSessionSampleRate=="number"&&(n.sessionSampleRate=r.replaysSessionSampleRate),typeof r.replaysOnErrorSampleRate=="number"&&(n.errorSampleRate=r.replaysOnErrorSampleRate),n):(Gd(()=>{console.warn("SDK client is not available.")}),n)}function I_(e){return[...Xae,...e.map(t=>t.toLowerCase())]}class tse extends Hw{}function rse(e){const t={...e};WF(t,"react"),Tte(t)}var Yz={exports:{}},jn={};/** @license React v16.13.1
41 * react-is.production.min.js
42 *
43 * Copyright (c) Facebook, Inc. and its affiliates.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE file in the root directory of this source tree.
47 */var Va=typeof Symbol=="function"&&Symbol.for,yI=Va?Symbol.for("react.element"):60103,bI=Va?Symbol.for("react.portal"):60106,Yw=Va?Symbol.for("react.fragment"):60107,Qw=Va?Symbol.for("react.strict_mode"):60108,Kw=Va?Symbol.for("react.profiler"):60114,Jw=Va?Symbol.for("react.provider"):60109,Zw=Va?Symbol.for("react.context"):60110,vI=Va?Symbol.for("react.async_mode"):60111,Xw=Va?Symbol.for("react.concurrent_mode"):60111,e2=Va?
47Symbol.for("react.forward_ref"):60112,t2=Va?Symbol.for("react.suspense"):60113,nse=Va?Symbol.for("react.suspense_list"):60120,r2=Va?Symbol.for("react.memo"):60115,n2=Va?Symbol.for("react.lazy"):60116,ase=Va?Symbol.for("react.block"):60121,sse=Va?Symbol.for("react.fundamental"):60117,ise=Va?Symbol.for("react.responder"):60118,ose=Va?Symbol.for("react.scope"):60119;function di(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yI:switch(e=e.type,e){case vI:case Xw:case Yw:case Kw:case Qw:case t2:return e;default:switch(e=e&&e.$$typeof,e){case Zw:case e2:case n2:case r2:case Jw:return e;default:return t}}case bI:return t}}}function Qz(e){return di(e)===Xw}jn.AsyncMode=vI;jn.ConcurrentMode=Xw;jn.ContextConsumer=Zw;jn.ContextProvider=Jw;jn.Element=yI;jn.ForwardRef=e2;jn.Fragment=Yw;jn.Lazy=n2;jn.Memo=r2;jn.Portal=bI;jn.Profiler=Kw;jn.StrictMode=Qw;jn.Suspense=t2;jn.isAsyncMode=function(e){return Qz(e)||di(e)===vI};jn.isConcurrentMode=Qz;jn.isContextConsumer=function(e){return di(e)===Zw};jn.isContextProvider=function(e){return di(e)===Jw};jn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yI};jn.isForwardRef=function(e){return di(e)===e2};jn.isFragment=function(e){return di(e)===Yw};jn.isLazy=function(e){return di(e)===n2};jn.isMemo=function(e){return di(e)===r2};jn.isPortal=function(e){return di(e)===bI};jn.isProfiler=function(e){return di(e)===Kw};jn.isStrictMode=function(e){return di(e)===Qw};jn.isSuspense=function(e){return di(e)===t2};jn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yw||e===Xw||e===Kw||e===Qw||e===t2||e===nse||typeof e=="object"&&e!==null&&(e.$$typeof===n2||e.$$typeof===r2||e.$$typeof===Jw||e.$$typeof===Zw||e.$$typeof===e2||e.$$typeof===sse||e.$$typeof===ise||e.$$typeof===ose||e.$$typeof===ase)};jn.typeOf=di;Yz.exports=jn;var lse=Yz.exports,xI=lse,cse={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},use={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},dse={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Kz={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},wI={};wI[xI.ForwardRef]=dse;wI[xI.Memo]=Kz;function E_(e){return xI.isMemo(e)?Kz:wI[e.$$typeof]||cse}var fse=Object.defineProperty,mse=Object.getOwnPropertyNames,T_=Object.getOwnPropertySymbols,hse=Object.getOwnPropertyDescriptor,pse=Object.getPrototypeOf,A_=Object.prototype;function Jz(e,t,r){if(typeof t!="string"){if(A_){var n=pse(t);n&&n!==A_&&Jz(e,n,r)}var a=mse(t);T_&&(a=a.concat(T_(t)));for(var i=E_(e),o=E_(t),l=0;l<a.length;++l){var c=a[l];if(!use[c]&&!(r&&r[c])&&!(o&&o[c])&&!(i&&i[c])){var u=hse(t,c);try{fse(e,c,u)}catch{}}}}return e}var gse=Jz;const P_=hn(gse),yse=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function bse(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const __={componentStack:null,error:null,eventId:null};function vse(e,t){const r=new WeakMap;function n(a,i){if(!r.has(a)){if(a.cause)return r.set(a,!0),n(a.cause,i);a.cause=i}}n(e,t)}let xse=class Zz extends b.Component{constructor(t){super(t),Zz.prototype.__init.call(this),this.state=__,this._openFallbackReportDialog=!0;const r=Vn();r&&r.on&&t.showDialog&&(this._openFallbackReportDialog=!1,r.on("afterSendEvent",n=>{!n.type&&n.event_id===this._lastEventId&&s_({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,{componentStack:r}){const{beforeCapture:n,onError:a,showDialog:i,dialogOptions:o}=this.props;TF(l=>{if(bse(b.version)&&V4(t)){const u=new Error(t.message);u.name=`React ErrorBoundary ${t.name}`,u.stack=r,vse(t,u)}n&&n(l,t,r);const c=Fw(t,{captureContext:{contexts:{react:{componentStack:r}}},mechanism:{handled:!!this.props.fallback}});a&&a(t,r,c),i&&(this._lastEventId=c,this._openFallbackReportDialog&&s_({...o,eventId:c})),this.setState({error:t,componentStack:r,eventId:c})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:r,eventId:n}=this.state,{onUnmount:a}=this.props;a&&a(t,r,n)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:r,componentStack:n,eventId:a}=this.state;t&&t(r,n,a),this.setState(__)}}render(){const{fallback:t,children:r}=this.props,n=this.state;if(n.error){let a;return typeof t=="function"?a=t({error:n.error,componentStack:n.componentStack,resetError:this.resetErrorBoundary,eventId:n.eventId}):a=t,b.isValidElement(a)?a:(t&&yse&&St.warn("fallback did not produce a valid ReactElement"),null)}return typeof r=="function"?r():r}};var Qh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qd=typeof window>"u"||"Deno"in globalThis;function Cs(){}function wse(e,t){return typeof e=="function"?e(t):e}function zC(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function du(e,t){return typeof e=="function"?e(t):e}function Ni(e,t){return typeof e=="function"?e(t):e}function L_(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==jI(o,t.options))return!1}else if(!c0(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function D_(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Kd(t.options.mutationKey)!==Kd(i))return!1}else if(!c0(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function jI(e,t){return((t==null?void 0:t.queryKeyHashFn)||Kd)(e)}function Kd(e){return JSON.stringify(e,(t,r)=>BC(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function c0(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>c0(e[r],t[r])):!1}function eB(e,t){if(e===t)return e;const r=O_(e)&&O_(t);if(r||BC(e)&&BC(t)){const n=r?e:Object.keys(e),a=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const f=r?d:i[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=eB(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===o&&u===a?e:l}return t}function Ax(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function O_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function BC(e){if(!R_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!R_(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function R_(e){return Object.prototype.toString.call(e)==="[object Object]"}function jse(e){return new Promise(t=>{setTimeout(t,e)})}function UC(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?eB(e,t):t}function Nse(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Sse(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var NI=Symbol();function tB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===NI?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rB(e,t){return typeof e=="function"?e(...t):!!e}var Md,Kc,_m,q9,Cse=(q9=class extends Qh{constructor(){super();Vt(this,Md);Vt(this,Kc);Vt(this,_m);It(this,_m,t=>{if(!Qd&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){be(this,Kc)||this.setEventListener(be(this,_m))}onUnsubscribe(){var t;this.hasListeners()||((t=be(this,Kc))==null||t.call(this),It(this,Kc,void 0))}setEventListener(t){var r;It(this,_m,t),(r=be(this,Kc))==null||r.call(this),It(this,Kc,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){be(this,Md)!==t&&(It(this,Md,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,882 bytes, line 47
47this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof be(this,Md)=="boolean"?be(this,Md):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Md=new WeakMap,Kc=new WeakMap,_m=new WeakMap,q9),SI=new Cse,Lm,Jc,Dm,G9,kse=(G9=class extends Qh{constructor(){super();Vt(this,Lm,!0);Vt(this,Jc);Vt(this,Dm);It(this,Dm,t=>{if(!Qd&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){be(this,Jc)||this.setEventListener(be(this,Dm))}onUnsubscribe(){var t;this.hasListeners()||((t=be(this,Jc))==null||t.call(this),It(this,Jc,void 0))}setEventListener(t){var r;It(this,Dm,t),(r=be(this,Jc))==null||r.call(this),It(this,Jc,t(this.setOnline.bind(this)))}setOnline(t){be(this,Lm)!==t&&(It(this,Lm,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return be(this,Lm)}},Lm=new WeakMap,Jc=new WeakMap,Dm=new WeakMap,G9),Px=new kse;function VC(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}function Mse(e){return Math.min(1e3*2**e,3e4)}function nB(e){return(e??"online")==="online"?Px.isOnline():!0}var aB=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sB(e){let t=!1,r=0,n;const a=VC(),i=()=>a.status!=="pending",o=g=>{var y;i()||(m(new aB(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>SI.isFocused()&&(e.networkMode==="always"||Px.isOnline())&&e.canRun(),d=()=>nB(e.networkMode)&&e.canRun(),f=g=>{i()||(n==null||n(),a.resolve(g))},m=g=>{i()||(n==null||n(),a.reject(g))},h=()=>new Promise(g=>{var y;n=v=>{(i()||u())&&g(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;n=void 0,i()||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(i())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(f).catch(v=>{var S;if(i())return;const x=e.retry??(Qd?0:3),j=e.retryDelay??Mse,C=typeof j=="function"?j(r,v):j,N=x===!0||typeof x=="number"&&r<x||typeof x=="function"&&x(r,v);if(t||!N){m(v);return}r++,(S=e.onFail)==null||S.call(e,r,v),jse(C).then(()=>u()?void 0:h()).then(()=>{t?m(v):p()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(n==null||n(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?p():h().then(p),a)}}var Ise=e=>setTimeout(e,0);function Ese(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=Ise;const i=l=>{t?e.push(l):a(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Ea=Ese(),Id,H9,iB=(H9=class{constructor(){Vt(this,Id)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zC(this.gcTime)&&It(this,Id,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qd?1/0:5*60*1e3))}clearGcTimeout(){be(this,Id)&&(clearTimeout(be(this,Id)),It(this,Id,void 0))}},Id=new WeakMap,H9),Om,Rm,wi,Ed,La,Ty,Td,Xi,Il,Y9,Tse=(Y9=class extends iB{constructor(r){super();Vt(this,Xi);Vt(this,Om);Vt(this,Rm);Vt(this,wi);Vt(this,Ed);Vt(this,La);Vt(this,Ty);Vt(this,Td);It(this,Td,!1),It(this,Ty,r.defaultOptions),this.setOptions(r.options),this.observers=[],It(this,Ed,r.client),It(this,wi,be(this,Ed).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,It(this,Om,Ase(this.options)),this.state=r.state??be(this,Om),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=be(this,La))==null?void 0:r.promise}setOptions(r){this.options={...be(this,Ty),...r},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&be(this,wi).remove(this)}setData(r,n){const a=UC(this.state.data,r,this.options);return br(this,Xi,Il).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(r,n){br(this,Xi,Il).call(this,{type:"setState",state:r,setStateOptions:n})}cancel(r){var a,i;const n=(a=be(this,La))==null?void 0:a.promise;return(i=be(this,La))==null||i.cancel(r),n?n.then(Cs).catch(Cs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(be(this,Om))}isActive(){return this.observers.some(r=>Ni(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===NI||this.state.dataUpdateCount+this.state.errorUpdate
47Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>du(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!Xz(this.state.dataUpdatedAt,r)}onFocus(){var n;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(n=be(this,La))==null||n.continue()}onOnline(){var n;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(n=be(this,La))==null||n.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),be(this,wi).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(n=>n!==r),this.observers.length||(be(this,La)&&(be(this,Td)?be(this,La).cancel({revert:!0}):be(this,La).cancelRetry()),this.scheduleGc()),be(this,wi).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||br(this,Xi,Il).call(this,{type:"invalidate"})}async fetch(r,n){var u,d,f,m,h,p,g,y,v,x,j,C;if(this.state.fetchStatus!=="idle"&&((u=be(this,La))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(be(this,La))return be(this,La).continueRetry(),be(this,La).promise}if(r&&this.setOptions(r),!this.options.queryFn){const N=this.observers.find(S=>S.options.queryFn);N&&this.setOptions(N.options)}const a=new AbortController,i=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(It(this,Td,!0),a.signal)})},o=()=>{const N=tB(this.options,n),M=(()=>{const k={client:be(this,Ed),queryKey:this.queryKey,meta:this.meta};return i(k),k})();return It(this,Td,!1),this.options.persister?this.options.persister(N,M,this):N(M)},c=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:be(this,Ed),state:this.state,fetchFn:o};return i(N),N})();(d=this.options.behavior)==null||d.onFetch(c,this),It(this,Rm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=c.fetchOptions)==null?void 0:f.meta))&&br(this,Xi,Il).call(this,{type:"fetch",meta:(m=c.fetchOptions)==null?void 0:m.meta}),It(this,La,sB({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,abort:a.abort.bind(a),onFail:(N,S)=>{br(this,Xi,Il).call(this,{type:"failed",failureCount:N,error:S})},onPause:()=>{br(this,Xi,Il).call(this,{type:"pause"})},onContinue:()=>{br(this,Xi,Il).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const N=await be(this,La).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(p=(h=be(this,wi).config).onSuccess)==null||p.call(h,N,this),(y=(g=be(this,wi).config).onSettled)==null||y.call(g,N,this.state.error,this),N}catch(N){if(N instanceof aB){if(N.silent)return be(this,La).promise;if(N.revert){if(this.setState({...be(this,Rm),fetchStatus:"idle"}),this.state.data===void 0)throw N;return this.state.data}}throw br(this,Xi,Il).call(this,{type:"error",error:N}),(x=(v=be(this,wi).config).onError)==null||x.call(v,N,this),(C=(j=be(this,wi).config).onSettled)==null||C.call(j,this.state.data,N,this),N}finally{this.scheduleGc()}}},Om=new WeakMap,Rm=new WeakMap,wi=new WeakMap,Ed=new WeakMap,La=new WeakMap,Ty=new WeakMap,Td=new WeakMap,Xi=new WeakSet,Il=function(r){const n=a=>{switch(r.type){case"failed":return{...a,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...oB(a.data,this.options),fetchMeta:r.meta??null};case"success":const i={...a,data:r.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:r.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return It(this,Rm,r.manual?i:void 0),i;case"error":const o=r.error;
vendor: 5,138 bytes, line 47
47return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...r.state}}};this.state=n(this.state),Ea.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),be(this,wi).notify({query:this,type:"updated",action:r})})},Y9);function oB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ase(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ao,Q9,Pse=(Q9=class extends Qh{constructor(t={}){super();Vt(this,Ao);this.config=t,It(this,Ao,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??jI(a,r);let o=this.get(i);return o||(o=new Tse({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){be(this,Ao).has(t.queryHash)||(be(this,Ao).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=be(this,Ao).get(t.queryHash);r&&(t.destroy(),r===t&&be(this,Ao).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ea.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return be(this,Ao).get(t)}getAll(){return[...be(this,Ao).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>L_(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>L_(t,n)):r}notify(t){Ea.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ea.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ea.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ao=new WeakMap,Q9),Po,Ns,Ad,_o,_c,K9,_se=(K9=class extends iB{constructor(r){super();Vt(this,_o);Vt(this,Po);Vt(this,Ns);Vt(this,Ad);this.mutationId=r.mutationId,It(this,Ns,r.mutationCache),It(this,Po,[]),this.state=r.state||lB(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){be(this,Po).includes(r)||(be(this,Po).push(r),this.clearGcTimeout(),be(this,Ns).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){It(this,Po,be(this,Po).filter(n=>n!==r)),this.scheduleGc(),be(this,Ns).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){be(this,Po).length||(this.state.status==="pending"?this.scheduleGc():be(this,Ns).remove(this))}continue(){var r;return((r=be(this,Ad))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var o,l,c,u,d,f,m,h,p,g,y,v,x,j,C,N,S,M,k,I;const n=()=>{br(this,_o,_c).call(this,{type:"continue"})};It(this,Ad,sB({fn:()=>this.options.mutationFn?this.options.mutationFn(r):Promise.reject(new Error("No mutationFn found")),onFail:(T,L)=>{br(this,_o,_c).call(this,{type:"failed",failureCount:T,error:L})},onPause:()=>{br(this,_o,_c).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>be(this,Ns).canRun(this)}));const a=this.state.status==="pending",i=!be(this,Ad).canStart();try{if(a)n();else{br(this,_o,_c).call(this,{type:"pending",variables:r,isPaused:i}),await((l=(o=be(this,Ns).config).onMutate)==null?void 0:l.call(o,r,this));const L=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,r));L!==this.state.context&&br(this,_o,_c).call(this,{type:"pending",context:L,variables:r,isPaused:i})}const T=await be(this,Ad).start();return await((f=(d=be(this,Ns).config).onSuccess)==null?void 0:f.call(d,T,r,this.state.context,this)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,T,r,this.state.context)),await((g=(p=be(this,Ns).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,T,null,r,this.state.context)),br(this,_o,_c).call(this,{type:"success",data:T}),T}catch(T){try{throw await((j=(x=be(this,Ns).config).onError)==null?void 0:j.call(x,T,r,this.state.context,this)),await((N=(C=this.options).onError)==null?void 0:N.call(C,T,r,this.state.context)),await((M=(S=be(this,Ns).config).onSettled)==null?void 0:M.call(S,void 0,T,this.state.variables,this.state.context,this)),await((I=(k=this.options).onSettled)==null?void 0:I.call(k,void 0,T,r,this.state.context)),T}finally{br(this,_o,_c).call(this,{type:"error",error:T})}}finally{be(this,Ns).runNext(this)}}},Po=new WeakMap,Ns=new WeakMap,Ad=new WeakMap,_o=new WeakSet,_c=function(r){const n=a=>{switch(r.type){case"failed":return{...a,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};
47case"pending":return{...a,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...a,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:r.error,failureCount:a.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ea.batch(()=>{be(this,Po).forEach(a=>{a.onMutationUpdate(r)}),be(this,Ns).notify({mutation:this,type:"updated",action:r})})},K9);function lB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tl,eo,Ay,J9,Lse=(J9=class extends Qh{constructor(t={}){super();Vt(this,Tl);Vt(this,eo);Vt(this,Ay);this.config=t,It(this,Tl,new Set),It(this,eo,new Map),It(this,Ay,0)}build(t,r,n){const a=new _se({mutationCache:this,mutationId:++Lb(this,Ay)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){be(this,Tl).add(t);const r=Wb(t);if(typeof r=="string"){const n=be(this,eo).get(r);n?n.push(t):be(this,eo).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(be(this,Tl).delete(t)){const r=Wb(t);if(typeof r=="string"){const n=be(this,eo).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&be(this,eo).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Wb(t);if(typeof r=="string"){const n=be(this,eo).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=Wb(t);if(typeof r=="string"){const a=(n=be(this,eo).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ea.batch(()=>{be(this,Tl).forEach(t=>{this.notify({type:"removed",mutation:t})}),be(this,Tl).clear(),be(this,eo).clear()})}getAll(){return Array.from(be(this,Tl))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>D_(r,n))}findAll(t={}){return this.getAll().filter(r=>D_(t,r))}notify(t){Ea.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 16,580 bytes, line 47
47r.state.isPaused);return Ea.batch(()=>Promise.all(t.map(r=>r.continue().catch(Cs))))}},Tl=new WeakMap,eo=new WeakMap,Ay=new WeakMap,J9);function Wb(e){var t;return(t=e.options.scope)==null?void 0:t.id}function $_(e){return{onFetch:(t,r)=>{var d,f,m,h,p;const n=t.options,a=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((p=t.state.data)==null?void 0:p.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=tB(t.options,t.fetchOptions),x=async(j,C,N)=>{if(g)return Promise.reject();if(C==null&&j.pages.length)return Promise.resolve(j);const M=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:C,direction:N?"backward":"forward",meta:t.options.meta};return y(L),L})(),k=await v(M),{maxPages:I}=t.options,T=N?Sse:Nse;return{pages:T(j.pages,k,I),pageParams:T(j.pageParams,C,I)}};if(a&&i.length){const j=a==="backward",C=j?Dse:F_,N={pages:i,pageParams:o},S=C(n,N);l=await x(N,S,j)}else{const j=e??i.length;do{const C=c===0?o[0]??n.initialPageParam:F_(n,l);if(c>0&&C==null)break;l=await x(l,C),c++}while(c<j)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function F_(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Dse(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var na,Zc,Xc,$m,Fm,eu,zm,Bm,Z9,Ose=(Z9=class{constructor(e={}){Vt(this,na);Vt(this,Zc);Vt(this,Xc);Vt(this,$m);Vt(this,Fm);Vt(this,eu);Vt(this,zm);Vt(this,Bm);It(this,na,e.queryCache||new Pse),It(this,Zc,e.mutationCache||new Lse),It(this,Xc,e.defaultOptions||{}),It(this,$m,new Map),It(this,Fm,new Map),It(this,eu,0)}mount(){Lb(this,eu)._++,be(this,eu)===1&&(It(this,zm,SI.subscribe(async e=>{e&&(await this.resumePausedMutations(),be(this,na).onFocus())})),It(this,Bm,Px.subscribe(async e=>{e&&(await this.resumePausedMutations(),be(this,na).onOnline())})))}unmount(){var e,t;Lb(this,eu)._--,be(this,eu)===0&&((e=be(this,zm))==null||e.call(this),It(this,zm,void 0),(t=be(this,Bm))==null||t.call(this),It(this,Bm,void 0))}isFetching(e){return be(this,na).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return be(this,Zc).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=be(this,na).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=be(this,na).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(du(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return be(this,na).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=be(this,na).get(n.queryHash),i=a==null?void 0:a.state.data,o=wse(t,i);if(o!==void 0)return be(this,na).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ea.batch(()=>be(this,na).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=be(this,na).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=be(this,na);Ea.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=be(this,na);return Ea.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ea.batch(()=>be(this,na).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Cs).catch(Cs)}invalidateQueries(e,t={}){return Ea.batch(()=>(be(this,na).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ea.batch(()=>be(this,na).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Cs)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Cs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=be(this,na).build(this,t);return r.isStaleByTime(du(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cs).catch(Cs)}fetchInfiniteQuery(e){return e.behavior=$_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cs).catch(Cs)}ensureInfiniteQueryData(e){return e.behavior=$_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Px.isOnline()?be(this,Zc).resumePausedMutations():Promise.resolve()}getQueryCache(){return be(this,na)}getMutationCache(){return be(this,Zc)}getDefaultOptions(){return be(this,Xc)}setDefaultOptions(e){It(this,Xc,e)}setQueryDefaults(e,t){be(this,$m).set(Kd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...be(this,$m).values()],r={};return t.forEach(n=>{c0(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){be(this,Fm).set(Kd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...be(this,Fm).values()],r={};return t.forEach(n=>{c0(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...be(this,Xc).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=jI(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===NI&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...be(this,Xc).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){be(this,na).clear(),be(this,Zc).clear()}},na=new WeakMap,Zc=new WeakMap,Xc=new WeakMap,$m=new WeakMap,Fm=new WeakMap,eu=new WeakMap,zm=new WeakMap,Bm=new WeakMap,Z9),Rs,Rr,Py,Ss,Pd,Um,Al,tu,_y,Vm,Wm,_d,Ld,ru,qm,fn,Sg,WC,qC,GC,HC,YC,QC,KC,cB,X9,Rse=(X9=class extends Qh{constructor(t,r){super();Vt(this,fn);Vt(this,Rs);Vt(this,Rr);Vt(this,Py);Vt(this,Ss);Vt(this,Pd);Vt(this,Um);Vt(this,Al);Vt(this,tu);Vt(this,_y);Vt(this,Vm);Vt(this,Wm);Vt(this,_d);Vt(this,Ld);Vt(this,ru);Vt(this,qm,new Set);this.options=r,It(this,Rs,t),It(this,tu,null),It(this,Al,VC()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(be(this,Rr).addObserver(this),z_(be(this,Rr),this.options)?br(this,fn,Sg).call(this):this.updateResult(),br(this,fn,HC).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return JC(be(this,Rr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return JC(be(this,Rr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,br(this,fn,YC).call(this),br(this,fn,QC).call(this),be(this,Rr).removeObserver(this)}setOptions(t){const r=this.options,n=be(this,Rr);if(this.options=be(this,Rs).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ni(this.options.enabled,be(this,Rr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");br(this,fn,KC).call(this),be(this,Rr).setOptions(this.options),r._defaulted&&!Ax(this.options,r)&&be(this,Rs).getQueryCache().notify({type:"observerOptionsUpdated",query:be(this,Rr),observer:this});const a=this.hasListeners();a&&B_(be(this,Rr),n,this.options,r)&&br(this,fn,Sg).call(this),this.updateResult(),a&&(be(this,Rr)!==n||Ni(this.options.enabled,be(this,Rr))!==Ni(r.enabled,be(this,Rr))||du(this.options.staleTime,be(this,Rr))!==du(r.staleTime,be(this,Rr)))&&br(this,fn,WC).call(this);const i=br(this,fn,qC).call(this);a&&(be(this,Rr)!==n||Ni(this.options.enabled,be(this,Rr))!==Ni(r.enabled,be(this,Rr))||i!==be(this,ru))&&br(this,fn,GC).call(this,i)}getOptimisticResult(t){const r=be(this,Rs).getQueryCache().build(be(this,Rs),t),n=this.createResult(r,t);return Fse(this,n)&&(It(this,Ss,n),It(this,Um,this.options),It(this,Pd,be(this,Rr).state)),n}getCurrentResult(){return be(this,Ss)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&!this.options.experimental_prefetchInRender&&be(this,Al).status==="pending"&&be(this,Al).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,a))})}trackProp(t){be(this,qm).add(t)}getCurrentQuery(){return be(this,Rr)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=be(this,Rs).defaultQueryOptions(t),n=be(this,Rs).getQueryCache().build(be(this,Rs),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return br(this,fn,Sg).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),be(this,Ss)))}createResult(t,r){var I;const n=be(this,Rr),a=this.options,i=be(this,Ss),o=be(this,Pd),l=be(this,Um),u=t!==n?t.state:be(this,Py),{state:d}=t;let f={...d},m=!1,h;if(r._optimisticResults){const T=this.hasListeners(),L=!T&&z_(t,r),R=T&&B_(t,n,r,a);(L||R)&&(f={...f,...oB(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:y}=f;h=f.data;let v=!1;if(r.placeholderData!==void 0&&h===void 0&&y==="pending"){let T;i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(T=i.data,v=!0):T=typeof r.placeholderData=="function"?r.placeholderData((I=be(this,Wm))==null?void 0:I.state.data,be(this,Wm)):r.placeholderData,T!==void 0&&(y="success",h=UC(i==null?void 0:i.data,T,r),m=!0)}if(r.select&&h!==void 0&&!v)if(i&&h===(o==null?void 0:o.data)&&r.select===be(this,_y))h=be(this,Vm);else try{It(this,_y,r.select),h=r.select(h),h=UC(i==null?void 0:i.data,h,r),It(this,Vm,h),It(this,tu,null)}catch(T){It(this,tu,T)}be(this,tu)&&(p=be(this,tu),h=be(this,Vm),g=Date.now(),y="error");const x=f.fetchStatus==="fetching",j=y==="pending",C=y==="error",N=j&&x,S=h!==void 0,k={status:y,fetchStatus:f.fetchStatus,isPending:j,isSuccess:y==="success",isError:C,isInitialLoading:N,isLoading:N,data:h,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!j,isLoadingError:C&&!S,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&S,isStale:CI(t,r),refetch:this.refetch,promise:be(this,Al),isEnabled:Ni(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=_=>{k.status==="error"?_.reject(k.error):k.data!==void 0&&_.resolve(k.data)},L=()=>{const _=It(this,Al,k.promise=VC());T(_)},R=be(this,Al);switch(R.status){case"pending":t.queryHash===n.queryHash&&T(R);break;case"fulfilled":(k.status==="error"||k.data!==R.value)&&L();break;case"rejected":(k.status!=="error"||k.error!==R.reason)&&L();break}}return k}updateResult(){const t=be(this,Ss),r=this.createResult(be(this,Rr),this.options);if(It(this,Pd,be(this,Rr).state),It(this,Um,this.options),be(this,Pd).data!==void 0&&It(this,Wm,be(this,Rr)),Ax(r,t))return;It(this,Ss,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!be(this,qm).size)return!0;const o=new Set(i??be(this,qm));return this.options.throwOnError&&o.add("error"),Object.keys(be(this,Ss)).some(l=>{const c=l;return be(this,Ss)[c]!==t[c]&&o.has(c)})};br(this,fn,cB).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&br(this,fn,HC).call(this)}},Rs=new WeakMap,Rr=new WeakMap,Py=new WeakMap,Ss=new WeakMap,Pd=new WeakMap,Um=new WeakMap,Al=new WeakMap,tu=new WeakMap,_y=new WeakMap,Vm=new WeakMap,Wm=new WeakMap,_d=new WeakMap,Ld=new WeakMap,ru=new WeakMap,qm=new WeakMap,fn=new WeakSet,Sg=function(t){br(this,fn,KC).call(this);let r=be(this,Rr).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Cs)),r},WC=function(){br(this,fn,YC).call(this);const t=du(this.options.staleTime,be(this,Rr));if(Qd||be(this,Ss).isStale||!zC(t))return;const n=Xz(be(this,Ss).dataUpdatedAt,t)+1;It(this,_d,setTimeout(()=>{be(this,Ss).isStale||this.updateResult()},n))},qC=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(be(this,Rr)):this.options.refetchInterval)??!1},GC=function(t){br(this,fn,QC).call(this),It(this,ru,t),!(Qd||Ni(this.options.enabled,be(this,Rr))===!1||!zC(be(this,ru))||be(this,ru)===0)&&It(this,Ld,setInterval(()=>{(this.options.refetchIntervalInBackground||SI.isFocused())&&br(this,fn,Sg).call(this)},be(this,ru)))},HC=function(){br(this,fn,WC).call(this),br(this,fn,GC).call(this,br(this,fn,qC).call(this))},YC=function(){be(this,_d)&&(clearTimeout(be(this,_d)),It(this,_d,void 0))},QC=function(){be(this,Ld)&&(clearInterval(be(this,Ld)),It(this,Ld,void 0))},KC=function(){const t=be(this,Rs).getQueryCache().build(be(this,Rs),this.options);if(t===be(this,Rr))return;const r=be(this,Rr);It(this,Rr,t),It(this,Py,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},cB=function(t){Ea.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(be(this,Ss))}),be(this,Rs).getQueryCache().notify({query:be(this,Rr),type:"observerResultsUpdated"})})},X9);function $se(e,t){return Ni(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function z_(e,t){return $se(e,t)||e.state.data!==void 0&&JC(e,t,t.refetchOnMount)}function JC(e,t,r){if(Ni(t.enabled,e)!==!1&&du(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&CI(e,t)}return!1}function B_(e,t,r,n){return(e!==t||Ni(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&CI(e,r)}function CI(e,t){return Ni(t.enabled,e)!==!1&&e.isStaleByTime(du(t.staleTime,e))}function Fse(e,t){return!Ax(e.getCurrentResult(),t)}var nu,au,$s,Pl,tc,$v,ZC,eF,zse=(eF=class extends Qh{constructor(r,n){super();Vt(this,tc);Vt(this,nu);Vt(this,au);Vt(this,$s);Vt(this,Pl);It(this,nu,r),this.setOptions(n),this.bindMethods(),br(this,tc,$v).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=be(this,nu).defaultMutationOptions(r),Ax(this.options,n)||be(this,nu).getMutationCache().notify({type:"observerOptionsUpdated",mutation:be(this,$s),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Kd(n.mutationKey)!==Kd(this.options.mutationKey)?this.reset():((a=be(this,$s))==null?void 0:a.state.status)==="pending"&&be(this,$s).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=be(this,$s))==null||r.removeObserver(this)}onMutationUpdate(r){br(this,tc,$v).call(this),br(this,tc,ZC).call(this,r)}getCurrentResult(){return be(this,au)}reset(){var r;(r=be(this,$s))==null||r.removeObserver(this),It(this,$s,void 0),br(this,tc,$v).call(this),br(this,tc,ZC).call(this)}mutate(r,n){var a;return It(this,Pl,n),(a=be(this,$s))==null||a.removeObserver(this),It(this,$s,be(this,nu).getMutationCache().build(be(this,nu),this.options)),be(this,$s).addObserver(this),be(this,$s).execute(r)}},nu=new WeakMap,au=new WeakMap,$s=new WeakMap,Pl=new WeakMap,tc=new WeakSet,$v=function(){var n;const r=((n=be(this,$s))==null?void 0:n.state)??lB();It(this,au,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},ZC=function(r){Ea.batch(()=>{var n,a,i,o,l,c,u,d;if(be(this,Pl)&&this.hasListeners()){const f=be(this,au).variables,m=be(this,au).context;(r==null?void 0:r.type)==="success"?((a=(n=be(this,Pl)).onSuccess)==null||a.call(n,r.data,f,m),(o=(i=be(this,Pl)).onSettled)==null||o.call(i,r.data,null,f,m)):(r==null?void 0:r.type)==="error"&&((c=(l=be(this,Pl)).onError)==null||c.call(l,r.error,f,m),(d=(u=be(this,Pl)).onSettled)==null||d.call(u,void 0,r.error,f,m))}
47this.listeners.forEach(f=>{f(be(this,au))})})},eF),uB=b.createContext(void 0),qr=e=>{const t=b.useContext(uB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bse=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(uB.Provider,{value:e,children:t})),dB=b.createContext(!1),Use=()=>b.useContext(dB);dB.Provider;function Vse(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wse=b.createContext(Vse()),qse=()=>b.useContext(Wse),Gse=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Hse=e=>{b.useEffect(()=>{e.clearReset()},[e])},Yse=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||rB(r,[e.error,n])),Qse=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Kse=(e,t)=>e.isLoading&&e.isFetching&&!t,Jse=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,U_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Zse(e,t,r){var f,m,h,p,g;const n=Use(),a=qse(),i=qr(),o=i.defaultQueryOptions(e);(m=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",Qse(o),Gse(o,a),Hse(a);const l=!i.getQueryCache().get(o.queryHash),[c]=b.useState(()=>new t(i,o)),u=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(y=>{const v=d?c.subscribe(Ea.batchCalls(y)):Cs;return c.updateResult(),v},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(o)},[o,c]),Jse(o,u))throw U_(o,c,a);if(Yse({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((p=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,o,u),o.experimental_prefetchInRender&&!Qd&&Kse(u,n)){const y=l?U_(o,c,a):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(Cs).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Wa(e,t){return Zse(e,Rse)}function mn(e,t){const r=qr(),[n]=b.useState(()=>new zse(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const a=b.useSyncExternalStore(b.useCallback(o=>n.subscribe(Ea.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=b.useCallback((o,l)=>{n.mutate(o,l).catch(Cs)},[n]);if(a.error&&rB(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}var V_={};/**
48 * @license
49 * Copyright 2017 Google LLC
50 *
51 * Licensed under the Apache License, Version 2.0 (the "License");
52 * you may not use this file except in compliance with the License.
53 * You may obtain a copy of the License at
54 *
55 *   http://www.apache.org/licenses/LICENSE-2.0
56 *
57 * Unless required by applicable law or agreed to in writing, software
58 * distributed under the License is distributed on an "AS IS" BASIS,
59 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60 * See the License for the specific language governing permissions and
61 * limitations under the License.
62 */const fB=function(e){const t=[];let r=0;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);a<128?t[r++]=a:a<2048?(t[r++]=a>>6|192,t[r++]=a&63|128):(a&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(a=65536+((a&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=a>>18|240,t[r++]=a>>12&63|128,t[r++]=a>>6&63|128,t[r++]=a&63|128):(t[r++]=a>>12|224,t[r++]=a>>6&63|128,t[r++]=a&63|128)}return t},Xse=function(e){const t=[];let r=0,n=0;for(;r<e.length;){const a=e[r++];if(a<128)t[n++]=String.fromCharCode(a);else if(a>191&&a<224){const i=e[r++];t[n++]=String.fromCharCode((a&31)<<6|i&63)}else if(a>239&&a<365){const i=e[r++],o=e[r++],l=e[r++],c=((a&7)<<18|(i&63)<<12|(o&63)<<6|l&63)-65536;t[n++]=String.fromCharCode(55296+(c>>10)),t[n++]=String.fromCharCode(56320+(c&1023))}else{const i=e[r++],o=e[r++];t[n++]=String.fromCharCode((a&15)<<12|(i&63)<<6|o&63)}}return t.join("")},mB={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let a=0;a<e.length;a+=3){const i=e[a],o=a+1<e.length,l=o?e[a+1]:0,c=a+2<e.length,u=c?e[a+2]:0,d=i>>2,f=(i&3)<<4|l>>4;let m=(l&15)<<2|u>>6,h=u&63;c||(h=64,o||(m=64)),n.push(r[d],r[f],r[m],r[h])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(fB(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):Xse(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let a=0;a<e.length;){const i=r[e.charAt(a++)],l=a<e.length?r[e.charAt(a)]:0;++a;const u=a<e.length?r[e.charAt(a)]:64;++a;const f=a<e.length?r[e.charAt(a)]:64;if(++a,i==null||l==null||u==null||f==null)throw new eie;const m=i<<2|l>>
624;if(n.push(m),u!==64){const h=l<<4&240|u>>2;if(n.push(h),f!==64){const p=u<<6&192|f;n.push(p)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class eie extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const tie=function(e){const t=fB(e);return mB.encodeByteArray(t,!0)},_x=function(e){return tie(e).replace(/\./g,"")},hB=function(e){try{return mB.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
63 * @license
64 * Copyright 2022 Google LLC
65 *
66 * Licensed under the Apache License, Version 2.0 (the "License");
67 * you may not use this file except in compliance with the License.
68 * You may obtain a copy of the License at
69 *
70 *   http://www.apache.org/licenses/LICENSE-2.0
71 *
72 * Unless required by applicable law or agreed to in writing, software
73 * distributed under the License is distributed on an "AS IS" BASIS,
74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 * See the License for the specific language governing permissions and
76 * limitations under the License.
77 */function rie(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
78 * @license
79 * Copyright 2022 Google LLC
80 *
81 * Licensed under the Apache License, Version 2.0 (the "License");
82 * you may not use this file except in compliance with the License.
83 * You may obtain a copy of the License at
84 *
85 *   http://www.apache.org/licenses/LICENSE-2.0
86 *
87 * Unless required by applicable law or agreed to in writing, software
88 * distributed under the License is distributed on an "AS IS" BASIS,
89 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90 * See the License for the specific language governing permissions and
91 * limitations under the License.
92 */const nie=()=>rie().__FIREBASE_DEFAULTS__,aie=()=>{if(typeof process>"u"||typeof V_>"u")return;const e=V_.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},sie=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&hB(e[1]);return t&&JSON.parse(t)},a2=()=>{try{return nie()||aie()||sie()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},pB=e=>{var t,r;return(r=(t=a2())===null||t===void 0?void 0:t.emulatorHosts)===null||r===void 0?void 0:r[e]},iie=e=>{const t=pB(e);if(!t)return;const r=t.lastIndexOf(":");if(r<=0||r+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const n=parseInt(t.substring(r+1),10);return t[0]==="["?[t.substring(1,r-1),n]:[t.substring(0,r),n]},gB=()=>{var e;return(e=a2())===null||e===void 0?void 0:e.config},yB=e=>{var t;return(t=a2())===null||t===void 0?void 0:t[`_${e}`]};/**
93 * @license
94 * Copyright 2017 Google LLC
95 *
96 * Licensed under the Apache License, Version 2.0 (the "License");
97 * you may not use this file except in compliance with the License.
98 * You may obtain a copy of the License at
99 *
100 *   http://www.apache.org/licenses/LICENSE-2.0
101 *
102 * Unless required by applicable law or agreed to in writing, software
103 * distributed under the License is distributed on an "AS IS" BASIS,
104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105 * See the License for the specific language governing permissions and
106 * limitations under the License.
107 */class oie{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}wrapCallback(t){return(r,n)=>{r?this.reject(r):this.resolve(n),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(r):t(r,n))}}}/**
108 * @license
109 * Copyright 2021 Google LLC
110 *
111 * Licensed under the Apache License, Version 2.0 (the "License");
112 * you may not use this file except in compliance with the License.
113 * You may obtain a copy of the License at
114 *
115 *   http://www.apache.org/licenses/LICENSE-2.0
116 *
117 * Unless required by applicable law or agreed to in writing, software
118 * distributed under the License is distributed on an "AS IS" BASIS,
119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120 * See the License for the specific language governing permissions and
121 * limitations under the License.
122 */function lie(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r={alg:"none",type:"JWT"},n=t||"demo-project",a=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:a,exp:a+3600,auth_time:a,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[_x(JSON.stringify(r)),_x(JSON.stringify(o)),""].join(".")}/**
123 * @license
124 * Copyright 2017 Google LLC
125 *
126 * Licensed under the Apache License, Version 2.0 (the "License");
127 * you may not use this file except in compliance with the License.
128 * You may obtain a copy of the License at
129 *
130 *   http://www.apache.org/licenses/LICENSE-2.0
131 *
132 * Unless required by applicable law or agreed to in writing, software
133 * distributed under the License is distributed on an "AS IS" BASIS,
134 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135 * See the License for the specific language governing permissions and
136 * limitations under the License.
137 */function ys(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function cie(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ys())}function uie(){var e;const t=(e=a2())===null||e===void 0?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function die(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function fie(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function mie(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function hie(){const e=ys();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function pie(){return!uie()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function gie(){try{return typeof indexedDB=="object"}catch{return!1}}function yie(){return new Promise((e,t)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(n);a.onsuccess=()=>{a.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},a.onupgradeneeded=()=>{r=!1},a.onerror=()=>{var i;t(((i=a.error)===null||i===void 0?void 0:i.message)||"")}}catch(r){t(r)}})}/**
138 * @license
139 * Copyright 2017 Google LLC
140 *
141 * Licensed under the Apache License, Version 2.0 (the "License");
142 * you may not use this file except in compliance with the License.
143 * You may obtain a copy of the License at
144 *
145 *   http://www.apache.org/licenses/LICENSE-2.0
146 *
147 * Unless required by applicable law or agreed to in writing, software
148 * distributed under the License is distributed on an "AS IS" BASIS,
149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
150 * See the License for the specific language governing permissions and
151 * limitations under the License.
152 */const bie="FirebaseError";class gc extends Error{constructor(t,r,n){super(r),this.code=t,this.customData=n,this.name=bie,Object.setPrototypeOf(this,gc.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,By.prototype.create)}}class By{constructor(t,r,n){this.service=t,this.serviceName=r,this.errors=n}create(t,...r){const n=r[0]||{},a=`${this.service}/${t}`,i=this.errors[t],o=i?vie(i,n):"Error",l=`${this.serviceName}: ${o} (${a}).`;return new gc(a,l,n)}}function vie(e,t){return e.replace(xie,(r,n)=>{const a=t[n];return a!=null?String(a):`<${n}?>`})}const xie=/\{\$([^}]+)}/g;function wie(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Lx(e,t){if(e===t)return!0;const r=Object.keys(e),n=Object.keys(t);for(const a of r){if(!n.includes(a))return!1;const i=e[a],o=t[a];if(W_(i)&&W_(o)){if(!Lx(i,o))return!1}else if(i!==o)return!1}for(const a of n)if(!r.includes(a))return!1;return!0}function W_(e){return e!==null&&typeof e=="object"}/**
153 * @license
154 * Copyright 2017 Google LLC
155 *
156 * Licensed under the Apache License, Version 2.0 (the "License");
157 * you may not use this file except in compliance with the License.
158 * You may obtain a copy of the License at
159 *
160 *   http://www.apache.org/licenses/LICENSE-2.0
161 *
162 * Unless required by applicable law or agreed to in writing, software
163 * distributed under the License is distributed on an "AS IS" BASIS,
164 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
165 * See the License for the specific language governing permissions and
166 * limitations under the License.
167 */function Uy(e){const t=[];for(const[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(a=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(a))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""}function Cg(e){const t={};return e.replace(/^\?/,"").split("&").forEach(n=>{if(n){const[a,i]=n.split("=");t[decodeURIComponent(a)]=decodeURIComponent(i)}}),t}function kg(e){const t=e.indexOf("?");if(!t)return"";const r=e.indexOf("#",t);return e.substring(t,r>0?r:void 0)}function jie(e,t){const r=new Nie(e,t);return r.subscribe.bind(r)}class Nie{constructor(t,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{t(this)}).catch(n=>{this.error(n)})}next(t){this.forEachObserver(r=>{r.next(t)})}error(t){this.forEachObserver(r=>{r.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,r,n){let a;if(t===void 0&&r===void 0&&n===void 0)throw new Error("Missing Observer.");Sie(t,["next","error","complete"])?a=t:a={next:t,error:r,complete:n},a.next===void 0&&(a.next=EN),a.error===void 0&&(a.error=EN),a.complete===void 0&&(a.complete=EN);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?a.error(this.finalError):a.complete()}catch{}}),this.observers.push(a),i}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let r=0;r<this.observers.length;r++)this.sendOne(r,t)}sendOne(t,r){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{r(this.observers[t])}catch(n){typeof console<"u"&&console.error&&console.error(n)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Sie(e,t){if(typeof e!="object"||e===null)return!1;for(const r of t)if(r in e&&typeof e[r]=="function")return!0;return!1}function EN(){}/**
168 * @license
169 * Copyright 2021 Google LLC
170 *
171 * Licensed under the Apache License, Version 2.0 (the "License");
172 * you may not use this file except in compliance with the License.
173 * You may obtain a copy of the License at
174 *
175 *   http://www.apache.org/licenses/LICENSE-2.0
176 *
177 * Unless required by applicable law or agreed to in writing, software
178 * distributed under the License is distributed on an "AS IS" BASIS,
179 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
180 * See the License for the specific language governing permissions and
181 * limitations under the License.
182 */function es(e){return e&&e._delegate?e._delegate:e}class Jd{constructor(t,r,n){this.name=t,this.instanceFactory=r,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
183 * @license
184 * Copyright 2019 Google LLC
185 *
186 * Licensed under the Apache License, Version 2.0 (the "License");
187 * you may not use this file except in compliance with the License.
188 * You may obtain a copy of the License at
189 *
190 *   http://www.apache.org/licenses/LICENSE-2.0
191 *
192 * Unless required by applicable law or agreed to in writing, software
193 * distributed under the License is distributed on an "AS IS" BASIS,
194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195 * See the License for the specific language governing permissions and
196 * limitations under the License.
197 */const nd="[DEFAULT]";/**
198 * @license
199 * Copyright 2019 Google LLC
200 *
201 * Licensed under the Apache License, Version 2.0 (the "License");
202 * you may not use this file except in compliance with the License.
203 * You may obtain a copy of the License at
204 *
205 *   http://www.apache.org/licenses/LICENSE-2.0
206 *
207 * Unless required by applicable law or agreed to in writing, software
208 * distributed under the License is distributed on an "AS IS" BASIS,
209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210 * See the License for the specific language governing permissions and
211 * limitations under the License.
212 */let Cie=class{constructor(t,r){this.name=t,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const r=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(r)){const n=new oie;if(this.instancesDeferred.set(r,n),this.isInitialized(r)||this.shouldAutoInitialize())try{const a=this.getOrInitializeService({instanceIdentifier:r});a&&n.resolve(a)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(t){var r;const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),a=(r=t==null?void 0:t.optional)!==null&&r!==void 0?r:!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(a)return null;throw i}else{if(a)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(Mie(t))try{this.getOrInitializeService({instanceIdentifier:nd})}catch{}for(const[r,n]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(r);try{const i=this.getOrInitializeService({instanceIdentifier:a});n.resolve(i)}catch{}}}}clearInstance(t=nd){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=nd){return this.instances.has(t)}getOptions(t=nd){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:r={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const a=this.getOrInitializeService({instanceIdentifier:n,options:r});for(const[i,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(i);n===l&&o.resolve(a)}return a}onInit(t,r){var n;const a=this.normalizeInstanceIdentifier(r),i=(n=this.onInitCallbacks.get(a))!==null&&n!==void 0?n:new Set;i.add(t),this.onInitCallbacks.set(a,i);const o=this.instances.get(a);return o&&t(o,a),()=>{i.delete(t)}}invokeOnInitCallbacks(t,r){const n=this.onInitCallbacks.get(r);if(n)for(const a of n)try{a(t,r)}catch{}}getOrInitializeService({instanceIdentifier:t,options:r={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:kie(t),options:r}),this.instances.set(t,n),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch{}return n||null}normalizeInstanceIdentifier(t=nd){return this.component?this.component.multipleInstances?t:nd:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function kie(e){return e===nd?void 0:e}function Mie(e){return e.instantiationMode==="EAGER"}/**
213 * @license
214 * Copyright 2019 Google LLC
215 *
216 * Licensed under the Apache License, Version 2.0 (the "License");
217 * you may not use this file except in compliance with the License.
218 * You may obtain a copy of the License at
219 *
220 *   http://www.apache.org/licenses/LICENSE-2.0
221 *
222 * Unless required by applicable law or agreed to in writing, softw
222are
223 * distributed under the License is distributed on an "AS IS" BASIS,
224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225 * See the License for the specific language governing permissions and
226 * limitations under the License.
227 */class Iie{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const r=this.getProvider(t.name);if(r.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);r.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const r=new Cie(t,this);return this.providers.set(t,r),r}getProviders(){return Array.from(this.providers.values())}}/**
228 * @license
229 * Copyright 2017 Google LLC
230 *
231 * Licensed under the Apache License, Version 2.0 (the "License");
232 * you may not use this file except in compliance with the License.
233 * You may obtain a copy of the License at
234 *
235 *   http://www.apache.org/licenses/LICENSE-2.0
236 *
237 * Unless required by applicable law or agreed to in writing, software
238 * distributed under the License is distributed on an "AS IS" BASIS,
239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240 * See the License for the specific language governing permissions and
241 * limitations under the License.
242 */var $r;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})($r||($r={}));const Eie={debug:$r.DEBUG,verbose:$r.VERBOSE,info:$r.INFO,warn:$r.WARN,error:$r.ERROR,silent:$r.SILENT},Tie=$r.INFO,Aie={[$r.DEBUG]:"log",[$r.VERBOSE]:"log",[$r.INFO]:"info",[$r.WARN]:"warn",[$r.ERROR]:"error"},Pie=(e,t,...r)=>{if(t<e.logLevel)return;const n=new Date().toISOString(),a=Aie[t];if(a)console[a](`[${n}]  ${e.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};let kI=class{constructor(t){this.name=t,this._logLevel=Tie,this._logHandler=Pie,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in $r))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?Eie[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,$r.DEBUG,...t),this._logHandler(this,$r.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,$r.VERBOSE,...t),this._logHandler(this,$r.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,$r.INFO,...t),this._logHandler(this,$r.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,$r.WARN,...t),this._logHandler(this,$r.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,$r.ERROR,...t),this._logHandler(this,$r.ERROR,...t)}};const _ie=(e,t)=>t.some(r=>e instanceof r);let q_,G_;function Lie(){return q_||(q_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Die(){return G_||(G_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bB=new WeakMap,XC=new WeakMap,vB=new WeakMap,TN=new WeakMap,MI=new WeakMap;function Oie(e){const t=new Promise((r,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{r(fu(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return t.then(r=>{r instanceof IDBCursor&&bB.set(r,e)}).catch(()=>{}),MI.set(t,e),t}function Rie(e){if(XC.has(e))return;const t=new Promise((r,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{r(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});XC.set(e,t)}let ek={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return XC.get(e);if(t==="objectStoreNames")return e.objectStoreNames||vB.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return fu(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function $ie(e){ek=e(ek)}function Fie(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...r){const n=e.call(AN(this),t,...r);return vB.set(n,t.sort?t.sort():[t]),fu(n)}:Die().includes(e)?function(...t){return e.apply(AN(this),t),fu(bB.get(this))}:function(...t){return fu(e.apply(AN(this),t))}}function zie(e){return typeof e=="function"?Fie(e):(e instanceof IDBTransaction&&Rie(e),_ie(e,Lie())?new Proxy(e,ek):e)}function fu(e){if(e instanceof IDBRequest)return Oie(e);if(TN.has(e))return TN.get(e);const t=zie(e);return t!==e&&(TN.set(e,t),MI.set(t,e)),t}const AN=e=>MI.get(e);function Bie(e,t,{blocked:r,upgrade:n,blocking:a,terminated:i}={}){const o=indexedDB.open(e,t),l=fu(o);return n&&o.addEventListener("upgradeneeded",c=>{n(fu(o.result),c.oldVersion,c.newVersion,fu(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),l.then(c=>{i&&c.addEventListener("close",()=>i()),a&&c.addEventListener("versionchange",u=>a(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const Uie=["get","getKey","getAll","getAllKeys","count"],Vie=["put","add","delete","clear"],PN=new Map;function H_(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(PN.get(t))return PN.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,a=Vie.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Uie.includes(r)))return;const i=async function(o,...l){const c=this.transaction(o,a?"readwrite":"readonly");let u=c.store;
242return n&&(u=u.index(l.shift())),(await Promise.all([u[r](...l),a&&c.done]))[0]};return PN.set(t,i),i}$ie(e=>({...e,get:(t,r,n)=>H_(t,r)||e.get(t,r,n),has:(t,r)=>!!H_(t,r)||e.has(t,r)}));/**
243 * @license
244 * Copyright 2019 Google LLC
245 *
246 * Licensed under the Apache License, Version 2.0 (the "License");
247 * you may not use this file except in compliance with the License.
248 * You may obtain a copy of the License at
249 *
250 *   http://www.apache.org/licenses/LICENSE-2.0
251 *
252 * Unless required by applicable law or agreed to in writing, software
253 * distributed under the License is distributed on an "AS IS" BASIS,
254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255 * See the License for the specific language governing permissions and
256 * limitations under the License.
257 */class Wie{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(qie(r)){const n=r.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(r=>r).join(" ")}}function qie(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const tk="@firebase/app",Y_="0.10.13";/**
258 * @license
259 * Copyright 2019 Google LLC
260 *
261 * Licensed under the Apache License, Version 2.0 (the "License");
262 * you may not use this file except in compliance with the License.
263 * You may obtain a copy of the License at
264 *
265 *   http://www.apache.org/licenses/LICENSE-2.0
266 *
267 * Unless required by applicable law or agreed to in writing, software
268 * distributed under the License is distributed on an "AS IS" BASIS,
269 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
270 * See the License for the specific language governing permissions and
271 * limitations under the License.
272 */const nc=new kI("@firebase/app"),Gie="@firebase/app-compat",Hie="@firebase/analytics-compat",Yie="@firebase/analytics",Qie="@firebase/app-check-compat",Kie="@firebase/app-check",Jie="@firebase/auth",Zie="@firebase/auth-compat",Xie="@firebase/database",eoe="@firebase/data-connect",toe="@firebase/database-compat",roe="@firebase/functions",noe="@firebase/functions-compat",aoe="@firebase/installations",soe="@firebase/installations-compat",ioe="@firebase/messaging",ooe="@firebase/messaging-compat",loe="@firebase/performance",coe="@firebase/performance-compat",uoe="@firebase/remote-config",doe="@firebase/remote-config-compat",foe="@firebase/storage",moe="@firebase/storage-compat",hoe="@firebase/firestore",poe="@firebase/vertexai-preview",goe="@firebase/firestore-compat",yoe="firebase",boe="10.14.1";/**
273 * @license
274 * Copyright 2019 Google LLC
275 *
276 * Licensed under the Apache License, Version 2.0 (the "License");
277 * you may not use this file except in compliance with the License.
278 * You may obtain a copy of the License at
279 *
280 *   http://www.apache.org/licenses/LICENSE-2.0
281 *
282 * Unless required by applicable law or agreed to in writing, software
283 * distributed under the License is distributed on an "AS IS" BASIS,
284 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
285 * See the License for the specific language governing permissions and
286 * limitations under the License.
287 */const rk="[DEFAULT]",voe={[tk]:"fire-core",[Gie]:"fire-core-compat",[Yie]:"fire-analytics",[Hie]:"fire-analytics-compat",[Kie]:"fire-app-check",[Qie]:"fire-app-check-compat",[Jie]:"fire-auth",[Zie]:"fire-auth-compat",[Xie]:"fire-rtdb",[eoe]:"fire-data-connect",[toe]:"fire-rtdb-compat",[roe]:"fire-fn",[noe]:"fire-fn-compat",[aoe]:"fire-iid",[soe]:"fire-iid-compat",[ioe]:"fire-fcm",[ooe]:"fire-fcm-compat",[loe]:"fire-perf",[coe]:"fire-perf-compat",[uoe]:"fire-rc",[doe]:"fire-rc-compat",[foe]:"fire-gcs",[moe]:"fire-gcs-compat",[hoe]:"fire-fst",[goe]:"fire-fst-compat",[poe]:"fire-vertex","fire-js":"fire-js",[yoe]:"fire-js-all"};/**
288 * @license
289 * Copyright 2019 Google LLC
290 *
291 * Licensed under the Apache License, Version 2.0 (the "License");
292 * you may not use this file except in compliance with the License.
293 * You may obtain a copy of the License at
294 *
295 *   http://www.apache.org/licenses/LICENSE-2.0
296 *
297 * Unless required by applicable law or agreed to in writing, softw
297are
298 * distributed under the License is distributed on an "AS IS" BASIS,
299 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
300 * See the License for the specific language governing permissions and
301 * limitations under the License.
302 */const Dx=new Map,xoe=new Map,nk=new Map;function Q_(e,t){try{e.container.addComponent(t)}catch(r){nc.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function Zm(e){const t=e.name;if(nk.has(t))return nc.debug(`There were multiple attempts to register component ${t}.`),!1;nk.set(t,e);for(const r of Dx.values())Q_(r,e);for(const r of xoe.values())Q_(r,e);return!0}function II(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function Ii(e){return e.settings!==void 0}/**
303 * @license
304 * Copyright 2019 Google LLC
305 *
306 * Licensed under the Apache License, Version 2.0 (the "License");
307 * you may not use this file except in compliance with the License.
308 * You may obtain a copy of the License at
309 *
310 *   http://www.apache.org/licenses/LICENSE-2.0
311 *
312 * Unless required by applicable law or agreed to in writing, software
313 * distributed under the License is distributed on an "AS IS" BASIS,
314 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
315 * See the License for the specific language governing permissions and
316 * limitations under the License.
317 */const woe={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
317d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},mu=new By("app","Firebase",woe);/**
318 * @license
319 * Copyright 2019 Google LLC
320 *
321 * Licensed under the Apache License, Version 2.0 (the "License");
322 * you may not use this file except in compliance with the License.
323 * You may obtain a copy of the License at
324 *
325 *   http://www.apache.org/licenses/LICENSE-2.0
326 *
327 * Unless required by applicable law or agreed to in writing, software
328 * distributed under the License is distributed on an "AS IS" BASIS,
329 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
330 * See the License for the specific language governing permissions and
331 * limitations under the License.
332 */class joe{constructor(t,r,n){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},r),this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Jd("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw mu.create("app-deleted",{appName:this._name})}}/**
333 * @license
334 * Copyright 2019 Google LLC
335 *
336 * Licensed under the Apache License, Version 2.0 (the "License");
337 * you may not use this file except in compliance with the License.
338 * You may obtain a copy of the License at
339 *
340 *   http://www.apache.org/licenses/LICENSE-2.0
341 *
342 * Unless required by applicable law or agreed to in writing, software
343 * distributed under the License is distributed on an "AS IS" BASIS,
344 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
345 * See the License for the specific language governing permissions and
346 * limitations under the License.
347 */const Kh=boe;function xB(e,t={}){let r=e;typeof t!="object"&&(t={name:t});const n=Object.assign({name:rk,automaticDataCollectionEnabled:!1},t),a=n.name;if(typeof a!="string"||!a)throw mu.create("bad-app-name",{appName:String(a)});if(r||(r=gB()),!r)throw mu.create("no-options");const i=Dx.get(a);if(i){if(Lx(r,i.options)&&Lx(n,i.config))return i;throw mu.create("duplicate-app",{appName:a})}const o=new Iie(a);for(const c of nk.values())o.addComponent(c);const l=new joe(r,n,o);return Dx.set(a,l),l}function wB(e=rk){const t=Dx.get(e);if(!t&&e===rk&&gB())return xB();if(!t)throw mu.create("no-app",{appName:e});return t}function hu(e,t,r){var n;let a=(n=voe[e])!==null&&n!==void 0?n:e;r&&(a+=`-${r}`);const i=a.match(/\s|\//),o=t.match(/\s|\//);if(i||o){const l=[`Unable to register library "${a}" with version "${t}":`];i&&l.push(`library name "${a}" contains illegal characters (whitespace or "/")`),i&&o&&l.push("and"),o&&l.push(`version name "${t}" contains illegal characters (whitespace or "/")`),nc.warn(l.join(" "));return}Zm(new Jd(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}/**
348 * @license
349 * Copyright 2021 Google LLC
350 *
351 * Licensed under the Apache License, Version 2.0 (the "License");
352 * you may not use this file except in compliance with the License.
353 * You may obtain a copy of the License at
354 *
355 *   http://www.apache.org/licenses/LICENSE-2.0
356 *
357 * Unless required by applicable law or agreed to in writing, softw
357are
358 * distributed under the License is distributed on an "AS IS" BASIS,
359 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
360 * See the License for the specific language governing permissions and
361 * limitations under the License.
362 */const Noe="firebase-heartbeat-database",Soe=1,u0="firebase-heartbeat-store";let _N=null;function jB(){return _N||(_N=Bie(Noe,Soe,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(u0)}catch(r){console.warn(r)}}}}).catch(e=>{throw mu.create("idb-open",{originalErrorMessage:e.message})})),_N}async function Coe(e){try{const r=(await jB()).transaction(u0),n=await r.objectStore(u0).get(NB(e));return await r.done,n}catch(t){if(t instanceof gc)nc.warn(t.message);else{const r=mu.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});nc.warn(r.message)}}}async function K_(e,t){try{const n=(await jB()).transaction(u0,"readwrite");await n.objectStore(u0).put(t,NB(e)),await n.done}catch(r){if(r instanceof gc)nc.warn(r.message);else{const n=mu.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});nc.warn(n.message)}}}function NB(e){return`${e.name}!${e.options.appId}`}/**
363 * @license
364 * Copyright 2021 Google LLC
365 *
366 * Licensed under the Apache License, Version 2.0 (the "License");
367 * you may not use this file except in compliance with the License.
368 * You may obtain a copy of the License at
369 *
370 *   http://www.apache.org/licenses/LICENSE-2.0
371 *
372 * Unless required by applicable law or agreed to in writing, software
373 * distributed under the License is distributed on an "AS IS" BASIS,
374 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
375 * See the License for the specific language governing permissions and
376 * limitations under the License.
377 */const koe=1024,Moe=30*24*60*60*1e3;class Ioe{constructor(t){this.container=t,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new Toe(r),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){var t,r;try{const a=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=J_();return((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(o=>o.date===i)?void 0:(this._heartbeatsCache.heartbeats.push({date:i,agent:a}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const l=new Date(o.date).valueOf();return Date.now()-l<=Moe}),this._storage.overwrite(this._heartbeatsCache))}catch(n){nc.warn(n)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const r=J_(),{heartbeatsToSend:n,unsentEntries:a}=Eoe(this._heartbeatsCache.heartbeats),i=_x(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=r,a.length>0?(this._heartbeatsCache.heartbeats=a,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(r){return nc.warn(r),""}}}function J_(){return new Date().toISOString().substring(0,10)}function Eoe(e,t=koe){const r=[];let n=e.slice();for(const a of e){const i=r.find(o=>o.agent===a.agent);if(i){if(i.dates.push(a.date),Z_(r)>t){i.dates.pop();break}}else if(r.push({agent:a.agent,dates:[a.date]}),Z_(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}class Toe{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return gie()?yie().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await Coe(this.app);return r!=null&&r.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var r;if(await this._canUseIndexedDBPromise){const a=await this.read();return K_(this.app,{lastSentHeartbeatDate:(r=t.lastSentHeartbeatDate)!==null&&r!==void 0?r:a.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var r;if(await this._canUseIndexedDBPromise){const a=await this.read();return K_(this.app,{lastSentHeartbeatDate:(r=t.lastSentHeartbeatDate)!==null&&r!==void 0?r:a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...t.heartbeats]})}else return}}function Z_(e){return _x(JSON.stringify({version:2,heartbeats:e})).length}/**
378 * @license
379 * Copyright 2019 Google LLC
380 *
381 * Licensed under the Apache License, Version 2.0 (the "License");
382 * you may not use this file except in compliance with the License.
383 * You may obtain a copy of the License at
384 *
385 *   http://www.apache.org/licenses/LICENSE-2.0
386 *
387 * Unless required by applicable law or agreed to in writing, software
388 * distributed under the License is distributed on an "AS IS" BASIS,
389 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
390 * See the License for the specific language governing permissions and
391 * limitations under the License.
392 */function Aoe(e){Zm(new Jd("platform-logger",t=>new Wie(t),"PRIVATE")),Zm(new Jd("heartbeat",t=>new Ioe(t),"PRIVATE")),hu(tk,Y_,e),hu(tk,Y_,"esm2017"),hu("fire-js","")}Aoe("");function EI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function SB(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Poe=SB,CB=new By("auth","Firebase",SB());/**
393 * @license
394 * Copyright 2020 Google LLC
395 *
396 * Licensed under the Apache License, Version 2.0 (the "License");
397 * you may not use this file except in compliance with the License.
398 * You may obtain a copy of the License at
399 *
400 *   http://www.apache.org/licenses/LICENSE-2.0
401 *
402 * Unless required by applicable law or agreed to in writing, software
403 * distributed under the License is distributed on an "AS IS" BASIS,
404 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
405 * See the License for the specific language governing permissions and
406 * limitations under the License.
407 */const Ox=new kI("@firebase/auth");function _oe(e,...t){Ox.logLevel<=$r.WARN&&Ox.warn(`Auth (${Kh}): ${e}`,...t)}function Fv(e,...t){Ox.logLevel<=$r.ERROR&&Ox.error(`Auth (${Kh}): ${e}`,...t)}/**
408 * @license
409 * Copyright 2020 Google LLC
410 *
411 * Licensed under the Apache License, Version 2.0 (the "License");
412 * you may not use this file except in compliance with the License.
413 * You may obtain a copy of the License at
414 *
415 *   http://www.apache.org/licenses/LICENSE-2.0
416 *
417 * Unless required by applicable law or agreed to in writing, software
418 * distributed under the License is distributed on an "AS IS" BASIS,
419 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
420 * See the License for the specific language governing permissions and
421 * limitations under the License.
422 */function Ri(e,...t){throw AI(e,...t)}function po(e,...t){return AI(e,...t)}function TI(e,t,r){const n=Object.assign(Object.assign({},Poe()),{[t]:r});return new By("auth","Firebase",n).create(t,{appName:e.name})}function Yo(e){return TI(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Loe(e,t,r){const n=r;if(!(t instanceof n))throw n.name!==t.constructor.name&&Ri(e,"argument-error"),TI(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function AI(e,...t){if(typeof e!="string"){const r=t[0],n=[...t.slice(1)];return n[0]&&(n[0].appName=e.name),e._errorFactory.create(r,...n)}return CB.create(e,...t)}function tr(e,t,...r){if(!e)throw AI(t,...r)}function _l(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Fv(t),new Error(t)}function ac(e,t){e||_l(t)}/**
423 * @license
424 * Copyright 2020 Google LLC
425 *
426 * Licensed under the Apache License, Version 2.0 (the "License");
427 * you may not use this file except in compliance with the License.
428 * You may obtain a copy of the License at
429 *
430 *   http://www.apache.org/licenses/LICENSE-2.0
431 *
432 * Unless required by applicable law or agreed to in writing, software
433 * distributed under the License is distributed on an "AS IS" BASIS,
434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
435 * See the License for the specific language governing permissions and
436 * limitations under the License.
437 */function ak(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.href)||""}function Doe(){return X_()==="http:"||X_()==="https:"}function X_(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.protocol)||null}/**
438 * @license
439 * Copyright 2020 Google LLC
440 *
441 * Licensed under the Apache License, Version 2.0 (the "License");
442 * you may not use this file except in compliance with the License.
443 * You may obtain a copy of the License at
444 *
445 *   http://www.apache.org/licenses/LICENSE-2.0
446 *
447 * Unless required by applicable law or agreed to in writing, software
448 * distributed under the License is distributed on an "AS IS" BASIS,
449 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
450 * See the License for the specific language governing permissions and
451 * limitations under the License.
452 */function Ooe(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Doe()||fie()||"connection"in navigator)?navigator.onLine:!0}function Roe(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
453 * @license
454 * Copyright 2020 Google LLC
455 *
456 * Licensed under the Apache License, Version 2.0 (the "License");
457 * you may not use this file except in compliance with the License.
458 * You may obtain a copy of the License at
459 *
460 *   http://www.apache.org/licenses/LICENSE-2.0
461 *
462 * Unless required by applicable law or agreed to in writing, software
463 * distributed under the License is distributed on an "AS IS" BASIS,
464 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
465 * See the License for the specific language governing permissions and
466 * limitations under the License.
467 */class Vy{constructor(t,r){this.shortDelay=t,this.longDelay=r,ac(r>
467t,"Short delay should be less than long delay!"),this.isMobile=cie()||mie()}get(){return Ooe()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
468 * @license
469 * Copyright 2020 Google LLC
470 *
471 * Licensed under the Apache License, Version 2.0 (the "License");
472 * you may not use this file except in compliance with the License.
473 * You may obtain a copy of the License at
474 *
475 *   http://www.apache.org/licenses/LICENSE-2.0
476 *
477 * Unless required by applicable law or agreed to in writing, software
478 * distributed under the License is distributed on an "AS IS" BASIS,
479 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
480 * See the License for the specific language governing permissions and
481 * limitations under the License.
482 */function PI(e,t){ac(e.emulator,"Emulator should always be set here");const{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}/**
483 * @license
484 * Copyright 2020 Google LLC
485 *
486 * Licensed under the Apache License, Version 2.0 (the "License");
487 * you may not use this file except in compliance with the License.
488 * You may obtain a copy of the License at
489 *
490 *   http://www.apache.org/licenses/LICENSE-2.0
491 *
492 * Unless required by applicable law or agreed to in writing, software
493 * distributed under the License is distributed on an "AS IS" BASIS,
494 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
495 * See the License for the specific language governing permissions and
496 * limitations under the License.
497 */class kB{static initialize(t,r,n){this.fetchImpl=t,r&&(this.headersImpl=r),n&&(this.responseImpl=n)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;_l("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;_l("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;_l("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
498 * @license
499 * Copyright 2020 Google LLC
500 *
501 * Licensed under the Apache License, Version 2.0 (the "License");
502 * you may not use this file except in compliance with the License.
503 * You may obtain a copy of the License at
504 *
505 *   http://www.apache.org/licenses/LICENSE-2.0
506 *
507 * Unless required by applicable law or agreed to in writing, software
508 * distributed under the License is distributed on an "AS IS" BASIS,
509 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
510 * See the License for the specific language governing permissions and
511 * limitations under the License.
512 */const $oe={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-rec
512aptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
513 * @license
514 * Copyright 2020 Google LLC
515 *
516 * Licensed under the Apache License, Version 2.0 (the "License");
517 * you may not use this file except in compliance with the License.
518 * You may obtain a copy of the License at
519 *
520 *   http://www.apache.org/licenses/LICENSE-2.0
521 *
522 * Unless required by applicable law or agreed to in writing, software
523 * distributed under the License is distributed on an "AS IS" BASIS,
524 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
525 * See the License for the specific language governing permissions and
526 * limitations under the License.
527 */const Foe=new Vy(3e4,6e4);function dl(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function fl(e,t,r,n,a={}){return MB(e,a,async()=>{let i={},o={};n&&(t==="GET"?o=n:i={body:JSON.stringify(n)});const l=Uy(Object.assign({key:e.config.apiKey},o)).slice(1),c=await e._getAdditionalHeaders();c["Content-Type"]="application/json",e.languageCode&&(c["X-Firebase-Locale"]=e.languageCode);const u=Object.assign({method:t,headers:c},i);return die()||(u.referrerPolicy="no-referrer"),kB.fetch()(IB(e,e.config.apiHost,r,l),u)})}async function MB(e,t,r){e._canInitEmulator=!1;const n=Object.assign(Object.assign({},$oe),t);try{const a=new Boe(e),i=await Promise.race([r(),a.promise]);a.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw qb(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const l=i.ok?o.errorMessage:o.error.message,[c,u]=l.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw qb(e,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw qb(e,"email-already-in-use",o);if(c==="USER_DISABLED")throw qb(e,"user-disabled",o);const d=n[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw TI(e,d,u);Ri(e,d)}}catch(a){if(a instanceof gc)throw a;Ri(e,"network-request-failed",{message:String(a)})}}async function Jh(e,t,r,n,a={}){const i=await fl(e,t,r,n,a);return"mfaPendingCredential"in i&&Ri(e,"multi-factor-auth-required",{_serverResponse:i}),i}function IB(e,t,r,n){const a=`${t}${r}?${n}`;return e.config.emulator?PI(e.config,a):`${e.config.apiScheme}://${a}`}function zoe(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Boe{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((r,n)=>{this.timer=setTimeout(()=>n(po(this.auth,"network-request-failed")),Foe.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function qb(e,t,r){const n={appName:e.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);const a=po(e,t,n);return a.customData._tokenResponse=r,a}function e3(e){return e!==void 0&&e.enterprise!==void 0}class Uoe{constructor(t){if(this.siteKey="",this.recaptchaEnforcementState=[],t.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=t.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=t.recaptchaEnforcementState}getProviderEnforcementState(t){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const r of this.recaptchaEnforcementState)if(r.provider&&r.provider===t)return zoe(r.enforcementState);return null}isProviderEnabled(t){return this.getProviderEnforcementState(t)==="ENFORCE"||this.getProviderEnforcementState(t)==="AUDIT"}}async function Voe(e,t){return fl(e,"GET","/v2/recaptchaConfig",dl(e,t))}/**
528 * @license
529 * Copyright 2020 Google LLC
530 *
531 * Licensed under the Apache License, Version 2.0 (the "License");
532 * you may not use this file except in compliance with the License.
533 * You may obtain a copy of the License at
534 *
535 *   http://www.apache.org/licenses/LICENSE-2.0
536 *
537 * Unless required by applicable law or agreed to in writing, softw
537are
538 * distributed under the License is distributed on an "AS IS" BASIS,
539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
540 * See the License for the specific language governing permissions and
541 * limitations under the License.
542 */async function Woe(e,t){return fl(e,"POST","/v1/accounts:delete",t)}async function EB(e,t){return fl(e,"POST","/v1/accounts:lookup",t)}/**
543 * @license
544 * Copyright 2020 Google LLC
545 *
546 * Licensed under the Apache License, Version 2.0 (the "License");
547 * you may not use this file except in compliance with the License.
548 * You may obtain a copy of the License at
549 *
550 *   http://www.apache.org/licenses/LICENSE-2.0
551 *
552 * Unless required by applicable law or agreed to in writing, software
553 * distributed under the License is distributed on an "AS IS" BASIS,
554 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
555 * See the License for the specific language governing permissions and
556 * limitations under the License.
557 */function zg(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function qoe(e,t=!1){const r=es(e),n=await r.getIdToken(t),a=_I(n);tr(a&&a.exp&&a.auth_time&&a.iat,r.auth,"internal-error");const i=typeof a.firebase=="object"?a.firebase:void 0,o=i==null?void 0:i.sign_in_provider;return{claims:a,token:n,authTime:zg(LN(a.auth_time)),issuedAtTime:zg(LN(a.iat)),expirationTime:zg(LN(a.exp)),signInProvider:o||null,signInSecondFactor:(i==null?void 0:i.sign_in_second_factor)||null}}function LN(e){return Number(e)*1e3}function _I(e){const[t,r,n]=e.split(".");if(t===void 0||r===void 0||n===void 0)return Fv("JWT malformed, contained fewer than 3 sections"),null;try{const a=hB(r);return a?JSON.parse(a):(Fv("Failed to decode base64 JWT payload"),null)}catch(a){return Fv("Caught error parsing JWT payload as JSON",a==null?void 0:a.toString()),null}}function t3(e){const t=_I(e);return tr(t,"internal-error"),tr(typeof t.exp<"u","internal-error"),tr(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
558 * @license
559 * Copyright 2020 Google LLC
560 *
561 * Licensed under the Apache License, Version 2.0 (the "License");
562 * you may not use this file except in compliance with the License.
563 * You may obtain a copy of the License at
564 *
565 *   http://www.apache.org/licenses/LICENSE-2.0
566 *
567 * Unless required by applicable law or agreed to in writing, software
568 * distributed under the License is distributed on an "AS IS" BASIS,
569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
570 * See the License for the specific language governing permissions and
571 * limitations under the License.
572 */async function Xm(e,t,r=!1){if(r)return t;try{return await t}catch(n){throw n instanceof gc&&Goe(n)&&e.auth.currentUser===e&&await e.auth.signOut(),n}}function Goe({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
573 * @license
574 * Copyright 2020 Google LLC
575 *
576 * Licensed under the Apache License, Version 2.0 (the "License");
577 * you may not use this file except in compliance with the License.
578 * You may obtain a copy of the License at
579 *
580 *   http://www.apache.org/licenses/LICENSE-2.0
581 *
582 * Unless required by applicable law or agreed to in writing, software
583 * distributed under the License is distributed on an "AS IS" BASIS,
584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
585 * See the License for the specific language governing permissions and
586 * limitations under the License.
587 */class Hoe{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){var r;if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const a=((r=this.user.stsTokenManager.expirationTime)!==null&&r!==void 0?r:0)-Date.now()-3e5;return Math.max(0,a)}}schedule(t=!1){if(!this.isRunning)return;const r=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},r)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
588 * @license
589 * Copyright 2020 Google LLC
590 *
591 * Licensed under the Apache License, Version 2.0 (the "License");
592 * you may not use this file except in compliance with the License.
593 * You may obtain a copy of the License at
594 *
595 *   http://www.apache.org/licenses/LICENSE-2.0
596 *
597 * Unless required by applicable law or agreed to in writing, software
598 * distributed under the License is distributed on an "AS IS" BASIS,
599 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
600 * See the License for the specific language governing permissions and
601 * limitations under the License.
602 */class sk{constructor(t,r){this.createdAt=t,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=zg(this.lastLoginAt),this.creationTime=zg(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
603 * @license
604 * Copyright 2019 Google LLC
605 *
606 * Licensed under the Apache License, Version 2.0 (the "License");
607 * you may not use this file except in compliance with the License.
608 * You may obtain a copy of the License at
609 *
610 *   http://www.apache.org/licenses/LICENSE-2.0
611 *
612 * Unless required by applicable law or agreed to in writing, software
613 * distributed under the License is distributed on an "AS IS" BASIS,
614 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
615 * See the License for the specific language governing permissions and
616 * limitations under the License.
617 */async function Rx(e){var t;const r=e.auth,n=await e.getIdToken(),a=await Xm(e,EB(r,{idToken:n}));tr(a==null?void 0:a.users.length,r,"internal-error");const i=a.users[0];e._notifyReloadListener(i);const o=!((t=i.providerUserInfo)===null||t===void 0)&&t.length?TB(i.providerUserInfo):[],l=Qoe(e.providerData,o),c=e.isAnonymous,u=!(e.email&&i.passwordHash)&&!(l!=null&&l.length),d=c?u:!1,f={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:l,metadata:new sk(i.createdAt,i.lastLoginAt),isAnonymous:d};Object.assign(e,f)}async function Yoe(e){const t=es(e);await Rx(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function Qoe(e,t){return[...e.filter(n=>!t.some(a=>a.providerId===n.providerId)),...t]}function TB(e){return e.map(t=>{var{providerId:r}=t,n=EI(t,["providerId"]);return{providerId:r,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}/**
618 * @license
619 * Copyright 2020 Google LLC
620 *
621 * Licensed under the Apache License, Version 2.0 (the "License");
622 * you may not use this file except in compliance with the License.
623 * You may obtain a copy of the License at
624 *
625 *   http://www.apache.org/licenses/LICENSE-2.0
626 *
627 * Unless required by applicable law or agreed to in writing, software
628 * distributed under the License is distributed on an "AS IS" BASIS,
629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
630 * See the License for the specific language governing permissions and
631 * limitations under the License.
632 */async function Koe(e,t){const r=await MB(e,{},async()=>{const n=Uy({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:a,apiKey:i}=e.config,o=IB(e,a,"/v1/token",`key=${i}`),l=await e._getAdditionalHeaders();return l["Content-Type"]="application/x-www-form-urlencoded",kB.fetch()(o,{method:"POST",headers:l,body:n})});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function Joe(e,t){return fl(e,"POST","/v2/accounts:revokeToken",dl(e,t))}/**
633 * @license
634 * Copyright 2020 Google LLC
635 *
636 * Licensed under the Apache License, Version 2.0 (the "License");
637 * you may not use this file except in compliance with the License.
638 * You may obtain a copy of the License at
639 *
640 *   http://www.apache.org/licenses/LICENSE-2.0
641 *
642 * Unless required by applicable law or agreed to in writing, software
643 * distributed under the License is distributed on an "AS IS" BASIS,
644 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
645 * See the License for the specific language governing permissions and
646 * limitations under the License.
647 */class vm{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){tr(t.idToken,"internal-error"),tr(typeof t.idToken<"u","internal-error"),tr(typeof t.refreshToken<"u","internal-error");
647const r="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):t3(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,r)}updateFromIdToken(t){tr(t.length!==0,"internal-error");const r=t3(t);this.updateTokensAndExpiration(t,null,r)}async getToken(t,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(tr(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,r){const{accessToken:n,refreshToken:a,expiresIn:i}=await Koe(t,r);this.updateTokensAndExpiration(n,a,Number(i))}updateTokensAndExpiration(t,r,n){this.refreshToken=r||null,this.accessToken=t||null,this.expirationTime=Date.now()+n*1e3}static fromJSON(t,r){const{refreshToken:n,accessToken:a,expirationTime:i}=r,o=new vm;return n&&(tr(typeof n=="string","internal-error",{appName:t}),o.refreshToken=n),a&&(tr(typeof a=="string","internal-error",{appName:t}),o.accessToken=a),i&&(tr(typeof i=="number","internal-error",{appName:t}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new vm,this.toJSON())}_performRefresh(){return _l("not implemented")}}/**
648 * @license
649 * Copyright 2020 Google LLC
650 *
651 * Licensed under the Apache License, Version 2.0 (the "License");
652 * you may not use this file except in compliance with the License.
653 * You may obtain a copy of the License at
654 *
655 *   http://www.apache.org/licenses/LICENSE-2.0
656 *
657 * Unless required by applicable law or agreed to in writing, software
658 * distributed under the License is distributed on an "AS IS" BASIS,
659 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660 * See the License for the specific language governing permissions and
661 * limitations under the License.
662 */function Tc(e,t){tr(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Ll{constructor(t){var{uid:r,auth:n,stsTokenManager:a}=t,i=EI(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Hoe(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=r,this.auth=n,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new sk(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(t){const r=await Xm(this,this.stsTokenManager.getToken(this.auth,t));return tr(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(t){return qoe(this,t)}reload(){return Yoe(this)}_assign(t){this!==t&&(tr(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(r=>Object.assign({},r)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const r=new Ll(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return r.metadata._copy(this.metadata),r}_onReload(t){tr(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,r=!1){let n=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),n=!0),r&&await Rx(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ii(this.auth.app))return Promise.reject(Yo(this.auth));const t=await this.getIdToken();return await Xm(this,Woe(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
662nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,r){var n,a,i,o,l,c,u,d;const f=(n=r.displayName)!==null&&n!==void 0?n:void 0,m=(a=r.email)!==null&&a!==void 0?a:void 0,h=(i=r.phoneNumber)!==null&&i!==void 0?i:void 0,p=(o=r.photoURL)!==null&&o!==void 0?o:void 0,g=(l=r.tenantId)!==null&&l!==void 0?l:void 0,y=(c=r._redirectEventId)!==null&&c!==void 0?c:void 0,v=(u=r.createdAt)!==null&&u!==void 0?u:void 0,x=(d=r.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:j,emailVerified:C,isAnonymous:N,providerData:S,stsTokenManager:M}=r;tr(j&&M,t,"internal-error");const k=vm.fromJSON(this.name,M);tr(typeof j=="string",t,"internal-error"),Tc(f,t.name),Tc(m,t.name),tr(typeof C=="boolean",t,"internal-error"),tr(typeof N=="boolean",t,"internal-error"),Tc(h,t.name),Tc(p,t.name),Tc(g,t.name),Tc(y,t.name),Tc(v,t.name),Tc(x,t.name);const I=new Ll({uid:j,auth:t,email:m,emailVerified:C,displayName:f,isAnonymous:N,photoURL:p,phoneNumber:h,tenantId:g,stsTokenManager:k,createdAt:v,lastLoginAt:x});return S&&Array.isArray(S)&&(I.providerData=S.map(T=>Object.assign({},T))),y&&(I._redirectEventId=y),I}static async _fromIdTokenResponse(t,r,n=!1){const a=new vm;a.updateFromServerResponse(r);const i=new Ll({uid:r.localId,auth:t,stsTokenManager:a,isAnonymous:n});return await Rx(i),i}static async _fromGetAccountInfoResponse(t,r,n){const a=r.users[0];tr(a.localId!==void 0,"internal-error");const i=a.providerUserInfo!==void 0?TB(a.providerUserInfo):[],o=!(a.email&&a.passwordHash)&&!(i!=null&&i.length),l=new vm;l.updateFromIdToken(n);const c=new Ll({uid:a.localId,auth:t,stsTokenManager:l,isAnonymous:o}),u={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:i,metadata:new sk(a.createdAt,a.lastLoginAt),isAnonymous:!(a.email&&a.passwordHash)&&!(i!=null&&i.length)};return Object.assign(c,u),c}}/**
663 * @license
664 * Copyright 2020 Google LLC
665 *
666 * Licensed under the Apache License, Version 2.0 (the "License");
667 * you may not use this file except in compliance with the License.
668 * You may obtain a copy of the License at
669 *
670 *   http://www.apache.org/licenses/LICENSE-2.0
671 *
672 * Unless required by applicable law or agreed to in writing, software
673 * distributed under the License is distributed on an "AS IS" BASIS,
674 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
675 * See the License for the specific language governing permissions and
676 * limitations under the License.
677 */const r3=new Map;function Dl(e){ac(e instanceof Function,"Expected a class definition");let t=r3.get(e);return t?(ac(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,r3.set(e,t),t)}/**
678 * @license
679 * Copyright 2019 Google LLC
680 *
681 * Licensed under the Apache License, Version 2.0 (the "License");
682 * you may not use this file except in compliance with the License.
683 * You may obtain a copy of the License at
684 *
685 *   http://www.apache.org/licenses/LICENSE-2.0
686 *
687 * Unless required by applicable law or agreed to in writing, software
688 * distributed under the License is distributed on an "AS IS" BASIS,
689 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
690 * See the License for the specific language governing permissions and
691 * limitations under the License.
692 */class AB{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,r){this.storage[t]=r}async _get(t){const r=this.storage[t];return r===void 0?null:r}async _remove(t){delete this.storage[t]}_addListener(t,r){}_removeListener(t,r){}}AB.type="NONE";const n3=AB;/**
693 * @license
694 * Copyright 2019 Google LLC
695 *
696 * Licensed under the Apache License, Version 2.0 (the "License");
697 * you may not use this file except in compliance with the License.
698 * You may obtain a copy of the License at
699 *
700 *   http://www.apache.org/licenses/LICENSE-2.0
701 *
702 * Unless required by applicable law or agreed to in writing, software
703 * distributed under the License is distributed on an "AS IS" BASIS,
704 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
705 * See the License for the specific language governing permissions and
706 * limitations under the License.
707 */function zv(e,t,r){return`firebase:${e}:${t}:${r}`}class xm{constructor(t,r,n){this.persistence=t,this.auth=r,this.userKey=n;const{config:a,name:i}=this.auth;this.fullUserKey=zv(this.userKey,a.apiKey,i),this.fullPersistenceKey=zv("persistence",a.apiKey,i),this.boundEventHandler=r._onStorageEvent.bind(r),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);return t?Ll._fromJSON(this.auth,t):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,r,n="authUser"){if(!r.length)return new xm(Dl(n3),t,n);const a=(await Promise.all(r.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let i=a[0]||Dl(n3);const o=zv(n,t.config.apiKey,t.name);let l=null;for(const u of r)try{const d=await u._get(o);if(d){const f=Ll._fromJSON(t,d);u!==i&&(l=f),i=u;break}}catch{}const c=a.filter(u=>u._shouldAllowMigration);return!i._shouldAllowMigration||!c.length?new xm(i,t,n):(i=c[0],l&&await i._set(o,l.toJSON()),await Promise.all(r.map(async u=>{if(u!==i)try{await u._remove(o)}catch{}})),new xm(i,t,n))}}/**
708 * @license
709 * Copyright 2020 Google LLC
710 *
711 * Licensed under the Apache License, Version 2.0 (the "License");
712 * you may not use this file except in compliance with the License.
713 * You may obtain a copy of the License at
714 *
715 *   http://www.apache.org/licenses/LICENSE-2.0
716 *
717 * Unless required by applicable law or agreed to in writing, software
718 * distributed under the License is distributed on an "AS IS" BASIS,
719 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
720 * See the License for the specific language governing permissions and
721 * limitations under the License.
722 */function a3(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(DB(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(PB(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(RB(t))return"Blackberry";if($B(t))return"Webos";if(_B(t))return"Safari";if((t.includes("chrome/")||LB(t))&&!t.includes("edge/"))return"Chrome";if(OB(t))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(r);if((n==null?void 0:n.length)===2)return n[1]}return"Other"}function PB(e=ys()){return/firefox\//i.test(e)}function _B(e=ys()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function LB(e=ys()){return/crios\//i.test(e)}function DB(e=ys()){return/iemobile/i.test(e)}function OB(e=ys()){return/android/i.test(e)}function RB(e=ys()){return/blackberry/i.test(e)}function $B(e=ys()){return/webos/i.test(e)}function LI(e=ys()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Zoe(e=ys()){var t;return LI(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function Xoe(){return hie()&&document.documentMode===10}function FB(e=ys()){return LI(e)||OB(e)||$B(e)||RB(e)||/windows phone/i.test(e)||DB(e)}/**
723 * @license
724 * Copyright 2020 Google LLC
725 *
726 * Licensed under the Apache License, Version 2.0 (the "License");
727 * you may not use this file except in compliance with the License.
728 * You may obtain a copy of the License at
729 *
730 *   http://www.apache.org/licenses/LICENSE-2.0
731 *
732 * Unless required by applicable law or agreed to in writing, software
733 * distributed under the License is distributed on an "AS IS" BASIS,
734 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
735 * See the License for the specific language governing permissions and
736 * limitations under the License.
737 */function zB(e,t=[]){let r;switch(e){case"Browser":r=a3(ys());break;case"Worker":r=`${a3(ys())}-${e}`;break;default:r=e}const n=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${Kh}/${n}`}/**
738 * @license
739 * Copyright 2022 Google LLC
740 *
741 * Licensed under the Apache License, Version 2.0 (the "License");
742 * you may not use this file except in compliance with the License.
743 * You may obtain a copy of the License at
744 *
745 *   http://www.apache.org/licenses/LICENSE-2.0
746 *
747 * Unless required by applicable law or agreed to in writing, software
748 * distributed under the License is distributed on an "AS IS" BASIS,
749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
750 * See the License for the specific language governing permissions and
751 * limitations under the License.
752 */class ele{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,r){const n=i=>new Promise((o,l)=>{try{const c=t(i);o(c)}catch(c){l(c)}});n.onAbort=r,this.queue.push(n);const a=this.queue.length-1;return()=>{this.queue[a]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const r=[];try{for(const n of this.queue)await n(t),n.onAbort&&r.push(n.onAbort)}catch(n){r.reverse();for(const a of r)try{a()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:n==null?void 0:n.message})}}}/**
753 * @license
754 * Copyright 2023 Google LLC
755 *
756 * Licensed under the Apache License, Version 2.0 (the "License");
757 * you may not use this file except in compliance with the License.
758 * You may obtain a copy of the License at
759 *
760 *   http://www.apache.org/licenses/LICENSE-2.0
761 *
762 * Unless required by applicable law or agreed to in writing, software
763 * distributed under the License is distributed on an "AS IS" BASIS,
764 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
765 * See the License for the specific language governing permissions and
766 * limitations under the License.
767 */async function tle(e,t={}){return fl(e,"GET","/v2/passwordPolicy",dl(e,t))}/**
768 * @license
769 * Copyright 2023 Google LLC
770 *
771 * Licensed under the Apache License, Version 2.0 (the "License");
772 * you may not use this file except in compliance with the License.
773 * You may obtain a copy of the License at
774 *
775 *   http://www.apache.org/licenses/LICENSE-2.0
776 *
777 * Unless required by applicable law or agreed to in writing, software
778 * distributed under the License is distributed on an "AS IS" BASIS,
779 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
780 * See the License for the specific language governing permissions and
781 * limitations under the License.
782 */const rle=6;class nle{constructor(t){var r,n,a,i;const o=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(r=o.minPasswordLength)!==null&&r!==void 0?r:rle,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(a=(n=t.allowedNonAlphanumericCharacters)===null||n===void 0?void 0:n.join(""))!==null&&a!==void 0?a:"",this.forceUpgradeOnSignin=(i=t.forceUpgradeOnSignin)!==null&&i!==void 0?i:!1,this.schemaVersion=t.schemaVersion}validatePassword(t){var r,n,a,i,o,l;const c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,c),this.validatePasswordCharacterOptions(t,c),c.isValid&&
782(c.isValid=(r=c.meetsMinPasswordLength)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(n=c.meetsMaxPasswordLength)!==null&&n!==void 0?n:!0),c.isValid&&(c.isValid=(a=c.containsLowercaseLetter)!==null&&a!==void 0?a:!0),c.isValid&&(c.isValid=(i=c.containsUppercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(o=c.containsNumericCharacter)!==null&&o!==void 0?o:!0),c.isValid&&(c.isValid=(l=c.containsNonAlphanumericCharacter)!==null&&l!==void 0?l:!0),c}validatePasswordLengthOptions(t,r){const n=this.customStrengthOptions.minPasswordLength,a=this.customStrengthOptions.maxPasswordLength;n&&(r.meetsMinPasswordLength=t.length>=n),a&&(r.meetsMaxPasswordLength=t.length<=a)}validatePasswordCharacterOptions(t,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let n;for(let a=0;a<t.length;a++)n=t.charAt(a),this.updatePasswordCharacterOptionsStatuses(r,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(t,r,n,a,i){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=a)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=i))}}/**
783 * @license
784 * Copyright 2020 Google LLC
785 *
786 * Licensed under the Apache License, Version 2.0 (the "License");
787 * you may not use this file except in compliance with the License.
788 * You may obtain a copy of the License at
789 *
790 *   http://www.apache.org/licenses/LICENSE-2.0
791 *
792 * Unless required by applicable law or agreed to in writing, software
793 * distributed under the License is distributed on an "AS IS" BASIS,
794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
795 * See the License for the specific language governing permissions and
796 * limitations under the License.
797 */class ale{constructor(t,r,n,a){this.app=t,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=n,this.config=a,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new s3(this),this.idTokenSubscription=new s3(this),this.beforeStateQueue=new ele(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=CB,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=a.sdkClientVersion}_initializeWithPersistence(t,r){return r&&(this._popupRedirectResolver=Dl(r)),this._initializationPromise=this.queue(async()=>{var n,a;if(!this._deleted&&(this.persistenceManager=await xm.create(this,t),!this._deleted)){if(!((n=this._popupRedirectResolver)===null||n===void 0)&&n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((a=this.currentUser)===null||a===void 0?void 0:a.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const r=await EB(this,{idToken:t}),n=await Ll._fromGetAccountInfoResponse(this,r,t);await this.directlySetCurrentUser(n)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var r;if(Ii(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(l=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(l,l))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let a=n,i=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId,l=a==null?void 0:a._redirectEventId,c=await this.tryRedirectSignIn(t);(!o||o===l)&&(c!=null&&c.user)&&(a=c.user,i=!0)}if(!a)return this.directlySetCurrentUser(null);
797if(!a._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(a)}catch(o){a=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return tr(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(t){let r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(t){try{await Rx(t)}catch(r){if((r==null?void 0:r.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=Roe()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Ii(this.app))return Promise.reject(Yo(this));const r=t?es(t):null;return r&&tr(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(t,r=!1){if(!this._deleted)return t&&tr(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Ii(this.app)?Promise.reject(Yo(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Ii(this.app)?Promise.reject(Yo(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Dl(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const r=this._getPasswordPolicyInternal();return r.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await tle(this),r=new nle(t);this.tenantId===null?this._projectPasswordPolicy=r:this._tenantPasswordPolicies[this.tenantId]=r}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new By("auth","Firebase",t())}onAuthStateChanged(t,r,n){return this.registerStateListener(this.authStateSubscription,t,r,n)}beforeAuthStateChanged(t,r){return this.beforeStateQueue.pushCallback(t,r)}onIdTokenChanged(t,r,n){return this.registerStateListener(this.idTokenSubscription,t,r,n)}authStateReady(){return new Promise((t,r)=>{if(this.currentUser)t();else{const n=this.onAuthStateChanged(()=>{n(),t()},r)}})}async revokeAccessToken(t){if(this.currentUser){const r=await this.currentUser.getIdToken(),n={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:r};this.tenantId!=null&&(n.tenantId=this.tenantId),await Joe(this,n)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}async _setRedirectUser(t,r){const n=await this.getOrInitRedirectPersistenceManager(r);return t===null?n.removeCurrentUser():n.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const r=t&&Dl(t)||this._popupRedirectResolver;tr(r,this,"argument-error"),this.redirectPersistenceManager=await xm.create(this,[Dl(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var r,n;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)===null||r===void 0?void 0:r._redirectEventId)===t?this._currentUser:((n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=(r=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&r!==void 0?r:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,r,n,a){if(this._deleted)return()=>{};const i=typeof r=="function"?r:r.next.bind(r);let o=!1;const l=this._isInitialized?Promise.resolve():this._initializationPromise;if(tr(l,this,"internal-error"),l.then(()=>{o||i(this.currentUser)}),typeof r=="function"){const c=t.addObserver(r,n,a);return()=>{o=!0,c()}}else{const c=t.addObserver(r);return()=>{o=!0,c()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return tr(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=zB(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const r={"X-Client-Version":this.clientVersion};this.app.options.appId&&(r["X-Firebase-gmpid"]=this.app.options.appId);const n=await((t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader());n&&(r["X-Firebase-Client"]=n);const a=await this._getAppCheckToken();return a&&(r["X-Firebase-AppCheck"]=a),r}async _getAppCheckToken(){var t;const r=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken());return r!=null&&r.error&&_oe(`Error while retrieving App Check token: ${r.error}`),r==null?void 0:r.token}}function yc(e){return es(e)}class s3{constructor(t){this.auth=t,this.observer=null,this.addObserver=jie(r=>this.observer=r)}get next(){return tr(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
798 * @license
799 * Copyright 2020 Google LLC
800 *
801 * Licensed under the Apache License, Version 2.0 (the "License");
802 * you may not use this file except in compliance with the License.
803 * You may obtain a copy of the License at
804 *
805 *   http://www.apache.org/licenses/LICENSE-2.0
806 *
807 * Unless required by applicable law or agreed to in writing, software
808 * distributed under the License is distributed on an "AS IS" BASIS,
809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
810 * See the License for the specific language governing permissions and
811 * limitations under the License.
812 */let s2={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function sle(e){s2=e}function BB(e){return s2.loadJS(e)}function ile(){return s2.recaptchaEnterpriseScript}function ole(){return s2.gapiScript}function lle(e){return`__${e}${Math.floor(Math.random()*1e6)}`}const cle="recaptcha-enterprise",ule="NO_RECAPTCHA";class dle{constructor(t){this.type=cle,this.auth=yc(t)}async verify(t="verify",r=!1){async function n(i){if(!r){if(i.tenantId==null&&i._agentRecaptchaConfig!=null)return i._agentRecaptchaConfig.siteKey;if(i.tenantId!=null&&i._tenantRecaptchaConfigs[i.tenantId]!==void 0)return i._tenantRecaptchaConfigs[i.tenantId].siteKey}return new Promise(async(o,l)=>{Voe(i,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)l(new Error("recaptcha Enterprise site key undefined"));else{const u=new Uoe(c);return i.tenantId==null?i._agentRecaptchaConfig=u:i._tenantRecaptchaConfigs[i.tenantId]=u,o(u.siteKey)}}).catch(c=>{l(c)})})}function a(i,o,l){const c=window.grecaptcha;e3(c)?c.enterprise.ready(()=>{c.enterprise.execute(i,{action:t}).then(u=>{o(u)}).catch(()=>{o(ule)})}):l(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((i,o)=>{n(this.auth).then(l=>{if(!r&&e3(window.grecaptcha))a(l,i,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=ile();c.length!==0&&(c+=l),BB(c).then(()=>{a(l,i,o)}).catch(u=>{o(u)})}}).catch(l=>{o(l)})})}}async function i3(e,t,r,n=!1){const a=new dle(e);let i;try{i=await a.verify(r)}catch{i=await a.verify(r,!0)}const o=Object.assign({},t);return n?Object.assign(o,{captchaResp:i}):Object.assign(o,{captchaResponse:i}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function ik(e,t,r,n){var a;if(!((a=e._getRecaptchaConfig())===null||a===void 0)&&a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await i3(e,t,r,r==="getOobCode");return n(e,i)}else return n(e,t).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await i3(e,t,r,r==="getOobCode");return n(e,o)}else return Promise.reject(i)})}/**
813 * @license
814 * Copyright 2020 Google LLC
815 *
816 * Licensed under the Apache License, Version 2.0 (the "License");
817 * you may not use this file except in compliance with the License.
818 * You may obtain a copy of the License at
819 *
820 *   http://www.apache.org/licenses/LICENSE-2.0
821 *
822 * Unless required by applicable law or agreed to in writing, software
823 * distributed under the License is distributed on an "AS IS" BASIS,
824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
825 * See the License for the specific language governing permissions and
826 * limitations under the License.
827 */function fle(e,t){const r=II(e,"auth");if(r.isInitialized()){const a=r.getImmediate(),i=r.getOptions();if(Lx(i,t??{}))return a;Ri(a,"already-initialized")}return r.initialize({options:t})}function mle(e,t){const r=(t==null?void 0:t.persistence)||[],n=(Array.isArray(r)?r:[r]).map(Dl);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(n,t==null?void 0:t.popupRedirectResolver)}function hle(e,t,r){const n=yc(e);tr(n._canInitEmulator,n,"emulator-config-failed"),tr(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");const a=!1,i=UB(t),{host:o,port:l}=ple(t),c=l===null?"":`:${l}`;n.config.emulator={url:`${i}//${o}${c}/`},n.settings.appVerificationDisabledForTesting=!0,n.emulatorConfig=Object.freeze({host:o,port:l,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:a})}),gle()}function UB(e){const t=e.indexOf(":");
827return t<0?"":e.substr(0,t+1)}function ple(e){const t=UB(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};const n=r[2].split("@").pop()||"",a=/^(\[[^\]]+\])(:|$)/.exec(n);if(a){const i=a[1];return{host:i,port:o3(n.substr(i.length+1))}}else{const[i,o]=n.split(":");return{host:i,port:o3(o)}}}function o3(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function gle(){function e(){const t=document.createElement("p"),r=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
828 * @license
829 * Copyright 2020 Google LLC
830 *
831 * Licensed under the Apache License, Version 2.0 (the "License");
832 * you may not use this file except in compliance with the License.
833 * You may obtain a copy of the License at
834 *
835 *   http://www.apache.org/licenses/LICENSE-2.0
836 *
837 * Unless required by applicable law or agreed to in writing, software
838 * distributed under the License is distributed on an "AS IS" BASIS,
839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
840 * See the License for the specific language governing permissions and
841 * limitations under the License.
842 */class DI{constructor(t,r){this.providerId=t,this.signInMethod=r}toJSON(){return _l("not implemented")}_getIdTokenResponse(t){return _l("not implemented")}_linkToIdToken(t,r){return _l("not implemented")}_getReauthenticationResolver(t){return _l("not implemented")}}async function yle(e,t){return fl(e,"POST","/v1/accounts:signUp",t)}/**
843 * @license
844 * Copyright 2020 Google LLC
845 *
846 * Licensed under the Apache License, Version 2.0 (the "License");
847 * you may not use this file except in compliance with the License.
848 * You may obtain a copy of the License at
849 *
850 *   http://www.apache.org/licenses/LICENSE-2.0
851 *
852 * Unless required by applicable law or agreed to in writing, software
853 * distributed under the License is distributed on an "AS IS" BASIS,
854 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
855 * See the License for the specific language governing permissions and
856 * limitations under the License.
857 */async function ble(e,t){return Jh(e,"POST","/v1/accounts:signInWithPassword",dl(e,t))}async function vle(e,t){return fl(e,"POST","/v1/accounts:sendOobCode",dl(e,t))}async function xle(e,t){return vle(e,t)}/**
858 * @license
859 * Copyright 2020 Google LLC
860 *
861 * Licensed under the Apache License, Version 2.0 (the "License");
862 * you may not use this file except in compliance with the License.
863 * You may obtain a copy of the License at
864 *
865 *   http://www.apache.org/licenses/LICENSE-2.0
866 *
867 * Unless required by applicable law or agreed to in writing, software
868 * distributed under the License is distributed on an "AS IS" BASIS,
869 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
870 * See the License for the specific language governing permissions and
871 * limitations under the License.
872 */async function wle(e,t){return Jh(e,"POST","/v1/accounts:signInWithEmailLink",dl(e,t))}async function jle(e,t){return Jh(e,"POST","/v1/accounts:signInWithEmailLink",dl(e,t))}/**
873 * @license
874 * Copyright 2020 Google LLC
875 *
876 * Licensed under the Apache License, Version 2.0 (the "License");
877 * you may not use this file except in compliance with the License.
878 * You may obtain a copy of the License at
879 *
880 *   http://www.apache.org/licenses/LICENSE-2.0
881 *
882 * Unless required by applicable law or agreed to in writing, software
883 * distributed under the License is distributed on an "AS IS" BASIS,
884 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
885 * See the License for the specific language governing permissions and
886 * limitations under the License.
887 */class d0 extends DI{constructor(t,r,n,a=null){super("password",n),this._email=t,this._password=r,this._tenantId=a}static _fromEmailAndPassword(t,r){return new d0(t,r,"password")}static _fromEmailAndCode(t,r,n=null){return new d0(t,r,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const r=typeof t=="string"?JSON.parse(t):t;if(r!=null&&r.email&&(r!=null&&r.password)){if(r.signInMethod==="password")return this._fromEmailAndPassword(r.email,r.password);if(r.signInMethod==="emailLink")return this._fromEmailAndCode(r.email,r.password,r.tenantId)}return null}async _getIdTokenResponse(t){switch(this.signInMethod){case"password":const r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ik(t,r,"signInWithPassword",ble);case"emailLink":return wle(t,{email:this._email,oobCode:this._password});default:Ri(t,"internal-error")}}async _linkToIdToken(t,r){switch(this.signInMethod){case"password":const n={idToken:r,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ik(t,n,"signUpPassword",yle);case"emailLink":return jle(t,{idToken:r,email:this._email,oobCode:this._password});default:Ri(t,"internal-error")}}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}/**
888 * @license
889 * Copyright 2020 Google LLC
890 *
891 * Licensed under the Apache License, Version 2.0 (the "License");
892 * you may not use this file except in compliance with the License.
893 * You may obtain a copy of the License at
894 *
895 *   http://www.apache.org/licenses/LICENSE-2.0
896 *
897 * Unless required by applicable law or agreed to in writing, software
898 * distributed under the License is distributed on an "AS IS" BASIS,
899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
900 * See the License for the specific language governing permissions and
901 * limitations under the License.
902 */async function wm(e,t){return Jh(e,"POST","/v1/accounts:signInWithIdp",dl(e,t))}/**
903 * @license
904 * Copyright 2020 Google LLC
905 *
906 * Licensed under the Apache License, Version 2.0 (the "License");
907 * you may not use this file except in compliance with the License.
908 * You may obtain a copy of the License at
909 *
910 *   http://www.apache.org/licenses/LICENSE-2.0
911 *
912 * Unless required by applicable law or agreed to in writing, software
913 * distributed under the License is distributed on an "AS IS" BASIS,
914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
915 * See the License for the specific language governing permissions and
916 * limitations under the License.
917 */const Nle="http://localhost";class Zd extends DI{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const r=new Zd(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(r.idToken=t.idToken),t.accessToken&&(r.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(r.nonce=t.nonce),t.pendingToken&&(r.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(r.accessToken=t.oauthToken,r.secret=t.oauthTokenSecret):Ri("argument-error"),r}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
917once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const r=typeof t=="string"?JSON.parse(t):t,{providerId:n,signInMethod:a}=r,i=EI(r,["providerId","signInMethod"]);if(!n||!a)return null;const o=new Zd(n,a);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(t){const r=this.buildRequest();return wm(t,r)}_linkToIdToken(t,r){const n=this.buildRequest();return n.idToken=r,wm(t,n)}_getReauthenticationResolver(t){const r=this.buildRequest();return r.autoCreate=!1,wm(t,r)}buildRequest(){const t={requestUri:Nle,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),t.postBody=Uy(r)}return t}}/**
918 * @license
919 * Copyright 2020 Google LLC
920 *
921 * Licensed under the Apache License, Version 2.0 (the "License");
922 * you may not use this file except in compliance with the License.
923 * You may obtain a copy of the License at
924 *
925 *   http://www.apache.org/licenses/LICENSE-2.0
926 *
927 * Unless required by applicable law or agreed to in writing, software
928 * distributed under the License is distributed on an "AS IS" BASIS,
929 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
930 * See the License for the specific language governing permissions and
931 * limitations under the License.
932 */function Sle(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Cle(e){const t=Cg(kg(e)).link,r=t?Cg(kg(t)).deep_link_id:null,n=Cg(kg(e)).deep_link_id;return(n?Cg(kg(n)).link:null)||n||r||t||e}class OI{constructor(t){var r,n,a,i,o,l;const c=Cg(kg(t)),u=(r=c.apiKey)!==null&&r!==void 0?r:null,d=(n=c.oobCode)!==null&&n!==void 0?n:null,f=Sle((a=c.mode)!==null&&a!==void 0?a:null);tr(u&&d&&f,"argument-error"),this.apiKey=u,this.operation=f,this.code=d,this.continueUrl=(i=c.continueUrl)!==null&&i!==void 0?i:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(l=c.tenantId)!==null&&l!==void 0?l:null}static parseLink(t){const r=Cle(t);try{return new OI(r)}catch{return null}}}/**
933 * @license
934 * Copyright 2020 Google LLC
935 *
936 * Licensed under the Apache License, Version 2.0 (the "License");
937 * you may not use this file except in compliance with the License.
938 * You may obtain a copy of the License at
939 *
940 *   http://www.apache.org/licenses/LICENSE-2.0
941 *
942 * Unless required by applicable law or agreed to in writing, software
943 * distributed under the License is distributed on an "AS IS" BASIS,
944 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
945 * See the License for the specific language governing permissions and
946 * limitations under the License.
947 */class Zh{constructor(){this.providerId=Zh.PROVIDER_ID}static credential(t,r){return d0._fromEmailAndPassword(t,r)}static credentialWithLink(t,r){const n=OI.parseLink(r);return tr(n,"argument-error"),d0._fromEmailAndCode(t,n.code,n.tenantId)}}Zh.PROVIDER_ID="password";Zh.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Zh.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
948 * @license
949 * Copyright 2020 Google LLC
950 *
951 * Licensed under the Apache License, Version 2.0 (the "License");
952 * you may not use this file except in compliance with the License.
953 * You may obtain a copy of the License at
954 *
955 *   http://www.apache.org/licenses/LICENSE-2.0
956 *
957 * Unless required by applicable law or agreed to in writing, software
958 * distributed under the License is distributed on an "AS IS" BASIS,
959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
960 * See the License for the specific language governing permissions and
961 * limitations under the License.
962 */class RI{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
963 * @license
964 * Copyright 2019 Google LLC
965 *
966 * Licensed under the Apache License, Version 2.0 (the "License");
967 * you may not use this file except in compliance with the License.
968 * You may obtain a copy of the License at
969 *
970 *   http://www.apache.org/licenses/LICENSE-2.0
971 *
972 * Unless required by applicable law or agreed to in writing, software
973 * distributed under the License is distributed on an "AS IS" BASIS,
974 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
975 * See the License for the specific language governing permissions and
976 * limitations under the License.
977 */class Wy extends RI{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
978 * @license
979 * Copyright 2020 Google LLC
980 *
981 * Licensed under the Apache License, Version 2.0 (the "License");
982 * you may not use this file except in compliance with the License.
983 * You may obtain a copy of the License at
984 *
985 *   http://www.apache.org/licenses/LICENSE-2.0
986 *
987 * Unless required by applicable law or agreed to in writing, software
988 * distributed under the License is distributed on an "AS IS" BASIS,
989 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
990 * See the License for the specific language governing permissions and
991 * limitations under the License.
992 */class Vc extends Wy{constructor(){super("facebook.com")}static credential(t){return Zd._fromParams({providerId:Vc.PROVIDER_ID,signInMethod:Vc.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Vc.credentialFromTaggedObject(t)}static credentialFromError(t){return Vc.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Vc.credential(t.oauthAccessToken)}catch{return null}}}Vc.FACEBOOK_SIGN_IN_METHOD="facebook.com";Vc.PROVIDER_ID="facebook.com";/**
993 * @license
994 * Copyright 2020 Google LLC
995 *
996 * Licensed under the Apache License, Version 2.0 (the "License");
997 * you may not use this file except in compliance with the License.
998 * You may obtain a copy of the License at
999 *
1000 *   http://www.apache.org/licenses/LICENSE-2.0
1001 *
1002 * Unless required by applicable law or agreed to in writing, software
1003 * distributed under the License is distributed on an "AS IS" BASIS,
1004 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1005 * See the License for the specific language governing permissions and
1006 * limitations under the License.
1007 */class Fo extends Wy{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return Zd._fromParams({providerId:Fo.PROVIDER_ID,signInMethod:Fo.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return Fo.credentialFromTaggedObject(t)}static credentialFromError(t){return Fo.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:n}=t;if(!r&&!n)return null;try{return Fo.credential(r,n)}catch{return null}}}Fo.GOOGLE_SIGN_IN_METHOD="google.com";Fo.PROVIDER_ID="google.com";/**
1008 * @license
1009 * Copyright 2020 Google LLC
1010 *
1011 * Licensed under the Apache License, Version 2.0 (the "License");
1012 * you may not use this file except in compliance with the License.
1013 * You may obtain a copy of the License at
1014 *
1015 *   http://www.apache.org/licenses/LICENSE-2.0
1016 *
1017 * Unless required by applicable law or agreed to in writing, software
1018 * distributed under the License is distributed on an "AS IS" BASIS,
1019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1020 * See the License for the specific language governing permissions and
1021 * limitations under the License.
1022 */class Wc extends Wy{constructor(){super("github.com")}static credential(t){return Zd._fromParams({providerId:Wc.PROVIDER_ID,signInMethod:Wc.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Wc.credentialFromTaggedObject(t)}static credentialFromError(t){return Wc.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Wc.credential(t.oauthAccessToken)}catch{return null}}}Wc.GITHUB_SIGN_IN_METHOD="github.com";Wc.PROVIDER_ID="github.com";/**
1023 * @license
1024 * Copyright 2020 Google LLC
1025 *
1026 * Licensed under the Apache License, Version 2.0 (the "License");
1027 * you may not use this file except in compliance with the License.
1028 * You may obtain a copy of the License at
1029 *
1030 *   http://www.apache.org/licenses/LICENSE-2.0
1031 *
1032 * Unless required by applicable law or agreed to in writing, software
1033 * distributed under the License is distributed on an "AS IS" BASIS,
1034 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1035 * See the License for the specific language governing permissions and
1036 * limitations under the License.
1037 */class qc extends Wy{constructor(){super("twitter.com")}static credential(t,r){return Zd._fromParams({providerId:qc.PROVIDER_ID,signInMethod:qc.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return qc.credentialFromTaggedObject(t)}static credentialFromError(t){return qc.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:r,oauthTokenSecret:n}=t;if(!r||!n)return null;try{return qc.credential(r,n)}catch{return null}}}qc.TWITTER_SIGN_IN_METHOD="twitter.com";qc.PROVIDER_ID="twitter.com";/**
1038 * @license
1039 * Copyright 2020 Google LLC
1040 *
1041 * Licensed under the Apache License, Version 2.0 (the "License");
1042 * you may not use this file except in compliance with the License.
1043 * You may obtain a copy of the License at
1044 *
1045 *   http://www.apache.org/licenses/LICENSE-2.0
1046 *
1047 * Unless required by applicable law or agreed to in writing, software
1048 * distributed under the License is distributed on an "AS IS" BASIS,
1049 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1050 * See the License for the specific language governing permissions and
1051 * limitations under the License.
1052 */async function kle(e,t){return Jh(e,"POST","/v1/accounts:signUp",dl(e,t))}/**
1053 * @license
1054 * Copyright 2020 Google LLC
1055 *
1056 * Licensed under the Apache License, Version 2.0 (the "License");
1057 * you may not use this file except in compliance with the License.
1058 * You may obtain a copy of the License at
1059 *
1060 *   http://www.apache.org/licenses/LICENSE-2.0
1061 *
1062 * Unless required by applicable law or agreed to in writing, software
1063 * distributed under the License is distributed on an "AS IS" BASIS,
1064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1065 * See the License for the specific language governing permissions and
1066 * limitations under the License.
1067 */class Su{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,r,n,a=!1){const i=await Ll._fromIdTokenResponse(t,n,a),o=l3(n);return new Su({user:i,providerId:o,_tokenResponse:n,operationType:r})}static async _forOperation(t,r,n){await t._updateTokensIfNecessary(n,!0);const a=l3(n);return new Su({user:t,providerId:a,_tokenResponse:n,operationType:r})}}function l3(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1068 * @license
1069 * Copyright 2020 Google LLC
1070 *
1071 * Licensed under the Apache License, Version 2.0 (the "License");
1072 * you may not use this file except in compliance with the License.
1073 * You may obtain a copy of the License at
1074 *
1075 *   http://www.apache.org/licenses/LICENSE-2.0
1076 *
1077 * Unless required by applicable law or agreed to in writing, software
1078 * distributed under the License is distributed on an "AS IS" BASIS,
1079 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1080 * See the License for the specific language governing permissions and
1081 * limitations under the License.
1082 */class $x extends gc{constructor(t,r,n,a){var i;super(r.code,r.message),this.operationType=n,this.user=a,Object.setPrototypeOf(this,$x.prototype),this.customData={appName:t.name,tenantId:(i=t.tenantId)!==null&&i!==void 0?i:void 0,_serverResponse:r.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(t,r,n,a){return new $x(t,r,n,a)}}function VB(e,t,r,n){return(t==="reauthenticate"?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?$x._fromErrorAndOperation(e,i,t,n):i})}async function Mle(e,t,r=!1){const n=await Xm(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return Su._forOperation(e,"link",n)}/**
1083 * @license
1084 * Copyright 2019 Google LLC
1085 *
1086 * Licensed under the Apache License, Version 2.0 (the "License");
1087 * you may not use this file except in compliance with the License.
1088 * You may obtain a copy of the License at
1089 *
1090 *   http://www.apache.org/licenses/LICENSE-2.0
1091 *
1092 * Unless required by applicable law or agreed to in writing, software
1093 * distributed under the License is distributed on an "AS IS" BASIS,
1094 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1095 * See the License for the specific language governing permissions and
1096 * limitations under the License.
1097 */async function Ile(e,t,r=!1){const{auth:n}=e;if(Ii(n.app))return Promise.reject(Yo(n));const a="reauthenticate";try{const i=await Xm(e,VB(n,a,t,e),r);tr(i.idToken,n,"internal-error");const o=_I(i.idToken);tr(o,n,"internal-error");const{sub:l}=o;return tr(e.uid===l,n,"user-mismatch"),Su._forOperation(e,a,i)}catch(i){throw(i==null?void 0:i.code)==="auth/user-not-found"&&Ri(n,"user-mismatch"),i}}/**
1098 * @license
1099 * Copyright 2020 Google LLC
1100 *
1101 * Licensed under the Apache License, Version 2.0 (the "License");
1102 * you may not use this file except in compliance with the License.
1103 * You may obtain a copy of the License at
1104 *
1105 *   http://www.apache.org/licenses/LICENSE-2.0
1106 *
1107 * Unless required by applicable law or agreed to in writing, software
1108 * distributed under the License is distributed on an "AS IS" BASIS,
1109 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1110 * See the License for the specific language governing permissions and
1111 * limitations under the License.
1112 */async function WB(e,t,r=!1){if(Ii(e.app))return Promise.reject(Yo(e));const n="signIn",a=await VB(e,n,t),i=await Su._fromIdTokenResponse(e,n,a);return r||await e._updateCurrentUser(i.user),i}async function Ele(e,t){return WB(yc(e),t)}/**
1113 * @license
1114 * Copyright 2020 Google LLC
1115 *
1116 * Licensed under the Apache License, Version 2.0 (the "License");
1117 * you may not use this file except in compliance with the License.
1118 * You may obtain a copy of the License at
1119 *
1120 *   http://www.apache.org/licenses/LICENSE-2.0
1121 *
1122 * Unless required by applicable law or agreed to in writing, software
1123 * distributed under the License is distributed on an "AS IS" BASIS,
1124 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1125 * See the License for the specific language governing permissions and
1126 * limitations under the License.
1127 */async function Tle(e,t){return Jh(e,"POST","/v1/accounts:signInWithCustomToken",dl(e,t))}/**
1128 * @license
1129 * Copyright 2020 Google LLC
1130 *
1131 * Licensed under the Apache License, Version 2.0 (the "License");
1132 * you may not use this file except in compliance with the License.
1133 * You may obtain a copy of the License at
1134 *
1135 *   http://www.apache.org/licenses/LICENSE-2.0
1136 *
1137 * Unless required by applicable law or agreed to in writing, software
1138 * distributed under the License is distributed on an "AS IS" BASIS,
1139 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1140 * See the License for the specific language governing permissions and
1141 * limitations under the License.
1142 */async function Ale(e,t){if(Ii(e.app))return Promise.reject(Yo(e));const r=yc(e),n=await Tle(r,{token:t,returnSecureToken:!0}),a=await Su._fromIdTokenResponse(r,"signIn",n);return await r._updateCurrentUser(a.user),a}/**
1143 * @license
1144 * Copyright 2020 Google LLC
1145 *
1146 * Licensed under the Apache License, Version 2.0 (the "License");
1147 * you may not use this file except in compliance with the License.
1148 * You may obtain a copy of the License at
1149 *
1150 *   http://www.apache.org/licenses/LICENSE-2.0
1151 *
1152 * Unless required by applicable law or agreed to in writing, software
1153 * distributed under the License is distributed on an "AS IS" BASIS,
1154 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1155 * See the License for the specific language governing permissions and
1156 * limitations under the License.
1157 */async function qB(e){const t=yc(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function Ple(e,t,r){if(Ii(e.app))return Promise.reject(Yo(e));const n=yc(e),o=await ik(n,{returnSecureToken:!0,email:t,password:r,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",kle).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&qB(e),c}),l=await Su._fromIdTokenResponse(n,"signIn",o);return await n._updateCurrentUser(l.user),l}function _le(e,t,r){return Ii(e.app)?Promise.reject(Yo(e)):Ele(es(e),Zh.credential(t,r)).catch(async n=>{throw n.code==="auth/password-does-not-meet-requirements"&&qB(e),n})}async function GB(e,t){const r=es(e),a={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()},{email:i}=await xle(r.auth,a);i!==e.email&&await e.reload()}/**
1158 * @license
1159 * Copyright 2020 Google LLC
1160 *
1161 * Licensed under the Apache License, Version 2.0 (the "License");
1162 * you may not use this file except in compliance with the License.
1163 * You may obtain a copy of the License at
1164 *
1165 *   http://www.apache.org/licenses/LICENSE-2.0
1166 *
1167 * Unless required by applicable law or agreed to in writing, software
1168 * distributed under the License is distributed on an "AS IS" BASIS,
1169 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170 * See the License for the specific language governing permissions and
1171 * limitations under the License.
1172 */async function Lle(e,t){return fl(e,"POST","/v1/accounts:update",t)}/**
1173 * @license
1174 * Copyright 2020 Google LLC
1175 *
1176 * Licensed under the Apache License, Version 2.0 (the "License");
1177 * you may not use this file except in compliance with the License.
1178 * You may obtain a copy of the License at
1179 *
1180 *   http://www.apache.org/licenses/LICENSE-2.0
1181 *
1182 * Unless required by applicable law or agreed to in writing, software
1183 * distributed under the License is distributed on an "AS IS" BASIS,
1184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1185 * See the License for the specific language governing permissions and
1186 * limitations under the License.
1187 */async function ok(e,{displayName:t,photoURL:r}){if(t===void 0&&r===void 0)return;const n=es(e),i={idToken:await n.getIdToken(),displayName:t,photoUrl:r,returnSecureToken:!0},o=await Xm(n,Lle(n.auth,i));n.displayName=o.displayName||null,n.photoURL=o.photoUrl||null;const l=n.providerData.find(({providerId:c})=>c==="password");l&&(l.displayName=n.displayName,l.photoURL=n.photoURL),await n._updateTokensIfNecessary(o)}function Dle(e,t,r,n){return es(e).onIdTokenChanged(t,r,n)}function Ole(e,t,r){return es(e).beforeAuthStateChanged(t,r)}function Rle(e,t,r,n){return es(e).onAuthStateChanged(t,r,n)}const Fx="__sak";/**
1188 * @license
1189 * Copyright 2019 Google LLC
1190 *
1191 * Licensed under the Apache License, Version 2.0 (the "License");
1192 * you may not use this file except in compliance with the License.
1193 * You may obtain a copy of the License at
1194 *
1195 *   http://www.apache.org/licenses/LICENSE-2.0
1196 *
1197 * Unless required by applicable law or agreed to in writing, software
1198 * distributed under the License is distributed on an "AS IS" BASIS,
1199 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1200 * See the License for the specific language governing permissions and
1201 * limitations under the License.
1202 */class HB{constructor(t,r){this.storageRetriever=t,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(Fx,"1"),this.storage.removeItem(Fx),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,r){return this.storage.setItem(t,JSON.stringify(r)),Promise.resolve()}_get(t){const r=this.storage.getItem(t);return Promise.resolve(r?JSON.parse(r):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1203 * @license
1204 * Copyright 2020 Google LLC
1205 *
1206 * Licensed under the Apache License, Version 2.0 (the "License");
1207 * you may not use this file except in compliance with the License.
1208 * You may obtain a copy of the License at
1209 *
1210 *   http://www.apache.org/licenses/LICENSE-2.0
1211 *
1212 * Unless required by applicable law or agreed to in writing, software
1213 * distributed under the License is distributed on an "AS IS" BASIS,
1214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1215 * See the License for the specific language governing permissions and
1216 * limitations under the License.
1217 */const $le=1e3,Fle=10;class YB extends HB{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=FB(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const n=this.storage.getItem(r),a=this.localCache[r];n!==a&&t(r,a,n)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((o,l,c)=>{this.notifyListeners(o,c)});return}const n=t.key;r?this.detachListener():this.stopPolling();const a=()=>{const o=this.storage.getItem(n);!r&&this.localCache[n]===o||this.notifyListeners(n,o)},i=this.storage.getItem(n);Xoe()&&i!==t.newValue&&t.newValue!==t.oldValue?setTimeout(a,Fle):a()}notifyListeners(t,r){this.localCache[t]=r;const n=this.listeners[t];if(n)for(const a of Array.from(n))a(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:n}),!0)})},$le)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,r){await super._set(t,r),this.localCache[t]=JSON.stringify(r)}async _get(t){const r=await super._get(t);return this.localCache[t]=JSON.stringify(r),r}async _remove(t){await super._remove(t),delete this.localCache[t]}}YB.type="LOCAL";const zle=YB;/**
1218 * @license
1219 * Copyright 2020 Google LLC
1220 *
1221 * Licensed under the Apache License, Version 2.0 (the "License");
1222 * you may not use this file except in compliance with the License.
1223 * You may obtain a copy of the License at
1224 *
1225 *   http://www.apache.org/licenses/LICENSE-2.0
1226 *
1227 * Unless required by applicable law or agreed to in writing, software
1228 * distributed under the License is distributed on an "AS IS" BASIS,
1229 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1230 * See the License for the specific language governing permissions and
1231 * limitations under the License.
1232 */class QB extends HB{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}QB.type="SESSION";const KB=QB;/**
1233 * @license
1234 * Copyright 2019 Google LLC
1235 *
1236 * Licensed under the Apache License, Version 2.0 (the "License");
1237 * you may not use this file except in compliance with the License.
1238 * You may obtain a copy of the License at
1239 *
1240 *   http://www.apache.org/licenses/LICENSE-2.0
1241 *
1242 * Unless required by applicable law or agreed to in writing, software
1243 * distributed under the License is distributed on an "AS IS" BASIS,
1244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1245 * See the License for the specific language governing permissions and
1246 * limitations under the License.
1247 */function Ble(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
1248 * @license
1249 * Copyright 2019 Google LLC
1250 *
1251 * Licensed under the Apache License, Version 2.0 (the "License");
1252 * you may not use this file except in compliance with the License.
1253 * You may obtain a copy of the License at
1254 *
1255 *   http://www.apache.org/licenses/LICENSE-2.0
1256 *
1257 * Unless required by applicable law or agreed to in writing, software
1258 * distributed under the License is distributed on an "AS IS" BASIS,
1259 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1260 * See the License for the specific language governing permissions and
1261 * limitations under the License.
1262 */class i2{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(a=>a.isListeningto(t));if(r)return r;const n=new i2(t);return this.receivers.push(n),n}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const r=t,{eventId:n,eventType:a,data:i}=r.data,o=this.handlersMap[a];if(!(o!=null&&o.size))return;r.ports[0].postMessage({status:"ack",eventId:n,eventType:a});const l=Array.from(o).map(async u=>u(r.origin,i)),c=await Ble(l);r.ports[0].postMessage({status:"done",eventId:n,eventType:a,response:c})}_subscribe(t,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}i2.receivers=[];/**
1263 * @license
1264 * Copyright 2020 Google LLC
1265 *
1266 * Licensed under the Apache License, Version 2.0 (the "License");
1267 * you may not use this file except in compliance with the License.
1268 * You may obtain a copy of the License at
1269 *
1270 *   http://www.apache.org/licenses/LICENSE-2.0
1271 *
1272 * Unless required by applicable law or agreed to in writing, software
1273 * distributed under the License is distributed on an "AS IS" BASIS,
1274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1275 * See the License for the specific language governing permissions and
1276 * limitations under the License.
1277 */function $I(e="",t=10){let r="";for(let n=0;n<t;n++)r+=Math.floor(Math.random()*10);return e+r}/**
1278 * @license
1279 * Copyright 2019 Google LLC
1280 *
1281 * Licensed under the Apache License, Version 2.0 (the "License");
1282 * you may not use this file except in compliance with the License.
1283 * You may obtain a copy of the License at
1284 *
1285 *   http://www.apache.org/licenses/LICENSE-2.0
1286 *
1287 * Unless required by applicable law or agreed to in writing, softw
1287are
1288 * distributed under the License is distributed on an "AS IS" BASIS,
1289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1290 * See the License for the specific language governing permissions and
1291 * limitations under the License.
1292 */class Ule{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,r,n=50){const a=typeof MessageChannel<"u"?new MessageChannel:null;if(!a)throw new Error("connection_unavailable");let i,o;return new Promise((l,c)=>{const u=$I("",20);a.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},n);o={messageChannel:a,onMessage(f){const m=f;if(m.data.eventId===u)switch(m.data.status){case"ack":clearTimeout(d),i=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),l(m.data.response);break;default:clearTimeout(d),clearTimeout(i),c(new Error("invalid_response"));break}}},this.handlers.add(o),a.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:t,eventId:u,data:r},[a.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1293 * @license
1294 * Copyright 2020 Google LLC
1295 *
1296 * Licensed under the Apache License, Version 2.0 (the "License");
1297 * you may not use this file except in compliance with the License.
1298 * You may obtain a copy of the License at
1299 *
1300 *   http://www.apache.org/licenses/LICENSE-2.0
1301 *
1302 * Unless required by applicable law or agreed to in writing, software
1303 * distributed under the License is distributed on an "AS IS" BASIS,
1304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1305 * See the License for the specific language governing permissions and
1306 * limitations under the License.
1307 */function Qo(){return window}function Vle(e){Qo().location.href=e}/**
1308 * @license
1309 * Copyright 2020 Google LLC.
1310 *
1311 * Licensed under the Apache License, Version 2.0 (the "License");
1312 * you may not use this file except in compliance with the License.
1313 * You may obtain a copy of the License at
1314 *
1315 *   http://www.apache.org/licenses/LICENSE-2.0
1316 *
1317 * Unless required by applicable law or agreed to in writing, software
1318 * distributed under the License is distributed on an "AS IS" BASIS,
1319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320 * See the License for the specific language governing permissions and
1321 * limitations under the License.
1322 */function JB(){return typeof Qo().WorkerGlobalScope<"u"&&typeof Qo().importScripts=="function"}async function Wle(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function qle(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function Gle(){return JB()?self:null}/**
1323 * @license
1324 * Copyright 2019 Google LLC
1325 *
1326 * Licensed under the Apache License, Version 2.0 (the "License");
1327 * you may not use this file except in compliance with the License.
1328 * You may obtain a copy of the License at
1329 *
1330 *   http://www.apache.org/licenses/LICENSE-2.0
1331 *
1332 * Unless required by applicable law or agreed to in writing, software
1333 * distributed under the License is distributed on an "AS IS" BASIS,
1334 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1335 * See the License for the specific language governing permissions and
1336 * limitations under the License.
1337 */const ZB="firebaseLocalStorageDb",Hle=1,zx="firebaseLocalStorage",XB="fbase_key";class qy{constructor(t){this.request=t}toPromise(){return new Promise((t,r)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function o2(e,t){return e.transaction([zx],t?"readwrite":"readonly").objectStore(zx)}function Yle(){const e=indexedDB.deleteDatabase(ZB);return new qy(e).toPromise()}function lk(){const e=indexedDB.open(ZB,Hle);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{const n=e.result;try{n.createObjectStore(zx,{keyPath:XB})}catch(a){r(a)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(zx)?t(n):(n.close(),await Yle(),t(await lk()))})})}async function c3(e,t,r){const n=o2(e,!0).put({[XB]:t,value:r});return new qy(n).toPromise()}async function Qle(e,t){const r=o2(e,!1).get(t),n=await new qy(r).toProm
1337ise();return n===void 0?null:n.value}function u3(e,t){const r=o2(e,!0).delete(t);return new qy(r).toPromise()}const Kle=800,Jle=3;class eU{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await lk(),this.db)}async _withRetries(t){let r=0;for(;;)try{const n=await this._openDb();return await t(n)}catch(n){if(r++>Jle)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return JB()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=i2._getInstance(Gle()),this.receiver._subscribe("keyChanged",async(t,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(t,r)=>["keyChanged"])}async initializeSender(){var t,r;if(this.activeServiceWorker=await Wle(),!this.activeServiceWorker)return;this.sender=new Ule(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&!((t=n[0])===null||t===void 0)&&t.fulfilled&&!((r=n[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||qle()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await lk();return await c3(t,Fx,"1"),await u3(t,Fx),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,r){return this._withPendingWrite(async()=>(await this._withRetries(n=>c3(n,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)))}async _get(t){const r=await this._withRetries(n=>Qle(n,t));return this.localCache[t]=r,r}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(r=>u3(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(a=>{const i=o2(a,!1).getAll();return new qy(i).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const r=[],n=new Set;if(t.length!==0)for(const{fbase_key:a,value:i}of t)n.add(a),JSON.stringify(this.localCache[a])!==JSON.stringify(i)&&(this.notifyListeners(a,i),r.push(a));for(const a of Object.keys(this.localCache))this.localCache[a]&&!n.has(a)&&(this.notifyListeners(a,null),r.push(a));return r}notifyListeners(t,r){this.localCache[t]=r;const n=this.listeners[t];if(n)for(const a of Array.from(n))a(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Kle)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}eU.type="LOCAL";const Zle=eU;new Vy(3e4,6e4);/**
1338 * @license
1339 * Copyright 2021 Google LLC
1340 *
1341 * Licensed under the Apache License, Version 2.0 (the "License");
1342 * you may not use this file except in compliance with the License.
1343 * You may obtain a copy of the License at
1344 *
1345 *   http://www.apache.org/licenses/LICENSE-2.0
1346 *
1347 * Unless required by applicable law or agreed to in writing, software
1348 * distributed under the License is distributed on an "AS IS" BASIS,
1349 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1350 * See the License for the specific language governing permissions and
1351 * limitations under the License.
1352 */function tU(e,t){return t?Dl(t):(tr(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1353 * @license
1354 * Copyright 2019 Google LLC
1355 *
1356 * Licensed under the Apache License, Version 2.0 (the "License");
1357 * you may not use this file except in compliance with the License.
1358 * You may obtain a copy of the License at
1359 *
1360 *   http://www.apache.org/licenses/LICENSE-2.0
1361 *
1362 * Unless required by applicable law or agreed to in writing, software
1363 * distributed under the License is distributed on an "AS IS" BASIS,
1364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1365 * See the License for the specific language governing permissions and
1366 * limitations under the License.
1367 */class FI extends DI{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return wm(t,this._buildIdpRequest())}_linkToIdToken(t,r){return wm(t,this._buildIdpRequest(r))}_getReauthenticationResolver(t){return wm(t,this._buildIdpRequest())}_buildIdpRequest(t){const r={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(r.idToken=t),r}}function Xle(e){return WB(e.auth,new FI(e),e.bypassAuthState)}function ece(e){const{auth:t,user:r}=e;return tr(r,t,"internal-error"),Ile(r,new FI(e),e.bypassAuthState)}async function tce(e){const{auth:t,user:r}=e;return tr(r,t,"internal-error"),Mle(r,new FI(e),e.bypassAuthState)}/**
1368 * @license
1369 * Copyright 2020 Google LLC
1370 *
1371 * Licensed under the Apache License, Version 2.0 (the "License");
1372 * you may not use this file except in compliance with the License.
1373 * You may obtain a copy of the License at
1374 *
1375 *   http://www.apache.org/licenses/LICENSE-2.0
1376 *
1377 * Unless required by applicable law or agreed to in writing, software
1378 * distributed under the License is distributed on an "AS IS" BASIS,
1379 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1380 * See the License for the specific language governing permissions and
1381 * limitations under the License.
1382 */class rU{constructor(t,r,n,a,i=!1){this.auth=t,this.resolver=n,this.user=a,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(t,r)=>{this.pendingPromise={resolve:t,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(t){const{urlResponse:r,sessionId:n,postBody:a,tenantId:i,error:o,type:l}=t;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:r,sessionId:n,tenantId:i||void 0,postBody:a||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(l)(c))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return Xle;case"linkViaPopup":case"linkViaRedirect":return tce;case"reauthViaPopup":case"reauthViaRedirect":return ece;default:Ri(this.auth,"internal-error")}}resolve(t){ac(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){ac(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1383 * @license
1384 * Copyright 2020 Google LLC
1385 *
1386 * Licensed under the Apache License, Version 2.0 (the "License");
1387 * you may not use this file except in compliance with the License.
1388 * You may obtain a copy of the License at
1389 *
1390 *   http://www.apache.org/licenses/LICENSE-2.0
1391 *
1392 * Unless required by applicable law or agreed to in writing, software
1393 * distributed under the License is distributed on an "AS IS" BASIS,
1394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1395 * See the License for the specific language governing permissions and
1396 * limitations under the License.
1397 */const rce=new Vy(2e3,1e4);async function nU(e,t,r){if(Ii(e.app))return Promise.reject(po(e,"operation-not-supported-in-this-environment"));const n=yc(e);Loe(e,t,RI);const a=tU(n,r);return new pd(n,"signInViaPopup",t,a).executeNotNull()}class pd extends rU{constructor(t,r,n,a,i){super(t,r,a,i),this.provider=n,this.authWindow=null,this.pollId=null,pd.currentPopupAction&&pd.currentPopupAction.cancel(),pd.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return tr(t,this.auth,"internal-error"),t}async onExecution(){ac(this.filter.length===1,"Popup operations only handle one event");const t=$I();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(po(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(po(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,pd.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,n;if(!((n=(r=this.authWindow)===null||r===void 0?void 0:r.window)===null||n===void 0)&&n.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(po(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,rce.get())};t()}}pd.currentPopupAction=null;/**
1398 * @license
1399 * Copyright 2020 Google LLC
1400 *
1401 * Licensed under the Apache License, Version 2.0 (the "License");
1402 * you may not use this file except in compliance with the License.
1403 * You may obtain a copy of the License at
1404 *
1405 *   http://www.apache.org/licenses/LICENSE-2.0
1406 *
1407 * Unless required by applicable law or agreed to in writing, software
1408 * distributed under the License is distributed on an "AS IS" BASIS,
1409 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1410 * See the License for the specific language governing permissions and
1411 * limitations under the License.
1412 */const nce="pendingRedirect",Bv=new Map;class ace extends rU{constructor(t,r,n=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,n),this.eventId=null}async execute(){let t=Bv.get(this.auth._key());if(!t){try{const n=await sce(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(n)}catch(r){t=()=>Promise.reject(r)}Bv.set(this.auth._key(),t)}return this.bypassAuthState||Bv.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const r=await this.auth._redirectUserForId(t.eventId);if(r)return this.user=r,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function sce(e,t){const r=lce(t),n=oce(e);if(!await n._isAvailable())return!1;const a=await n._get(r)==="true";return await n._remove(r),a}function ice(e,t){Bv.set(e._key(),t)}function oce(e){return Dl(e._redirectPersistence)}function lce(e){return zv(nce,e.config.apiKey,e.name)}async function cce(e,t,r=!1){if(Ii(e.app))return Promise.reject(Yo(e));const n=yc(e),a=tU(n,t),o=await new ace(n,a,r).execute();return o&&!r&&(delete o.user._redirectEventId,await n._persistUserIfCurrent(o.user),await n._setRedirectUser(null,t)),o}/**
1413 * @license
1414 * Copyright 2020 Google LLC
1415 *
1416 * Licensed under the Apache License, Version 2.0 (the "License");
1417 * you may not use this file except in compliance with the License.
1418 * You may obtain a copy of the License at
1419 *
1420 *   http://www.apache.org/licenses/LICENSE-2.0
1421 *
1422 * Unless required by applicable law or agreed to in writing, software
1423 * distributed under the License is distributed on an "AS IS" BASIS,
1424 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1425 * See the License for the specific language governing permissions and
1426 * limitations under the License.
1427 */const uce=10*60*1e3;class dce{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let r=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(t,n)&&(r=!0,this.sendToConsumer(t,n),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!fce(t)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=t,r=!0)),r}sendToConsumer(t,r){var n;if(t.error&&!aU(t)){const a=((n=t.error.code)===null||n===void 0?void 0:n.split("auth/")[1])||"internal-error";r.onError(po(this.auth,a))}else r.onAuthEvent(t)}isEventForConsumer(t,r){const n=r.eventId===null||!!t.eventId&&t.eventId===r.eventId;return r.filter.includes(t.type)&&n}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=uce&&this.cachedEventUids.clear(),this.cachedEventUids.has(d3(t))}saveEventToCache(t){this.cachedEventUids.add(d3(t)),this.lastProcessedEventTime=Date.now()}}function d3(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function aU({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function fce(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return aU(e);default:return!1}}/**
1428 * @license
1429 * Copyright 2020 Google LLC
1430 *
1431 * Licensed under the Apache License, Version 2.0 (the "License");
1432 * you may not use this file except in compliance with the License.
1433 * You may obtain a copy of the License at
1434 *
1435 *   http://www.apache.org/licenses/LICENSE-2.0
1436 *
1437 * Unless required by applicable law or agreed to in writing, software
1438 * distributed under the License is distributed on an "AS IS" BASIS,
1439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1440 * See the License for the specific language governing permissions and
1441 * limitations under the License.
1442 */async function mce(e,t={}){return fl(e,"GET","/v1/projects",t)}/**
1443 * @license
1444 * Copyright 2020 Google LLC
1445 *
1446 * Licensed under the Apache License, Version 2.0 (the "License");
1447 * you may not use this file except in compliance with the License.
1448 * You may obtain a copy of the License at
1449 *
1450 *   http://www.apache.org/licenses/LICENSE-2.0
1451 *
1452 * Unless required by applicable law or agreed to in writing, software
1453 * distributed under the License is distributed on an "AS IS" BASIS,
1454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1455 * See the License for the specific language governing permissions and
1456 * limitations under the License.
1457 */const hce=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,pce=/^https?/;async function gce(e){if(e.config.emulator)return;const{authorizedDomains:t}=await mce(e);for(const r of t)try{if(yce(r))return}catch{}Ri(e,"unauthorized-domain")}function yce(e){const t=ak(),{protocol:r,hostname:n}=new URL(t);if(e.startsWith("chrome-extension://")){const o=new URL(e);return o.hostname===""&&n===""?r==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):r==="chrome-extension:"&&o.hostname===n}if(!pce.test(r))return!1;if(hce.test(e))return n===e;const a=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+a+"|"+a+")$","i").test(n)}/**
1458 * @license
1459 * Copyright 2020 Google LLC.
1460 *
1461 * Licensed under the Apache License, Version 2.0 (the "License");
1462 * you may not use this file except in compliance with the License.
1463 * You may obtain a copy of the License at
1464 *
1465 *   http://www.apache.org/licenses/LICENSE-2.0
1466 *
1467 * Unless required by applicable law or agreed to in writing, software
1468 * distributed under the License is distributed on an "AS IS" BASIS,
1469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1470 * See the License for the specific language governing permissions and
1471 * limitations under the License.
1472 */const bce=new Vy(3e4,6e4);function f3(){const e=Qo().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let r=0;r<e.CP.length;r++)e.CP[r]=null}}function vce(e){return new Promise((t,r)=>{var n,a,i;function o(){f3(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{f3(),r(po(e,"network-request-failed"))},timeout:bce.get()})}if(!((a=(n=Qo().gapi)===null||n===void 0?void 0:n.iframes)===null||a===void 0)&&a.Iframe)t(gapi.iframes.getContext());else if(!((i=Qo().gapi)===null||i===void 0)&&i.load)o();else{const l=lle("iframefcb");return Qo()[l]=()=>{gapi.load?o():r(po(e,"network-request-failed"))},BB(`${ole()}?onload=${l}`).catch(c=>r(c))}}).catch(t=>{throw Uv=null,t})}let Uv=null;function xce(e){return Uv=Uv||vce(e),Uv}/**
1473 * @license
1474 * Copyright 2020 Google LLC.
1475 *
1476 * Licensed under the Apache License, Version 2.0 (the "License");
1477 * you may not use this file except in compliance with the License.
1478 * You may obtain a copy of the License at
1479 *
1480 *   http://www.apache.org/licenses/LICENSE-2.0
1481 *
1482 * Unless required by applicable law or agreed to in writing, software
1483 * distributed under the License is distributed on an "AS IS" BASIS,
1484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1485 * See the License for the specific language governing permissions and
1486 * limitations under the License.
1487 */const wce=new Vy(5e3,15e3),jce="__/auth/iframe",Nce="emulator/auth/iframe",Sce={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Cce=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function kce(e){const t=e.config;tr(t.authDomain,e,"auth-domain-config-required");const r=t.emulator?PI(t,Nce):`https://${e.config.authDomain}/${jce}
1487`,n={apiKey:t.apiKey,appName:e.name,v:Kh},a=Cce.get(e.config.apiHost);a&&(n.eid=a);const i=e._getFrameworks();return i.length&&(n.fw=i.join(",")),`${r}?${Uy(n).slice(1)}`}async function Mce(e){const t=await xce(e),r=Qo().gapi;return tr(r,e,"internal-error"),t.open({where:document.body,url:kce(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Sce,dontclear:!0},n=>new Promise(async(a,i)=>{await n.restyle({setHideOnLeave:!1});const o=po(e,"network-request-failed"),l=Qo().setTimeout(()=>{i(o)},wce.get());function c(){Qo().clearTimeout(l),a(n)}n.ping(c).then(c,()=>{i(o)})}))}/**
1488 * @license
1489 * Copyright 2020 Google LLC.
1490 *
1491 * Licensed under the Apache License, Version 2.0 (the "License");
1492 * you may not use this file except in compliance with the License.
1493 * You may obtain a copy of the License at
1494 *
1495 *   http://www.apache.org/licenses/LICENSE-2.0
1496 *
1497 * Unless required by applicable law or agreed to in writing, software
1498 * distributed under the License is distributed on an "AS IS" BASIS,
1499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1500 * See the License for the specific language governing permissions and
1501 * limitations under the License.
1502 */const Ice={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ece=500,Tce=600,Ace="_blank",Pce="http://localhost";class m3{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function _ce(e,t,r,n=Ece,a=Tce){const i=Math.max((window.screen.availHeight-a)/2,0).toString(),o=Math.max((window.screen.availWidth-n)/2,0).toString();let l="";const c=Object.assign(Object.assign({},Ice),{width:n.toString(),height:a.toString(),top:i,left:o}),u=ys().toLowerCase();r&&(l=LB(u)?Ace:r),PB(u)&&(t=t||Pce,c.scrollbars="yes");const d=Object.entries(c).reduce((m,[h,p])=>`${m}${h}=${p},`,"");if(Zoe(u)&&l!=="_self")return Lce(t||"",l),new m3(null);const f=window.open(t||"",l,d);tr(f,e,"popup-blocked");try{f.focus()}catch{}return new m3(f)}function Lce(e,t){const r=document.createElement("a");r.href=e,r.target=t;const n=document.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(n)}/**
1503 * @license
1504 * Copyright 2021 Google LLC
1505 *
1506 * Licensed under the Apache License, Version 2.0 (the "License");
1507 * you may not use this file except in compliance with the License.
1508 * You may obtain a copy of the License at
1509 *
1510 *   http://www.apache.org/licenses/LICENSE-2.0
1511 *
1512 * Unless required by applicable law or agreed to in writing, software
1513 * distributed under the License is distributed on an "AS IS" BASIS,
1514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515 * See the License for the specific language governing permissions and
1516 * limitations under the License.
1517 */const Dce="__/auth/handler",Oce="emulator/auth/handler",Rce=encodeURIComponent("fac");async function h3(e,t,r,n,a,i){tr(e.config.authDomain,e,"auth-domain-config-required"),tr(e.config.apiKey,e,"invalid-api-key");const o={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:n,v:Kh,eventId:a};if(t instanceof RI){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",wie(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(const[d,f]of Object.entries({}))o[d]=f}if(t instanceof Wy){const d=t.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}e.tenantId&&(o.tid=e.tenantId);const l=o;for(const d of Object.keys(l))l[d]===void 0&&delete l[d];const c=await e._getAppCheckToken(),u=c?`#${Rce}=${encodeURIComponent(c)}`:"";return`${$ce(e)}?${Uy(l).slice(1)}${u}`}function $ce({config:e}){return e.emulator?PI(e,Oce):`https://${e.authDomain}/${Dce}`}/**
1518 * @license
1519 * Copyright 2020 Google LLC
1520 *
1521 * Licensed under the Apache License, Version 2.0 (the "License");
1522 * you may not use this file except in compliance with the License.
1523 * You may obtain a copy of the License at
1524 *
1525 *   http://www.apache.org/licenses/LICENSE-2.0
1526 *
1527 * Unless required by applicable law or agreed to in writing, software
1528 * distributed under the License is distributed on an "AS IS" BASIS,
1529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1530 * See the License for the specific language governing permissions and
1531 * limitations under the License.
1532 */const DN="webStorageSupport";class Fce{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=KB,this._completeRedirectFn=cce,this._overrideRedirectResult=ice}async _openPopup(t,r,n,a){var i;ac((i=this.eventManagers[t._key()])===null||i===void 0?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await h3(t,r,n,ak(),a);return _ce(t,o,$I())}async _openRedirect(t,r,n,a){await this._originValidation(t);const i=await h3(t,r,n,ak(),a);return Vle(i),new Promise(()=>{})}_initialize(t){const r=t._key();if(this.eventManagers[r]){const{manager:a,promise:i}=this.eventManagers[r];return a?Promise.resolve(a):(ac(i,"If manager is not set, promise should be"),i)}const n=this.initAndGetManager(t);return this.eventManagers[r]={promise:n},n.catch(()=>{delete this.eventManagers[r]}),n}async initAndGetManager(t){const r=await Mce(t),n=new dce(t);return r.register("authEvent",a=>
1532(tr(a==null?void 0:a.authEvent,t,"invalid-auth-event"),{status:n.onEvent(a.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:n},this.iframes[t._key()]=r,n}_isIframeWebStorageSupported(t,r){this.iframes[t._key()].send(DN,{type:DN},a=>{var i;const o=(i=a==null?void 0:a[0])===null||i===void 0?void 0:i[DN];o!==void 0&&r(!!o),Ri(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const r=t._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=gce(t)),this.originValidationPromises[r]}get _shouldInitProactively(){return FB()||_B()||LI()}}const zce=Fce;var p3="@firebase/auth",g3="1.7.9";/**
1533 * @license
1534 * Copyright 2020 Google LLC
1535 *
1536 * Licensed under the Apache License, Version 2.0 (the "License");
1537 * you may not use this file except in compliance with the License.
1538 * You may obtain a copy of the License at
1539 *
1540 *   http://www.apache.org/licenses/LICENSE-2.0
1541 *
1542 * Unless required by applicable law or agreed to in writing, software
1543 * distributed under the License is distributed on an "AS IS" BASIS,
1544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1545 * See the License for the specific language governing permissions and
1546 * limitations under the License.
1547 */class Bce{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)===null||t===void 0?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const r=this.auth.onIdTokenChanged(n=>{t((n==null?void 0:n.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,r),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const r=this.internalListeners.get(t);r&&(this.internalListeners.delete(t),r(),this.updateProactiveRefresh())}assertAuthConfigured(){tr(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1548 * @license
1549 * Copyright 2020 Google LLC
1550 *
1551 * Licensed under the Apache License, Version 2.0 (the "License");
1552 * you may not use this file except in compliance with the License.
1553 * You may obtain a copy of the License at
1554 *
1555 *   http://www.apache.org/licenses/LICENSE-2.0
1556 *
1557 * Unless required by applicable law or agreed to in writing, software
1558 * distributed under the License is distributed on an "AS IS" BASIS,
1559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1560 * See the License for the specific language governing permissions and
1561 * limitations under the License.
1562 */function Uce(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Vce(e){Zm(new Jd("auth",(t,{options:r})=>{const n=t.getProvider("app").getImmediate(),a=t.getProvider("heartbeat"),i=t.getProvider("app-check-internal"),{apiKey:o,authDomain:l}=n.options;tr(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const c={apiKey:o,authDomain:l,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:zB(e)},u=new ale(n,a,i,c);return mle(u,r),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,r,n)=>{t.getProvider("auth-internal").initialize()})),Zm(new Jd("auth-internal",t=>{const r=yc(t.getProvider("auth").getImmediate());return(n=>new Bce(n))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),hu(p3,g3,Uce(e)),hu(p3,g3,"esm2017")}/**
1563 * @license
1564 * Copyright 2021 Google LLC
1565 *
1566 * Licensed under the Apache License, Version 2.0 (the "License");
1567 * you may not use this file except in compliance with the License.
1568 * You may obtain a copy of the License at
1569 *
1570 *   http://www.apache.org/licenses/LICENSE-2.0
1571 *
1572 * Unless required by applicable law or agreed to in writing, softw
1572are
1573 * distributed under the License is distributed on an "AS IS" BASIS,
1574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1575 * See the License for the specific language governing permissions and
1576 * limitations under the License.
1577 */const Wce=5*60,qce=yB("authIdTokenMaxAge")||Wce;let y3=null;const Gce=e=>async t=>{const r=t&&await t.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>qce)return;const a=r==null?void 0:r.token;y3!==a&&(y3=a,await fetch(e,{method:a?"POST":"DELETE",headers:a?{Authorization:`Bearer ${a}`}:{}}))};function Hce(e=wB()){const t=II(e,"auth");if(t.isInitialized())return t.getImmediate();const r=fle(e,{popupRedirectResolver:zce,persistence:[Zle,zle,KB]}),n=yB("authTokenSyncURL");if(n&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(n,location.origin);if(location.origin===i.origin){const o=Gce(i.toString());Ole(r,o,()=>o(r.currentUser)),Dle(r,l=>o(l))}}const a=pB("auth");return a&&hle(r,`http://${a}`),r}function Yce(){var e,t;return(t=(e=document.getElementsByTagName("head"))===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:document}sle({loadJS(e){return new Promise((t,r)=>{const n=document.createElement("script");n.setAttribute("src",e),n.onload=t,n.onerror=a=>{const i=po("internal-error");i.customData=a,r(i)},n.type="text/javascript",n.charset="UTF-8",Yce().appendChild(n)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Vce("Browser");var b3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1578Copyright The Closure Library Authors.
1579SPDX-License-Identifier: Apache-2.0
1580*/var Dd,sU;(function(){var e;/** @license
1581
1582 Copyright The Closure Library Authors.
1583 SPDX-License-Identifier: Apache-2.0
1584*/function t(M,k){function I(){}I.prototype=k.prototype,M.D=k.prototype,M.prototype=new I,M.prototype.constructor=M,M.C=function(T,L,R){for(var _=Array(arguments.length-2),B=2;B<arguments.length;B++)_[B-2]=arguments[B];return k.prototype[L].apply(T,_)}}function r(){this.blockSize=-1}function n(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}t(n,r),n.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function a(M,k,I){I||(I=0);var T=Array(16);if(typeof k=="string")for(var L=0;16>L;++L)T[L]=k.charCodeAt(I++)|k.charCodeAt(I++)<<8|k.charCodeAt(I++)<<16|k.charCodeAt(I++)<<24;else for(L=0;16>L;++L)T[L]=k[I++]|k[I++]<<8|k[I++]<<16|k[I++]<<24;k=M.g[0],I=M.g[1],L=M.g[2];var R=M.g[3],_=k+(R^I&(L^R))+T[0]+3614090360&4294967295;k=I+(_<<7&4294967295|_>>>25),_=R+(L^k&(I^L))+T[1]+3905402710&4294967295,R=k+(_<<12&4294967295|_>>>20),_=L+(I^R&(k^I))+T[2]+606105819&4294967295,L=R+(_<<17&4294967295|_>>>15),_=I+(k^L&(R^k))+T[3]+3250441966&4294967295,I=L+(_<<22&4294967295|_>>>10),_=k+(R^I&(L^R))+T[4]+4118548399&4294967295,k=I+(_<<7&4294967295|_>>>25),_=R+(L^k&(I^L))+T[5]+1200080426&4294967295,R=k+(_<<12&4294967295|_>>>20),_=L+(I^R&(k^I))+T[6]+2821735955&4294967295,L=R+(_<<17&4294967295|_>>>15),_=I+(k^L&(R^k))+T[7]+4249261313&4294967295,I=L+(_<<22&4294967295|_>>>10),_=k+(R^I&(L^R))+T[8]+1770035416&4294967295,k=I+(_<<7&4294967295|_>>>25),_=R+(L^k&(I^L))+T[9]+2336552879&4294967295,R=k+(_<<12&4294967295|_>>>20),_=L+(I^R&(k^I))+T[10]+4294925233&4294967295,L=R+(_<<17&4294967295|_>>>15),_=I+(k^L&(R^k))+T[11]+2304563134&4294967295,I=L+(_<<22&4294967295|_>>>10),_=k+(R^I&(L^R))+T[12]+1804603682&4294967295,k=I+(_<<7&4294967295|_>>>25),_=R+(L^k&(I^L))+T[13]+4254626195&4294967295,R=k+(_<<12&4294967295|_>>>20),_=L+(I^R&(k^I))+T[14]+2792965006&4294967295,L=R+(_<<17&4294967295|_>>>15),_=I+(k^L&(R^k))+T[15]+1236535329&4294967295,I=L+(_<<22&4294967295|_>>>10),_=k+(L^R&(I^L))+T[1]+4129170786&4294967295,k=I+(_<<5&4294967295|_>>>27),_=R+(I^L&(k^I))+T[6]+3225465664&4294967295,R=k+(_<<9&4294967295|_>>>23),_=L+(k^I&(R^k))+T[11]+643717713&4294967295,L=R+(_<<14&4294967295|_>>>18),_=I+(R^k&(L^R))+T[0]+3921069994&4294967295,I=L+(_<<20&4294967295|_>>>12),_=k+(L^R&(I^L))+T[5]+3593408605&4294967295,k=I+(_<<5&4294967295|_>>>27),_=R+(I^L&(k^I))+T[10]+38016083&4294967295,R=k+(_<<9&4294967295|_>>>23),_=L+(k^I&(R^k))+T[15]+3634488961&4294967295,L=R+(_<<14&4294967295|_>>>18),_=I+(R^k&(L^R))+T[4]+3889429448&4294967295,I=L+(_<<20&4294967295|_>>>12),_=k+(L^R&(I^L))+T[9]+568446438&4294967295,k=I+(_<<5&4294967295|_>>>27),_=R+(I^L&(k^I))+T[14]+3275163606&4294967295,R=k+(_<<9&4294967295|_>>>23),_=L+(k^I&(R^k))+T[3]+4107603335&4294967295,L=R+(_<<14&4294967295|_>>>18),_=I+(R^k&(L^R))+T[8]+1163531501&4294967295,I=L+(_<<20&4294967295|_>>>12),_=k+(L^R&(I^L))+T[13]+2850285829&4294967295,k=I+(_<<5&4294967295|_>>>27),_=R+(I^L&(k^I))+T[2]+4243563512&4294967295,R=k+(_<<9&4294967295|_>>>23),_=L+(k^I&(R^k))+T[7]+1735328473&4294967295,L=R+(_<<14&4294967295|_>>>18),_=I+(R^k&(L^R))+T[12]+2368359562&4294967295,I=L+(_<<20&4294967295|_>>>12),_=k+(I^L^R)+T[5]+4294588738&4294967295,k=I+(_<<4&4294967295|_>>>28),_=R+(k^I^L)+T[8]+2272392833&4294967295,R=k+(_<<11&4294967295|_>>>21),_=L+(R^k^I)+T[11]+1839030562&4294967295,L=R+(_<<16&4294967295|_>>>16),_=I+(L^R^k)+T[14]+4259657740&4294967295,I=L+(_<<23&4294967295|_>>>9),_=k+(I^L^R)+T[1]+2763975236&4294967295,k=I+(_<<4&4294967295|_>>>28),_=R+(k^I^L)+T[4]+1272893353&4294967295,R=k+(_<<11&4294967295|_>>>21),_=L+(R^k^I)+T[7]+4139469664&4294967295,L=R+(_<<16&4294967295|_>>>16),_=I+(L^R^k)+T[10]+3200236656&4294967295,I=L+(_<<23&4294967295|_>>>9),_=k+(I^L^R)+T[13]+681279174&4294967295,k=I+(_<<4&4294967295|_>>>28),_=R+(k^I^L)+T[0]+3936430074&4294967295,R=k+(_<<11&4294967295|_>>>21),_=L+(R^k^I)+T[3]+3572445317&4294967295,L=R+(_<<16&4294967295|_>>>16),_=I+(L^R^k)+T[6]+76029189&4294967295,I=L+(_<<23&4294967295|_>>>9),_=k+(I^L^R)+T[9]+3654602809&4294967295,k=I+(_<<4&4294967295|_>>>28),_=R+(k^I^L)+T[12]+3873151461&4294967295,R=k+(_<<11&4294967295|_>>>21),_=L+(R^k^I)+T[15]+530742520&4294967295,L=R+(_<<16&4294967295|_>>>16),_=I+(L^R^k)+T[2]+3299628645&4294967295,I=L+(_<<23&4294967295|_>>>9),_=k+(L^(I|~R))+T[0]+4096336452&4294967295,k=I+(_<<6&4294967295|_>>>26),_=R+(I^(k|~L))+T[7]+1126891415&4294967295,R=k+(_<<10&4294967295|_>>>22),_=L+(k^(R|~I))+T[14]+2878612391&4294967295,L=R+(_<<15&4294967295|_>>>17),_=I+(R^(L|~k))+T[5]+4237533241&4294967295,I=L+(_<<21&4294967295|_>>>11),_=k+(L^(I|~R))+T[12]+1700485571&4294967295,k=I+(_<<6&4294967295|_>>>26),_=R+(I^(k|~L))+T[3]+2399980690&4294967295,R=k+(_<<10&4294967295|_>>>22),_=L+(k^(R|~I))+T[10]+4293915773&4294967295,L=R+(_<<15&4294967295|_>>>17),_=I+(R^(L|~k))+T[1]+2240044497&4294967295,I=L+(_<<21&4294967295|_>>>11),_=k+(L^(I|~R))+T[8]+1873313359&4294967295,k=I+(_<<6&4294967295|_>>>26),_=R+(I^(k|~L))+T[15]+4264355552&4294967295,R=k+(_<<10&4294967295|_>>>22),_=L+(k^(R|~I))+T[6]+2734768916&4294967295,L=R+(_<<15&4294967295|_>>>17),_=I+(R^(L|~k))+T[13]+1309151649&4294967295,I=L+(_<<21&4294967295|_>>>11),_=k+(L^(I|~R))+T[4]+4149444226&4294967295,k=I+(_<<6&4294967295|_>>>26),_=R+(I^(k|~L))+T[11]+3174756917&4294967295,R=k+(_<<10&4294967295|_>>>22),_=L+(k^(R|~I))+T[2]+718787259&4294967295,L=R+(_<<15&4294967295|_>>>17),_=I+(R^(L|~k))+T[9]+3951481745&4294967295,M.g[0]=M.g[0]+k&4294967295,M.g[1]=M.g[1]+(L+(_<<21&4294967295|_>>>11))&4294967295,M.g[2]=M.g[2]+L&4294967295,M.g[3]=M.g[3]+R&4294967295}
vendor: 47,578 bytes, lines 1584-1609
1584n.prototype.u=function(M,k){k===void 0&&(k=M.length);for(var I=k-this.blockSize,T=this.B,L=this.h,R=0;R<k;){if(L==0)for(;R<=I;)a(this,M,R),R+=this.blockSize;if(typeof M=="string"){for(;R<k;)if(T[L++]=M.charCodeAt(R++),L==this.blockSize){a(this,T),L=0;break}}else for(;R<k;)if(T[L++]=M[R++],L==this.blockSize){a(this,T),L=0;break}}this.h=L,this.o+=k},n.prototype.v=function(){var M=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);M[0]=128;for(var k=1;k<M.length-8;++k)M[k]=0;var I=8*this.o;for(k=M.length-8;k<M.length;++k)M[k]=I&255,I/=256;for(this.u(M),M=Array(16),k=I=0;4>k;++k)for(var T=0;32>T;T+=8)M[I++]=this.g[k]>>>T&255;return M};function i(M,k){var I=l;return Object.prototype.hasOwnProperty.call(I,M)?I[M]:I[M]=k(M)}function o(M,k){this.h=k;for(var I=[],T=!0,L=M.length-1;0<=L;L--){var R=M[L]|0;T&&R==k||(I[L]=R,T=!1)}this.g=I}var l={};function c(M){return-128<=M&&128>M?i(M,function(k){return new o([k|0],0>k?-1:0)}):new o([M|0],0>M?-1:0)}function u(M){if(isNaN(M)||!isFinite(M))return f;if(0>M)return y(u(-M));for(var k=[],I=1,T=0;M>=I;T++)k[T]=M/I|0,I*=4294967296;return new o(k,0)}function d(M,k){if(M.length==0)throw Error("number format error: empty string");if(k=k||10,2>k||36<k)throw Error("radix out of range: "+k);if(M.charAt(0)=="-")return y(d(M.substring(1),k));if(0<=M.indexOf("-"))throw Error('number format error: interior "-" character');for(var I=u(Math.pow(k,8)),T=f,L=0;L<M.length;L+=8){var R=Math.min(8,M.length-L),_=parseInt(M.substring(L,L+R),k);8>R?(R=u(Math.pow(k,R)),T=T.j(R).add(u(_))):(T=T.j(I),T=T.add(u(_)))}return T}var f=c(0),m=c(1),h=c(16777216);e=o.prototype,e.m=function(){if(g(this))return-y(this).m();for(var M=0,k=1,I=0;I<this.g.length;I++){var T=this.i(I);M+=(0<=T?T:4294967296+T)*k,k*=4294967296}return M},e.toString=function(M){if(M=M||10,2>M||36<M)throw Error("radix out of range: "+M);if(p(this))return"0";if(g(this))return"-"+y(this).toString(M);for(var k=u(Math.pow(M,6)),I=this,T="";;){var L=C(I,k).g;I=v(I,L.j(k));var R=((0<I.g.length?I.g[0]:I.h)>>>0).toString(M);if(I=L,p(I))return R+T;for(;6>R.length;)R="0"+R;T=R+T}},e.i=function(M){return 0>M?0:M<this.g.length?this.g[M]:this.h};function p(M){if(M.h!=0)return!1;for(var k=0;k<M.g.length;k++)if(M.g[k]!=0)return!1;return!0}function g(M){return M.h==-1}e.l=function(M){return M=v(this,M),g(M)?-1:p(M)?0:1};function y(M){for(var k=M.g.length,I=[],T=0;T<k;T++)I[T]=~M.g[T];return new o(I,~M.h).add(m)}e.abs=function(){return g(this)?y(this):this},e.add=function(M){for(var k=Math.max(this.g.length,M.g.length),I=[],T=0,L=0;L<=k;L++){var R=T+(this.i(L)&65535)+(M.i(L)&65535),_=(R>>>16)+(this.i(L)>>>16)+(M.i(L)>>>16);T=_>>>16,R&=65535,_&=65535,I[L]=_<<16|R}return new o(I,I[I.length-1]&-2147483648?-1:0)};function v(M,k){return M.add(y(k))}e.j=function(M){if(p(this)||p(M))return f;if(g(this))return g(M)?y(this).j(y(M)):y(y(this).j(M));if(g(M))return y(this.j(y(M)));if(0>this.l(h)&&0>M.l(h))return u(this.m()*M.m());for(var k=this.g.length+M.g.length,I=[],T=0;T<2*k;T++)I[T]=0;for(T=0;T<this.g.length;T++)for(var L=0;L<M.g.length;L++){var R=this.i(T)>>>16,_=this.i(T)&65535,B=M.i(L)>>>16,z=M.i(L)&65535;I[2*T+2*L]+=_*z,x(I,2*T+2*L),I[2*T+2*L+1]+=R*z,x(I,2*T+2*L+1),I[2*T+2*L+1]+=_*B,x(I,2*T+2*L+1),I[2*T+2*L+2]+=R*B,x(I,2*T+2*L+2)}for(T=0;T<k;T++)I[T]=I[2*T+1]<<16|I[2*T];for(T=k;T<2*k;T++)I[T]=0;return new o(I,0)};function x(M,k){for(;(M[k]&65535)!=M[k];)M[k+1]+=M[k]>>>16,M[k]&=65535,k++}function j(M,k){this.g=M,this.h=k}function C(M,k){if(p(k))throw Error("division by zero");if(p(M))return new j(f,f);if(g(M))return k=C(y(M),k),new j(y(k.g),y(k.h));if(g(k))return k=C(M,y(k)),new j(y(k.g),k.h);if(30<M.g.length){if(g(M)||g(k))throw Error("slowDivide_ only works with positive integers.");for(var I=m,T=k;0>=T.l(M);)I=N(I),T=N(T);var L=S(I,1),R=S(T,1);for(T=S(T,2),I=S(I,2);!p(T);){var _=R.add(T);0>=_.l(M)&&(L=L.add(I),R=_),T=S(T,1),I=S(I,1)}return k=v(M,L.j(k)),new j(L,k)}for(L=f;0<=M.l(k);){for(I=Math.max(1,Math.floor(M.m()/k.m())),T=Math.ceil(Math.log(I)/Math.LN2),T=48>=T?1:Math.pow(2,T-48),R=u(I),_=R.j(k);g(_)||0<_.l(M);)I-=T,R=u(I),_=R.j(k);p(R)&&(R=m),L=L.add(R),M=v(M,_)}return new j(L,M)}e.A=function(M){return C(this,M).h},e.and=function(M){for(var k=Math.max(this.g.length,M.g.length),I=[],T=0;T<k;T++)I[T]=this.i(T)&M.i(T);return new o(I,this.h&M.h)},e.or=function(M){for(var k=Math.max(this.g.length,M.g.length),I=[],T=0;T<k;T++)I[T]=this.i(T)|M.i(T);return new o(I,this.h|M.h)},e.xor=function(M){for(var k=Math.max(this.g.length,M.g.length),I=[],T=0;T<k;T++)I[T]=this.i(T)^M.i(T);return new o(I,this.h^M.h)};function N(M){for(var k=M.g.length+1,I=[],T=0;T<k;T++)I[T]=M.i(T)<<1|M.i(T-1)>>>31;return new o(I,M.h)}function S(M,k){var I=k>>5;k%=32;for(var T=M.g.length-I,L=[],R=0;R<T;R++)L[R]=0<k?M.i(R+I)>>>k|M.i(R+I+1)<<32-k:M.i(R+I);return new o(L,M.h)}n.prototype.digest=n.prototype.v,n.prototype.reset=n.prototype.s,n.prototype.update=n.prototype.u,sU=n,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=u,o.fromString=d,Dd=o}).apply(typeof b3<"u"?b3:typeof self<"u"?self:typeof window<"u"?window:{});var Gb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1585Copyright The Closure Library Authors.
1586SPDX-License-Identifier: Apache-2.0
1587*/var iU,Mg,oU,Vv,ck,lU,cU,uU;(function(){var e,t=typeof Object.defineProperties=="function"?Object.defineProperty:function(w,O,V){return w==Array.prototype||w==Object.prototype||(w[O]=V.value),w};function r(w){w=[typeof globalThis=="object"&&globalThis,w,typeof window=="object"&&window,typeof self=="object"&&self,typeof Gb=="object"&&Gb];for(var O=0;O<w.length;++O){var V=w[O];if(V&&V.Math==Math)return V}throw Error("Cannot find global object")}var n=r(this);function a(w,O){if(O)e:{var V=n;w=w.split(".");for(var re=0;re<w.length-1;re++){var Me=w[re];if(!(Me in V))break e;V=V[Me]}w=w[w.length-1],re=V[w],O=O(re),O!=re&&O!=null&&t(V,w,{configurable:!0,writable:!0,value:O})}}function i(w,O){w instanceof String&&(w+="");var V=0,re=!1,Me={next:function(){if(!re&&V<w.length){var Le=V++;return{value:O(Le,w[Le]),done:!1}}return re=!0,{done:!0,value:void 0}}};return Me[Symbol.iterator]=function(){return Me},Me}a("Array.prototype.values",function(w){return w||function(){return i(this,function(O,V){return V})}});/** @license
1588
1589 Copyright The Closure Library Authors.
1590 SPDX-License-Identifier: Apache-2.0
1591*/var o=o||{},l=this||self;function c(w){var O=typeof w;return O=O!="object"?O:w?Array.isArray(w)?"array":O:"null",O=="array"||O=="object"&&typeof w.length=="number"}function u(w){var O=typeof w;return O=="object"&&w!=null||O=="function"}function d(w,O,V){return w.call.apply(w.bind,arguments)}function f(w,O,V){if(!w)throw Error();if(2<arguments.length){var re=Array.prototype.slice.call(arguments,2);return function(){var Me=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(Me,re),w.apply(O,Me)}}return function(){return w.apply(O,arguments)}}function m(w,O,V){return m=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:f,m.apply(null,arguments)}function h(w,O){var V=Array.prototype.slice.call(arguments,1);return function(){var re=V.slice();return re.push.apply(re,arguments),w.apply(this,re)}}function p(w,O){function V(){}V.prototype=O.prototype,w.aa=O.prototype,w.prototype=new V,w.prototype.constructor=w,w.Qb=function(re,Me,Le){for(var mt=Array(arguments.length-2),on=2;on<arguments.length;on++)mt[on-2]=arguments[on];return O.prototype[Me].apply(re,mt)}}function g(w){const O=w.length;if(0<O){const V=Array(O);for(let re=0;re<O;re++)V[re]=w[re];return V}return[]}function y(w,O){for(let V=1;V<arguments.length;V++){const re=arguments[V];if(c(re)){const Me=w.length||0,Le=re.length||0;w.length=Me+Le;for(let mt=0;mt<Le;mt++)w[Me+mt]=re[mt]}else w.push(re)}}class v{constructor(O,V){this.i=O,this.j=V,this.h=0,this.g=null}get(){let O;return 0<this.h?(this.h--,O=this.g,this.g=O.next,O.next=null):O=this.i(),O}}function x(w){return/^[\s\xa0]*$/.test(w)}function j(){var w=l.navigator;return w&&(w=w.userAgent)?w:""}function C(w){return C[" "](w),w}C[" "]=function(){};var N=j().indexOf("Gecko")!=-1&&!(j().toLowerCase().indexOf("webkit")!=-1&&j().indexOf("Edge")==-1)&&!(j().indexOf("Trident")!=-1||j().indexOf("MSIE")!=-1)&&j().indexOf("Edge")==-1;function S(w,O,V){for(const re in w)O.call(V,w[re],re,w)}function M(w,O){for(const V in w)O.call(void 0,w[V],V,w)}function k(w){const O={};for(const V in w)O[V]=w[V];return O}const I="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function T(w,O){let V,re;for(let Me=1;Me<arguments.length;Me++){re=arguments[Me];for(V in re)w[V]=re[V];for(let Le=0;Le<I.length;Le++)V=I[Le],Object.prototype.hasOwnProperty.call(re,V)&&(w[V]=re[V])}}function L(w){var O=1;w=w.split(":");const V=[];for(;0<O&&w.length;)V.push(w.shift()),O--;return w.length&&V.push(w.join(":")),V}function R(w){l.setTimeout(()=>{throw w},0)}function _(){var w=E;let O=null;return w.g&&(O=w.g,w.g=w.g.next,w.g||(w.h=null),O.next=null),O}class B{constructor(){this.h=this.g=null}add(O,V){const re=z.get();re.set(O,V),this.h?this.h.next=re:this.g=re,this.h=re}}var z=new v(()=>new D,w=>w.reset());class D{constructor(){this.next=this.g=this.h=null}set(O,V){this.h=O,this.g=V,this.next=null}reset(){this.next=this.g=this.h=null}}let A,P=!1,E=new B,F=()=>{const w=l.Promise.resolve(void 0);A=()=>{w.then($)}};var $=()=>{for(var w;w=_();){try{w.h.call(w.g)}catch(V){R(V)}var O=z;O.j(w),100>O.h&&(O.h++,w.next=O.g,O.g=w)}P=!1};function H(){this.s=this.s,this.C=this.C}H.prototype.s=!1,H.prototype.ma=function(){this.s||(this.s=!0,this.N())},H.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function X(w,O){this.type=w,this.g=this.target=O,this.defaultPrevented=!1}X.prototype.h=function(){this.defaultPrevented=!0};var ue=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var w=!1,O=Object.defineProperty({},"passive",{get:function(){w=!0}});try{const V=()=>{};l.addEventListener("test",V,O),l.removeEventListener("test",V,O)}catch{}return w}();function le(w,O){if(X.call(this,w?w.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,w){var V=this.type=w.type,re=w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:null;if(this.target=w.target||w.srcElement,this.g=O,O=w.relatedTarget){if(N){e:{try{C(O.nodeName);var Me=!0;break e}catch{}Me=!1}Me||(O=null)}}else V=="mouseover"?O=w.fromElement:V=="mouseout"&&(O=w.toElement);this.relatedTarget=O,re?(this.clientX=re.clientX!==void 0?re.clientX:re.pageX,this.clientY=re.clientY!==void 0?re.clientY:re.pageY,this.screenX=re.screenX||0,this.screenY=re.screenY||0):(this.clientX=w.clientX!==void 0?w.clientX:w.pageX,this.clientY=w.clientY!==void 0?w.clientY:w.pageY,this.screenX=w.screenX||0,this.screenY=w.screenY||0),this.button=w.button,this.key=w.key||"",this.ctrlKey=w.ctrlKey,this.altKey=w.altKey,this.shiftKey=w.shiftKey,this.metaKey=w.metaKey,this.pointerId=w.pointerId||0,this.pointerType=typeof w.pointerType=="string"?w.pointerType:ae[w.pointerType]||"",this.state=w.state,this.i=w,w.defaultPrevented&&le.aa.h.call(this)}}p(le,X);var ae={2:"touch",3:"pen",4:"mouse"};le.prototype.h=function(){le.aa.h.call(this);var w=this.i;w.preventDefault?w.preventDefault():w.returnValue=!1};var te="closure_listenable_"+(1e6*Math.random()|0),ne=0;function J(w,O,V,re,Me){this.listener=w,this.proxy=null,this.src=O,this.type=V,this.capture=!!re,this.ha=Me,this.key=++ne,this.da=this.fa=!1}function G(w){w.da=!0,w.listener=null,w.proxy=null,w.src=null,w.ha=null}function Q(w){this.src=w,this.g={},this.h=0}Q.prototype.add=function(w,O,V,re,Me){var Le=w.toString();w=this.g[Le],w||(w=this.g[Le]=[],this.h++);var mt=Y(w,O,re,Me);return-1<mt?(O=w[mt],V||(O.fa=!1)):(O=new J(O,this.src,Le,!!re,Me),O.fa=V,w.push(O)),O};function W(w,O){var V=O.type;if(V in w.g){var re=w.g[V],Me=Array.prototype.indexOf.call(re,O,void 0),Le;(Le=0<=Me)&&Array.prototype.splice.call(re,Me,1),Le&&(G(O),w.g[V].length==0&&(delete w.g[V],w.h--))}}function Y(w,O,V,re){for(var Me=0;Me<w.length;++Me){var Le=w[Me];if(!Le.da&&Le.listener==O&&Le.capture==!!V&&Le.ha==re)return Me}return-1}var q="closure_lm_"+(1e6*Math.random()|0),Z={};function me(w,O,V,re,Me){if(Array.isArray(O)){for(var Le=0;Le<O.length;Le++)me(w,O[Le],V,re,Me);return null}return V=Ye(V),w&&w[te]?w.K(O,V,u(re)?!!re.capture:!1,Me):we(w,O,V,!1,re,Me)}function we(w,O,V,re,Me,Le){if(!O)throw Error("Invalid event type");var mt=u(Me)?!!Me.capture:!!Me,on=xe(w);if(on||(w[q]=on=new Q(w)),V=on.add(O,V,re,mt,Le),V.proxy)return V;if(re=he(),V.proxy=re,re.src=w,re.listener=V,w.addEventListener)ue||(Me=mt),Me===void 0&&(Me=!1),w.addEventListener(O.toString(),re,Me);else if(w.attachEvent)w.attachEvent(pe(O.toString()),re);else if(w.addListener&&w.removeListener)w.addListener(re);else throw Error("addEventListener and attachEvent are unavailable.");return V}function he(){function w(V){return O.call(w.src,w.listener,V)}const O=ce;return w}function ie(w,O,V,re,Me){if(Array.isArray(O))for(var Le=0;Le<O.length;Le++)ie(w,O[Le],V,re,Me);else re=u(re)?!!re.capture:!!re,V=Ye(V),w&&w[te]?(w=w.i,O=String(O).toString(),O in w.g&&(Le=w.g[O],V=Y(Le,V,re,Me),-1<V&&(G(Le[V]),Array.prototype.splice.call(Le,V,1),Le.length==0&&(delete w.g[O],w.h--)))):w&&(w=xe(w))&&(O=w.g[O.toString()],w=-1,O&&(w=Y(O,V,re,Me)),(V=-1<w?O[w]:null)&&ye(V))}function ye(w){if(typeof w!="number"&&w&&!w.da){var O=w.src;if(O&&O[te])W(O.i,w);else{var V=w.type,re=w.proxy;O.removeEventListener?O.removeEventListener(V,re,w.capture):O.detachEvent?O.detachEvent(pe(V),re):O.addListener&&O.removeListener&&O.removeListener(re),(V=xe(O))?(W(V,w),V.h==0&&(V.src=null,O[q]=null)):G(w)}}}function pe(w){return w in Z?Z[w]:Z[w]="on"+w}function ce(w,O){if(w.da)w=!0;else{O=new le(O,this);var V=w.listener,re=w.ha||w.src;w.fa&&ye(w),w=V.call(re,O)}return w}function xe(w){return w=w[q],w instanceof Q?w:null}var Ee="__closure_events_fn_"+(1e9*Math.random()>>>0);function Ye(w){return typeof w=="function"?w:(w[Ee]||(w[Ee]=function(O){return w.handleEvent(O)}),w[Ee])}function fe(){H.call(this),this.i=new Q(this),this.M=this,this.F=null}p(fe,H),fe.prototype[te]=!0,fe.prototype.removeEventListener=function(w,O,V,re){ie(this,w,O,V,re)};function je(w,O){var V,re=w.F;if(re)for(V=[];re;re=re.F)V.push(re);if(w=w.M,re=O.type||O,typeof O=="string")O=new X(O,w);else if(O instanceof X)O.target=O.target||w;else{var Me=O;O=new X(re,w),T(O,Me)}if(Me=!0,V)for(var Le=V.length-1;0<=Le;Le--){var mt=O.g=V[Le];Me=We(mt,re,!0,O)&&Me}if(mt=O.g=w,Me=We(mt,re,!0,O)&&Me,Me=We(mt,re,!1,O)&&Me,V)for(Le=0;Le<V.length;Le++)mt=O.g=V[Le],Me=We(mt,re,!1,O)&&Me}fe.prototype.N=function(){if(fe.aa.N.call(this),this.i){var w=this.i,O;for(O in w.g){for(var V=w.g[O],re=0;re<V.length;re++)G(V[re]);delete w.g[O],w.h--}}this.F=null},fe.prototype.K=function(w,O,V,re){return this.i.add(String(w),O,!1,V,re)},fe.prototype.L=function(w,O,V,re){return this.i.add(String(w),O,!0,V,re)};function We(w,O,V,re){if(O=w.i.g[String(O)],!O)return!0;O=O.concat();for(var Me=!0,Le=0;Le<O.length;++Le){var mt=O[Le];if(mt&&!mt.da&&mt.capture==V){var on=mt.listener,ya=mt.ha||mt.src;mt.fa&&W(w.i,mt),Me=on.call(ya,re)!==!1&&Me}}return Me&&!re.defaultPrevented}function yt(w,O,V){if(typeof w=="function")V&&(w=m(w,V));else if(w&&typeof w.handleEvent=="function")w=m(w.handleEvent,w);else throw Error("Invalid listener argument");return 2147483647<Number(O)?-1:l.setTimeout(w,O||0)}function gt(w){w.g=yt(()=>{w.g=null,w.i&&(w.i=!1,gt(w))},w.l);const O=w.h;w.h=null,w.m.apply(null,O)}class qe extends H{constructor(O,V){super(),this.m=O,this.l=V,this.h=null,this.i=!1,this.g=null}j(O){this.h=arguments,this.g?this.i=!0:gt(this)}N(){super.N(),this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ze(w){H.call(this),this.h=w,this.g={}}p(ze,H);var $e=[];function ct(w){S(w.g,function(O,V){this.g.hasOwnProperty(V)&&ye(O)},w),w.g={}}ze.prototype.N=function(){ze.aa.N.call(this),ct(this)},ze.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var oe=l.JSON.stringify,Ne=l.JSON.parse,Ae=class{stringify(w){return l.JSON.stringify(w,void 0)}parse(w){return l.JSON.parse(w,void 0)}};function lt(){}lt.prototype.h=null;function Mt(w){return w.h||(w.h=w.i())}function jt(){}var Xe={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Bt(){X.call(this,"d")}p(Bt,X);function ve(){X.call(this,"c")}p(ve,X);var Fe={},nt=null;function At(){return nt=nt||new fe}Fe.La="serverreachability";function Wt(w){X.call(this,Fe.La,w)}p(Wt,X);function In(w){const O=At();je(O,new Wt(O))}Fe.STAT_EVENT="statevent";function ir(w,O){X.call(this,Fe.STAT_EVENT,w),this.stat=O}p(ir,X);function Qt(w){const O=At();je(O,new ir(O,w))}Fe.Ma="timingevent";function Sn(w,O){X.call(this,Fe.Ma,w),this.size=O}p(Sn,X);function nn(w,O){if(typeof w!="function")throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){w()},O)}function Lt(){this.g=!0}Lt.prototype.xa=function(){this.g=!1};function _e(w,O,V,re,Me,Le){w.info(function(){if(w.g)if(Le)for(var mt="",on=Le.split("&"),ya=0;ya<on.length;ya++){var Or=on[ya].split("=");if(1<Or.length){var Sa=Or[0];Or=Or[1];var Ca=Sa.split("_");mt=2<=Ca.length&&Ca[1]=="type"?mt+(Sa+"="+Or+"&"):mt+(Sa+"=redacted&")}}else mt=null;else mt=Le;return"XMLHTTP REQ ("+re+") [attempt "+Me+"]: "+O+`
1592`+V+`
1593`+mt})}function et(w,O,V,re,Me,Le,mt){w.info(function(){return"XMLHTTP RESP ("+re+") [ attempt "+Me+"]: "+O+`
1594`+V+`
1595`+Le+" "+mt})}function ft(w,O,V,re){w.info(function(){return"XMLHTTP TEXT ("+O+"): "+$t(w,V)+(re?" "+re:"")})}function pt(w,O){w.info(function(){return"TIMEOUT: "+O})}Lt.prototype.info=function(){};function $t(w,O){if(!w.g)return O;if(!O)return null;try{var V=JSON.parse(O);if(V){for(w=0;w<V.length;w++)if(Array.isArray(V[w])){var re=V[w];if(!(2>re.length)){var Me=re[1];if(Array.isArray(Me)&&!(1>Me.length)){var Le=Me[0];if(Le!="noop"&&Le!="stop"&&Le!="close")for(var mt=1;mt<Me.length;mt++)Me[mt]=""}}}}return oe(V)}catch{return O}}var Pt={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Ft={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},Dr;function K(){}p(K,lt),K.prototype.g=function(){return new XMLHttpRequest},K.prototype.i=function(){return{}},Dr=new K;function ke(w,O,V,re){this.j=w,this.i=O,this.l=V,this.R=re||1,this.U=new ze(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Ze}function Ze(){this.i=null,this.g="",this.h=!1}var bt={},Re={};function dt(w,O,V){w.L=1,w.v=Xt(Zt(O)),w.m=V,w.P=!0,Et(w,null)}function Et(w,O){w.F=Date.now(),Gr(w),w.A=Zt(w.v);var V=w.A,re=w.R;Array.isArray(re)||(re=[String(re)]),ge(V.i,"t",re),w.C=0,V=w.j.J,w.h=new Ze,w.g=Bp(w.j,V?O:null,!w.m),0<w.O&&(w.M=new qe(m(w.Y,w,w.g),w.O)),O=w.U,V=w.g,re=w.ca;var Me="readystatechange";Array.isArray(Me)||(Me&&($e[0]=Me.toString()),Me=$e);for(var Le=0;Le<Me.length;Le++){var mt=me(V,Me[Le],re||O.handleEvent,!1,O.h||O);if(!mt)break;O.g[mt.key]=mt}O=w.H?k(w.H):{},w.m?(w.u||(w.u="POST"),O["Content-Type"]="application/x-www-form-urlencoded",w.g.ea(w.A,w.u,w.m,O)):(w.u="GET",w.g.ea(w.A,w.u,null,O)),In(),_e(w.i,w.u,w.A,w.l,w.R,w.m)}ke.prototype.ca=function(w){w=w.target;const O=this.M;O&&xs(w)==3?O.j():this.Y(w)},ke.prototype.Y=function(w){try{if(w==this.g)e:{const Ca=xs(this.g);var O=this.g.Ba();const jl=this.g.Z();if(!(3>Ca)&&(Ca!=3||this.g&&(this.h.h||this.g.oa()||Ic(this.g)))){this.J||Ca!=4||O==7||(O==8||0>=jl?In(3):In(2)),$n(this);var V=this.g.Z();this.X=V;t:if(xt(this)){var re=Ic(this.g);w="";var Me=re.length,Le=xs(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){rr(this),Rt(this);var mt="";break t}this.h.i=new l.TextDecoder}for(O=0;O<Me;O++)this.h.h=!0,w+=this.h.i.decode(re[O],{stream:!(Le&&O==Me-1)});re.length=0,this.h.g+=w,this.C=0,mt=this.h.g}else mt=this.g.oa();if(this.o=V==200,et(this.i,this.u,this.A,this.l,this.R,Ca,V),this.o){if(this.T&&!this.K){t:{if(this.g){var on,ya=this.g;if((on=ya.g?ya.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!x(on)){var Or=on;break t}}Or=null}if(V=Or)ft(this.i,this.l,V,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,se(this,V);else{this.o=!1,this.s=3,Qt(12),rr(this),Rt(this);break e}}if(this.P){V=!0;let Ds;for(;!this.J&&this.C<mt.length;)if(Ds=qt(this,mt),Ds==Re){Ca==4&&(this.s=4,Qt(14),V=!1),ft(this.i,this.l,null,"[Incomplete Response]");break}else if(Ds==bt){this.s=4,Qt(15),ft(this.i,this.l,mt,"[Invalid Chunk]"),V=!1;break}else ft(this.i,this.l,Ds,null),se(this,Ds);if(xt(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Ca!=4||mt.length!=0||this.h.h||(this.s=1,Qt(16),V=!1),this.o=this.o&&V,!V)ft(this.i,this.l,mt,"[Invalid Chunked Response]"),rr(this),Rt(this);else if(0<mt.length&&!this.W){this.W=!0;var Sa=this.j;Sa.g==this&&Sa.ba&&!Sa.M&&(Sa.j.info("Great, no buffering proxy detected. Bytes received: "+mt.length),Ec(Sa),Sa.M=!0,Qt(11))}}else ft(this.i,this.l,mt,null),se(this,mt);Ca==4&&rr(this),this.o&&!this.J&&(Ca==4?Rp(this.j,this):(this.o=!1,Gr(this)))}else Qu(this.g),V==400&&0<mt.indexOf("Unknown SID")?(this.s=3,Qt(12)):(this.s=0,Qt(13)),rr(this),Rt(this)}}}catch{}finally{}};function xt(w){return w.g?w.u=="GET"&&w.L!=2&&w.j.Ca:!1}function qt(w,O){var V=w.C,re=O.indexOf(`
1596`,V);return re==-1?Re:(V=Number(O.substring(V,re)),isNaN(V)?bt:(re+=1,re+V>O.length?Re:(O=O.slice(re,re+V),w.C=re+V,O)))}ke.prototype.cancel=function(){this.J=!0,rr(this)};function Gr(w){w.S=Date.now()+w.I,la(w,w.I)}function la(w,O){if(w.B!=null)throw Error("WatchDog timer not null");w.B=nn(m(w.ba,w),O)}function $n(w){w.B&&(l.clearTimeout(w.B),w.B=null)}ke.prototype.ba=function(){this.B=null;const w=Date.now();0<=w-this.S?(pt(this.i,this.A),this.L!=2&&(In(),Qt(17)),rr(this),this.s=2,Rt(this)):la(this,this.S-w)};function Rt(w){w.j.G==0||w.J||Rp(w.j,w)}function rr(w){$n(w);var O=w.M;O&&typeof O.ma=="function"&&O.ma(),w.M=null,ct(w.U),w.g&&(O=w.g,w.g=null,O.abort(),O.ma())}function se(w,O){try{var V=w.j;if(V.G!=0&&(V.g==w||de(V.h,w))){if(!w.K&&de(V.h,w)&&V.G==3){try{var re=V.Da.g.parse(O)}catch{re=null}if(Array.isArray(re)&&re.length==3){var Me=re;if(Me[0]==0){e:if(!V.u){if(V.g)if(V.g.F+3e3<w.F)Ku(V),Yr(V);else break e;Qi(V),Qt(18)}}else V.za=Me[1],0<V.za-V.T&&37500>Me[2]&&V.F&&V.v==0&&!V.C&&(V.C=nn(m(V.Za,V),6e3));if(1>=ee(V.h)&&V.ca){try{V.ca()}catch{}V.ca=void 0}}else ko(V,11)}else if((w.K||V.g==w)&&Ku(V),!x(O))for(Me=V.Da.g.parse(O),O=0;O<Me.length;O++){let Or=Me[O];if(V.T=Or[0],Or=Or[1],V.G==2)if(Or[0]=="c"){V.K=Or[1],V.ia=Or[2];const Sa=Or[3];Sa!=null&&(V.la=Sa,V.j.info("VER="+V.la));const Ca=Or[4];Ca!=null&&(V.Aa=Ca,V.j.info("SVER="+V.Aa));const jl=Or[5];jl!=null&&typeof jl=="number"&&0<jl&&(re=1.5*jl,V.L=re,V.j.info("backChannelRequestTimeoutMs_="+re)),re=V;const Ds=w.g;if(Ds){const Zu=Ds.g?Ds.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Zu){var Le=re.h;Le.g||Zu.indexOf("spdy")==-1&&Zu.indexOf("quic")==-1&&Zu.indexOf("h2")==-1||(Le.j=Le.l,Le.g=new Set,Le.h&&(Se(Le,Le.h),Le.h=null))}if(re.D){const Ff=Ds.g?Ds.g.getResponseHeader("X-HTTP-Session-Id"):null;Ff&&(re.ya=Ff,Je(re.I,re.D,Ff))}}V.G=3,V.l&&V.l.ua(),V.ba&&(V.R=Date.now()-w.F,V.j.info("Handshake RTT: "+V.R+"ms")),re=V;var mt=w;if(re.qa=zp(re,re.J?re.ia:null,re.W),mt.K){Ue(re.h,mt);var on=mt,ya=re.L;ya&&(on.I=ya),on.B&&($n(on),Gr(on)),re.g=mt}else xl(re);0<V.i.length&&ar(V)}else Or[0]!="stop"&&Or[0]!="close"||ko(V,7);else V.G==3&&(Or[0]=="stop"||Or[0]=="close"?Or[0]=="stop"?ko(V,7):vl(V):Or[0]!="noop"&&V.l&&V.l.ta(Or),V.v=0)}}In(4)}catch{}}var Be=class{constructor(w,O){this.g=w,this.map=O}};function at(w){this.l=w||10,l.PerformanceNavigationTiming?(w=l.performance.getEntriesByType("navigation"),w=0<w.length&&(w[0].nextHopProtocol=="hq"||w[0].nextHopProtocol=="h2")):w=!!(l.chrome&&l.chrome.loadTimes&&l.chrome.loadTimes()&&l.chrome.loadTimes().wasFetchedViaSpdy),this.j=w?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Ke(w){return w.h?!0:w.g?w.g.size>=w.j:!1}function ee(w){return w.h?1:w.g?w.g.size:0}function de(w,O){return w.h?w.h==O:w.g?w.g.has(O):!1}function Se(w,O){w.g?w.g.add(O):w.h=O}function Ue(w,O){w.h&&w.h==O?w.h=null:w.g&&w.g.has(O)&&w.g.delete(O)}at.prototype.cancel=function(){if(this.i=Pe(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const w of this.g.values())w.cancel();this.g.clear()}};function Pe(w){if(w.h!=null)return w.i.concat(w.h.D);if(w.g!=null&&w.g.size!==0){let O=w.i;for(const V of w.g.values())O=O.concat(V.D);return O}return g(w.i)}function tt(w){if(w.V&&typeof w.V=="function")return w.V();if(typeof Map<"u"&&w instanceof Map||typeof Set<"u"&&w instanceof Set)return Array.from(w.values());if(typeof w=="string")return w.split("");if(c(w)){for(var O=[],V=w.length,re=0;re<V;re++)O.push(w[re]);return O}O=[],V=0;for(re in w)O[V++]=w[re];return O}function kt(w){if(w.na&&typeof w.na=="function")return w.na();if(!w.V||typeof w.V!="function"){if(typeof Map<"u"&&w instanceof Map)return Array.from(w.keys());if(!(typeof Set<"u"&&w instanceof Set)){if(c(w)||typeof w=="string"){var O=[];w=w.length;for(var V=0;V<w;V++)O.push(V);return O}O=[],V=0;for(const re in w)O[V++]=re;return O}}}function or(w,O){if(w.forEach&&typeof w.forEach=="function")w.forEach(O,void 0);else if(c(w)||typeof w=="string")Array.prototype.forEach.call(w,O,void 0);else for(var V=kt(w),re=tt(w),Me=re.length,Le=0;Le<Me;Le++)O.call(void 0,re[Le],V&&V[Le],w)}var Nr=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Fr(w,O){if(w){w=w.split("&");for(var V=0;V<w.length;V++){var re=w[V].indexOf("="),Me=null;if(0<=re){var Le=w[V].substring(0,re);Me=w[V].substring(re+1)}else Le=w[V];O(Le,Me?decodeURIComponent(Me.replace(/\+/g," ")):"")}}}function Sr(w){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,w instanceof Sr){this.h=w.h,kr(this,w.j),this.o=w.o,this.g=w.g,Ce(this,w.s),this.l=w.l;var O=w.i,V=new Mr;V.i=O.i,O.g&&(V.g=new Map(O.g),V.h=O.h),Ge(this,V),this.m=w.m}else w&&(O=String(w).match(Nr))?(this.h=!1,kr(this,O[1]||"",!0),this.o=pr(O[2]||""),this.g=pr(O[3]||"",!0),Ce(this,O[4]),this.l=pr(O[5]||"",!0),Ge(this,O[6]||"",!0),this.m=pr(O[7]||"")):(this.h=!1,this.i=new Mr(null,this.h))}Sr.prototype.toString=function(){var w=[],O=this.j;O&&w.push(ot(O,mr,!0),":");var V=this.g;return(V||O=="file")&&(w.push("//"),(O=this.o)&&w.push(ot(O,mr,!0),"@"),w.push(encodeURIComponent(String(V)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),V=this.s,V!=null&&w.push(":",String(V))),(V=this.l)&&(this.g&&V.charAt(0)!="/"&&w.push("/"),w.push(ot(V,V.charAt(0)=="/"?er:en,!0))),(V=this.i.toString())&&w.push("?",V),(V=this.m)&&w.push("#",ot(V,En)),w.join("")};function Zt(w){return new Sr(w)}function kr(w,O,V){w.j=V?pr(O,!0):O,w.j&&(w.j=w.j.replace(/:$/,""))}function Ce(w,O){if(O){if(O=Number(O),isNaN(O)||0>O)throw Error("Bad port number "+O);w.s=O}else w.s=null}function Ge(w,O,V){O instanceof Mr?(w.i=O,Nt(w.i,w.h)):(V||(O=ot(O,qn)),w.i=new Mr(O,w.h))}function Je(w,O,V){w.i.set(O,V)}function Xt(w){return Je(w,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),w}function pr(w,O){return w?O?decodeURI(w.replace(/%25/g,"%2525")):decodeURIComponent(w):""}function ot(w,O,V){return typeof w=="string"?(w=encodeURI(w).replace(O,Ut),V&&(w=w.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),w):null}function Ut(w){return w=w.charCodeAt(0),"%"+(w>>4&15).toString(16)+(w&15).toString(16)}var mr=/[#\/\?@]/g,en=/[#\?:]/g,er=/[#\?]/g,qn=/[#\?@]/g,En=/#/g;function Mr(w,O){this.h=this.g=null,this.i=w||null,this.j=!!O}function Hr(w){w.g||(w.g=new Map,w.h=0,w.i&&Fr(w.i,function(O,V){w.add(decodeURIComponent(O.replace(/\+/g," ")),V)}))}e=Mr.prototype,e.add=function(w,O){Hr(this),this.i=null,w=Oe(this,w);var V=this.g.get(w);return V||this.g.set(w,V=[]),V.push(O),this.h+=1,this};function ca(w,O){Hr(w),O=Oe(w,O),w.g.has(O)&&(w.i=null,w.h-=w.g.get(O).length,w.g.delete(O))}function ss(w,O){return Hr(w),O=Oe(w,O),w.g.has(O)}e.forEach=function(w,O){Hr(this),this.g.forEach(function(V,re){V.forEach(function(Me){w.call(O,Me,re,this)},this)},this)},e.na=function(){Hr(this);const w=Array.from(this.g.values()),O=Array.from(this.g.keys()),V=[];for(let re=0;re<O.length;re++){const Me=w[re];for(let Le=0;Le<Me.length;Le++)V.push(O[re])}return V},e.V=function(w){Hr(this);let O=[];if(typeof w=="string")ss(this,w)&&(O=O.concat(this.g.get(Oe(this,w))));else{w=Array.from(this.g.values());for(let V=0;V<w.length;V++)O=O.concat(w[V])}return O},e.set=function(w,O){return Hr(this),this.i=null,w=Oe(this,w),ss(this,w)&&(this.h-=this.g.get(w).length),this.g.set(w,[O]),this.h+=1,this},e.get=function(w,O){return w?(w=this.V(w),0<w.length?String(w[0]):O):O};function ge(w,O,V){ca(w,O),0<V.length&&(w.i=null,w.g.set(Oe(w,O),g(V)),w.h+=V.length)}e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const w=[],O=Array.from(this.g.keys());for(var V=0;V<O.length;V++){var re=O[V];const Le=encodeURIComponent(String(re)),mt=this.V(re);for(re=0;re<mt.length;re++){var Me=Le;mt[re]!==""&&(Me+="="+encodeURIComponent(String(mt[re]))),w.push(Me)}}return this.i=w.join("&")};function Oe(w,O){return O=String(O),w.j&&(O=O.toLowerCase()),O}function Nt(w,O){O&&!w.j&&(Hr(w),w.i=null,w.g.forEach(function(V,re){var Me=re.toLowerCase();re!=Me&&(ca(this,re),ge(this,Me,V))},w)),w.j=O}function wt(w,O){const V=new Lt;if(l.Image){const re=new Image;re.onload=h(an,V,"TestLoadImage: loaded",!0,O,re),re.onerror=h(an,V,"TestLoadImage: error",!1,O,re),re.onabort=h(an,V,"TestLoadImage: abort",!1,O,re),re.ontimeout=h(an,V,"TestLoadImage: timeout",!1,O,re),l.setTimeout(function(){re.ontimeout&&re.ontimeout()},1e4),re.src=w}else O(!1)}function Ir(w,O){const V=new Lt,re=new AbortController,Me=setTimeout(()=>{re.abort(),an(V,"TestPingServer: timeout",!1,O)},1e4);fetch(w,{signal:re.signal}).then(Le=>{clearTimeout(Me),Le.ok?an(V,"TestPingServer: ok",!0,O):an(V,"TestPingServer: server error",!1,O)}).catch(()=>{clearTimeout(Me),an(V,"TestPingServer: error",!1,O)})}function an(w,O,V,re,Me){try{Me&&(Me.onload=null,Me.onerror=null,Me.onabort=null,Me.ontimeout=null),re(V)}catch{}}function ta(){this.g=new Ae}function nr(w,O,V){const re=V||"";try{or(w,function(Me,Le){let mt=Me;u(Me)&&(mt=oe(Me)),O.push(re+Le+"="+encodeURIComponent(mt))})}catch(Me){throw O.push(re+"type="+encodeURIComponent("_badmap")),Me}}function gr(w){this.l=w.Ub||null,this.j=w.eb||!1}p(gr,lt),gr.prototype.g=function(){return new gn(this.l,this.j)},gr.prototype.i=function(w){return function(){return w}}({});function gn(w,O){fe.call(this),this.D=w,this.o=O,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}p(gn,fe),e=gn.prototype,e.open=function(w,O){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=w,this.A=O,this.readyState=1,it(this)},e.send=function(w){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const O={headers:this.u,method:this.B,credentials:this.m,cache:void 0};w&&(O.body=w),(this.D||l).fetch(new Request(this.A,O)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Hs(this)),this.readyState=0},e.Sa=function(w){if(this.g&&(this.l=w,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=w.headers,this.readyState=2,it(this)),this.g&&(this.readyState=3,it(this),this.g)))if(this.responseType==="arraybuffer")w.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof l.ReadableStream<"u"&&"body"in w){if(this.j=w.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Na(this)}else w.text().then(this.Ra.bind(this),this.ga.bind(this))};function Na(w){w.j.read().then(w.Pa.bind(w)).catch(w.ga.bind(w))}e.Pa=function(w){if(this.g){if(this.o&&w.value)this.response.push(w.value);else if(!this.o){var O=w.value?w.value:new Uint8Array(0);(O=this.v.decode(O,{stream:!w.done}))&&(this.response=this.responseText+=O)}w.done?Hs(this):it(this),this.readyState==3&&Na(this)}},e.Ra=function(w){this.g&&(this.response=this.responseText=w,Hs(this))},e.Qa=function(w){this.g&&(this.response=w,Hs(this))},e.ga=function(){this.g&&Hs(this)};function Hs(w){w.readyState=4,w.l=null,w.j=null,w.v=null,it(w)}e.setRequestHeader=function(w,O){this.u.append(w,O)},e.getResponseHeader=function(w){return this.h&&this.h.get(w.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const w=[],O=this.h.entries();for(var V=O.next();!V.done;)V=V.value,w.push(V[0]+": "+V[1]),V=O.next();return w.join(`\r
1597`)};function it(w){w.onreadystatechange&&w.onreadystatechange.call(w)}Object.defineProperty(gn.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(w){this.m=w?"include":"same-origin"}});function Co(w){let O="";return S(w,function(V,re){O+=re,O+=":",O+=V,O+=`\r
1598`}),O}function Cc(w,O,V){e:{for(re in V){var re=!1;break e}re=!0}re||(V=Co(V),typeof w=="string"?V!=null&&encodeURIComponent(String(V)):Je(w,O,V))}function sn(w){fe.call(this),this.headers=new Map,this.o=w||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}p(sn,fe);var Rf=/^https?$/i,Ys=["POST","PUT"];e=sn.prototype,e.Ha=function(w){this.J=w},e.ea=function(w,O,V,re){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+w);O=O?O.toUpperCase():"GET",this.D=w,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Dr.g(),this.v=this.o?Mt(this.o):Mt(Dr),this.g.onreadystatechange=m(this.Ea,this);try{this.B=!0,this.g.open(O,String(w),!0),this.B=!1}catch(Le){Gi(this,Le);return}if(w=V||"",V=new Map(this.headers),re)if(Object.getPrototypeOf(re)===Object.prototype)for(var Me in re)V.set(Me,re[Me]);else if(typeof re.keys=="function"&&typeof re.get=="function")for(const Le of re.keys())V.set(Le,re.get(Le));else throw Error("Unknown input type for opt_headers: "+String(re));re=Array.from(V.keys()).find(Le=>Le.toLowerCase()=="content-type"),Me=l.FormData&&w instanceof l.FormData,!(0<=Array.prototype.indexOf.call(Ys,O,void 0))||re||Me||V.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Le,mt]of V)this.g.setRequestHeader(Le,mt);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Mc(this),this.u=!0,this.g.send(w),this.u=!1}catch(Le){Gi(this,Le)}};function Gi(w,O){w.h=!1,w.g&&(w.j=!0,w.g.abort(),w.j=!1),w.l=O,w.m=5,kc(w),bl(w)}function kc(w){w.A||(w.A=!0,je(w,"complete"),je(w,"error"))}e.abort=function(w){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=w||7,je(this,"complete"),je(this,"abort"),bl(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),bl(this,!0)),sn.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?Yu(this):this.bb())},e.bb=function(){Yu(this)};function Yu(w){if(w.h&&typeof o<"u"&&(!w.v[1]||xs(w)!=4||w.Z()!=2)){if(w.u&&xs(w)==4)yt(w.Ea,0,w);else if(je(w,"readystatechange"),xs(w)==4){w.h=!1;try{const mt=w.Z();e:switch(mt){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var O=!0;break e;default:O=!1}var V;if(!(V=O)){var re;if(re=mt===0){var Me=String(w.D).match(Nr)[1]||null;!Me&&l.self&&l.self.location&&(Me=l.self.location.protocol.slice(0,-1)),re=!Rf.test(Me?Me.toLowerCase():"")}V=re}if(V)je(w,"complete"),je(w,"success");else{w.m=6;try{var Le=2<xs(w)?w.g.statusText:""}catch{Le=""}w.l=Le+" ["+w.Z()+"]",kc(w)}}finally{bl(w)}}}}function bl(w,O){if(w.g){Mc(w);const V=w.g,re=w.v[0]?()=>{}:null;w.g=null,w.v=null,O||je(w,"ready");try{V.onreadystatechange=re}catch{}}}function Mc(w){w.I&&(l.clearTimeout(w.I),w.I=null)}e.isActive=function(){return!!this.g};function xs(w){return w.g?w.g.readyState:0}e.Z=function(){try{return 2<xs(this)?this.g.status:-1}catch{return-1}},e.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},e.Oa=function(w){if(this.g){var O=this.g.responseText;return w&&O.indexOf(w)==0&&(O=O.substring(w.length)),Ne(O)}};function Ic(w){try{if(!w.g)return null;if("response"in w.g)return w.g.response;switch(w.H){case"":case"text":return w.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in w.g)return w.g.mozResponseArrayBuffer}return null}catch{return null}}function Qu(w){const O={};w=(w.g&&2<=xs(w)&&w.g.getAllResponseHeaders()||"").split(`\r
1599`);for(let re=0;re<w.length;re++){if(x(w[re]))continue;var V=L(w[re]);const Me=V[0];if(V=V[1],typeof V!="string")continue;V=V.trim();const Le=O[Me]||[];O[Me]=Le,Le.push(V)}M(O,function(re){return re.join(", ")})}e.Ba=function(){return this.m},e.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Hi(w,O,V){return V&&V.internalChannelParams&&V.internalChannelParams[w]||O}function Yi(w){this.Aa=0,this.i=[],this.j=new Lt,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Hi("failFast",!1,w),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Hi("baseRetryDelayMs",5e3,w),this.cb=Hi("retryDelaySeedMs",1e4,w),this.Wa=Hi("forwardChannelMaxRetries",2,w),this.wa=Hi("forwardChannelRequestTimeoutMs",2e4,w),this.pa=w&&w.xmlHttpFactory||void 0,this.Xa=w&&w.Tb||void 0,this.Ca=w&&w.useFetchStreams||!1,this.L=void 0,this.J=w&&w.supportsCrossDomainXhr||!1,this.K="",this.h=new at(w&&w.concurrentRequestLimit),this.Da=new ta,this.P=w&&w.fastHandshake||!1,this.O=w&&w.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=w&&w.Rb||!1,w&&w.xa&&this.j.xa(),w&&w.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&w&&w.detectBufferingProxy||!1,this.ja=void 0,w&&w.longPollingTimeout&&0<w.longPollingTimeout&&(this.ja=w.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}e=Yi.prototype,e.la=8,e.G=1,e.connect=function(w,O,V,re){Qt(0),this.W=w,this.H=O||{},V&&re!==void 0&&(this.H.OSID=V,this.H.OAID=re),this.F=this.X,this.I=zp(this,null,this.W),ar(this)};function vl(w){if(_s(w),w.G==3){var O=w.U++,V=Zt(w.I);if(Je(V,"SID",w.K),Je(V,"RID",O),Je(V,"TYPE","terminate"),is(w,V),O=new ke(w,w.j,O),O.L=2,O.v=Xt(Zt(V)),V=!1,l.navigator&&l.navigator.sendBeacon)try{V=l.navigator.sendBeacon(O.v.toString(),"")}catch{}!V&&l.Image&&(new Image().src=O.v,V=!0),V||(O.g=Bp(O.j,null),O.g.ea(O.v)),O.F=Date.now(),Gr(O)}Fp(w)}function Yr(w){w.g&&(Ec(w),w.g.cancel(),w.g=null)}function _s(w){Yr(w),w.u&&(l.clearTimeout(w.u),w.u=null),Ku(w),w.h.cancel(),w.s&&(typeof w.s=="number"&&l.clearTimeout(w.s),w.s=null)}function ar(w){if(!Ke(w.h)&&!w.s){w.s=!0;var O=w.Ga;A||F(),P||(A(),P=!0),E.add(O,w),w.B=0}}function yn(w,O){return ee(w.h)>=w.h.j-(w.s?1:0)?!1:w.s?(w.i=O.D.concat(w.i),!0):w.G==1||w.G==2||w.B>=(w.Va?0:w.Wa)?!1:(w.s=nn(m(w.Ga,w,O),$p(w,w.B)),w.B++,!0)}e.Ga=function(w){if(this.s)if(this.s=null,this.G==1){if(!w){this.U=Math.floor(1e5*Math.random()),w=this.U++;const Me=new ke(this,this.j,w);let Le=this.o;if(this.S&&(Le?(Le=k(Le),T(Le,this.S)):Le=this.S),this.m!==null||this.O||(Me.H=Le,Le=null),this.P)e:{for(var O=0,V=0;V<this.i.length;V++){t:{var re=this.i[V];if("__data__"in re.map&&(re=re.map.__data__,typeof re=="string")){re=re.length;break t}re=void 0}if(re===void 0)break;if(O+=re,4096<O){O=V;break e}if(O===4096||V===this.i.length-1){O=V+1;break e}}O=1e3}else O=1e3;O=$f(this,Me,O),V=Zt(this.I),Je(V,"RID",w),Je(V,"CVER",22),this.D&&Je(V,"X-HTTP-Session-Id",this.D),is(this,V),Le&&(this.O?O="headers="+encodeURIComponent(String(Co(Le)))+"&"+O:this.m&&Cc(V,this.m,Le)),Se(this.h,Me),this.Ua&&Je(V,"TYPE","init"),this.P?(Je(V,"$req",O),Je(V,"SID","null"),Me.T=!0,dt(Me,V,null)):dt(Me,V,O),this.G=2}}else this.G==3&&(w?Ls(this,w):this.i.length==0||Ke(this.h)||Ls(this))};function Ls(w,O){var V;O?V=O.l:V=w.U++;const re=Zt(w.I);Je(re,"SID",w.K),Je(re,"RID",V),Je(re,"AID",w.T),is(w,re),w.m&&w.o&&Cc(re,w.m,w.o),V=new ke(w,w.j,V,w.B+1),w.m===null&&(V.H=w.o),O&&(w.i=O.D.concat(w.i)),O=$f(w,V,1e3),V.I=Math.round(.5*w.wa)+Math.round(.5*w.wa*Math.random()),Se(w.h,V),dt(V,re,O)}function is(w,O){w.H&&S(w.H,function(V,re){Je(O,re,V)}),w.l&&or({},function(V,re){Je(O,re,V)})}function $f(w,O,V){V=Math.min(w.i.length,V);var re=w.l?m(w.l.Na,w.l,w):null;e:{var Me=w.i;let Le=-1;for(;;){const mt=["count="+V];Le==-1?0<V?(Le=Me[0].g,mt.push("ofs="+Le)):Le=0:mt.push("ofs="+Le);let on=!0;for(let ya=0;ya<V;ya++){let Or=Me[ya].g;const Sa=Me[ya].map;if(Or-=Le,0>Or)Le=Math.max(0,Me[ya].g-100),on=!1;else try{nr(Sa,mt,"req"+Or+"_")}catch{re&&re(Sa)}}if(on){re=mt.join("&");break e}}}return w=w.i.splice(0,V),O.D=w,re}function xl(w){if(!w.g&&!w.u){w.Y=1;var O=w.Fa;A||F(),P||(A(),P=!0),E.add(O,w),w.v=0}}function Qi(w){return w.g||w.u||3<=w.v?!1:(w.Y++,w.u=nn(m(w.Fa,w),$p(w,w.v)),w.v++,!0)}e.Fa=function(){if(this.u=null,Op(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var w=2*this.R;this.j.info("BP detection timer enabled: "+w),this.A=nn(m(this.ab,this),w)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Qt(10),Yr(this),Op(this))};function Ec(w){w.A!=null&&(l.clearTimeout(w.A),w.A=null)}function Op(w){w.g=new ke(w,w.j,"rpc",w.Y),w.m===null&&(w.g.H=w.o),w.g.O=0;var O=Zt(w.qa);Je(O,"RID","rpc"),Je(O,"SID",w.K),Je(O,"AID",w.T),Je(O,"CI",w.F?"0":"1"),!w.F&&w.ja&&Je(O,"TO",w.ja),Je(O,"TYPE","xmlhttp"),is(w,O),w.m&&w.o&&Cc(O,w.m,w.o),w.L&&(w.g.I=w.L);var V=w.g;w=w.ia,V.L=1,V.v=Xt(Zt(O)),V.m=null,V.P=!0,Et(V,w)}e.Za=function(){this.C!=null&&(this.C=null,Yr(this),Qi(this),Qt(19))};function Ku(w){w.C!=null&&(l.clearTimeout(w.C),w.C=null)}function Rp(w,O){var V=null;if(w.g==O){Ku(w),Ec(w),w.g=null;var re=2}else if(de(w.h,O))V=O.D,Ue(w.h,O),re=1;else return;if(w.G!=0){if(O.o)if(re==1){V=O.m?O.m.length:0,O=Date.now()-O.F;var Me=w.B;re=At(),je(re,new Sn(re,V)),ar(w)}else xl(w);else if(Me=O.s,Me==3||Me==0&&0<O.X||!(re==1&&yn(w,O)||re==2&&Qi(w)))switch(V&&0<V.length&&(O=w.h,O.i=O.i.concat(V)),Me){case 1:ko(w,5);break;case 4:ko(w,10);break;case 3:ko(w,6);break;default:ko(w,2)}}}function $p(w,O){let V=w.Ta+Math.floor(Math.random()*w.cb);return w.isActive()||(V*=2),V*O}function ko(w,O){if(w.j.info("Error code "+O),O==2){var V=m(w.fb,w),re=w.Xa;const Me=!re;re=new Sr(re||"//www.google.com/images/cleardot.gif"),l.location&&l.location.protocol=="http"||kr(re,"https"),Xt(re),Me?wt(re.toString(),V):Ir(re.toString(),V)}else Qt(2);w.G=0,w.l&&w.l.sa(O),Fp(w),_s(w)}e.fb=function(w){w?(this.j.info("Successfully pinged google.com"),Qt(2)):(this.j.info("Failed to ping google.com"),Qt(1))};function Fp(w){if(w.G=0,w.ka=[],w.l){const O=Pe(w.h);(O.length!=0||w.i.length!=0)&&(y(w.ka,O),y(w.ka,w.i),w.h.i.length=0,g(w.i),w.i.length=0),w.l.ra()}}function zp(w,O,V){var re=V instanceof Sr?Zt(V):new Sr(V);if(re.g!="")O&&(re.g=O+"."+re.g),Ce(re,re.s);else{var Me=l.location;re=Me.protocol,O=O?O+"."+Me.hostname:Me.hostname,Me=+Me.port;var Le=new Sr(null);re&&kr(Le,re),O&&(Le.g=O),Me&&Ce(Le,Me),V&&(Le.l=V),re=Le}return V=w.D,O=w.ya,V&&O&&Je(re,V,O),Je(re,"VER",w.la),is(w,re),re}function Bp(w,O,V){if(O&&!w.J)throw Error("Can't create secondary domain capable XhrIo object.");return O=w.Ca&&!w.pa?new sn(new gr({eb:V})):new sn(w.pa),O.Ha(w.J),O}e.isActive=function(){return!!this.l&&this.l.isActive(this)};function Up(){}e=Up.prototype,e.ua=function(){},e.ta=function(){},e.sa=function(){},e.ra=function(){},e.isActive=function(){return!0},e.Na=function(){};function Ju(){}Ju.prototype.g=function(w,O){return new os(w,O)};function os(w,O){fe.call(this),this.g=new Yi(O),this.l=w,this.h=O&&O.messageUrlParams||null,w=O&&O.messageHeaders||null,O&&O.clientProtocolHeaderRequired&&(w?w["X-Client-Protocol"]="webchannel":w={"X-Client-Protocol":"webchannel"}),this.g.o=w,w=O&&O.initMessageHeaders||null,O&&O.messageContentType&&(w?w["X-WebChannel-Content-Type"]=O.messageContentType:w={"X-WebChannel-Content-Type":O.messageContentType}),O&&O.va&&(w?w["X-WebChannel-Client-Profile"]=O.va:w={"X-WebChannel-Client-Profile":O.va}),this.g.S=w,(w=O&&O.Sb)&&!x(w)&&(this.g.m=w),this.v=O&&O.supportsCrossDomainXhr||!1,this.u=O&&O.sendRawJson||!1,(O=O&&O.httpSessionIdParam)&&!x(O)&&(this.g.D=O,w=this.h,w!==null&&O in w&&(w=this.h,O in w&&delete w[O])),this.j=new wl(this)}p(os,fe),os.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},os.prototype.close=function(){vl(this.g)},os.prototype.o=function(w){var O=this.g;if(typeof w=="string"){var V={};V.__data__=w,w=V}else this.u&&(V={},V.__data__=oe(w),w=V);O.i.push(new Be(O.Ya++,w)),O.G==3&&ar(O)},os.prototype.N=function(){this.g.l=null,delete this.j,vl(this.g),delete this.g,os.aa.N.call(this)};function Vp(w){Bt.call(this),w.__headers__&&(this.headers=w.__headers__,this.statusCode=w.__status__,delete w.__headers__,delete w.__status__);var O=w.__sm__;if(O){e:{for(const V in O){w=V;break e}w=void 0}(this.i=w)&&(w=this.i,O=O!==null&&w in O?O[w]:void 0),this.data=O}else this.data=w}p(Vp,Bt);function Wp(){ve.call(this),this.status=1}p(Wp,ve);function wl(w){this.g=w}p(wl,Up),wl.prototype.ua=function(){je(this.g,"a")},wl.prototype.ta=function(w){je(this.g,new Vp(w))},wl.prototype.sa=function(w){je(this.g,new Wp)},wl.prototype.ra=function(){je(this.g,"b")},Ju.prototype.createWebChannel=Ju.prototype.g,os.prototype.send=os.prototype.o,os.prototype.open=os.prototype.m,os.prototype.close=os.prototype.close,uU=function(){return new Ju},cU=function(){return At()},lU=Fe,ck={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Pt.NO_ERROR=0,Pt.TIMEOUT=8,Pt.HTTP_ERROR=6,Vv=Pt,Ft.COMPLETE="complete",oU=Ft,jt.EventType=Xe,Xe.OPEN="a",Xe.CLOSE="b",Xe.ERROR="c",Xe.MESSAGE="d",fe.prototype.listen=fe.prototype.K,Mg=jt,sn.prototype.listenOnce=sn.prototype.L,sn.prototype.getLastError=sn.prototype.Ka,sn.prototype.getLastErrorCode=sn.prototype.Ba,sn.prototype.getStatus=sn.prototype.Z,sn.prototype.getResponseJson=sn.prototype.Oa,sn.prototype.getResponseText=sn.prototype.oa,sn.prototype.send=sn.prototype.ea,sn.prototype.setWithCredentials=sn.prototype.Ha,iU=sn}).apply(typeof Gb<"u"?Gb:typeof self<"u"?self:typeof window<"u"?window:{});const v3="@firebase/firestore";/**
1600 * @license
1601 * Copyright 2017 Google LLC
1602 *
1603 * Licensed under the Apache License, Version 2.0 (the "License");
1604 * you may not use this file except in compliance with the License.
1605 * You may obtain a copy of the License at
1606 *
1607 *   http://www.apache.org/licenses/LICENSE-2.0
1608 *
1609 * Unless required by applicable law or agreed to in writing, softw
1609are
1610 * distributed under the License is distributed on an "AS IS" BASIS,
1611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1612 * See the License for the specific language governing permissions and
1613 * limitations under the License.
1614 */let us=class{constructor(t){this.uid=t}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}};us.UNAUTHENTICATED=new us(null),us.GOOGLE_CREDENTIALS=new us("google-credentials-uid"),us.FIRST_PARTY=new us("first-party-uid"),us.MOCK_USER=new us("mock-user");/**
1615 * @license
1616 * Copyright 2017 Google LLC
1617 *
1618 * Licensed under the Apache License, Version 2.0 (the "License");
1619 * you may not use this file except in compliance with the License.
1620 * You may obtain a copy of the License at
1621 *
1622 *   http://www.apache.org/licenses/LICENSE-2.0
1623 *
1624 * Unless required by applicable law or agreed to in writing, software
1625 * distributed under the License is distributed on an "AS IS" BASIS,
1626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1627 * See the License for the specific language governing permissions and
1628 * limitations under the License.
1629 */let Xh="10.14.0";/**
1630 * @license
1631 * Copyright 2017 Google LLC
1632 *
1633 * Licensed under the Apache License, Version 2.0 (the "License");
1634 * you may not use this file except in compliance with the License.
1635 * You may obtain a copy of the License at
1636 *
1637 *   http://www.apache.org/licenses/LICENSE-2.0
1638 *
1639 * Unless required by applicable law or agreed to in writing, software
1640 * distributed under the License is distributed on an "AS IS" BASIS,
1641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1642 * See the License for the specific language governing permissions and
1643 * limitations under the License.
1644 */const Xd=new kI("@firebase/firestore");function Yp(){return Xd.logLevel}function Dt(e,...t){if(Xd.logLevel<=$r.DEBUG){const r=t.map(zI);Xd.debug(`Firestore (${Xh}): ${e}`,...r)}}function sc(e,...t){if(Xd.logLevel<=$r.ERROR){const r=t.map(zI);Xd.error(`Firestore (${Xh}): ${e}`,...r)}}function eh(e,...t){if(Xd.logLevel<=$r.WARN){const r=t.map(zI);Xd.warn(`Firestore (${Xh}): ${e}`,...r)}}function zI(e){if(typeof e=="string")return e;try{/**
1645* @license
1646* Copyright 2020 Google LLC
1647*
1648* Licensed under the Apache License, Version 2.0 (the "License");
1649* you may not use this file except in compliance with the License.
1650* You may obtain a copy of the License at
1651*
1652*   http://www.apache.org/licenses/LICENSE-2.0
1653*
1654* Unless required by applicable law or agreed to in writing, software
1655* distributed under the License is distributed on an "AS IS" BASIS,
1656* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1657* See the License for the specific language governing permissions and
1658* limitations under the License.
1659*/return function(r){return JSON.stringify(r)}(e)}catch{return e}}/**
1660 * @license
1661 * Copyright 2017 Google LLC
1662 *
1663 * Licensed under the Apache License, Version 2.0 (the "License");
1664 * you may not use this file except in compliance with the License.
1665 * You may obtain a copy of the License at
1666 *
1667 *   http://www.apache.org/licenses/LICENSE-2.0
1668 *
1669 * Unless required by applicable law or agreed to in writing, software
1670 * distributed under the License is distributed on an "AS IS" BASIS,
1671 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1672 * See the License for the specific language governing permissions and
1673 * limitations under the License.
1674 */function ur(e="Unexpected state"){const t=`FIRESTORE (${Xh}) INTERNAL ASSERTION FAILED: `+e;throw sc(t),new Error(t)}function xn(e,t){e||ur()}function fr(e,t){return e}/**
1675 * @license
1676 * Copyright 2017 Google LLC
1677 *
1678 * Licensed under the Apache License, Version 2.0 (the "License");
1679 * you may not use this file except in compliance with the License.
1680 * You may obtain a copy of the License at
1681 *
1682 *   http://www.apache.org/licenses/LICENSE-2.0
1683 *
1684 * Unless required by applicable law or agreed to in writing, software
1685 * distributed under the License is distributed on an "AS IS" BASIS,
1686 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1687 * See the License for the specific language governing permissions and
1688 * limitations under the License.
1689 */const st={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
1689ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Ht extends gc{constructor(t,r){super(t,r),this.code=t,this.message=r,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1690 * @license
1691 * Copyright 2017 Google LLC
1692 *
1693 * Licensed under the Apache License, Version 2.0 (the "License");
1694 * you may not use this file except in compliance with the License.
1695 * You may obtain a copy of the License at
1696 *
1697 *   http://www.apache.org/licenses/LICENSE-2.0
1698 *
1699 * Unless required by applicable law or agreed to in writing, software
1700 * distributed under the License is distributed on an "AS IS" BASIS,
1701 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1702 * See the License for the specific language governing permissions and
1703 * limitations under the License.
1704 */class pu{constructor(){this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}}/**
1705 * @license
1706 * Copyright 2017 Google LLC
1707 *
1708 * Licensed under the Apache License, Version 2.0 (the "License");
1709 * you may not use this file except in compliance with the License.
1710 * You may obtain a copy of the License at
1711 *
1712 *   http://www.apache.org/licenses/LICENSE-2.0
1713 *
1714 * Unless required by applicable law or agreed to in writing, software
1715 * distributed under the License is distributed on an "AS IS" BASIS,
1716 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1717 * See the License for the specific language governing permissions and
1718 * limitations under the License.
1719 */class dU{constructor(t,r){this.user=r,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class Qce{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,r){t.enqueueRetryable(()=>r(us.UNAUTHENTICATED))}shutdown(){}}class Kce{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,r){this.changeListener=r,t.enqueueRetryable(()=>r(this.token.user))}shutdown(){this.changeListener=null}}class Jce{constructor(t){this.t=t,this.currentUser=us.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,r){xn(this.o===void 0);let n=this.i;const a=c=>this.i!==n?(n=this.i,r(c)):Promise.resolve();let i=new pu;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new pu,t.enqueueRetryable(()=>a(this.currentUser))};const o=()=>{const c=i;t.enqueueRetryable(async()=>{await c.promise,await a(this.currentUser)})},l=c=>{Dt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(c=>l(c)),setTimeout(()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?l(c):(Dt("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new pu)}},0),o()}getToken(){const t=this.i,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then(n=>this.i!==t?(Dt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):n?(xn(typeof n.accessToken=="string"),new dU(n.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const t=this.auth&&this.auth.getUid();return xn(t===null||typeof t=="string"),new us(t)}}class Zce{constructor(t,r,n){this.l=t,this.h=r,this.P=n,this.type="FirstParty",this.user=us.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const t=this.T();return t&&this.I.set("Authorization",t),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class Xce{constructor(t,r,n){this.l=t,this.h=r,this.P=n}getToken(){return Promise.resolve(new Zce(this.l,this.h,this.P))}start(t,r){t.enqueueRetryable(()=>r(us.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class eue{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class tue{constructor(t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(t,r){xn(this.o===void 0);const n=i=>{i.error!=null&&Dt("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const o=i.token!==this.R;return this.R=i.token,Dt("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?r(i.token):Promise.resolve()};this.o=i=>{t.enqueueRetryable(()=>n(i))};const a=i=>{Dt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(i=>a(i)),setTimeout(()=>{if(!this.appCheck){const i=this.A.getImmediate({optional:!0});i?a(i):Dt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(r=>r?(xn(typeof r.token=="string"),this.R=r.token,new eue(r.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
1720 * @license
1721 * Copyright 2020 Google LLC
1722 *
1723 * Licensed under the Apache License, Version 2.0 (the "License");
1724 * you may not use this file except in compliance with the License.
1725 * You may obtain a copy of the License at
1726 *
1727 *   http://www.apache.org/licenses/LICENSE-2.0
1728 *
1729 * Unless required by applicable law or agreed to in writing, software
1730 * distributed under the License is distributed on an "AS IS" BASIS,
1731 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1732 * See the License for the specific language governing permissions and
1733 * limitations under the License.
1734 */function rue(e){const t=typeof self<"u"&&(self.crypto||self.msCrypto),r=new Uint8Array(e);if(t&&typeof t.getRandomValues=="function")t.getRandomValues(r);else for(let n=0;n<e;n++)r[n]=Math.floor(256*Math.random());return r}/**
1735 * @license
1736 * Copyright 2017 Google LLC
1737 *
1738 * Licensed under the Apache License, Version 2.0 (the "License");
1739 * you may not use this file except in compliance with the License.
1740 * You may obtain a copy of the License at
1741 *
1742 *   http://www.apache.org/licenses/LICENSE-2.0
1743 *
1744 * Unless required by applicable law or agreed to in writing, software
1745 * distributed under the License is distributed on an "AS IS" BASIS,
1746 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1747 * See the License for the specific language governing permissions and
1748 * limitations under the License.
1749 */class fU{static newId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=Math.floor(256/t.length)*t.length;let n="";for(;n.length<20;){const a=rue(40);for(let i=0;i<a.length;++i)n.length<20&&a[i]<r&&(n+=t.charAt(a[i]%t.length))}return n}}function Zr(e,t){return e<t?-1:e>t?1:0}function th(e,t,r){return e.length===t.length&&e.every((n,a)=>r(n,t[a]))}/**
1750 * @license
1751 * Copyright 2017 Google LLC
1752 *
1753 * Licensed under the Apache License, Version 2.0 (the "License");
1754 * you may not use this file except in compliance with the License.
1755 * You may obtain a copy of the License at
1756 *
1757 *   http://www.apache.org/licenses/LICENSE-2.0
1758 *
1759 * Unless required by applicable law or agreed to in writing, software
1760 * distributed under the License is distributed on an "AS IS" BASIS,
1761 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1762 * See the License for the specific language governing permissions and
1763 * limitations under the License.
1764 */class Pa{constructor(t,r){if(this.seconds=t,this.nanoseconds=r,r<0)throw new Ht(st.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(r>=1e9)throw new Ht(st.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(t<-62135596800)throw new Ht(st.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Ht(st.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return Pa.fromMillis(Date.now())}static fromDate(t){return Pa.fromMillis(t.getTime())}static fromMillis(t){const r=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*r));return new Pa(r,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?Zr(this.nanoseconds,t.nanoseconds):Zr(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
1765 * @license
1766 * Copyright 2017 Google LLC
1767 *
1768 * Licensed under the Apache License, Version 2.0 (the "License");
1769 * you may not use this file except in compliance with the License.
1770 * You may obtain a copy of the License at
1771 *
1772 *   http://www.apache.org/licenses/LICENSE-2.0
1773 *
1774 * Unless required by applicable law or agreed to in writing, software
1775 * distributed under the License is distributed on an "AS IS" BASIS,
1776 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1777 * See the License for the specific language governing permissions and
1778 * limitations under the License.
1779 */class dr{constructor(t){this.timestamp=t}static fromTimestamp(t){return new dr(t)}static min(){return new dr(new Pa(0,0))}static max(){return new dr(new Pa(253402300799,999999999))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
1780 * @license
1781 * Copyright 2017 Google LLC
1782 *
1783 * Licensed under the Apache License, Version 2.0 (the "License");
1784 * you may not use this file except in compliance with the License.
1785 * You may obtain a copy of the License at
1786 *
1787 *   http://www.apache.org/licenses/LICENSE-2.0
1788 *
1789 * Unless required by applicable law or agreed to in writing, software
1790 * distributed under the License is distributed on an "AS IS" BASIS,
1791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1792 * See the License for the specific language governing permissions and
1793 * limitations under the License.
1794 */class f0{constructor(t,r,n){r===void 0?r=0:r>t.length&&ur(),n===void 0?n=t.length-r:n>t.length-r&&ur(),this.segments=t,this.offset=r,this.len=n}get length(){return this.len}isEqual(t){return f0.comparator(this,t)===0}child(t){const r=this.segments.slice(this.offset,this.limit());return t instanceof f0?t.forEach(n=>{r.push(n)}):r.push(t),this.construct(r)}limit(){return this.offset+this.length}popFirst(t){return t=t===void 0?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return this.length===0}isPrefixOf(t){if(t.length<this.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==t.get(r))return!1;return!0}isImmediateParentOf(t){if(this.length+1!==t.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==t.get(r))return!1;return!0}forEach(t){for(let r=this.offset,n=this.limit();r<n;r++)t(this.segments[r])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(t,r){const n=Math.min(t.length,r.length);for(let a=0;a<n;a++){const i=t.get(a),o=r.get(a);if(i<o)return-1;if(i>o)return 1}return t.length<r.length?-1:t.length>r.length?1:0}}class sa extends f0{construct(t,r,n){return new sa(t,r,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...t){const r=[];for(const n of t){if(n.indexOf("//")>=0)throw new Ht(st.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);r.push(...n.split("/").filter(a=>a.length>0))}return new sa(r)}static emptyPath(){return new sa([])}}const nue=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Qa extends f0{construct(t,r,n){return new Qa(t,r,n)}static isValidIdentifier(t){return nue.test(t)}canonicalString(){return this.toArray().map(t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Qa.isValidIdentifier(t)||(t="`"+t+"`"),t)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Qa(["__name__"])}static fromServerFormat(t){const r=[];let n="",a=0;const i=()=>{if(n.length===0)throw new Ht(st.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);r.push(n),n=""};let o=!1;for(;a<t.length;){const l=t[a];if(l==="\\"){if(a+1===t.length)throw new Ht(st.INVALID_ARGUMENT,"Path has trailing escape character: "+t);const c=t[a+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new Ht(st.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);n+=c,a+=2}else l==="`"?(o=!o,a++):l!=="."||o?(n+=l,a++):(i(),a++)}if(i(),o)throw new Ht(st.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new Qa(r)}static emptyPath(){return new Qa([])}}/**
1795 * @license
1796 * Copyright 2017 Google LLC
1797 *
1798 * Licensed under the Apache License, Version 2.0 (the "License");
1799 * you may not use this file except in compliance with the License.
1800 * You may obtain a copy of the License at
1801 *
1802 *   http://www.apache.org/licenses/LICENSE-2.0
1803 *
1804 * Unless required by applicable law or agreed to in writing, software
1805 * distributed under the License is distributed on an "AS IS" BASIS,
1806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1807 * See the License for the specific language governing permissions and
1808 * limitations under the License.
1809 */class Yt{constructor(t){this.path=t}static fromPath(t){return new Yt(sa.fromString(t))}static fromName(t){return new Yt(sa.fromString(t).popFirst(5))}static empty(){return new Yt(sa.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(t){return t!==null&&sa.comparator(this.path,t.path)===0}toString(){return this.path.toString()}static comparator(t,r){return sa.comparator(t.path,r.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new Yt(new sa(t.slice()))}}function aue(e,t){const r=e.toTimestamp().seconds,n=e.toTimestamp().nanoseconds+1,a=dr.fromTimestamp(n===1e9?new Pa(r+1,0):new Pa(r,n));return new Cu(a,Yt.empty(),t)}function sue(e){return new Cu(e.readTime,e.key,-1)}class Cu{constructor(t,r,n){this.readTime=t,this.documentKey=r,this.largestBatchId=n}static min(){return new Cu(dr.min(),Yt.empty(),-1)}static max(){return new Cu(dr.max(),Yt.empty(),-1)}}function iue(e,t){let r=e.readTime.compareTo(t.readTime);return r!==0?r:(r=Yt.comparator(e.documentKey,t.documentKey),r!==0?r:Zr(e.largestBatchId,t.largestBatchId))}/**
1810 * @license
1811 * Copyright 2020 Google LLC
1812 *
1813 * Licensed under the Apache License, Version 2.0 (the "License");
1814 * you may not use this file except in compliance with the License.
1815 * You may obtain a copy of the License at
1816 *
1817 *   http://www.apache.org/licenses/LICENSE-2.0
1818 *
1819 * Unless required by applicable law or agreed to in writing, software
1820 * distributed under the License is distributed on an "AS IS" BASIS,
1821 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1822 * See the License for the specific language governing permissions and
1823 * limitations under the License.
1824 */const oue="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class lue{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(t=>t())}}/**
1825 * @license
1826 * Copyright 2017 Google LLC
1827 *
1828 * Licensed under the Apache License, Version 2.0 (the "License");
1829 * you may not use this file except in compliance with the License.
1830 * You may obtain a copy of the License at
1831 *
1832 *   http://www.apache.org/licenses/LICENSE-2.0
1833 *
1834 * Unless required by applicable law or agreed to in writing, software
1835 * distributed under the License is distributed on an "AS IS" BASIS,
1836 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1837 * See the License for the specific language governing permissions and
1838 * limitations under the License.
1839 */async function Gy(e){if(e.code!==st.FAILED_PRECONDITION||e.message!==oue)throw e;Dt("LocalStore","Unexpectedly lost primary lease")}/**
1840 * @license
1841 * Copyright 2017 Google LLC
1842 *
1843 * Licensed under the Apache License, Version 2.0 (the "License");
1844 * you may not use this file except in compliance with the License.
1845 * You may obtain a copy of the License at
1846 *
1847 *   http://www.apache.org/licenses/LICENSE-2.0
1848 *
1849 * Unless required by applicable law or agreed to in writing, software
1850 * distributed under the License is distributed on an "AS IS" BASIS,
1851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1852 * See the License for the specific language governing permissions and
1853 * limitations under the License.
1854 */class rt{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(r=>{this.isDone=!0,this.result=r,this.nextCallback&&this.nextCallback(r)},r=>{this.isDone=!0,this.error=r,this.catchCallback&&this.catchCallback(r)})}catch(t){return this.next(void 0,t)}next(t,r){return this.callbackAttached&&ur(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(t,this.result):new rt((n,a)=>{this.nextCallback=i=>{this.wrapSuccess(t,i).next(n,a)},this.catchCallback=i=>{this.wrapFailure(r,i).next(n,a)}})}toPromise(){return new Promise((t,r)=>{this.next(t,r)})}wrapUserFunction(t){try{const r=t();return r instanceof rt?r:rt.resolve(r)}catch(r){return rt.reject(r)}}wrapSuccess(t,r){return t?this.wrapUserFunction(()=>t(r)):rt.resolve(r)}wrapFailure(t,r){return t?this.wrapUserFunction(()=>t(r)):rt.reject(r)}static resolve(t){return new rt((r,n)=>{r(t)})}static reject(t){return new rt((r,n)=>{n(t)})}static waitFor(t){return new rt((r,n)=>{let a=0,i=0,o=!1;t.forEach(l=>{++a,l.next(()=>{++i,o&&i===a&&r()},c=>n(c))}),o=!0,i===a&&r()})}static or(t){let r=rt.resolve(!1);for(const n of t)r=r.next(a=>a?rt.resolve(a):n());return r}static forEach(t,r){const n=[];return t.forEach((a,i)=>{n.push(r.call(this,a,i))}),this.waitFor(n)}static mapArray(t,r){return new rt((n,a)=>{const i=t.length,o=new Array(i);let l=0;for(let c=0;c<i;c++){const u=c;r(t[u]).next(d=>{o[u]=d,++l,l===i&&n(o)},d=>a(d))}})}static doWhile(t,r){return new rt((n,a)=>{const i=()=>{t()===!0?r().next(()=>{i()},a):n()};i()})}}function cue(e){const t=e.match(/Android ([\d.]+)/i),r=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(r)}function Hy(e){return e.name==="IndexedDbTransactionError"}/**
1855 * @license
1856 * Copyright 2018 Google LLC
1857 *
1858 * Licensed under the Apache License, Version 2.0 (the "License");
1859 * you may not use this file except in compliance with the License.
1860 * You may obtain a copy of the License at
1861 *
1862 *   http://www.apache.org/licenses/LICENSE-2.0
1863 *
1864 * Unless required by applicable law or agreed to in writing, softw
1864are
1865 * distributed under the License is distributed on an "AS IS" BASIS,
1866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1867 * See the License for the specific language governing permissions and
1868 * limitations under the License.
1869 */class BI{constructor(t,r){this.previousValue=t,r&&(r.sequenceNumberHandler=n=>this.ie(n),this.se=n=>r.writeSequenceNumber(n))}ie(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.se&&this.se(t),t}}BI.oe=-1;function l2(e){return e==null}function Bx(e){return e===0&&1/e==-1/0}function uue(e){return typeof e=="number"&&Number.isInteger(e)&&!Bx(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}/**
1870 * @license
1871 * Copyright 2017 Google LLC
1872 *
1873 * Licensed under the Apache License, Version 2.0 (the "License");
1874 * you may not use this file except in compliance with the License.
1875 * You may obtain a copy of the License at
1876 *
1877 *   http://www.apache.org/licenses/LICENSE-2.0
1878 *
1879 * Unless required by applicable law or agreed to in writing, software
1880 * distributed under the License is distributed on an "AS IS" BASIS,
1881 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1882 * See the License for the specific language governing permissions and
1883 * limitations under the License.
1884 */function x3(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function bf(e,t){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function mU(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}/**
1885 * @license
1886 * Copyright 2017 Google LLC
1887 *
1888 * Licensed under the Apache License, Version 2.0 (the "License");
1889 * you may not use this file except in compliance with the License.
1890 * You may obtain a copy of the License at
1891 *
1892 *   http://www.apache.org/licenses/LICENSE-2.0
1893 *
1894 * Unless required by applicable law or agreed to in writing, software
1895 * distributed under the License is distributed on an "AS IS" BASIS,
1896 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1897 * See the License for the specific language governing permissions and
1898 * limitations under the License.
1899 */class ea{constructor(t,r){this.comparator=t,this.root=r||Ya.EMPTY}insert(t,r){return new ea(this.comparator,this.root.insert(t,r,this.comparator).copy(null,null,Ya.BLACK,null,null))}remove(t){return new ea(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Ya.BLACK,null,null))}get(t){let r=this.root;for(;!r.isEmpty();){const n=this.comparator(t,r.key);if(n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}indexOf(t){let r=0,n=this.root;for(;!n.isEmpty();){const a=this.comparator(t,n.key);if(a===0)return r+n.left.size;a<0?n=n.left:(r+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal((r,n)=>(t(r,n),!1))}toString(){const t=[];return this.inorderTraversal((r,n)=>(t.push(`${r}:${n}`),!1)),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new Hb(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new Hb(this.root,t,this.comparator,!1)}getReverseIterator(){return new Hb(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new Hb(this.root,t,this.comparator,!0)}}class Hb{constructor(t,r,n,a){this.isReverse=a,this.nodeStack=[];let i=1;for(;!t.isEmpty();)if(i=r?n(t.key,r):1,r&&a&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(i===0){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const r={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return r}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class Ya{constructor(t,r,n,a,i){this.key=t,this.value=r,this.color=n??Ya.RED,this.left=a??Ya.EMPTY,this.right=i??Ya.EMPTY,this.size=this.left.size+1+this.right.size}
vendor: 5,036 bytes, lines 1899-1914
1899copy(t,r,n,a,i){return new Ya(t??this.key,r??this.value,n??this.color,a??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,r,n){let a=this;const i=n(t,a.key);return a=i<0?a.copy(null,null,null,a.left.insert(t,r,n),null):i===0?a.copy(null,r,null,null,null):a.copy(null,null,null,null,a.right.insert(t,r,n)),a.fixUp()}removeMin(){if(this.left.isEmpty())return Ya.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,r){let n,a=this;if(r(t,a.key)<0)a.left.isEmpty()||a.left.isRed()||a.left.left.isRed()||(a=a.moveRedLeft()),a=a.copy(null,null,null,a.left.remove(t,r),null);else{if(a.left.isRed()&&(a=a.rotateRight()),a.right.isEmpty()||a.right.isRed()||a.right.left.isRed()||(a=a.moveRedRight()),r(t,a.key)===0){if(a.right.isEmpty())return Ya.EMPTY;n=a.right.min(),a=a.copy(n.key,n.value,null,null,a.right.removeMin())}a=a.copy(null,null,null,null,a.right.remove(t,r))}return a.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,Ya.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,Ya.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,r)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ur();const t=this.left.check();if(t!==this.right.check())throw ur();return t+(this.isRed()?0:1)}}Ya.EMPTY=null,Ya.RED=!0,Ya.BLACK=!1;Ya.EMPTY=new class{constructor(){this.size=0}get key(){throw ur()}get value(){throw ur()}get color(){throw ur()}get left(){throw ur()}get right(){throw ur()}copy(t,r,n,a,i){return this}insert(t,r,n){return new Ya(t,r)}remove(t,r){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1900 * @license
1901 * Copyright 2017 Google LLC
1902 *
1903 * Licensed under the Apache License, Version 2.0 (the "License");
1904 * you may not use this file except in compliance with the License.
1905 * You may obtain a copy of the License at
1906 *
1907 *   http://www.apache.org/licenses/LICENSE-2.0
1908 *
1909 * Unless required by applicable law or agreed to in writing, software
1910 * distributed under the License is distributed on an "AS IS" BASIS,
1911 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1912 * See the License for the specific language governing permissions and
1913 * limitations under the License.
1914 */class Za{constructor(t){this.comparator=t,this.data=new ea(this.comparator)}has(t){return this.data.get(t)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal((r,n)=>(t(r),!1))}forEachInRange(t,r){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const a=n.getNext();if(this.comparator(a.key,t[1])>=0)return;r(a.key)}}forEachWhile(t,r){let n;for(n=r!==void 0?this.data.getIteratorFrom(r):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const r=this.data.getIteratorFrom(t);return r.hasNext()?r.getNext().key:null}getIterator(){return new w3(this.data.getIterator())}getIteratorFrom(t){return new w3(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let r=this;return r.size<t.size&&(r=t,t=this),t.forEach(n=>{r=r.add(n)}),r}isEqual(t){if(!(t instanceof Za)||this.size!==t.size)return!1;const r=this.data.getIterator(),n=t.data.getIterator();for(;r.hasNext();){const a=r.getNext().key,i=n.getNext().key;if(this.comparator(a,i)!==0)return!1}return!0}toArray(){const t=[];return this.forEach(r=>{t.push(r)}),t}toString(){const t=[];return this.forEach(r=>t.push(r)),"SortedSet("+t.toString()+")"}copy(t){const r=new Za(this.comparator);return r.data=t,r}}
1914class w3{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
1915 * @license
1916 * Copyright 2020 Google LLC
1917 *
1918 * Licensed under the Apache License, Version 2.0 (the "License");
1919 * you may not use this file except in compliance with the License.
1920 * You may obtain a copy of the License at
1921 *
1922 *   http://www.apache.org/licenses/LICENSE-2.0
1923 *
1924 * Unless required by applicable law or agreed to in writing, software
1925 * distributed under the License is distributed on an "AS IS" BASIS,
1926 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1927 * See the License for the specific language governing permissions and
1928 * limitations under the License.
1929 */class lo{constructor(t){this.fields=t,t.sort(Qa.comparator)}static empty(){return new lo([])}unionWith(t){let r=new Za(Qa.comparator);for(const n of this.fields)r=r.add(n);for(const n of t)r=r.add(n);return new lo(r.toArray())}covers(t){for(const r of this.fields)if(r.isPrefixOf(t))return!0;return!1}isEqual(t){return th(this.fields,t.fields,(r,n)=>r.isEqual(n))}}/**
1930 * @license
1931 * Copyright 2023 Google LLC
1932 *
1933 * Licensed under the Apache License, Version 2.0 (the "License");
1934 * you may not use this file except in compliance with the License.
1935 * You may obtain a copy of the License at
1936 *
1937 *   http://www.apache.org/licenses/LICENSE-2.0
1938 *
1939 * Unless required by applicable law or agreed to in writing, software
1940 * distributed under the License is distributed on an "AS IS" BASIS,
1941 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1942 * See the License for the specific language governing permissions and
1943 * limitations under the License.
1944 */class hU extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
1945 * @license
1946 * Copyright 2020 Google LLC
1947 *
1948 * Licensed under the Apache License, Version 2.0 (the "License");
1949 * you may not use this file except in compliance with the License.
1950 * You may obtain a copy of the License at
1951 *
1952 *   http://www.apache.org/licenses/LICENSE-2.0
1953 *
1954 * Unless required by applicable law or agreed to in writing, software
1955 * distributed under the License is distributed on an "AS IS" BASIS,
1956 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1957 * See the License for the specific language governing permissions and
1958 * limitations under the License.
1959 */class ts{constructor(t){this.binaryString=t}static fromBase64String(t){const r=function(a){try{return atob(a)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new hU("Invalid base64 string: "+i):i}}(t);return new ts(r)}static fromUint8Array(t){const r=function(a){let i="";for(let o=0;o<a.length;++o)i+=String.fromCharCode(a[o]);return i}(t);return new ts(r)}[Symbol.iterator](){let t=0;return{next:()=>t<this.binaryString.length?{value:this.binaryString.charCodeAt(t++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(r){return btoa(r)}(this.binaryString)}toUint8Array(){return function(r){const n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a);return n}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(t){return Zr(this.binaryString,t.binaryString)}isEqual(t){return this.binaryString===t.binaryString}}ts.EMPTY_BYTE_STRING=new ts("");const due=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function ku(e){if(xn(!!e),typeof e=="string"){let t=0;const r=due.exec(e);if(xn(!!r),r[1]){let a=r[1];a=(a+"000000000").substr(0,9),t=Number(a)}const n=new Date(e);return{seconds:Math.floor(n.getTime()/1e3),nanos:t}}return{seconds:ua(e.seconds),nanos:ua(e.nanos)}}function ua(e){return typeof e=="number"?e:typeof e=="string"?Number(e):0}function ef(e){return typeof e=="string"?ts.fromBase64String(e):ts.fromUint8Array(e)}/**
1960 * @license
1961 * Copyright 2020 Google LLC
1962 *
1963 * Licensed under the Apache License, Version 2.0 (the "License");
1964 * you may not use this file except in compliance with the License.
1965 * You may obtain a copy of the License at
1966 *
1967 *   http://www.apache.org/licenses/LICENSE-2.0
1968 *
1969 * Unless required by applicable law or agreed to in writing, softw
1969are
1970 * distributed under the License is distributed on an "AS IS" BASIS,
1971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1972 * See the License for the specific language governing permissions and
1973 * limitations under the License.
1974 */function UI(e){var t,r;return((r=(((t=e==null?void 0:e.mapValue)===null||t===void 0?void 0:t.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="server_timestamp"}function VI(e){const t=e.mapValue.fields.__previous_value__;return UI(t)?VI(t):t}function m0(e){const t=ku(e.mapValue.fields.__local_write_time__.timestampValue);return new Pa(t.seconds,t.nanos)}/**
1975 * @license
1976 * Copyright 2017 Google LLC
1977 *
1978 * Licensed under the Apache License, Version 2.0 (the "License");
1979 * you may not use this file except in compliance with the License.
1980 * You may obtain a copy of the License at
1981 *
1982 *   http://www.apache.org/licenses/LICENSE-2.0
1983 *
1984 * Unless required by applicable law or agreed to in writing, software
1985 * distributed under the License is distributed on an "AS IS" BASIS,
1986 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1987 * See the License for the specific language governing permissions and
1988 * limitations under the License.
1989 */class fue{constructor(t,r,n,a,i,o,l,c,u){this.databaseId=t,this.appId=r,this.persistenceKey=n,this.host=a,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=l,this.longPollingOptions=c,this.useFetchStreams=u}}class h0{constructor(t,r){this.projectId=t,this.database=r||"(default)"}static empty(){return new h0("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(t){return t instanceof h0&&t.projectId===this.projectId&&t.database===this.database}}/**
1990 * @license
1991 * Copyright 2020 Google LLC
1992 *
1993 * Licensed under the Apache License, Version 2.0 (the "License");
1994 * you may not use this file except in compliance with the License.
1995 * You may obtain a copy of the License at
1996 *
1997 *   http://www.apache.org/licenses/LICENSE-2.0
1998 *
1999 * Unless required by applicable law or agreed to in writing, software
2000 * distributed under the License is distributed on an "AS IS" BASIS,
2001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2002 * See the License for the specific language governing permissions and
2003 * limitations under the License.
2004 */const Yb={mapValue:{}};function tf(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?UI(e)?4:hue(e)?9007199254740991:mue(e)?10:11:ur()}function nl(e,t){if(e===t)return!0;const r=tf(e);if(r!==tf(t))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return m0(e).isEqual(m0(t));case 3:return function(a,i){if(typeof a.timestampValue=="string"&&typeof i.timestampValue=="string"&&a.timestampValue.length===i.timestampValue.length)return a.timestampValue===i.timestampValue;const o=ku(a.timestampValue),l=ku(i.timestampValue);return o.seconds===l.seconds&&o.nanos===l.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(a,i){return ef(a.bytesValue).isEqual(ef(i.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(a,i){return ua(a.geoPointValue.latitude)===ua(i.geoPointValue.latitude)&&ua(a.geoPointValue.longitude)===ua(i.geoPointValue.longitude)}(e,t);case 2:return function(a,i){if("integerValue"in a&&"integerValue"in i)return ua(a.integerValue)===ua(i.integerValue);if("doubleValue"in a&&"doubleValue"in i){const o=ua(a.doubleValue),l=ua(i.doubleValue);return o===l?Bx(o)===Bx(l):isNaN(o)&&isNaN(l)}return!1}(e,t);case 9:return th(e.arrayValue.values||[],t.arrayValue.values||[],nl);case 10:case 11:return function(a,i){const o=a.mapValue.fields||{},l=i.mapValue.fields||{};if(x3(o)!==x3(l))return!1;for(const c in o)if(o.hasOwnProperty(c)&&(l[c]===void 0||!nl(o[c],l[c])))return!1;return!0}(e,t);default:return ur()}}function p0(e,t){return(e.values||[]).find(r=>nl(r,t))!==void 0}function rh(e,t){if(e===t)return 0;const r=tf(e),n=tf(t);if(r!==n)return Zr(r,n);switch(r){case 0:case 9007199254740991:return 0;case 1:return Zr(e.booleanValue,t.booleanValue);case 2:return function(i,o){const l=ua(i.integerValue||i.doubleValue),c=ua(o.integerValue||o.doubleValue);return l<c?-1:l>c?1:l===c?0:isNaN(l)?isNaN(c)?0:-1:1}(e,t);case 3:return j3(e.timestampValue,t.timestampValue);case 4:return j3(m0(e),m0(t));case 5:return Zr(e.stringValue,t.stringValue);case 6:return function(i,o){const l=ef(i),c=ef(o);return l.compareTo(c)}(e.bytesValue,t.bytesValue);case 7:return function(i,o){const l=i.split("/"),c=o.split("/");for(let u=0;u<l.length&&u<c.length;u++){const d=Zr(l[u],c[u]);if(d!==0)return d}return Zr(l.length,c.length)}(e.referenceValue,t.referenceValue);case 8:return function(i,o){const l=Zr(ua(i.latitude),ua(o.latitude));return l!==0?l:Zr(ua(i.longitude),ua(o.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return N3(e.arrayValue,t.arrayValue);case 10:return function(i,o){var l,c,u,d;const f=i.fields||{},m=o.fields||{},h=(l=f.value)===null||l===void 0?void 0:l.arrayValue,p=(c=m.value)===null||c===void 0?void 0:c.arrayValue,g=Zr(((u=h==null?void 0:h.values)===null||u===void 0?void 0:u.length)||0,((d=p==null?void 0:p.values)===null||d===void 0?void 0:d.length)||0);return g!==0?g:N3(h,p)}(e.mapValue,t.mapValue);case 11:return function(i,o){if(i===Yb.mapValue&&o===Yb.mapValue)return 0;if(i===Yb.mapValue)return 1;if(o===Yb.mapValue)return-1;const l=i.fields||{},c=Object.keys(l),u=o.fields||{},d=Object.keys(u);c.sort(),d.sort();for(let f=0;f<c.length&&f<d.length;++f){const m=Zr(c[f],d[f]);if(m!==0)return m;const h=rh(l[c[f]],u[d[f]]);if(h!==0)return h}return Zr(c.length,d.length)}(e.mapValue,t.mapValue);default:throw ur()}}function j3(e,t){if(typeof e=="string"&&typeof t=="string"&&e.length===t.length)return Zr(e,t);const r=ku(e),n=ku(t),a=Zr(r.seconds,n.seconds);return a!==0?a:Zr(r.nanos,n.nanos)}function N3(e,t){const r=e.values||[],n=t.values||[];for(let a=0;a<r.length&&a<n.length;++a){const i=rh(r[a],n[a]);if(i)return i}return Zr(r.length,n.length)}function nh(e){return uk(e)}function uk(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(r){const n=ku(r);return`time(${n.seconds},${n.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(r){return ef(r).toBase64()}(e.bytesValue):"referenceValue"in e?function(r){return Yt.fromName(r).toString()}(e.referenceValue):"geoPointValue"in e?function(r){return`geo(${r.latitude},${r.longitude})`}(e.geoPointValue):"arrayValue"in e?function(r){let n="[",a=!0;for(const i of r.values||[])a?a=!1:n+=",",n+=uk(i);return n+"]"}(e.arrayValue):"mapValue"in e?function(r){const n=Object.keys(r.fields||{}).sort();let a="{",i=!0;for(const o of n)i?i=!1:a+=",",a+=`${o}:${uk(r.fields[o])}`;return a+"}"}(e.mapValue):ur()}function dk(e){return!!e&&"integerValue"in e}function WI(e){return!!e&&"arrayValue"in e}function S3(e){return!!e&&"nullValue"in e}function C3(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Wv(e){return!!e&&"mapValue"in e}function mue(e){var t,r;return((r=(((t=e==null?void 0:e.mapValue)===null||t===void 0?void 0:t.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="__vector__"}function Bg(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&typeof e.timestampValue=="object")return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};
vendor: 4,896 bytes, lines 2004-2034
2004return bf(e.mapValue.fields,(r,n)=>t.mapValue.fields[r]=Bg(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let r=0;r<(e.arrayValue.values||[]).length;++r)t.arrayValue.values[r]=Bg(e.arrayValue.values[r]);return t}return Object.assign({},e)}function hue(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
2005 * @license
2006 * Copyright 2017 Google LLC
2007 *
2008 * Licensed under the Apache License, Version 2.0 (the "License");
2009 * you may not use this file except in compliance with the License.
2010 * You may obtain a copy of the License at
2011 *
2012 *   http://www.apache.org/licenses/LICENSE-2.0
2013 *
2014 * Unless required by applicable law or agreed to in writing, software
2015 * distributed under the License is distributed on an "AS IS" BASIS,
2016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2017 * See the License for the specific language governing permissions and
2018 * limitations under the License.
2019 */class Xs{constructor(t){this.value=t}static empty(){return new Xs({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let r=this.value;for(let n=0;n<t.length-1;++n)if(r=(r.mapValue.fields||{})[t.get(n)],!Wv(r))return null;return r=(r.mapValue.fields||{})[t.lastSegment()],r||null}}set(t,r){this.getFieldsMap(t.popLast())[t.lastSegment()]=Bg(r)}setAll(t){let r=Qa.emptyPath(),n={},a=[];t.forEach((o,l)=>{if(!r.isImmediateParentOf(l)){const c=this.getFieldsMap(r);this.applyChanges(c,n,a),n={},a=[],r=l.popLast()}o?n[l.lastSegment()]=Bg(o):a.push(l.lastSegment())});const i=this.getFieldsMap(r);this.applyChanges(i,n,a)}delete(t){const r=this.field(t.popLast());Wv(r)&&r.mapValue.fields&&delete r.mapValue.fields[t.lastSegment()]}isEqual(t){return nl(this.value,t.value)}getFieldsMap(t){let r=this.value;r.mapValue.fields||(r.mapValue={fields:{}});for(let n=0;n<t.length;++n){let a=r.mapValue.fields[t.get(n)];Wv(a)&&a.mapValue.fields||(a={mapValue:{fields:{}}},r.mapValue.fields[t.get(n)]=a),r=a}return r.mapValue.fields}applyChanges(t,r,n){bf(r,(a,i)=>t[a]=i);for(const a of n)delete t[a]}clone(){return new Xs(Bg(this.value))}}function pU(e){const t=[];return bf(e.fields,(r,n)=>{const a=new Qa([r]);if(Wv(n)){const i=pU(n.mapValue).fields;if(i.length===0)t.push(a);else for(const o of i)t.push(a.child(o))}else t.push(a)}),new lo(t)}/**
2020 * @license
2021 * Copyright 2017 Google LLC
2022 *
2023 * Licensed under the Apache License, Version 2.0 (the "License");
2024 * you may not use this file except in compliance with the License.
2025 * You may obtain a copy of the License at
2026 *
2027 *   http://www.apache.org/licenses/LICENSE-2.0
2028 *
2029 * Unless required by applicable law or agreed to in writing, software
2030 * distributed under the License is distributed on an "AS IS" BASIS,
2031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2032 * See the License for the specific language governing permissions and
2033 * limitations under the License.
2034 */class ds{constructor(t,r,n,a,i,o,l){this.key=t,this.documentType=r,this.version=n,this.readTime=a,this.createTime=i,this.data=o,this.documentState=l}static newInvalidDocument(t){return new ds(t,0,dr.min(),dr.min(),dr.min(),Xs.empty(),0)}static newFoundDocument(t,r,n,a){return new ds(t,1,r,dr.min(),n,a,0)}static newNoDocument(t,r){return new ds(t,2,r,dr.min(),dr.min(),Xs.empty(),0)}static newUnknownDocument(t,r){return new ds(t,3,r,dr.min(),dr.min(),Xs.empty(),2)}convertToFoundDocument(t,r){return!this.createTime.isEqual(dr.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=t),this.version=t,this.documentType=1,this.data=r,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=Xs.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=Xs.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=dr.min(),this}setReadTime(t){return this.readTime=t,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(t){return t instanceof ds&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new ds(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
2034/**
2035 * @license
2036 * Copyright 2022 Google LLC
2037 *
2038 * Licensed under the Apache License, Version 2.0 (the "License");
2039 * you may not use this file except in compliance with the License.
2040 * You may obtain a copy of the License at
2041 *
2042 *   http://www.apache.org/licenses/LICENSE-2.0
2043 *
2044 * Unless required by applicable law or agreed to in writing, software
2045 * distributed under the License is distributed on an "AS IS" BASIS,
2046 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2047 * See the License for the specific language governing permissions and
2048 * limitations under the License.
2049 */class Ux{constructor(t,r){this.position=t,this.inclusive=r}}function k3(e,t,r){let n=0;for(let a=0;a<e.position.length;a++){const i=t[a],o=e.position[a];if(i.field.isKeyField()?n=Yt.comparator(Yt.fromName(o.referenceValue),r.key):n=rh(o,r.data.field(i.field)),i.dir==="desc"&&(n*=-1),n!==0)break}return n}function M3(e,t){if(e===null)return t===null;if(t===null||e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let r=0;r<e.position.length;r++)if(!nl(e.position[r],t.position[r]))return!1;return!0}/**
2050 * @license
2051 * Copyright 2022 Google LLC
2052 *
2053 * Licensed under the Apache License, Version 2.0 (the "License");
2054 * you may not use this file except in compliance with the License.
2055 * You may obtain a copy of the License at
2056 *
2057 *   http://www.apache.org/licenses/LICENSE-2.0
2058 *
2059 * Unless required by applicable law or agreed to in writing, software
2060 * distributed under the License is distributed on an "AS IS" BASIS,
2061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2062 * See the License for the specific language governing permissions and
2063 * limitations under the License.
2064 */class Vx{constructor(t,r="asc"){this.field=t,this.dir=r}}function pue(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}/**
2065 * @license
2066 * Copyright 2022 Google LLC
2067 *
2068 * Licensed under the Apache License, Version 2.0 (the "License");
2069 * you may not use this file except in compliance with the License.
2070 * You may obtain a copy of the License at
2071 *
2072 *   http://www.apache.org/licenses/LICENSE-2.0
2073 *
2074 * Unless required by applicable law or agreed to in writing, software
2075 * distributed under the License is distributed on an "AS IS" BASIS,
2076 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2077 * See the License for the specific language governing permissions and
2078 * limitations under the License.
2079 */let gU=class{};class Ta extends gU{constructor(t,r,n){super(),this.field=t,this.op=r,this.value=n}static create(t,r,n){return t.isKeyField()?r==="in"||r==="not-in"?this.createKeyFieldInFilter(t,r,n):new yue(t,r,n):r==="array-contains"?new xue(t,n):r==="in"?new wue(t,n):r==="not-in"?new jue(t,n):r==="array-contains-any"?new Nue(t,n):new Ta(t,r,n)}static createKeyFieldInFilter(t,r,n){return r==="in"?new bue(t,n):new vue(t,n)}matches(t){const r=t.data.field(this.field);return this.op==="!="?r!==null&&this.matchesComparison(rh(r,this.value)):r!==null&&tf(this.value)===tf(r)&&this.matchesComparison(rh(r,this.value))}matchesComparison(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return t===0;case"!=":return t!==0;case">":return t>0;case">=":return t>=0;default:return ur()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class al extends gU{constructor(t,r){super(),this.filters=t,this.op=r,this.ae=null}static create(t,r){return new al(t,r)}matches(t){return yU(this)?this.filters.find(r=>!r.matches(t))===void 0:this.filters.find(r=>r.matches(t))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((t,r)=>t.concat(r.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function yU(e){return e.op==="and"}function bU(e){return gue(e)&&yU(e)}function gue(e){for(const t of e.filters)if(t instanceof al)return!1;return!0}function fk(e){if(e instanceof Ta)return e.field.canonicalString()+e.op.toString()+nh(e.value);if(bU(e))return e.filters.map(t=>fk(t)).join(",");{const t=e.filters.map(r=>fk(r)).join(",");
2079return`${e.op}(${t})`}}function vU(e,t){return e instanceof Ta?function(n,a){return a instanceof Ta&&n.op===a.op&&n.field.isEqual(a.field)&&nl(n.value,a.value)}(e,t):e instanceof al?function(n,a){return a instanceof al&&n.op===a.op&&n.filters.length===a.filters.length?n.filters.reduce((i,o,l)=>i&&vU(o,a.filters[l]),!0):!1}(e,t):void ur()}function xU(e){return e instanceof Ta?function(r){return`${r.field.canonicalString()} ${r.op} ${nh(r.value)}`}(e):e instanceof al?function(r){return r.op.toString()+" {"+r.getFilters().map(xU).join(" ,")+"}"}(e):"Filter"}class yue extends Ta{constructor(t,r,n){super(t,r,n),this.key=Yt.fromName(n.referenceValue)}matches(t){const r=Yt.comparator(t.key,this.key);return this.matchesComparison(r)}}class bue extends Ta{constructor(t,r){super(t,"in",r),this.keys=wU("in",r)}matches(t){return this.keys.some(r=>r.isEqual(t.key))}}class vue extends Ta{constructor(t,r){super(t,"not-in",r),this.keys=wU("not-in",r)}matches(t){return!this.keys.some(r=>r.isEqual(t.key))}}function wU(e,t){var r;return(((r=t.arrayValue)===null||r===void 0?void 0:r.values)||[]).map(n=>Yt.fromName(n.referenceValue))}class xue extends Ta{constructor(t,r){super(t,"array-contains",r)}matches(t){const r=t.data.field(this.field);return WI(r)&&p0(r.arrayValue,this.value)}}class wue extends Ta{constructor(t,r){super(t,"in",r)}matches(t){const r=t.data.field(this.field);return r!==null&&p0(this.value.arrayValue,r)}}class jue extends Ta{constructor(t,r){super(t,"not-in",r)}matches(t){if(p0(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const r=t.data.field(this.field);return r!==null&&!p0(this.value.arrayValue,r)}}class Nue extends Ta{constructor(t,r){super(t,"array-contains-any",r)}matches(t){const r=t.data.field(this.field);return!(!WI(r)||!r.arrayValue.values)&&r.arrayValue.values.some(n=>p0(this.value.arrayValue,n))}}/**
2080 * @license
2081 * Copyright 2019 Google LLC
2082 *
2083 * Licensed under the Apache License, Version 2.0 (the "License");
2084 * you may not use this file except in compliance with the License.
2085 * You may obtain a copy of the License at
2086 *
2087 *   http://www.apache.org/licenses/LICENSE-2.0
2088 *
2089 * Unless required by applicable law or agreed to in writing, software
2090 * distributed under the License is distributed on an "AS IS" BASIS,
2091 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2092 * See the License for the specific language governing permissions and
2093 * limitations under the License.
2094 */class Sue{constructor(t,r=null,n=[],a=[],i=null,o=null,l=null){this.path=t,this.collectionGroup=r,this.orderBy=n,this.filters=a,this.limit=i,this.startAt=o,this.endAt=l,this.ue=null}}function I3(e,t=null,r=[],n=[],a=null,i=null,o=null){return new Sue(e,t,r,n,a,i,o)}function qI(e){const t=fr(e);if(t.ue===null){let r=t.path.canonicalString();t.collectionGroup!==null&&(r+="|cg:"+t.collectionGroup),r+="|f:",r+=t.filters.map(n=>fk(n)).join(","),r+="|ob:",r+=t.orderBy.map(n=>function(i){return i.field.canonicalString()+i.dir}(n)).join(","),l2(t.limit)||(r+="|l:",r+=t.limit),t.startAt&&(r+="|lb:",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(n=>nh(n)).join(",")),t.endAt&&(r+="|ub:",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(n=>nh(n)).join(",")),t.ue=r}return t.ue}function GI(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let r=0;r<e.orderBy.length;r++)if(!pue(e.orderBy[r],t.orderBy[r]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let r=0;r<e.filters.length;r++)if(!vU(e.filters[r],t.filters[r]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!M3(e.startAt,t.startAt)&&M3(e.endAt,t.endAt)}function mk(e){return Yt.isDocumentKey(e.path)&&e.collectionGroup===null&&e.filters.length===0}/**
2095 * @license
2096 * Copyright 2017 Google LLC
2097 *
2098 * Licensed under the Apache License, Version 2.0 (the "License");
2099 * you may not use this file except in compliance with the License.
2100 * You may obtain a copy of the License at
2101 *
2102 *   http://www.apache.org/licenses/LICENSE-2.0
2103 *
2104 * Unless required by applicable law or agreed to in writing, softw
2104are
2105 * distributed under the License is distributed on an "AS IS" BASIS,
2106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2107 * See the License for the specific language governing permissions and
2108 * limitations under the License.
2109 */class c2{constructor(t,r=null,n=[],a=[],i=null,o="F",l=null,c=null){this.path=t,this.collectionGroup=r,this.explicitOrderBy=n,this.filters=a,this.limit=i,this.limitType=o,this.startAt=l,this.endAt=c,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function Cue(e,t,r,n,a,i,o,l){return new c2(e,t,r,n,a,i,o,l)}function HI(e){return new c2(e)}function E3(e){return e.filters.length===0&&e.limit===null&&e.startAt==null&&e.endAt==null&&(e.explicitOrderBy.length===0||e.explicitOrderBy.length===1&&e.explicitOrderBy[0].field.isKeyField())}function kue(e){return e.collectionGroup!==null}function Ug(e){const t=fr(e);if(t.ce===null){t.ce=[];const r=new Set;for(const i of t.explicitOrderBy)t.ce.push(i),r.add(i.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(o){let l=new Za(Qa.comparator);return o.filters.forEach(c=>{c.getFlattenedFilters().forEach(u=>{u.isInequality()&&(l=l.add(u.field))})}),l})(t).forEach(i=>{r.has(i.canonicalString())||i.isKeyField()||t.ce.push(new Vx(i,n))}),r.has(Qa.keyField().canonicalString())||t.ce.push(new Vx(Qa.keyField(),n))}return t.ce}function Ko(e){const t=fr(e);return t.le||(t.le=Mue(t,Ug(e))),t.le}function Mue(e,t){if(e.limitType==="F")return I3(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(a=>{const i=a.dir==="desc"?"asc":"desc";return new Vx(a.field,i)});const r=e.endAt?new Ux(e.endAt.position,e.endAt.inclusive):null,n=e.startAt?new Ux(e.startAt.position,e.startAt.inclusive):null;return I3(e.path,e.collectionGroup,t,e.filters,e.limit,r,n)}}function hk(e,t,r){return new c2(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,r,e.startAt,e.endAt)}function u2(e,t){return GI(Ko(e),Ko(t))&&e.limitType===t.limitType}function jU(e){return`${qI(Ko(e))}|lt:${e.limitType}`}function tm(e){return`Query(target=${function(r){let n=r.path.canonicalString();return r.collectionGroup!==null&&(n+=" collectionGroup="+r.collectionGroup),r.filters.length>0&&(n+=`, filters: [${r.filters.map(a=>xU(a)).join(", ")}]`),l2(r.limit)||(n+=", limit: "+r.limit),r.orderBy.length>0&&(n+=`, orderBy: [${r.orderBy.map(a=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(a)).join(", ")}]`),r.startAt&&(n+=", startAt: ",n+=r.startAt.inclusive?"b:":"a:",n+=r.startAt.position.map(a=>nh(a)).join(",")),r.endAt&&(n+=", endAt: ",n+=r.endAt.inclusive?"a:":"b:",n+=r.endAt.position.map(a=>nh(a)).join(",")),`Target(${n})`}(Ko(e))}; limitType=${e.limitType})`}function d2(e,t){return t.isFoundDocument()&&function(n,a){const i=a.key.path;return n.collectionGroup!==null?a.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(i):Yt.isDocumentKey(n.path)?n.path.isEqual(i):n.path.isImmediateParentOf(i)}(e,t)&&function(n,a){for(const i of Ug(n))if(!i.field.isKeyField()&&a.data.field(i.field)===null)return!1;return!0}(e,t)&&function(n,a){for(const i of n.filters)if(!i.matches(a))return!1;return!0}(e,t)&&function(n,a){return!(n.startAt&&!function(o,l,c){const u=k3(o,l,c);return o.inclusive?u<=0:u<0}(n.startAt,Ug(n),a)||n.endAt&&!function(o,l,c){const u=k3(o,l,c);return o.inclusive?u>=0:u>0}(n.endAt,Ug(n),a))}(e,t)}function Iue(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function NU(e){return(t,r)=>{let n=!1;for(const a of Ug(e)){const i=Eue(a,t,r);if(i!==0)return i;n=n||a.field.isKeyField()}return 0}}function Eue(e,t,r){const n=e.field.isKeyField()?Yt.comparator(t.key,r.key):function(i,o,l){const c=o.data.field(i),u=l.data.field(i);return c!==null&&u!==null?rh(c,u):ur()}(e.field,t,r);switch(e.dir){case"asc":return n;case"desc":return-1*n;default:return ur()}}/**
2110 * @license
2111 * Copyright 2017 Google LLC
2112 *
2113 * Licensed under the Apache License, Version 2.0 (the "License");
2114 * you may not use this file except in compliance with the License.
2115 * You may obtain a copy of the License at
2116 *
2117 *   http://www.apache.org/licenses/LICENSE-2.0
2118 *
2119 * Unless required by applicable law or agreed to in writing, softw
2119are
2120 * distributed under the License is distributed on an "AS IS" BASIS,
2121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2122 * See the License for the specific language governing permissions and
2123 * limitations under the License.
2124 */class ep{constructor(t,r){this.mapKeyFn=t,this.equalsFn=r,this.inner={},this.innerSize=0}get(t){const r=this.mapKeyFn(t),n=this.inner[r];if(n!==void 0){for(const[a,i]of n)if(this.equalsFn(a,t))return i}}has(t){return this.get(t)!==void 0}set(t,r){const n=this.mapKeyFn(t),a=this.inner[n];if(a===void 0)return this.inner[n]=[[t,r]],void this.innerSize++;for(let i=0;i<a.length;i++)if(this.equalsFn(a[i][0],t))return void(a[i]=[t,r]);a.push([t,r]),this.innerSize++}delete(t){const r=this.mapKeyFn(t),n=this.inner[r];if(n===void 0)return!1;for(let a=0;a<n.length;a++)if(this.equalsFn(n[a][0],t))return n.length===1?delete this.inner[r]:n.splice(a,1),this.innerSize--,!0;return!1}forEach(t){bf(this.inner,(r,n)=>{for(const[a,i]of n)t(a,i)})}isEmpty(){return mU(this.inner)}size(){return this.innerSize}}/**
2125 * @license
2126 * Copyright 2017 Google LLC
2127 *
2128 * Licensed under the Apache License, Version 2.0 (the "License");
2129 * you may not use this file except in compliance with the License.
2130 * You may obtain a copy of the License at
2131 *
2132 *   http://www.apache.org/licenses/LICENSE-2.0
2133 *
2134 * Unless required by applicable law or agreed to in writing, software
2135 * distributed under the License is distributed on an "AS IS" BASIS,
2136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2137 * See the License for the specific language governing permissions and
2138 * limitations under the License.
2139 */const Tue=new ea(Yt.comparator);function ic(){return Tue}const SU=new ea(Yt.comparator);function Ig(...e){let t=SU;for(const r of e)t=t.insert(r.key,r);return t}function CU(e){let t=SU;return e.forEach((r,n)=>t=t.insert(r,n.overlayedDocument)),t}function gd(){return Vg()}function kU(){return Vg()}function Vg(){return new ep(e=>e.toString(),(e,t)=>e.isEqual(t))}const Aue=new ea(Yt.comparator),Pue=new Za(Yt.comparator);function Pr(...e){let t=Pue;for(const r of e)t=t.add(r);return t}const _ue=new Za(Zr);function Lue(){return _ue}/**
2140 * @license
2141 * Copyright 2020 Google LLC
2142 *
2143 * Licensed under the Apache License, Version 2.0 (the "License");
2144 * you may not use this file except in compliance with the License.
2145 * You may obtain a copy of the License at
2146 *
2147 *   http://www.apache.org/licenses/LICENSE-2.0
2148 *
2149 * Unless required by applicable law or agreed to in writing, software
2150 * distributed under the License is distributed on an "AS IS" BASIS,
2151 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2152 * See the License for the specific language governing permissions and
2153 * limitations under the License.
2154 */function YI(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Bx(t)?"-0":t}}function MU(e){return{integerValue:""+e}}function Due(e,t){return uue(t)?MU(t):YI(e,t)}/**
2155 * @license
2156 * Copyright 2018 Google LLC
2157 *
2158 * Licensed under the Apache License, Version 2.0 (the "License");
2159 * you may not use this file except in compliance with the License.
2160 * You may obtain a copy of the License at
2161 *
2162 *   http://www.apache.org/licenses/LICENSE-2.0
2163 *
2164 * Unless required by applicable law or agreed to in writing, software
2165 * distributed under the License is distributed on an "AS IS" BASIS,
2166 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2167 * See the License for the specific language governing permissions and
2168 * limitations under the License.
2169 */class f2{constructor(){this._=void 0}}function Oue(e,t,r){return e instanceof Wx?function(a,i){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:a.seconds,nanos:a.nanoseconds}}}};return i&&UI(i)&&(i=VI(i)),i&&(o.fields.__previous_value__=i),{mapValue:o}}(r,t):e instanceof g0?EU(e,t):e instanceof y0?TU(e,t):function(a,i){const o=IU(a,i),l=T3(o)+T3(a.Pe);return dk(o)&&dk(a.Pe)?MU(l):YI(a.serializer,l)}(e,t)}function Rue(e,t,r){return e instanceof g0?EU(e,t):e instanceof y0?TU(e,t):r}function IU(e,t){return e instanceof qx?function(n){return dk(n)||function(i){return!!i&&"doubleValue"in i}(n)}(t)?t:{integerValue:0}:null}class Wx extends f2{}class g0 extends f2{constructor(t){super(),this.elements=t}}function EU(e,t){const r=AU(t);for(const n of e.elements)r.some(a=>nl(a,n))||r.push(n);return{arrayValue:{values:r}}}class y0 extends f2{constructor(t){super(),this.elements=t}}function TU(e,t){let r=AU(t);for(const n of e.elements)r=r.filter(a=>!nl(a,n));return{arrayValue:{values:r}}}
2169class qx extends f2{constructor(t,r){super(),this.serializer=t,this.Pe=r}}function T3(e){return ua(e.integerValue||e.doubleValue)}function AU(e){return WI(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}function $ue(e,t){return e.field.isEqual(t.field)&&function(n,a){return n instanceof g0&&a instanceof g0||n instanceof y0&&a instanceof y0?th(n.elements,a.elements,nl):n instanceof qx&&a instanceof qx?nl(n.Pe,a.Pe):n instanceof Wx&&a instanceof Wx}(e.transform,t.transform)}class Fue{constructor(t,r){this.version=t,this.transformResults=r}}class Wl{constructor(t,r){this.updateTime=t,this.exists=r}static none(){return new Wl}static exists(t){return new Wl(void 0,t)}static updateTime(t){return new Wl(t)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function qv(e,t){return e.updateTime!==void 0?t.isFoundDocument()&&t.version.isEqual(e.updateTime):e.exists===void 0||e.exists===t.isFoundDocument()}class m2{}function PU(e,t){if(!e.hasLocalMutations||t&&t.fields.length===0)return null;if(t===null)return e.isNoDocument()?new LU(e.key,Wl.none()):new h2(e.key,e.data,Wl.none());{const r=e.data,n=Xs.empty();let a=new Za(Qa.comparator);for(let i of t.fields)if(!a.has(i)){let o=r.field(i);o===null&&i.length>1&&(i=i.popLast(),o=r.field(i)),o===null?n.delete(i):n.set(i,o),a=a.add(i)}return new vf(e.key,n,new lo(a.toArray()),Wl.none())}}function zue(e,t,r){e instanceof h2?function(a,i,o){const l=a.value.clone(),c=P3(a.fieldTransforms,i,o.transformResults);l.setAll(c),i.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(e,t,r):e instanceof vf?function(a,i,o){if(!qv(a.precondition,i))return void i.convertToUnknownDocument(o.version);const l=P3(a.fieldTransforms,i,o.transformResults),c=i.data;c.setAll(_U(a)),c.setAll(l),i.convertToFoundDocument(o.version,c).setHasCommittedMutations()}(e,t,r):function(a,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()}(0,t,r)}function Wg(e,t,r,n){return e instanceof h2?function(i,o,l,c){if(!qv(i.precondition,o))return l;const u=i.value.clone(),d=_3(i.fieldTransforms,c,o);return u.setAll(d),o.convertToFoundDocument(o.version,u).setHasLocalMutations(),null}(e,t,r,n):e instanceof vf?function(i,o,l,c){if(!qv(i.precondition,o))return l;const u=_3(i.fieldTransforms,c,o),d=o.data;return d.setAll(_U(i)),d.setAll(u),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),l===null?null:l.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map(f=>f.field))}(e,t,r,n):function(i,o,l){return qv(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):l}(e,t,r)}function Bue(e,t){let r=null;for(const n of e.fieldTransforms){const a=t.data.field(n.field),i=IU(n.transform,a||null);i!=null&&(r===null&&(r=Xs.empty()),r.set(n.field,i))}return r||null}function A3(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(n,a){return n===void 0&&a===void 0||!(!n||!a)&&th(n,a,(i,o)=>$ue(i,o))}(e.fieldTransforms,t.fieldTransforms)&&(e.type===0?e.value.isEqual(t.value):e.type!==1||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class h2 extends m2{constructor(t,r,n,a=[]){super(),this.key=t,this.value=r,this.precondition=n,this.fieldTransforms=a,this.type=0}getFieldMask(){return null}}class vf extends m2{constructor(t,r,n,a,i=[]){super(),this.key=t,this.data=r,this.fieldMask=n,this.precondition=a,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function _U(e){const t=new Map;return e.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){const n=e.data.field(r);t.set(r,n)}}),t}function P3(e,t,r){const n=new Map;xn(e.length===r.length);for(let a=0;a<r.length;a++){const i=e[a],o=i.transform,l=t.data.field(i.field);n.set(i.field,Rue(o,l,r[a]))}return n}function _3(e,t,r){const n=new Map;for(const a of e){const i=a.transform,o=r.data.field(a.field);n.set(a.field,Oue(i,o,t))}return n}class LU extends m2{constructor(t,r){super(),this.key=t,this.precondition=r,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Uue extends m2{constructor(t,r){super(),this.key=t,this.prec
2169ondition=r,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2170 * @license
2171 * Copyright 2017 Google LLC
2172 *
2173 * Licensed under the Apache License, Version 2.0 (the "License");
2174 * you may not use this file except in compliance with the License.
2175 * You may obtain a copy of the License at
2176 *
2177 *   http://www.apache.org/licenses/LICENSE-2.0
2178 *
2179 * Unless required by applicable law or agreed to in writing, software
2180 * distributed under the License is distributed on an "AS IS" BASIS,
2181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2182 * See the License for the specific language governing permissions and
2183 * limitations under the License.
2184 */class Vue{constructor(t,r,n,a){this.batchId=t,this.localWriteTime=r,this.baseMutations=n,this.mutations=a}applyToRemoteDocument(t,r){const n=r.mutationResults;for(let a=0;a<this.mutations.length;a++){const i=this.mutations[a];i.key.isEqual(t.key)&&zue(i,t,n[a])}}applyToLocalView(t,r){for(const n of this.baseMutations)n.key.isEqual(t.key)&&(r=Wg(n,t,r,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(t.key)&&(r=Wg(n,t,r,this.localWriteTime));return r}applyToLocalDocumentSet(t,r){const n=kU();return this.mutations.forEach(a=>{const i=t.get(a.key),o=i.overlayedDocument;let l=this.applyToLocalView(o,i.mutatedFields);l=r.has(a.key)?null:l;const c=PU(o,l);c!==null&&n.set(a.key,c),o.isValidDocument()||o.convertToNoDocument(dr.min())}),n}keys(){return this.mutations.reduce((t,r)=>t.add(r.key),Pr())}isEqual(t){return this.batchId===t.batchId&&th(this.mutations,t.mutations,(r,n)=>A3(r,n))&&th(this.baseMutations,t.baseMutations,(r,n)=>A3(r,n))}}class QI{constructor(t,r,n,a){this.batch=t,this.commitVersion=r,this.mutationResults=n,this.docVersions=a}static from(t,r,n){xn(t.mutations.length===n.length);let a=function(){return Aue}();const i=t.mutations;for(let o=0;o<i.length;o++)a=a.insert(i[o].key,n[o].version);return new QI(t,r,n,a)}}/**
2185 * @license
2186 * Copyright 2022 Google LLC
2187 *
2188 * Licensed under the Apache License, Version 2.0 (the "License");
2189 * you may not use this file except in compliance with the License.
2190 * You may obtain a copy of the License at
2191 *
2192 *   http://www.apache.org/licenses/LICENSE-2.0
2193 *
2194 * Unless required by applicable law or agreed to in writing, software
2195 * distributed under the License is distributed on an "AS IS" BASIS,
2196 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2197 * See the License for the specific language governing permissions and
2198 * limitations under the License.
2199 */class Wue{constructor(t,r){this.largestBatchId=t,this.mutation=r}getKey(){return this.mutation.key}isEqual(t){return t!==null&&this.mutation===t.mutation}toString(){return`Overlay{
2200      largestBatchId: ${this.largestBatchId},
2201      mutation: ${this.mutation.toString()}
2202    }`}}/**
2203 * @license
2204 * Copyright 2017 Google LLC
2205 *
2206 * Licensed under the Apache License, Version 2.0 (the "License");
2207 * you may not use this file except in compliance with the License.
2208 * You may obtain a copy of the License at
2209 *
2210 *   http://www.apache.org/licenses/LICENSE-2.0
2211 *
2212 * Unless required by applicable law or agreed to in writing, software
2213 * distributed under the License is distributed on an "AS IS" BASIS,
2214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2215 * See the License for the specific language governing permissions and
2216 * limitations under the License.
2217 */class que{constructor(t,r){this.count=t,this.unchangedNames=r}}/**
2218 * @license
2219 * Copyright 2017 Google LLC
2220 *
2221 * Licensed under the Apache License, Version 2.0 (the "License");
2222 * you may not use this file except in compliance with the License.
2223 * You may obtain a copy of the License at
2224 *
2225 *   http://www.apache.org/licenses/LICENSE-2.0
2226 *
2227 * Unless required by applicable law or agreed to in writing, software
2228 * distributed under the License is distributed on an "AS IS" BASIS,
2229 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2230 * See the License for the specific language governing permissions and
2231 * limitations under the License.
2232 */var ba,zr;function Gue(e){switch(e){default:return ur();case st.CANCELLED:case st.UNKNOWN:case st.DEADLINE_EXCEEDED:case st.RESOURCE_EXHAUSTED:case st.INTERNAL:case st.UNAVAILABLE:case st.UNAUTHENTICATED:return!1;case st.INVALID_ARGUMENT:case st.NOT_FOUND:case st.ALREADY_EXISTS:case st.PERMISSION_DENIED:case st.FAILED_PRECONDITION:case st.ABORTED:case st.OUT_OF_RANGE:case st.UNIMPLEMENT
2232ED:case st.DATA_LOSS:return!0}}function DU(e){if(e===void 0)return sc("GRPC error has no .code"),st.UNKNOWN;switch(e){case ba.OK:return st.OK;case ba.CANCELLED:return st.CANCELLED;case ba.UNKNOWN:return st.UNKNOWN;case ba.DEADLINE_EXCEEDED:return st.DEADLINE_EXCEEDED;case ba.RESOURCE_EXHAUSTED:return st.RESOURCE_EXHAUSTED;case ba.INTERNAL:return st.INTERNAL;case ba.UNAVAILABLE:return st.UNAVAILABLE;case ba.UNAUTHENTICATED:return st.UNAUTHENTICATED;case ba.INVALID_ARGUMENT:return st.INVALID_ARGUMENT;case ba.NOT_FOUND:return st.NOT_FOUND;case ba.ALREADY_EXISTS:return st.ALREADY_EXISTS;case ba.PERMISSION_DENIED:return st.PERMISSION_DENIED;case ba.FAILED_PRECONDITION:return st.FAILED_PRECONDITION;case ba.ABORTED:return st.ABORTED;case ba.OUT_OF_RANGE:return st.OUT_OF_RANGE;case ba.UNIMPLEMENTED:return st.UNIMPLEMENTED;case ba.DATA_LOSS:return st.DATA_LOSS;default:return ur()}}(zr=ba||(ba={}))[zr.OK=0]="OK",zr[zr.CANCELLED=1]="CANCELLED",zr[zr.UNKNOWN=2]="UNKNOWN",zr[zr.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",zr[zr.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",zr[zr.NOT_FOUND=5]="NOT_FOUND",zr[zr.ALREADY_EXISTS=6]="ALREADY_EXISTS",zr[zr.PERMISSION_DENIED=7]="PERMISSION_DENIED",zr[zr.UNAUTHENTICATED=16]="UNAUTHENTICATED",zr[zr.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",zr[zr.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",zr[zr.ABORTED=10]="ABORTED",zr[zr.OUT_OF_RANGE=11]="OUT_OF_RANGE",zr[zr.UNIMPLEMENTED=12]="UNIMPLEMENTED",zr[zr.INTERNAL=13]="INTERNAL",zr[zr.UNAVAILABLE=14]="UNAVAILABLE",zr[zr.DATA_LOSS=15]="DATA_LOSS";/**
2233 * @license
2234 * Copyright 2023 Google LLC
2235 *
2236 * Licensed under the Apache License, Version 2.0 (the "License");
2237 * you may not use this file except in compliance with the License.
2238 * You may obtain a copy of the License at
2239 *
2240 *   http://www.apache.org/licenses/LICENSE-2.0
2241 *
2242 * Unless required by applicable law or agreed to in writing, software
2243 * distributed under the License is distributed on an "AS IS" BASIS,
2244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2245 * See the License for the specific language governing permissions and
2246 * limitations under the License.
2247 */function Hue(){return new TextEncoder}/**
2248 * @license
2249 * Copyright 2022 Google LLC
2250 *
2251 * Licensed under the Apache License, Version 2.0 (the "License");
2252 * you may not use this file except in compliance with the License.
2253 * You may obtain a copy of the License at
2254 *
2255 *   http://www.apache.org/licenses/LICENSE-2.0
2256 *
2257 * Unless required by applicable law or agreed to in writing, software
2258 * distributed under the License is distributed on an "AS IS" BASIS,
2259 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2260 * See the License for the specific language governing permissions and
2261 * limitations under the License.
2262 */const Yue=new Dd([4294967295,4294967295],0);function L3(e){const t=Hue().encode(e),r=new sU;return r.update(t),new Uint8Array(r.digest())}function D3(e){const t=new DataView(e.buffer),r=t.getUint32(0,!0),n=t.getUint32(4,!0),a=t.getUint32(8,!0),i=t.getUint32(12,!0);return[new Dd([r,n],0),new Dd([a,i],0)]}class KI{constructor(t,r,n){if(this.bitmap=t,this.padding=r,this.hashCount=n,r<0||r>=8)throw new Eg(`Invalid padding: ${r}`);if(n<0)throw new Eg(`Invalid hash count: ${n}`);if(t.length>0&&this.hashCount===0)throw new Eg(`Invalid hash count: ${n}`);if(t.length===0&&r!==0)throw new Eg(`Invalid padding when bitmap length is 0: ${r}`);this.Ie=8*t.length-r,this.Te=Dd.fromNumber(this.Ie)}Ee(t,r,n){let a=t.add(r.multiply(Dd.fromNumber(n)));return a.compare(Yue)===1&&(a=new Dd([a.getBits(0),a.getBits(1)],0)),a.modulo(this.Te).toNumber()}de(t){return(this.bitmap[Math.floor(t/8)]&1<<t%8)!=0}mightContain(t){if(this.Ie===0)return!1;const r=L3(t),[n,a]=D3(r);for(let i=0;i<this.hashCount;i++){const o=this.Ee(n,a,i);if(!this.de(o))return!1}return!0}static create(t,r,n){const a=t%8==0?0:8-t%8,i=new Uint8Array(Math.ceil(t/8)),o=new KI(i,a,r);return n.forEach(l=>o.insert(l)),o}insert(t){if(this.Ie===0)return;const r=L3(t),[n,a]=D3(r);for(let i=0;i<this.hashCount;i++){const o=this.Ee(n,a,i);this.Ae(o)}}Ae(t){const r=Math.floor(t/8),n=t%8;this.bitmap[r]|=1<<n}}
2262class Eg extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2263 * @license
2264 * Copyright 2017 Google LLC
2265 *
2266 * Licensed under the Apache License, Version 2.0 (the "License");
2267 * you may not use this file except in compliance with the License.
2268 * You may obtain a copy of the License at
2269 *
2270 *   http://www.apache.org/licenses/LICENSE-2.0
2271 *
2272 * Unless required by applicable law or agreed to in writing, software
2273 * distributed under the License is distributed on an "AS IS" BASIS,
2274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2275 * See the License for the specific language governing permissions and
2276 * limitations under the License.
2277 */class p2{constructor(t,r,n,a,i){this.snapshotVersion=t,this.targetChanges=r,this.targetMismatches=n,this.documentUpdates=a,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(t,r,n){const a=new Map;return a.set(t,Yy.createSynthesizedTargetChangeForCurrentChange(t,r,n)),new p2(dr.min(),a,new ea(Zr),ic(),Pr())}}class Yy{constructor(t,r,n,a,i){this.resumeToken=t,this.current=r,this.addedDocuments=n,this.modifiedDocuments=a,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(t,r,n){return new Yy(n,r,Pr(),Pr(),Pr())}}/**
2278 * @license
2279 * Copyright 2017 Google LLC
2280 *
2281 * Licensed under the Apache License, Version 2.0 (the "License");
2282 * you may not use this file except in compliance with the License.
2283 * You may obtain a copy of the License at
2284 *
2285 *   http://www.apache.org/licenses/LICENSE-2.0
2286 *
2287 * Unless required by applicable law or agreed to in writing, software
2288 * distributed under the License is distributed on an "AS IS" BASIS,
2289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2290 * See the License for the specific language governing permissions and
2291 * limitations under the License.
2292 */class Gv{constructor(t,r,n,a){this.Re=t,this.removedTargetIds=r,this.key=n,this.Ve=a}}class OU{constructor(t,r){this.targetId=t,this.me=r}}class RU{constructor(t,r,n=ts.EMPTY_BYTE_STRING,a=null){this.state=t,this.targetIds=r,this.resumeToken=n,this.cause=a}}class O3{constructor(){this.fe=0,this.ge=$3(),this.pe=ts.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(t){t.approximateByteSize()>0&&(this.we=!0,this.pe=t)}ve(){let t=Pr(),r=Pr(),n=Pr();return this.ge.forEach((a,i)=>{switch(i){case 0:t=t.add(a);break;case 2:r=r.add(a);break;case 1:n=n.add(a);break;default:ur()}}),new Yy(this.pe,this.ye,t,r,n)}Ce(){this.we=!1,this.ge=$3()}Fe(t,r){this.we=!0,this.ge=this.ge.insert(t,r)}Me(t){this.we=!0,this.ge=this.ge.remove(t)}xe(){this.fe+=1}Oe(){this.fe-=1,xn(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class Que{constructor(t){this.Le=t,this.Be=new Map,this.ke=ic(),this.qe=R3(),this.Qe=new ea(Zr)}Ke(t){for(const r of t.Re)t.Ve&&t.Ve.isFoundDocument()?this.$e(r,t.Ve):this.Ue(r,t.key,t.Ve);for(const r of t.removedTargetIds)this.Ue(r,t.key,t.Ve)}We(t){this.forEachTarget(t,r=>{const n=this.Ge(r);switch(t.state){case 0:this.ze(r)&&n.De(t.resumeToken);break;case 1:n.Oe(),n.Se||n.Ce(),n.De(t.resumeToken);break;case 2:n.Oe(),n.Se||this.removeTarget(r);break;case 3:this.ze(r)&&(n.Ne(),n.De(t.resumeToken));break;case 4:this.ze(r)&&(this.je(r),n.De(t.resumeToken));break;default:ur()}})}forEachTarget(t,r){t.targetIds.length>0?t.targetIds.forEach(r):this.Be.forEach((n,a)=>{this.ze(a)&&r(a)})}He(t){const r=t.targetId,n=t.me.count,a=this.Je(r);if(a){const i=a.target;if(mk(i))if(n===0){const o=new Yt(i.path);this.Ue(r,o,ds.newNoDocument(o,dr.min()))}else xn(n===1);else{const o=this.Ye(r);if(o!==n){const l=this.Ze(t),c=l?this.Xe(l,t,o):1;if(c!==0){this.je(r);const u=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(r,u)}}}}}Ze(t){const r=t.me.unchangedNames;if(!r||!r.bits)return null;const{bits:{bitmap:n="",padding:a=0},hashCount:i=0}=r;let o,l;try{o=ef(n).toUint8Array()}catch(c){if(c instanceof hU)return eh("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{l=new KI(o,a,i)}catch(c){return eh(c instanceof Eg?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return l.Ie===0?null:l}Xe(t,r,n){return r.me.count===n-this.nt(t,r.targetId)?0:2}nt(t,r){const n=this.Le.getRemoteKeysForTarget(r);let a=0;
2292return n.forEach(i=>{const o=this.Le.tt(),l=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;t.mightContain(l)||(this.Ue(r,i,null),a++)}),a}rt(t){const r=new Map;this.Be.forEach((i,o)=>{const l=this.Je(o);if(l){if(i.current&&mk(l.target)){const c=new Yt(l.target.path);this.ke.get(c)!==null||this.it(o,c)||this.Ue(o,c,ds.newNoDocument(c,t))}i.be&&(r.set(o,i.ve()),i.Ce())}});let n=Pr();this.qe.forEach((i,o)=>{let l=!0;o.forEachWhile(c=>{const u=this.Je(c);return!u||u.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)}),l&&(n=n.add(i))}),this.ke.forEach((i,o)=>o.setReadTime(t));const a=new p2(t,r,this.Qe,this.ke,n);return this.ke=ic(),this.qe=R3(),this.Qe=new ea(Zr),a}$e(t,r){if(!this.ze(t))return;const n=this.it(t,r.key)?2:0;this.Ge(t).Fe(r.key,n),this.ke=this.ke.insert(r.key,r),this.qe=this.qe.insert(r.key,this.st(r.key).add(t))}Ue(t,r,n){if(!this.ze(t))return;const a=this.Ge(t);this.it(t,r)?a.Fe(r,1):a.Me(r),this.qe=this.qe.insert(r,this.st(r).delete(t)),n&&(this.ke=this.ke.insert(r,n))}removeTarget(t){this.Be.delete(t)}Ye(t){const r=this.Ge(t).ve();return this.Le.getRemoteKeysForTarget(t).size+r.addedDocuments.size-r.removedDocuments.size}xe(t){this.Ge(t).xe()}Ge(t){let r=this.Be.get(t);return r||(r=new O3,this.Be.set(t,r)),r}st(t){let r=this.qe.get(t);return r||(r=new Za(Zr),this.qe=this.qe.insert(t,r)),r}ze(t){const r=this.Je(t)!==null;return r||Dt("WatchChangeAggregator","Detected inactive target",t),r}Je(t){const r=this.Be.get(t);return r&&r.Se?null:this.Le.ot(t)}je(t){this.Be.set(t,new O3),this.Le.getRemoteKeysForTarget(t).forEach(r=>{this.Ue(t,r,null)})}it(t,r){return this.Le.getRemoteKeysForTarget(t).has(r)}}function R3(){return new ea(Yt.comparator)}function $3(){return new ea(Yt.comparator)}const Kue={asc:"ASCENDING",desc:"DESCENDING"},Jue={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Zue={and:"AND",or:"OR"};class Xue{constructor(t,r){this.databaseId=t,this.useProto3Json=r}}function pk(e,t){return e.useProto3Json||l2(t)?t:{value:t}}function Gx(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function $U(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function ede(e,t){return Gx(e,t.toTimestamp())}function Jo(e){return xn(!!e),dr.fromTimestamp(function(r){const n=ku(r);return new Pa(n.seconds,n.nanos)}(e))}function JI(e,t){return gk(e,t).canonicalString()}function gk(e,t){const r=function(a){return new sa(["projects",a.projectId,"databases",a.database])}(e).child("documents");return t===void 0?r:r.child(t)}function FU(e){const t=sa.fromString(e);return xn(WU(t)),t}function yk(e,t){return JI(e.databaseId,t.path)}function ON(e,t){const r=FU(t);if(r.get(1)!==e.databaseId.projectId)throw new Ht(st.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+e.databaseId.projectId);if(r.get(3)!==e.databaseId.database)throw new Ht(st.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+e.databaseId.database);return new Yt(BU(r))}function zU(e,t){return JI(e.databaseId,t)}function tde(e){const t=FU(e);return t.length===4?sa.emptyPath():BU(t)}function bk(e){return new sa(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function BU(e){return xn(e.length>4&&e.get(4)==="documents"),e.popFirst(5)}function F3(e,t,r){return{name:yk(e,t),fields:r.value.mapValue.fields}}function rde(e,t){let r;if("targetChange"in t){t.targetChange;const n=function(u){return u==="NO_CHANGE"?0:u==="ADD"?1:u==="REMOVE"?2:u==="CURRENT"?3:u==="RESET"?4:ur()}(t.targetChange.targetChangeType||"NO_CHANGE"),a=t.targetChange.targetIds||[],i=function(u,d){return u.useProto3Json?(xn(d===void 0||typeof d=="string"),ts.fromBase64String(d||"")):(xn(d===void 0||d instanceof Buffer||d instanceof Uint8Array),ts.fromUint8Array(d||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,l=o&&function(u){const d=u.code===void 0?st.UNKNOWN:DU(u.code);return new Ht(d,u.message||"")}(o);r=new RU(n,a,i,l||null)}else if("documentChange"in t){t.documentChange;const n=t.documentChange;n.document,n.document.name,n.document.updateTime;const a=ON(e,n.document.name),i=Jo(n.document.updateTime),o=n.document.createTime?Jo(n.document.createTime):dr.min(),l=new Xs({mapValue:{fields:n.document.fields}}),c=ds.newFoundDocument(a,i,o,l),u=n.targetIds||[],d=n.removedTargetIds||[];
2292r=new Gv(u,d,c.key,c)}else if("documentDelete"in t){t.documentDelete;const n=t.documentDelete;n.document;const a=ON(e,n.document),i=n.readTime?Jo(n.readTime):dr.min(),o=ds.newNoDocument(a,i),l=n.removedTargetIds||[];r=new Gv([],l,o.key,o)}else if("documentRemove"in t){t.documentRemove;const n=t.documentRemove;n.document;const a=ON(e,n.document),i=n.removedTargetIds||[];r=new Gv([],i,a,null)}else{if(!("filter"in t))return ur();{t.filter;const n=t.filter;n.targetId;const{count:a=0,unchangedNames:i}=n,o=new que(a,i),l=n.targetId;r=new OU(l,o)}}return r}function nde(e,t){let r;if(t instanceof h2)r={update:F3(e,t.key,t.value)};else if(t instanceof LU)r={delete:yk(e,t.key)};else if(t instanceof vf)r={update:F3(e,t.key,t.data),updateMask:fde(t.fieldMask)};else{if(!(t instanceof Uue))return ur();r={verify:yk(e,t.key)}}return t.fieldTransforms.length>0&&(r.updateTransforms=t.fieldTransforms.map(n=>function(i,o){const l=o.transform;if(l instanceof Wx)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof g0)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof y0)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof qx)return{fieldPath:o.field.canonicalString(),increment:l.Pe};throw ur()}(0,n))),t.precondition.isNone||(r.currentDocument=function(a,i){return i.updateTime!==void 0?{updateTime:ede(a,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:ur()}(e,t.precondition)),r}function ade(e,t){return e&&e.length>0?(xn(t!==void 0),e.map(r=>function(a,i){let o=a.updateTime?Jo(a.updateTime):Jo(i);return o.isEqual(dr.min())&&(o=Jo(i)),new Fue(o,a.transformResults||[])}(r,t))):[]}function sde(e,t){return{documents:[zU(e,t.path)]}}function ide(e,t){const r={structuredQuery:{}},n=t.path;let a;t.collectionGroup!==null?(a=n,r.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(a=n.popLast(),r.structuredQuery.from=[{collectionId:n.lastSegment()}]),r.parent=zU(e,a);const i=function(u){if(u.length!==0)return VU(al.create(u,"and"))}(t.filters);i&&(r.structuredQuery.where=i);const o=function(u){if(u.length!==0)return u.map(d=>function(m){return{field:rm(m.field),direction:cde(m.dir)}}(d))}(t.orderBy);o&&(r.structuredQuery.orderBy=o);const l=pk(e,t.limit);return l!==null&&(r.structuredQuery.limit=l),t.startAt&&(r.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(t.startAt)),t.endAt&&(r.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(t.endAt)),{_t:r,parent:a}}function ode(e){let t=tde(e.parent);const r=e.structuredQuery,n=r.from?r.from.length:0;let a=null;if(n>0){xn(n===1);const d=r.from[0];d.allDescendants?a=d.collectionId:t=t.child(d.collectionId)}let i=[];r.where&&(i=function(f){const m=UU(f);return m instanceof al&&bU(m)?m.getFilters():[m]}(r.where));let o=[];r.orderBy&&(o=function(f){return f.map(m=>function(p){return new Vx(nm(p.field),function(y){switch(y){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(p.direction))}(m))}(r.orderBy));let l=null;r.limit&&(l=function(f){let m;return m=typeof f=="object"?f.value:f,l2(m)?null:m}(r.limit));let c=null;r.startAt&&(c=function(f){const m=!!f.before,h=f.values||[];return new Ux(h,m)}(r.startAt));let u=null;return r.endAt&&(u=function(f){const m=!f.before,h=f.values||[];return new Ux(h,m)}(r.endAt)),Cue(t,a,o,i,l,"F",c,u)}function lde(e,t){const r=function(a){switch(a){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ur()}}(t.purpose);return r==null?null:{"goog-listen-tags":r}}function UU(e){return e.unaryFilter!==void 0?function(r){switch(r.unaryFilter.op){case"IS_NAN":const n=nm(r.unaryFilter.field);return Ta.create(n,"==",{doubleValue:NaN});case"IS_NULL":const a=nm(r.unaryFilter.field);return Ta.create(a,"==",{nullValue:"NULL_VALUE"});
2292case"IS_NOT_NAN":const i=nm(r.unaryFilter.field);return Ta.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=nm(r.unaryFilter.field);return Ta.create(o,"!=",{nullValue:"NULL_VALUE"});default:return ur()}}(e):e.fieldFilter!==void 0?function(r){return Ta.create(nm(r.fieldFilter.field),function(a){switch(a){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ur()}}(r.fieldFilter.op),r.fieldFilter.value)}(e):e.compositeFilter!==void 0?function(r){return al.create(r.compositeFilter.filters.map(n=>UU(n)),function(a){switch(a){case"AND":return"and";case"OR":return"or";default:return ur()}}(r.compositeFilter.op))}(e):ur()}function cde(e){return Kue[e]}function ude(e){return Jue[e]}function dde(e){return Zue[e]}function rm(e){return{fieldPath:e.canonicalString()}}function nm(e){return Qa.fromServerFormat(e.fieldPath)}function VU(e){return e instanceof Ta?function(r){if(r.op==="=="){if(C3(r.value))return{unaryFilter:{field:rm(r.field),op:"IS_NAN"}};if(S3(r.value))return{unaryFilter:{field:rm(r.field),op:"IS_NULL"}}}else if(r.op==="!="){if(C3(r.value))return{unaryFilter:{field:rm(r.field),op:"IS_NOT_NAN"}};if(S3(r.value))return{unaryFilter:{field:rm(r.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:rm(r.field),op:ude(r.op),value:r.value}}}(e):e instanceof al?function(r){const n=r.getFilters().map(a=>VU(a));return n.length===1?n[0]:{compositeFilter:{op:dde(r.op),filters:n}}}(e):ur()}function fde(e){const t=[];return e.fields.forEach(r=>t.push(r.canonicalString())),{fieldPaths:t}}function WU(e){return e.length>=4&&e.get(0)==="projects"&&e.get(2)==="databases"}/**
2293 * @license
2294 * Copyright 2017 Google LLC
2295 *
2296 * Licensed under the Apache License, Version 2.0 (the "License");
2297 * you may not use this file except in compliance with the License.
2298 * You may obtain a copy of the License at
2299 *
2300 *   http://www.apache.org/licenses/LICENSE-2.0
2301 *
2302 * Unless required by applicable law or agreed to in writing, software
2303 * distributed under the License is distributed on an "AS IS" BASIS,
2304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2305 * See the License for the specific language governing permissions and
2306 * limitations under the License.
2307 */class su{constructor(t,r,n,a,i=dr.min(),o=dr.min(),l=ts.EMPTY_BYTE_STRING,c=null){this.target=t,this.targetId=r,this.purpose=n,this.sequenceNumber=a,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=l,this.expectedCount=c}withSequenceNumber(t){return new su(this.target,this.targetId,this.purpose,t,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(t,r){return new su(this.target,this.targetId,this.purpose,this.sequenceNumber,r,this.lastLimboFreeSnapshotVersion,t,null)}withExpectedCount(t){return new su(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,t)}withLastLimboFreeSnapshotVersion(t){return new su(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,t,this.resumeToken,this.expectedCount)}}/**
2308 * @license
2309 * Copyright 2017 Google LLC
2310 *
2311 * Licensed under the Apache License, Version 2.0 (the "License");
2312 * you may not use this file except in compliance with the License.
2313 * You may obtain a copy of the License at
2314 *
2315 *   http://www.apache.org/licenses/LICENSE-2.0
2316 *
2317 * Unless required by applicable law or agreed to in writing, software
2318 * distributed under the License is distributed on an "AS IS" BASIS,
2319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2320 * See the License for the specific language governing permissions and
2321 * limitations under the License.
2322 */class mde{constructor(t){this.ct=t}}function hde(e){const t=ode({parent:e.parent,structuredQuery:e.structuredQuery});return e.limitType==="LAST"?hk(t,t.limit,"L"):t}/**
2323 * @license
2324 * Copyright 2019 Google LLC
2325 *
2326 * Licensed under the Apache License, Version 2.0 (the "License");
2327 * you may not use this file except in compliance with the License.
2328 * You may obtain a copy of the License at
2329 *
2330 *   http://www.apache.org/licenses/LICENSE-2.0
2331 *
2332 * Unless required by applicable law or agreed to in writing, software
2333 * distributed under the License is distributed on an "AS IS" BASIS,
2334 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2335 * See the License for the specific language governing permissions and
2336 * limitations under the License.
2337 */class pde{constructor(){this.un=new gde}addToCollectionParentIndex(t,r){return this.un.add(r),rt.resolve()}getCollectionParents(t,r){return rt.resolve(this.un.getEntries(r))}addFieldIndex(t,r){return rt.resolve()}deleteFieldIndex(t,r){return rt.resolve()}deleteAllFieldIndexes(t){return rt.resolve()}createTargetIndexes(t,r){return rt.resolve()}getDocumentsMatchingTarget(t,r){return rt.resolve(null)}getIndexType(t,r){return rt.resolve(0)}getFieldIndexes(t,r){return rt.resolve([])}getNextCollectionGroupToUpdate(t){return rt.resolve(null)}getMinOffset(t,r){return rt.resolve(Cu.min())}getMinOffsetFromCollectionGroup(t,r){return rt.resolve(Cu.min())}updateCollectionGroup(t,r,n){return rt.resolve()}updateIndexEntries(t,r){return rt.resolve()}}class gde{constructor(){this.index={}}add(t){const r=t.lastSegment(),n=t.popLast(),a=this.index[r]||new Za(sa.comparator),i=!a.has(n);return this.index[r]=a.add(n),i}has(t){const r=t.lastSegment(),n=t.popLast(),a=this.index[r];return a&&a.has(n)}getEntries(t){return(this.index[t]||new Za(sa.comparator)).toArray()}}/**
2338 * @license
2339 * Copyright 2017 Google LLC
2340 *
2341 * Licensed under the Apache License, Version 2.0 (the "License");
2342 * you may not use this file except in compliance with the License.
2343 * You may obtain a copy of the License at
2344 *
2345 *   http://www.apache.org/licenses/LICENSE-2.0
2346 *
2347 * Unless required by applicable law or agreed to in writing, software
2348 * distributed under the License is distributed on an "AS IS" BASIS,
2349 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2350 * See the License for the specific language governing permissions and
2351 * limitations under the License.
2352 */class ah{constructor(t){this.Ln=t}next(){return this.Ln+=2,this.Ln}static Bn(){return new ah(0)}static kn(){return new ah(-1)}}/**
2353 * @license
2354 * Copyright 2017 Google LLC
2355 *
2356 * Licensed under the Apache License, Version 2.0 (the "License");
2357 * you may not use this file except in compliance with the License.
2358 * You may obtain a copy of the License at
2359 *
2360 *   http://www.apache.org/licenses/LICENSE-2.0
2361 *
2362 * Unless required by applicable law or agreed to in writing, software
2363 * distributed under the License is distributed on an "AS IS" BASIS,
2364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2365 * See the License for the specific language governing permissions and
2366 * limitations under the License.
2367 */class yde{constructor(){this.changes=new ep(t=>t.toString(),(t,r)=>t.isEqual(r)),this.changesApplied=!1}addEntry(t){this.assertNotApplied(),this.changes.set(t.key,t)}removeEntry(t,r){this.assertNotApplied(),this.changes.set(t,ds.newInvalidDocument(t).setReadTime(r))}getEntry(t,r){this.assertNotApplied();const n=this.changes.get(r);return n!==void 0?rt.resolve(n):this.getFromCache(t,r)}getEntries(t,r){return this.getAllFromCache(t,r)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}/**
2368 * @license
2369 * Copyright 2017 Google LLC
2370 *
2371 * Licensed under the Apache License, Version 2.0 (the "License");
2372 * you may not use this file except in compliance with the License.
2373 * You may obtain a copy of the License at
2374 *
2375 *   http://www.apache.org/licenses/LICENSE-2.0
2376 *
2377 * Unless required by applicable law or agreed to in writing, software
2378 * distributed under the License is distributed on an "AS IS" BASIS,
2379 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2380 * See the License for the specific language governing permissions and
2381 * limitations under the License.
2382 *//**
2383 * @license
2384 * Copyright 2022 Google LLC
2385 *
2386 * Licensed under the Apache License, Version 2.0 (the "License");
2387 * you may not use this file except in compliance with the License.
2388 * You may obtain a copy of the License at
2389 *
2390 *   http://www.apache.org/licenses/LICENSE-2.0
2391 *
2392 * Unless required by applicable law or agreed to in writing, software
2393 * distributed under the License is distributed on an "AS IS" BASIS,
2394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2395 * See the License for the specific language governing permissions and
2396 * limitations under the License.
2397 */class bde{constructor(t,r){this.overlayedDocument=t,this.mutatedFields=r}}/**
2398 * @license
2399 * Copyright 2017 Google LLC
2400 *
2401 * Licensed under the Apache License, Version 2.0 (the "License");
2402 * you may not use this file except in compliance with the License.
2403 * You may obtain a copy of the License at
2404 *
2405 *   http://www.apache.org/licenses/LICENSE-2.0
2406 *
2407 * Unless required by applicable law or agreed to in writing, software
2408 * distributed under the License is distributed on an "AS IS" BASIS,
2409 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2410 * See the License for the specific language governing permissions and
2411 * limitations under the License.
2412 */class vde{constructor(t,r,n,a){this.remoteDocumentCache=t,this.mutationQueue=r,this.documentOverlayCache=n,this.indexManager=a}getDocument(t,r){let n=null;return this.documentOverlayCache.getOverlay(t,r).next(a=>(n=a,this.remoteDocumentCache.getEntry(t,r))).next(a=>(n!==null&&Wg(n.mutation,a,lo.empty(),Pa.now()),a))}getDocuments(t,r){return this.remoteDocumentCache.getEntries(t,r).next(n=>this.getLocalViewOfDocuments(t,n,Pr()).next(()=>n))}getLocalViewOfDocuments(t,r,n=Pr()){const a=gd();return this.populateOverlays(t,a,r).next(()=>this.computeViews(t,r,a,n).next(i=>{let o=Ig();return i.forEach((l,c)=>{o=o.insert(l,c.overlayedDocument)}),o}))}getOverlayedDocuments(t,r){const n=gd();return this.populateOverlays(t,n,r).next(()=>this.computeViews(t,r,n,Pr()))}populateOverlays(t,r,n){const a=[];return n.forEach(i=>{r.has(i)||a.push(i)}),this.documentOverlayCache.getOverlays(t,a).next(i=>{i.forEach((o,l)=>{r.set(o,l)})})}computeViews(t,r,n,a){let i=ic();const o=Vg(),l=function(){return Vg()}();return r.forEach((c,u)=>{const d=n.get(u.key);a.has(u.key)&&(d===void 0||d.mutation instanceof vf)?i=i.insert(u.key,u):d!==void 0?(o.set(u.key,d.mutation.getFieldMask()),Wg(d.mutation,u,d.mutation.getFieldMask(),Pa.now())):o.set(u.key,lo.empty())}),this.recalculateAndSaveOverlays(t,i).next(c=>(c.forEach((u,d)=>o.set(u,d)),r.forEach((u,d)=>{var f;return l.set(u,new bde(d,(f=o.get(u))!==null&&f!==void 0?f:null))}),l))}recalculateAndSaveOverlays(t,r){const n=Vg();let a=new ea((o,l)=>o-l),i=Pr();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,r).next(o=>{for(const l of o)l.keys().forEach(c=>{const u=r.get(c);if(u===null)return;let d=n.get(c)||lo.empty();d=l.applyToLocalView(u,d),n.set(c,d);const f=(a.get(l.batchId)||Pr()).add(c);a=a.insert(l.batchId,f)})}).next(()=>{const o=[],l=a.getReverseIterator();for(;l.hasNext();){const c=l.getNext(),u=c.key,d=c.value,f=kU();d.forEach(m=>{if(!i.has(m)){const h=PU(r.get(m),n.get(m));h!==null&&f.set(m,h),i=i.add(m)}}),o.push(this.documentOverlayCache.saveOverlays(t,u,f))}return rt.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(t,r){return this.remoteDocumentCache.getEntries(t,r).next(n=>this.recalculateAndSaveOverlays(t,n))}getDocumentsMatchingQuery(t,r,n,a){return function(o){return Yt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(r)?this.getDocumentsMatchingDocumentQuery(t,r.path):kue(r)?this.getDocumentsMatchingCollectionGroupQuery(t,r,n,a):this.getDocumentsMatchingCollectionQuery(t,r,n,a)}getNextDocuments(t,r,n,a){return this.remoteDocumentCache.getAllFromCollectionGroup(t,r,n,a).next(i=>{const o=a-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,r,n.largestBatchId,a-i.size):rt.resolve(gd());let l=-1,c=i;return o.next(u=>rt.forEach(u,(d,f)=>(l<f.largestBatchId&&(l=f.largestBatchId),i.get(d)?rt.resolve():this.remoteDocumentCache.getEntry(t,d).next(m=>{c=c.insert(d,m)}))).next(()=>this.populateOverlays(t,u,i)).next(()=>this.computeViews(t,c,u,Pr())).next(d=>({batchId:l,changes:CU(d)})))})}getDocumentsMatchingDocumentQuery(t,r){return this.getDocument(t,new Yt(r)).next(n=>{let a=Ig();
vendor: 4,219 bytes, lines 2412-2446
2412return n.isFoundDocument()&&(a=a.insert(n.key,n)),a})}getDocumentsMatchingCollectionGroupQuery(t,r,n,a){const i=r.collectionGroup;let o=Ig();return this.indexManager.getCollectionParents(t,i).next(l=>rt.forEach(l,c=>{const u=function(f,m){return new c2(m,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(r,c.child(i));return this.getDocumentsMatchingCollectionQuery(t,u,n,a).next(d=>{d.forEach((f,m)=>{o=o.insert(f,m)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(t,r,n,a){let i;return this.documentOverlayCache.getOverlaysForCollection(t,r.path,n.largestBatchId).next(o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(t,r,n,i,a))).next(o=>{i.forEach((c,u)=>{const d=u.getKey();o.get(d)===null&&(o=o.insert(d,ds.newInvalidDocument(d)))});let l=Ig();return o.forEach((c,u)=>{const d=i.get(c);d!==void 0&&Wg(d.mutation,u,lo.empty(),Pa.now()),d2(r,u)&&(l=l.insert(c,u))}),l})}}/**
2413 * @license
2414 * Copyright 2020 Google LLC
2415 *
2416 * Licensed under the Apache License, Version 2.0 (the "License");
2417 * you may not use this file except in compliance with the License.
2418 * You may obtain a copy of the License at
2419 *
2420 *   http://www.apache.org/licenses/LICENSE-2.0
2421 *
2422 * Unless required by applicable law or agreed to in writing, software
2423 * distributed under the License is distributed on an "AS IS" BASIS,
2424 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2425 * See the License for the specific language governing permissions and
2426 * limitations under the License.
2427 */class xde{constructor(t){this.serializer=t,this.hr=new Map,this.Pr=new Map}getBundleMetadata(t,r){return rt.resolve(this.hr.get(r))}saveBundleMetadata(t,r){return this.hr.set(r.id,function(a){return{id:a.id,version:a.version,createTime:Jo(a.createTime)}}(r)),rt.resolve()}getNamedQuery(t,r){return rt.resolve(this.Pr.get(r))}saveNamedQuery(t,r){return this.Pr.set(r.name,function(a){return{name:a.name,query:hde(a.bundledQuery),readTime:Jo(a.readTime)}}(r)),rt.resolve()}}/**
2428 * @license
2429 * Copyright 2022 Google LLC
2430 *
2431 * Licensed under the Apache License, Version 2.0 (the "License");
2432 * you may not use this file except in compliance with the License.
2433 * You may obtain a copy of the License at
2434 *
2435 *   http://www.apache.org/licenses/LICENSE-2.0
2436 *
2437 * Unless required by applicable law or agreed to in writing, software
2438 * distributed under the License is distributed on an "AS IS" BASIS,
2439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2440 * See the License for the specific language governing permissions and
2441 * limitations under the License.
2442 */class wde{constructor(){this.overlays=new ea(Yt.comparator),this.Ir=new Map}getOverlay(t,r){return rt.resolve(this.overlays.get(r))}getOverlays(t,r){const n=gd();return rt.forEach(r,a=>this.getOverlay(t,a).next(i=>{i!==null&&n.set(a,i)})).next(()=>n)}saveOverlays(t,r,n){return n.forEach((a,i)=>{this.ht(t,r,i)}),rt.resolve()}removeOverlaysForBatchId(t,r,n){const a=this.Ir.get(n);return a!==void 0&&(a.forEach(i=>this.overlays=this.overlays.remove(i)),this.Ir.delete(n)),rt.resolve()}getOverlaysForCollection(t,r,n){const a=gd(),i=r.length+1,o=new Yt(r.child("")),l=this.overlays.getIteratorFrom(o);for(;l.hasNext();){const c=l.getNext().value,u=c.getKey();if(!r.isPrefixOf(u.path))break;u.path.length===i&&c.largestBatchId>n&&a.set(c.getKey(),c)}return rt.resolve(a)}getOverlaysForCollectionGroup(t,r,n,a){let i=new ea((u,d)=>u-d);const o=this.overlays.getIterator();for(;o.hasNext();){const u=o.getNext().value;if(u.getKey().getCollectionGroup()===r&&u.largestBatchId>n){let d=i.get(u.largestBatchId);d===null&&(d=gd(),i=i.insert(u.largestBatchId,d)),d.set(u.getKey(),u)}}const l=gd(),c=i.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach((u,d)=>l.set(u,d)),!(l.size()>=a)););return rt.resolve(l)}ht(t,r,n){const a=this.overlays.get(n.key);if(a!==null){const o=this.Ir.get(a.largestBatchId).delete(n.key);this.Ir.set(a.largestBatchId,o)}this.overlays=this.overlays.insert(n.key,new Wue(r,n));let i=this.Ir.get(r);i===void 0&&(i=Pr(),this.Ir.set(r,i)),this.Ir.set(r,i.add(n.key))}}/**
2443 * @license
2444 * Copyright 2024 Google LLC
2445 *
2446 * Licensed under the Apache License, Version 2.0 (the "License");
2447 * you may not use this file except in compliance with the License.
2448 * You may obtain a copy of the License at
2449 *
2450 *   http://www.apache.org/licenses/LICENSE-2.0
2451 *
2452 * Unless required by applicable law or agreed to in writing, software
2453 * distributed under the License is distributed on an "AS IS" BASIS,
2454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2455 * See the License for the specific language governing permissions and
2456 * limitations under the License.
2457 */class jde{constructor(){this.sessionToken=ts.EMPTY_BYTE_STRING}getSessionToken(t){return rt.resolve(this.sessionToken)}setSessionToken(t,r){return this.sessionToken=r,rt.resolve()}}/**
2458 * @license
2459 * Copyright 2017 Google LLC
2460 *
2461 * Licensed under the Apache License, Version 2.0 (the "License");
2462 * you may not use this file except in compliance with the License.
2463 * You may obtain a copy of the License at
2464 *
2465 *   http://www.apache.org/licenses/LICENSE-2.0
2466 *
2467 * Unless required by applicable law or agreed to in writing, software
2468 * distributed under the License is distributed on an "AS IS" BASIS,
2469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2470 * See the License for the specific language governing permissions and
2471 * limitations under the License.
2472 */class ZI{constructor(){this.Tr=new Za(Da.Er),this.dr=new Za(Da.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(t,r){const n=new Da(t,r);this.Tr=this.Tr.add(n),this.dr=this.dr.add(n)}Rr(t,r){t.forEach(n=>this.addReference(n,r))}removeReference(t,r){this.Vr(new Da(t,r))}mr(t,r){t.forEach(n=>this.removeReference(n,r))}gr(t){const r=new Yt(new sa([])),n=new Da(r,t),a=new Da(r,t+1),i=[];return this.dr.forEachInRange([n,a],o=>{this.Vr(o),i.push(o.key)}),i}pr(){this.Tr.forEach(t=>this.Vr(t))}Vr(t){this.Tr=this.Tr.delete(t),this.dr=this.dr.delete(t)}yr(t){const r=new Yt(new sa([])),n=new Da(r,t),a=new Da(r,t+1);let i=Pr();return this.dr.forEachInRange([n,a],o=>{i=i.add(o.key)}),i}containsKey(t){const r=new Da(t,0),n=this.Tr.firstAfterOrEqual(r);return n!==null&&t.isEqual(n.key)}}class Da{constructor(t,r){this.key=t,this.wr=r}static Er(t,r){return Yt.comparator(t.key,r.key)||Zr(t.wr,r.wr)}static Ar(t,r){return Zr(t.wr,r.wr)||Yt.comparator(t.key,r.key)}}/**
2473 * @license
2474 * Copyright 2017 Google LLC
2475 *
2476 * Licensed under the Apache License, Version 2.0 (the "License");
2477 * you may not use this file except in compliance with the License.
2478 * You may obtain a copy of the License at
2479 *
2480 *   http://www.apache.org/licenses/LICENSE-2.0
2481 *
2482 * Unless required by applicable law or agreed to in writing, software
2483 * distributed under the License is distributed on an "AS IS" BASIS,
2484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2485 * See the License for the specific language governing permissions and
2486 * limitations under the License.
2487 */class Nde{constructor(t,r){this.indexManager=t,this.referenceDelegate=r,this.mutationQueue=[],this.Sr=1,this.br=new Za(Da.Er)}checkEmpty(t){return rt.resolve(this.mutationQueue.length===0)}addMutationBatch(t,r,n,a){const i=this.Sr;this.Sr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Vue(i,r,n,a);this.mutationQueue.push(o);for(const l of a)this.br=this.br.add(new Da(l.key,i)),this.indexManager.addToCollectionParentIndex(t,l.key.path.popLast());return rt.resolve(o)}lookupMutationBatch(t,r){return rt.resolve(this.Dr(r))}getNextMutationBatchAfterBatchId(t,r){const n=r+1,a=this.vr(n),i=a<0?0:a;return rt.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return rt.resolve(this.mutationQueue.length===0?-1:this.Sr-1)}getAllMutationBatches(t){return rt.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(t,r){const n=new Da(r,0),a=new Da(r,Number.POSITIVE_INFINITY),i=[];return this.br.forEachInRange([n,a],o=>{const l=this.Dr(o.wr);i.push(l)}),rt.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(t,r){let n=new Za(Zr);return r.forEach(a=>{const i=new Da(a,0),o=new Da(a,Number.POSITIVE_INFINITY);this.br.forEachInRange([i,o],l=>{n=n.add(l.wr)})}),rt.resolve(this.Cr(n))}getAllMutationBatchesAffectingQuery(t,r){const n=r.path,a=n.length+1;let i=n;Yt.isDocumentKey(i)||(i=i.child(""));const o=new Da(new Yt(i),0);let l=new Za(Zr);return this.br.forEachWhile(c=>{const u=c.key.path;return!!n.isPrefixOf(u)&&(u.length===a&&(l=l.add(c.wr)),!0)},o),rt.resolve(this.Cr(l))}Cr(t){const r=[];return t.forEach(n=>{const a=this.Dr(n);a!==null&&r.push(a)}),r}removeMutationBatch(t,r){xn(this.Fr(r.batchId,"removed")===0),this.mutation
2487Queue.shift();let n=this.br;return rt.forEach(r.mutations,a=>{const i=new Da(a.key,r.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(t,a.key)}).next(()=>{this.br=n})}On(t){}containsKey(t,r){const n=new Da(r,0),a=this.br.firstAfterOrEqual(n);return rt.resolve(r.isEqual(a&&a.key))}performConsistencyCheck(t){return this.mutationQueue.length,rt.resolve()}Fr(t,r){return this.vr(t)}vr(t){return this.mutationQueue.length===0?0:t-this.mutationQueue[0].batchId}Dr(t){const r=this.vr(t);return r<0||r>=this.mutationQueue.length?null:this.mutationQueue[r]}}/**
2488 * @license
2489 * Copyright 2017 Google LLC
2490 *
2491 * Licensed under the Apache License, Version 2.0 (the "License");
2492 * you may not use this file except in compliance with the License.
2493 * You may obtain a copy of the License at
2494 *
2495 *   http://www.apache.org/licenses/LICENSE-2.0
2496 *
2497 * Unless required by applicable law or agreed to in writing, software
2498 * distributed under the License is distributed on an "AS IS" BASIS,
2499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2500 * See the License for the specific language governing permissions and
2501 * limitations under the License.
2502 */class Sde{constructor(t){this.Mr=t,this.docs=function(){return new ea(Yt.comparator)}(),this.size=0}setIndexManager(t){this.indexManager=t}addEntry(t,r){const n=r.key,a=this.docs.get(n),i=a?a.size:0,o=this.Mr(r);return this.docs=this.docs.insert(n,{document:r.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(t,n.path.popLast())}removeEntry(t){const r=this.docs.get(t);r&&(this.docs=this.docs.remove(t),this.size-=r.size)}getEntry(t,r){const n=this.docs.get(r);return rt.resolve(n?n.document.mutableCopy():ds.newInvalidDocument(r))}getEntries(t,r){let n=ic();return r.forEach(a=>{const i=this.docs.get(a);n=n.insert(a,i?i.document.mutableCopy():ds.newInvalidDocument(a))}),rt.resolve(n)}getDocumentsMatchingQuery(t,r,n,a){let i=ic();const o=r.path,l=new Yt(o.child("")),c=this.docs.getIteratorFrom(l);for(;c.hasNext();){const{key:u,value:{document:d}}=c.getNext();if(!o.isPrefixOf(u.path))break;u.path.length>o.length+1||iue(sue(d),n)<=0||(a.has(d.key)||d2(r,d))&&(i=i.insert(d.key,d.mutableCopy()))}return rt.resolve(i)}getAllFromCollectionGroup(t,r,n,a){ur()}Or(t,r){return rt.forEach(this.docs,n=>r(n))}newChangeBuffer(t){return new Cde(this)}getSize(t){return rt.resolve(this.size)}}class Cde extends yde{constructor(t){super(),this.cr=t}applyChanges(t){const r=[];
vendor: 10,447 bytes, lines 2502-2581
2502return this.changes.forEach((n,a)=>{a.isValidDocument()?r.push(this.cr.addEntry(t,a)):this.cr.removeEntry(n)}),rt.waitFor(r)}getFromCache(t,r){return this.cr.getEntry(t,r)}getAllFromCache(t,r){return this.cr.getEntries(t,r)}}/**
2503 * @license
2504 * Copyright 2017 Google LLC
2505 *
2506 * Licensed under the Apache License, Version 2.0 (the "License");
2507 * you may not use this file except in compliance with the License.
2508 * You may obtain a copy of the License at
2509 *
2510 *   http://www.apache.org/licenses/LICENSE-2.0
2511 *
2512 * Unless required by applicable law or agreed to in writing, software
2513 * distributed under the License is distributed on an "AS IS" BASIS,
2514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2515 * See the License for the specific language governing permissions and
2516 * limitations under the License.
2517 */class kde{constructor(t){this.persistence=t,this.Nr=new ep(r=>qI(r),GI),this.lastRemoteSnapshotVersion=dr.min(),this.highestTargetId=0,this.Lr=0,this.Br=new ZI,this.targetCount=0,this.kr=ah.Bn()}forEachTarget(t,r){return this.Nr.forEach((n,a)=>r(a)),rt.resolve()}getLastRemoteSnapshotVersion(t){return rt.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return rt.resolve(this.Lr)}allocateTargetId(t){return this.highestTargetId=this.kr.next(),rt.resolve(this.highestTargetId)}setTargetsMetadata(t,r,n){return n&&(this.lastRemoteSnapshotVersion=n),r>this.Lr&&(this.Lr=r),rt.resolve()}Kn(t){this.Nr.set(t.target,t);const r=t.targetId;r>this.highestTargetId&&(this.kr=new ah(r),this.highestTargetId=r),t.sequenceNumber>this.Lr&&(this.Lr=t.sequenceNumber)}addTargetData(t,r){return this.Kn(r),this.targetCount+=1,rt.resolve()}updateTargetData(t,r){return this.Kn(r),rt.resolve()}removeTargetData(t,r){return this.Nr.delete(r.target),this.Br.gr(r.targetId),this.targetCount-=1,rt.resolve()}removeTargets(t,r,n){let a=0;const i=[];return this.Nr.forEach((o,l)=>{l.sequenceNumber<=r&&n.get(l.targetId)===null&&(this.Nr.delete(o),i.push(this.removeMatchingKeysForTargetId(t,l.targetId)),a++)}),rt.waitFor(i).next(()=>a)}getTargetCount(t){return rt.resolve(this.targetCount)}getTargetData(t,r){const n=this.Nr.get(r)||null;return rt.resolve(n)}addMatchingKeys(t,r,n){return this.Br.Rr(r,n),rt.resolve()}removeMatchingKeys(t,r,n){this.Br.mr(r,n);const a=this.persistence.referenceDelegate,i=[];return a&&r.forEach(o=>{i.push(a.markPotentiallyOrphaned(t,o))}),rt.waitFor(i)}removeMatchingKeysForTargetId(t,r){return this.Br.gr(r),rt.resolve()}getMatchingKeysForTargetId(t,r){const n=this.Br.yr(r);return rt.resolve(n)}containsKey(t,r){return rt.resolve(this.Br.containsKey(r))}}/**
2518 * @license
2519 * Copyright 2017 Google LLC
2520 *
2521 * Licensed under the Apache License, Version 2.0 (the "License");
2522 * you may not use this file except in compliance with the License.
2523 * You may obtain a copy of the License at
2524 *
2525 *   http://www.apache.org/licenses/LICENSE-2.0
2526 *
2527 * Unless required by applicable law or agreed to in writing, software
2528 * distributed under the License is distributed on an "AS IS" BASIS,
2529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2530 * See the License for the specific language governing permissions and
2531 * limitations under the License.
2532 */class Mde{constructor(t,r){this.qr={},this.overlays={},this.Qr=new BI(0),this.Kr=!1,this.Kr=!0,this.$r=new jde,this.referenceDelegate=t(this),this.Ur=new kde(this),this.indexManager=new pde,this.remoteDocumentCache=function(a){return new Sde(a)}(n=>this.referenceDelegate.Wr(n)),this.serializer=new mde(r),this.Gr=new xde(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(t){return this.indexManager}getDocumentOverlayCache(t){let r=this.overlays[t.toKey()];return r||(r=new wde,this.overlays[t.toKey()]=r),r}getMutationQueue(t,r){let n=this.qr[t.toKey()];return n||(n=new Nde(r,this.referenceDelegate),this.qr[t.toKey()]=n),n}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(t,r,n){Dt("MemoryPersistence","Starting transaction:",t);const a=new Ide(this.Qr.next());return this.referenceDelegate.zr(),n(a).next(i=>this.referenceDelegate.jr(a).next(()=>i)).toPromise().then(i=>(a.raiseOnCommittedEvent(),i))}Hr(t,r){return rt.or(Object.values(this.qr).map(n=>()=>n.containsKey(t,r)))}}class Ide extends lue{constructor(t){super(),this.currentSequenceNumber=t}}class XI{constructor(t){this.persistence=t,this.Jr=new ZI,this.Yr=null}static Zr(t){return new XI(t)}get Xr(){if(this.Yr)return this.Yr;throw ur()}addReference(t,r,n){return this.Jr.addReference(n,r),this.Xr.delete(n.toString()),rt.resolve()}removeReference(t,r,n){return this.Jr.removeReference(n,r),this.Xr.add(n.toString()),rt.resolve()}markPotentiallyOrphaned(t,r){return this.Xr.add(r.toString()),rt.resolve()}removeTarget(t,r){this.Jr.gr(r.targetId).forEach(a=>this.Xr.add(a.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,r.targetId).next(a=>{a.forEach(i=>this.Xr.add(i.toString()))}).next(()=>n.removeTargetData(t,r))}zr(){this.Yr=new Set}jr(t){const r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return rt.forEach(this.Xr,n=>{const a=Yt.fromPath(n);return this.ei(t,a).next(i=>{i||r.removeEntry(a,dr.min())})}).next(()=>(this.Yr=null,r.apply(t)))}updateLimboDocument(t,r){return this.ei(t,r).next(n=>{n?this.Xr.delete(r.toString()):this.Xr.add(r.toString())})}Wr(t){return 0}ei(t,r){return rt.or([()=>rt.resolve(this.Jr.containsKey(r)),()=>this.persistence.getTargetCache().containsKey(t,r),()=>this.persistence.Hr(t,r)])}}/**
2533 * @license
2534 * Copyright 2017 Google LLC
2535 *
2536 * Licensed under the Apache License, Version 2.0 (the "License");
2537 * you may not use this file except in compliance with the License.
2538 * You may obtain a copy of the License at
2539 *
2540 *   http://www.apache.org/licenses/LICENSE-2.0
2541 *
2542 * Unless required by applicable law or agreed to in writing, software
2543 * distributed under the License is distributed on an "AS IS" BASIS,
2544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2545 * See the License for the specific language governing permissions and
2546 * limitations under the License.
2547 */class eE{constructor(t,r,n,a){this.targetId=t,this.fromCache=r,this.$i=n,this.Ui=a}static Wi(t,r){let n=Pr(),a=Pr();for(const i of r.docChanges)switch(i.type){case 0:n=n.add(i.doc.key);break;case 1:a=a.add(i.doc.key)}return new eE(t,r.fromCache,n,a)}}/**
2548 * @license
2549 * Copyright 2023 Google LLC
2550 *
2551 * Licensed under the Apache License, Version 2.0 (the "License");
2552 * you may not use this file except in compliance with the License.
2553 * You may obtain a copy of the License at
2554 *
2555 *   http://www.apache.org/licenses/LICENSE-2.0
2556 *
2557 * Unless required by applicable law or agreed to in writing, software
2558 * distributed under the License is distributed on an "AS IS" BASIS,
2559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2560 * See the License for the specific language governing permissions and
2561 * limitations under the License.
2562 */class Ede{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(t){this._documentReadCount+=t}}/**
2563 * @license
2564 * Copyright 2019 Google LLC
2565 *
2566 * Licensed under the Apache License, Version 2.0 (the "License");
2567 * you may not use this file except in compliance with the License.
2568 * You may obtain a copy of the License at
2569 *
2570 *   http://www.apache.org/licenses/LICENSE-2.0
2571 *
2572 * Unless required by applicable law or agreed to in writing, software
2573 * distributed under the License is distributed on an "AS IS" BASIS,
2574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2575 * See the License for the specific language governing permissions and
2576 * limitations under the License.
2577 */class Tde{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return pie()?8:cue(ys())>0?6:4}()}initialize(t,r){this.Ji=t,this.indexManager=r,this.Gi=!0}getDocumentsMatchingQuery(t,r,n,a){const i={result:null};return this.Yi(t,r).next(o=>{i.result=o}).next(()=>{if(!i.result)return this.Zi(t,r,a,n).next(o=>{i.result=o})}).next(()=>{if(i.result)return;const o=new Ede;return this.Xi(t,r,o).next(l=>{if(i.result=l,this.zi)return this.es(t,r,o,l.size)})}).next(()=>i.result)}es(t,r,n,a){return n.documentReadCount<this.ji?(Yp()<=$r.DEBUG&&Dt("QueryEngine","SDK will not create cache indexes for query:",tm(r),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),rt.resolve()):(Yp()<=$r.DEBUG&&Dt("QueryEngine","Query:",tm(r),"scans",n.documentReadCount,"local documents and returns",a,"documents as results."),n.documentReadCount>this.Hi*a?(Yp()<=$r.DEBUG&&Dt("QueryEngine","The SDK decides to create cache indexes for query:",tm(r),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,Ko(r))):rt.resolve())}Yi(t,r){if(E3(r))return rt.resolve(null);let n=Ko(r);return this.indexManager.getIndexType(t,n).next(a=>a===0?null:(r.limit!==null&&a===1&&(r=hk(r,null,"F"),n=Ko(r)),this.indexManager.getDocumentsMatchingTarget(t,n).next(i=>{const o=Pr(...i);return this.Ji.getDocuments(t,o).next(l=>this.indexManager.getMinOffset(t,n).next(c=>{const u=this.ts(r,l);return this.ns(r,u,o,c.readTime)?this.Yi(t,hk(r,null,"F")):this.rs(t,u,r,c)}))})))}Zi(t,r,n,a){return E3(r)||a.isEqual(dr.min())?rt.resolve(null):this.Ji.getDocuments(t,n).next(i=>{const o=this.ts(r,i);return this.ns(r,o,n,a)?rt.resolve(null):(Yp()<=$r.DEBUG&&Dt("QueryEngine","Re-using previous result from %s to execute query: %s",a.toString(),tm(r)),this.rs(t,o,r,aue(a,-1)).next(l=>l))})}ts(t,r){let n=new Za(NU(t));return r.forEach((a,i)=>{d2(t,i)&&(n=n.add(i))}),n}ns(t,r,n,a){if(t.limit===null)return!1;if(n.size!==r.size)return!0;const i=t.limitType==="F"?r.last():r.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(a)>0)}Xi(t,r,n){return Yp()<=$r.DEBUG&&Dt("QueryEngine","Using full collection scan to execute query:",tm(r)),this.Ji.getDocumentsMatchingQuery(t,r,Cu.min(),n)}rs(t,r,n,a){return this.Ji.getDocumentsMatchingQuery(t,n,a).next(i=>(r.forEach(o=>{i=i.insert(o.key,o)}),i))}}/**
2578 * @license
2579 * Copyright 2020 Google LLC
2580 *
2581 * Licensed under the Apache License, Version 2.0 (the "License");
2582 * you may not use this file except in compliance with the License.
2583 * You may obtain a copy of the License at
2584 *
2585 *   http://www.apache.org/licenses/LICENSE-2.0
2586 *
2587 * Unless required by applicable law or agreed to in writing, software
2588 * distributed under the License is distributed on an "AS IS" BASIS,
2589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2590 * See the License for the specific language governing permissions and
2591 * limitations under the License.
2592 */class Ade{constructor(t,r,n,a){this.persistence=t,this.ss=r,this.serializer=a,this.os=new ea(Zr),this._s=new ep(i=>qI(i),GI),this.us=new Map,this.cs=t.getRemoteDocumentCache(),this.Ur=t.getTargetCache(),this.Gr=t.getBundleCache(),this.ls(n)}ls(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new vde(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",r=>t.collect(r,this.os))}}function Pde(e,t,r,n){return new Ade(e,t,r,n)}async function qU(e,t){const r=fr(e);return await r.persistence.runTransaction("Handle user change","readonly",n=>{let a;return r.mutationQueue.getAllMutationBatches(n).next(i=>(a=i,r.ls(t),r.mutationQueue.getAllMutationBatches(n))).next(i=>{const o=[],l=[];let c=Pr();for(const u of a){o.push(u.batchId);for(const d of u.mutations)c=c.add(d.key)}for(const u of i){l.push(u.batchId);for(const d of u.mutations)c=c.add(d.key)}return r.localDocuments.getDocuments(n,c).next(u=>({hs:u,removedBatchIds:o,addedBatchIds:l}))})})}function _de(e,t){const r=fr(e);return r.persistence.runTransaction("Acknowledge batch","readwrite-primary",n=>{const a=t.batch.keys(),i=r.cs.newChangeBuffer({trackRemovals:!0});return function(l,c,u,d){const f=u.batch,m=f.keys();let h=rt.resolve();return m.forEach(p=>{h=h.next(()=>d.getEntry(c,p)).next(g=>{const y=u.docVersions.get(p);xn(y!==null),g.version.compareTo(y)<0&&(f.applyToRemoteDocument(g,u),g.isValidDocument()&&(g.setReadTime(u.commitVersion),d.addEntry(g)))})}),h.next(()=>l.mutationQueue.removeMutationBatch(c,f))}(r,n,t,i).next(()=>i.apply(n)).next(()=>r.mutationQueue.performConsistencyCheck(n)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(n,a,t.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,function(l){let c=Pr();for(let u=0;u<l.mutationResults.length;++u)l.mutationResults[u].transformResults.length>0&&(c=c.add(l.batch.mutations[u].key));return c}(t))).next(()=>r.localDocuments.getDocuments(n,a))})}function GU(e){const t=fr(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",r=>t.Ur.getLastRemoteSnapshotVersion(r))}function Lde(e,t){const r=fr(e),n=t.snapshotVersion;let a=r.os;return r.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{const o=r.cs.newChangeBuffer({trackRemovals:!0});a=r.os;const l=[];
vendor: 4,439 bytes, lines 2592-2596
2592t.targetChanges.forEach((d,f)=>{const m=a.get(f);if(!m)return;l.push(r.Ur.removeMatchingKeys(i,d.removedDocuments,f).next(()=>r.Ur.addMatchingKeys(i,d.addedDocuments,f)));let h=m.withSequenceNumber(i.currentSequenceNumber);t.targetMismatches.get(f)!==null?h=h.withResumeToken(ts.EMPTY_BYTE_STRING,dr.min()).withLastLimboFreeSnapshotVersion(dr.min()):d.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(d.resumeToken,n)),a=a.insert(f,h),function(g,y,v){return g.resumeToken.approximateByteSize()===0||y.snapshotVersion.toMicroseconds()-g.snapshotVersion.toMicroseconds()>=3e8?!0:v.addedDocuments.size+v.modifiedDocuments.size+v.removedDocuments.size>0}(m,h,d)&&l.push(r.Ur.updateTargetData(i,h))});let c=ic(),u=Pr();if(t.documentUpdates.forEach(d=>{t.resolvedLimboDocuments.has(d)&&l.push(r.persistence.referenceDelegate.updateLimboDocument(i,d))}),l.push(Dde(i,o,t.documentUpdates).next(d=>{c=d.Ps,u=d.Is})),!n.isEqual(dr.min())){const d=r.Ur.getLastRemoteSnapshotVersion(i).next(f=>r.Ur.setTargetsMetadata(i,i.currentSequenceNumber,n));l.push(d)}return rt.waitFor(l).next(()=>o.apply(i)).next(()=>r.localDocuments.getLocalViewOfDocuments(i,c,u)).next(()=>c)}).then(i=>(r.os=a,i))}function Dde(e,t,r){let n=Pr(),a=Pr();return r.forEach(i=>n=n.add(i)),t.getEntries(e,n).next(i=>{let o=ic();return r.forEach((l,c)=>{const u=i.get(l);c.isFoundDocument()!==u.isFoundDocument()&&(a=a.add(l)),c.isNoDocument()&&c.version.isEqual(dr.min())?(t.removeEntry(l,c.readTime),o=o.insert(l,c)):!u.isValidDocument()||c.version.compareTo(u.version)>0||c.version.compareTo(u.version)===0&&u.hasPendingWrites?(t.addEntry(c),o=o.insert(l,c)):Dt("LocalStore","Ignoring outdated watch update for ",l,". Current version:",u.version," Watch version:",c.version)}),{Ps:o,Is:a}})}function Ode(e,t){const r=fr(e);return r.persistence.runTransaction("Get next mutation batch","readonly",n=>(t===void 0&&(t=-1),r.mutationQueue.getNextMutationBatchAfterBatchId(n,t)))}function Rde(e,t){const r=fr(e);return r.persistence.runTransaction("Allocate target","readwrite",n=>{let a;return r.Ur.getTargetData(n,t).next(i=>i?(a=i,rt.resolve(a)):r.Ur.allocateTargetId(n).next(o=>(a=new su(t,o,"TargetPurposeListen",n.currentSequenceNumber),r.Ur.addTargetData(n,a).next(()=>a))))}).then(n=>{const a=r.os.get(n.targetId);return(a===null||n.snapshotVersion.compareTo(a.snapshotVersion)>0)&&(r.os=r.os.insert(n.targetId,n),r._s.set(t,n.targetId)),n})}async function vk(e,t,r){const n=fr(e),a=n.os.get(t),i=r?"readwrite":"readwrite-primary";try{r||await n.persistence.runTransaction("Release target",i,o=>n.persistence.referenceDelegate.removeTarget(o,a))}catch(o){if(!Hy(o))throw o;Dt("LocalStore",`Failed to update sequence numbers for target ${t}: ${o}`)}n.os=n.os.remove(t),n._s.delete(a.target)}function z3(e,t,r){const n=fr(e);let a=dr.min(),i=Pr();return n.persistence.runTransaction("Execute query","readwrite",o=>function(c,u,d){const f=fr(c),m=f._s.get(d);return m!==void 0?rt.resolve(f.os.get(m)):f.Ur.getTargetData(u,d)}(n,o,Ko(t)).next(l=>{if(l)return a=l.lastLimboFreeSnapshotVersion,n.Ur.getMatchingKeysForTargetId(o,l.targetId).next(c=>{i=c})}).next(()=>n.ss.getDocumentsMatchingQuery(o,t,r?a:dr.min(),r?i:Pr())).next(l=>($de(n,Iue(t),l),{documents:l,Ts:i})))}function $de(e,t,r){let n=e.us.get(t)||dr.min();r.forEach((a,i)=>{i.readTime.compareTo(n)>0&&(n=i.readTime)}),e.us.set(t,n)}class B3{constructor(){this.activeTargetIds=Lue()}fs(t){this.activeTargetIds=this.activeTargetIds.add(t)}gs(t){this.activeTargetIds=this.activeTargetIds.delete(t)}Vs(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class Fde{constructor(){this.so=new B3,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,r,n){}addLocalQueryTarget(t,r=!0){return r&&this.so.fs(t),this.oo[t]||"not-current"}updateQueryState(t,r,n){this.oo[t]=r}removeLocalQueryTarget(t){this.so.gs(t)}isLocalQueryTarget(t){return this.so.activeTargetIds.has(t)}clearQueryState(t){delete this.oo[t]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(t){return this.so.activeTargetIds.has(t)}start(){return this.so=new B3,Promise.resolve()}handleUserChange(t,r,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}/**
2593 * @license
2594 * Copyright 2019 Google LLC
2595 *
2596 * Licensed under the Apache License, Version 2.0 (the "License");
2597 * you may not use this file except in compliance with the License.
2598 * You may obtain a copy of the License at
2599 *
2600 *   http://www.apache.org/licenses/LICENSE-2.0
2601 *
2602 * Unless required by applicable law or agreed to in writing, software
2603 * distributed under the License is distributed on an "AS IS" BASIS,
2604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2605 * See the License for the specific language governing permissions and
2606 * limitations under the License.
2607 */class zde{_o(t){}shutdown(){}}/**
2608 * @license
2609 * Copyright 2019 Google LLC
2610 *
2611 * Licensed under the Apache License, Version 2.0 (the "License");
2612 * you may not use this file except in compliance with the License.
2613 * You may obtain a copy of the License at
2614 *
2615 *   http://www.apache.org/licenses/LICENSE-2.0
2616 *
2617 * Unless required by applicable law or agreed to in writing, software
2618 * distributed under the License is distributed on an "AS IS" BASIS,
2619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2620 * See the License for the specific language governing permissions and
2621 * limitations under the License.
2622 */class U3{constructor(){this.ao=()=>this.uo(),this.co=()=>this.lo(),this.ho=[],this.Po()}_o(t){this.ho.push(t)}shutdown(){window.removeEventListener("online",this.ao),window.removeEventListener("offline",this.co)}Po(){window.addEventListener("online",this.ao),window.addEventListener("offline",this.co)}uo(){Dt("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.ho)t(0)}lo(){Dt("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.ho)t(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
2623 * @license
2624 * Copyright 2023 Google LLC
2625 *
2626 * Licensed under the Apache License, Version 2.0 (the "License");
2627 * you may not use this file except in compliance with the License.
2628 * You may obtain a copy of the License at
2629 *
2630 *   http://www.apache.org/licenses/LICENSE-2.0
2631 *
2632 * Unless required by applicable law or agreed to in writing, software
2633 * distributed under the License is distributed on an "AS IS" BASIS,
2634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2635 * See the License for the specific language governing permissions and
2636 * limitations under the License.
2637 */let Qb=null;function RN(){return Qb===null?Qb=function(){return 268435456+Math.round(2147483648*Math.random())}():Qb++,"0x"+Qb.toString(16)}/**
2638 * @license
2639 * Copyright 2020 Google LLC
2640 *
2641 * Licensed under the Apache License, Version 2.0 (the "License");
2642 * you may not use this file except in compliance with the License.
2643 * You may obtain a copy of the License at
2644 *
2645 *   http://www.apache.org/licenses/LICENSE-2.0
2646 *
2647 * Unless required by applicable law or agreed to in writing, software
2648 * distributed under the License is distributed on an "AS IS" BASIS,
2649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2650 * See the License for the specific language governing permissions and
2651 * limitations under the License.
2652 */const Bde={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
2653 * @license
2654 * Copyright 2017 Google LLC
2655 *
2656 * Licensed under the Apache License, Version 2.0 (the "License");
2657 * you may not use this file except in compliance with the License.
2658 * You may obtain a copy of the License at
2659 *
2660 *   http://www.apache.org/licenses/LICENSE-2.0
2661 *
2662 * Unless required by applicable law or agreed to in writing, software
2663 * distributed under the License is distributed on an "AS IS" BASIS,
2664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2665 * See the License for the specific language governing permissions and
2666 * limitations under the License.
2667 */class Ude{constructor(t){this.Io=t.Io,this.To=t.To}Eo(t){this.Ao=t}Ro(t){this.Vo=t}mo(t){this.fo=t}onMessage(t){this.po=t}close(){this.To()}send(t){this.Io(t)}yo(){this.Ao()}wo(){this.Vo()}So(t){this.fo(t)}bo(t){this.po(t)}}/**
2668 * @license
2669 * Copyright 2017 Google LLC
2670 *
2671 * Licensed under the Apache License, Version 2.0 (the "License");
2672 * you may not use this file except in compliance with the License.
2673 * You may obtain a copy of the License at
2674 *
2675 *   http://www.apache.org/licenses/LICENSE-2.0
2676 *
2677 * Unless required by applicable law or agreed to in writing, software
2678 * distributed under the License is distributed on an "AS IS" BASIS,
2679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2680 * See the License for the specific language governing permissions and
2681 * limitations under the License.
2682 */const ls="WebChannelConnection";class Vde extends class{constructor(r){this.databaseInfo=r,this.databaseId=r.databaseId;const n=r.ssl?"https":"http",a=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Do=n+"://"+r.host,this.vo=`projects/${a}/databases/${i}`,this.Co=this.databaseId.database==="(default)"?`project_id=${a}`:`project_id=${a}&database_id=${i}`}get Fo(){return!1}Mo(r,n,a,i,o){const l=RN(),c=this.xo(r,n.toUriEncodedString());Dt("RestConnection",`Sending RPC '${r}' ${l}:`,c,a);const u={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(u,i,o),this.No(r,c,u,a).then(d=>(Dt("RestConnection",`Received RPC '${r}' ${l}: `,d),d),d=>{throw eh("RestConnection",`RPC '${r}' ${l} failed with error: `,d,"url: ",c,"request:",a),d})}Lo(r,n,a,i,o,l){return this.Mo(r,n,a,i,o)}Oo(r,n,a){r["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Xh}(),r["Content-Type"]="text/plain",this.databaseInfo.appId&&(r["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,o)=>r[o]=i),a&&a.headers.forEach((i,o)=>r[o]=i)}xo(r,n){const a=Bde[r];return`${this.Do}/v1/${n}:${a}`}terminate(){}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}No(t,r,n,a){const i=RN();return new Promise((o,l)=>{const c=new iU;c.setWithCredentials(!0),c.listenOnce(oU.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Vv.NO_ERROR:const d=c.getResponseJson();Dt(ls,`XHR for RPC '${t}' ${i} received:`,JSON.stringify(d)),o(d);break;case Vv.TIMEOUT:Dt(ls,`RPC '${t}' ${i} timed out`),l(new Ht(st.DEADLINE_EXCEEDED,"Request time out"));break;case Vv.HTTP_ERROR:const f=c.getStatus();if(Dt(ls,`RPC '${t}' ${i} failed with status:`,f,"response text:",c.getResponseText()),f>0){let m=c.getResponseJson();Array.isArray(m)&&(m=m[0]);const h=m==null?void 0:m.error;if(h&&h.status&&h.message){const p=function(y){const v=y.toLowerCase().replace(/_/g,"-");return Object.values(st).indexOf(v)>=0?v:st.UNKNOWN}(h.status);l(new Ht(p,h.message))}else l(new Ht(st.UNKNOWN,"Server responded with status "+c.getStatus()))}else l(new Ht(st.UNAVAILABLE,"Connection failed."));break;default:ur()}}finally{Dt(ls,`RPC '${t}' ${i} completed.`)}});const u=JSON.stringify(a);Dt(ls,`RPC '${t}' ${i} sending request:`,a),c.send(r,"POST",u,n,15)})}Bo(t,r,n){const a=RN(),i=[this.Do,"/","google.firestore.v1.Firestore","/",t,"/channel"],o=uU(),l=cU(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;u!==void 0&&(c.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(c.useFetchStreams=!0),this.Oo(c.initMessageHeaders,r,n),c.encodeInitMessageHeaders=!0;const d=i.join("");Dt(ls,`Creating RPC '${t}' stream ${a}: ${d}`,c);const f=o.createWebChannel(d,c);let m=!1,h=!1;const p=new Ude({Io:y=>{h?Dt(ls,`Not sending because RPC '${t}' stream ${a} is closed:`,y):(m||(Dt(ls,`Opening RPC '${t}' stream ${a} transport.`),f.open(),m=!0),Dt(ls,`RPC '${t}' stream ${a} sending:`,y),f.send(y))},To:()=>f.close()}),g=(y,v,x)=>{y.listen(v,j=>{try{x(j)}catch(C){setTimeout(()=>{throw C},0)}})};return g(f,Mg.EventType.OPEN,()=>{h||(Dt(ls,`RPC '${t}' stream ${a} transport opened.`),p.yo())}),g(f,Mg.EventType.CLOSE,()=>{h||(h=!0,Dt(ls,`RPC '${t}' stream ${a} transport closed`),p.So())}
2682),g(f,Mg.EventType.ERROR,y=>{h||(h=!0,eh(ls,`RPC '${t}' stream ${a} transport errored:`,y),p.So(new Ht(st.UNAVAILABLE,"The operation could not be completed")))}),g(f,Mg.EventType.MESSAGE,y=>{var v;if(!h){const x=y.data[0];xn(!!x);const j=x,C=j.error||((v=j[0])===null||v===void 0?void 0:v.error);if(C){Dt(ls,`RPC '${t}' stream ${a} received error:`,C);const N=C.status;let S=function(I){const T=ba[I];if(T!==void 0)return DU(T)}(N),M=C.message;S===void 0&&(S=st.INTERNAL,M="Unknown error status: "+N+" with message "+C.message),h=!0,p.So(new Ht(S,M)),f.close()}else Dt(ls,`RPC '${t}' stream ${a} received:`,x),p.bo(x)}}),g(l,lU.STAT_EVENT,y=>{y.stat===ck.PROXY?Dt(ls,`RPC '${t}' stream ${a} detected buffering proxy`):y.stat===ck.NOPROXY&&Dt(ls,`RPC '${t}' stream ${a} detected no buffering proxy`)}),setTimeout(()=>{p.wo()},0),p}}function $N(){return typeof document<"u"?document:null}/**
2683 * @license
2684 * Copyright 2020 Google LLC
2685 *
2686 * Licensed under the Apache License, Version 2.0 (the "License");
2687 * you may not use this file except in compliance with the License.
2688 * You may obtain a copy of the License at
2689 *
2690 *   http://www.apache.org/licenses/LICENSE-2.0
2691 *
2692 * Unless required by applicable law or agreed to in writing, software
2693 * distributed under the License is distributed on an "AS IS" BASIS,
2694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2695 * See the License for the specific language governing permissions and
2696 * limitations under the License.
2697 */function g2(e){return new Xue(e,!0)}/**
2698 * @license
2699 * Copyright 2017 Google LLC
2700 *
2701 * Licensed under the Apache License, Version 2.0 (the "License");
2702 * you may not use this file except in compliance with the License.
2703 * You may obtain a copy of the License at
2704 *
2705 *   http://www.apache.org/licenses/LICENSE-2.0
2706 *
2707 * Unless required by applicable law or agreed to in writing, software
2708 * distributed under the License is distributed on an "AS IS" BASIS,
2709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2710 * See the License for the specific language governing permissions and
2711 * limitations under the License.
2712 */class HU{constructor(t,r,n=1e3,a=1.5,i=6e4){this.ui=t,this.timerId=r,this.ko=n,this.qo=a,this.Qo=i,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(t){this.cancel();const r=Math.floor(this.Ko+this.zo()),n=Math.max(0,Date.now()-this.Uo),a=Math.max(0,r-n);a>0&&Dt("ExponentialBackoff",`Backing off for ${a} ms (base delay: ${this.Ko} ms, delay with jitter: ${r} ms, last attempt: ${n} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,a,()=>(this.Uo=Date.now(),t())),this.Ko*=this.qo,this.Ko<this.ko&&(this.Ko=this.ko),this.Ko>this.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/**
2713 * @license
2714 * Copyright 2017 Google LLC
2715 *
2716 * Licensed under the Apache License, Version 2.0 (the "License");
2717 * you may not use this file except in compliance with the License.
2718 * You may obtain a copy of the License at
2719 *
2720 *   http://www.apache.org/licenses/LICENSE-2.0
2721 *
2722 * Unless required by applicable law or agreed to in writing, software
2723 * distributed under the License is distributed on an "AS IS" BASIS,
2724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2725 * See the License for the specific language governing permissions and
2726 * limitations under the License.
2727 */class YU{constructor(t,r,n,a,i,o,l,c){this.ui=t,this.Ho=n,this.Jo=a,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=l,this.listener=c,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new HU(t,r)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(t){this.u_(),this.stream.send(t)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}
2727c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(t,r){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,t!==4?this.t_.reset():r&&r.code===st.RESOURCE_EXHAUSTED?(sc(r.toString()),sc("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):r&&r.code===st.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=t,await this.listener.mo(r)}l_(){}auth(){this.state=1;const t=this.h_(this.Yo),r=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([n,a])=>{this.Yo===r&&this.P_(n,a)},n=>{t(()=>{const a=new Ht(st.UNKNOWN,"Fetching auth token failed: "+n.message);return this.I_(a)})})}P_(t,r){const n=this.h_(this.Yo);this.stream=this.T_(t,r),this.stream.Eo(()=>{n(()=>this.listener.Eo())}),this.stream.Ro(()=>{n(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(a=>{n(()=>this.I_(a))}),this.stream.onMessage(a=>{n(()=>++this.e_==1?this.E_(a):this.onNext(a))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(t){return Dt("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}h_(t){return r=>{this.ui.enqueueAndForget(()=>this.Yo===t?r():(Dt("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Wde extends YU{constructor(t,r,n,a,i,o){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,n,a,o),this.serializer=i}T_(t,r){return this.connection.Bo("Listen",t,r)}E_(t){return this.onNext(t)}onNext(t){this.t_.reset();const r=rde(this.serializer,t),n=function(i){if(!("targetChange"in i))return dr.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?dr.min():o.readTime?Jo(o.readTime):dr.min()}(t);return this.listener.d_(r,n)}A_(t){const r={};r.database=bk(this.serializer),r.addTarget=function(i,o){let l;const c=o.target;if(l=mk(c)?{documents:sde(i,c)}:{query:ide(i,c)._t},l.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){l.resumeToken=$U(i,o.resumeToken);const u=pk(i,o.expectedCount);u!==null&&(l.expectedCount=u)}else if(o.snapshotVersion.compareTo(dr.min())>0){l.readTime=Gx(i,o.snapshotVersion.toTimestamp());const u=pk(i,o.expectedCount);u!==null&&(l.expectedCount=u)}return l}(this.serializer,t);const n=lde(this.serializer,t);n&&(r.labels=n),this.a_(r)}R_(t){const r={};r.database=bk(this.serializer),r.removeTarget=t,this.a_(r)}}class qde extends YU{constructor(t,r,n,a,i,o){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,n,a,o),this.serializer=i}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(t,r){return this.connection.Bo("Write",t,r)}E_(t){return xn(!!t.streamToken),this.lastStreamToken=t.streamToken,xn(!t.writeResults||t.writeResults.length===0),this.listener.f_()}onNext(t){xn(!!t.streamToken),this.lastStreamToken=t.streamToken,this.t_.reset();const r=ade(t.writeResults,t.commitTime),n=Jo(t.commitTime);return this.listener.g_(n,r)}p_(){const t={};t.database=bk(this.serializer),this.a_(t)}m_(t){const r={streamToken:this.lastStreamToken,writes:t.map(n=>nde(this.serializer,n))};this.a_(r)}}/**
2728 * @license
2729 * Copyright 2017 Google LLC
2730 *
2731 * Licensed under the Apache License, Version 2.0 (the "License");
2732 * you may not use this file except in compliance with the License.
2733 * You may obtain a copy of the License at
2734 *
2735 *   http://www.apache.org/licenses/LICENSE-2.0
2736 *
2737 * Unless required by applicable law or agreed to in writing, software
2738 * distributed under the License is distributed on an "AS IS" BASIS,
2739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2740 * See the License for the specific language governing permissions and
2741 * limitations under the License.
2742 */class Gde extends class{}{constructor(t,r,n,a){super(),this.authCredentials=t,this.appCheckCredentials=r,this.connection=n,this.serializer
2742=a,this.y_=!1}w_(){if(this.y_)throw new Ht(st.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(t,r,n,a){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.Mo(t,gk(r,n),a,i,o)).catch(i=>{throw i.name==="FirebaseError"?(i.code===st.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new Ht(st.UNKNOWN,i.toString())})}Lo(t,r,n,a,i){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,l])=>this.connection.Lo(t,gk(r,n),a,o,l,i)).catch(o=>{throw o.name==="FirebaseError"?(o.code===st.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Ht(st.UNKNOWN,o.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class Hde{constructor(t,r){this.asyncQueue=t,this.onlineStateHandler=r,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(t){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.C_("Offline")))}set(t){this.x_(),this.S_=0,t==="Online"&&(this.D_=!1),this.C_(t)}C_(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}F_(t){const r=`Could not reach Cloud Firestore backend. ${t}
2743This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.D_?(sc(r),this.D_=!1):Dt("OnlineStateTracker",r)}x_(){this.b_!==null&&(this.b_.cancel(),this.b_=null)}}/**
2744 * @license
2745 * Copyright 2017 Google LLC
2746 *
2747 * Licensed under the Apache License, Version 2.0 (the "License");
2748 * you may not use this file except in compliance with the License.
2749 * You may obtain a copy of the License at
2750 *
2751 *   http://www.apache.org/licenses/LICENSE-2.0
2752 *
2753 * Unless required by applicable law or agreed to in writing, software
2754 * distributed under the License is distributed on an "AS IS" BASIS,
2755 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2756 * See the License for the specific language governing permissions and
2757 * limitations under the License.
2758 */class Yde{constructor(t,r,n,a,i){this.localStore=t,this.datastore=r,this.asyncQueue=n,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=i,this.k_._o(o=>{n.enqueueAndForget(async()=>{xf(this)&&(Dt("RemoteStore","Restarting streams for network reachability change."),await async function(c){const u=fr(c);u.L_.add(4),await Qy(u),u.q_.set("Unknown"),u.L_.delete(4),await y2(u)}(this))})}),this.q_=new Hde(n,a)}}async function y2(e){if(xf(e))for(const t of e.B_)await t(!0)}async function Qy(e){for(const t of e.B_)await t(!1)}function QU(e,t){const r=fr(e);r.N_.has(t.targetId)||(r.N_.set(t.targetId,t),aE(r)?nE(r):tp(r).r_()&&rE(r,t))}function tE(e,t){const r=fr(e),n=tp(r);r.N_.delete(t),n.r_()&&KU(r,t),r.N_.size===0&&(n.r_()?n.o_():xf(r)&&r.q_.set("Unknown"))}function rE(e,t){if(e.Q_.xe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(dr.min())>0){const r=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(r)}tp(e).A_(t)}function KU(e,t){e.Q_.xe(t),tp(e).R_(t)}function nE(e){e.Q_=new Que({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ot:t=>e.N_.get(t)||null,tt:()=>e.datastore.serializer.databaseId}),tp(e).start(),e.q_.v_()}function aE(e){return xf(e)&&!tp(e).n_()&&e.N_.size>0}function xf(e){return fr(e).L_.size===0}function JU(e){e.Q_=void 0}async function Qde(e){e.q_.set("Online")}async function Kde(e){e.N_.forEach((t,r)=>{rE(e,t)})}async function Jde(e,t){JU(e),aE(e)?(e.q_.M_(t),nE(e)):e.q_.set("Unknown")}async function Zde(e,t,r){if(e.q_.set("Online"),t instanceof RU&&t.state===2&&t.cause)try{await async function(a,i){const o=i.cause;for(const l of i.targetIds)a.N_.has(l)&&(await a.remoteSyncer.rejectListen(l,o),a.N_.delete(l),a.Q_.removeTarget(l))}(e,t)}catch(n){Dt("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await Hx(e,n)}else if(t instanceof Gv?e.Q_.Ke(t):t instanceof OU?e.Q_.He(t):e.Q_.We(t),!r.isEqual(dr.min()))try{const n=await GU(e.localStore);r.compareTo(n)>=0&&await function(i,o){const l=i.Q_.rt(o);
2758return l.targetChanges.forEach((c,u)=>{if(c.resumeToken.approximateByteSize()>0){const d=i.N_.get(u);d&&i.N_.set(u,d.withResumeToken(c.resumeToken,o))}}),l.targetMismatches.forEach((c,u)=>{const d=i.N_.get(c);if(!d)return;i.N_.set(c,d.withResumeToken(ts.EMPTY_BYTE_STRING,d.snapshotVersion)),KU(i,c);const f=new su(d.target,c,u,d.sequenceNumber);rE(i,f)}),i.remoteSyncer.applyRemoteEvent(l)}(e,r)}catch(n){Dt("RemoteStore","Failed to raise snapshot:",n),await Hx(e,n)}}async function Hx(e,t,r){if(!Hy(t))throw t;e.L_.add(1),await Qy(e),e.q_.set("Offline"),r||(r=()=>GU(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Dt("RemoteStore","Retrying IndexedDB access"),await r(),e.L_.delete(1),await y2(e)})}function ZU(e,t){return t().catch(r=>Hx(e,r,t))}async function b2(e){const t=fr(e),r=Mu(t);let n=t.O_.length>0?t.O_[t.O_.length-1].batchId:-1;for(;Xde(t);)try{const a=await Ode(t.localStore,n);if(a===null){t.O_.length===0&&r.o_();break}n=a.batchId,efe(t,a)}catch(a){await Hx(t,a)}XU(t)&&e7(t)}function Xde(e){return xf(e)&&e.O_.length<10}function efe(e,t){e.O_.push(t);const r=Mu(e);r.r_()&&r.V_&&r.m_(t.mutations)}function XU(e){return xf(e)&&!Mu(e).n_()&&e.O_.length>0}function e7(e){Mu(e).start()}async function tfe(e){Mu(e).p_()}async function rfe(e){const t=Mu(e);for(const r of e.O_)t.m_(r.mutations)}async function nfe(e,t,r){const n=e.O_.shift(),a=QI.from(n,t,r);await ZU(e,()=>e.remoteSyncer.applySuccessfulWrite(a)),await b2(e)}async function afe(e,t){t&&Mu(e).V_&&await async function(n,a){if(function(o){return Gue(o)&&o!==st.ABORTED}(a.code)){const i=n.O_.shift();Mu(n).s_(),await ZU(n,()=>n.remoteSyncer.rejectFailedWrite(i.batchId,a)),await b2(n)}}(e,t),XU(e)&&e7(e)}async function V3(e,t){const r=fr(e);r.asyncQueue.verifyOperationInProgress(),Dt("RemoteStore","RemoteStore received new credentials");const n=xf(r);r.L_.add(3),await Qy(r),n&&r.q_.set("Unknown"),await r.remoteSyncer.handleCredentialChange(t),r.L_.delete(3),await y2(r)}async function sfe(e,t){const r=fr(e);t?(r.L_.delete(2),await y2(r)):t||(r.L_.add(2),await Qy(r),r.q_.set("Unknown"))}function tp(e){return e.K_||(e.K_=function(r,n,a){const i=fr(r);return i.w_(),new Wde(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,a)}(e.datastore,e.asyncQueue,{Eo:Qde.bind(null,e),Ro:Kde.bind(null,e),mo:Jde.bind(null,e),d_:Zde.bind(null,e)}),e.B_.push(async t=>{t?(e.K_.s_(),aE(e)?nE(e):e.q_.set("Unknown")):(await e.K_.stop(),JU(e))})),e.K_}function Mu(e){return e.U_||(e.U_=function(r,n,a){const i=fr(r);return i.w_(),new qde(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,a)}(e.datastore,e.asyncQueue,{Eo:()=>Promise.resolve(),Ro:tfe.bind(null,e),mo:afe.bind(null,e),f_:rfe.bind(null,e),g_:nfe.bind(null,e)}),e.B_.push(async t=>{t?(e.U_.s_(),await b2(e)):(await e.U_.stop(),e.O_.length>0&&(Dt("RemoteStore",`Stopping write stream with ${e.O_.length} pending writes`),e.O_=[]))})),e.U_}/**
2759 * @license
2760 * Copyright 2017 Google LLC
2761 *
2762 * Licensed under the Apache License, Version 2.0 (the "License");
2763 * you may not use this file except in compliance with the License.
2764 * You may obtain a copy of the License at
2765 *
2766 *   http://www.apache.org/licenses/LICENSE-2.0
2767 *
2768 * Unless required by applicable law or agreed to in writing, software
2769 * distributed under the License is distributed on an "AS IS" BASIS,
2770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2771 * See the License for the specific language governing permissions and
2772 * limitations under the License.
2773 */class sE{constructor(t,r,n,a,i){this.asyncQueue=t,this.timerId=r,this.targetTimeMs=n,this.op=a,this.removalCallback=i,this.deferred=new pu,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,r,n,a,i){const o=Date.now()+n,l=new sE(t,r,o,a,i);return l.start(n),l}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Ht(st.CANCELLED,"Operation cancelled"+(t?": "+t:"")))
2773)}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function iE(e,t){if(sc("AsyncQueue",`${t}: ${e}`),Hy(e))return new Ht(st.UNAVAILABLE,`${t}: ${e}`);throw e}/**
2774 * @license
2775 * Copyright 2017 Google LLC
2776 *
2777 * Licensed under the Apache License, Version 2.0 (the "License");
2778 * you may not use this file except in compliance with the License.
2779 * You may obtain a copy of the License at
2780 *
2781 *   http://www.apache.org/licenses/LICENSE-2.0
2782 *
2783 * Unless required by applicable law or agreed to in writing, software
2784 * distributed under the License is distributed on an "AS IS" BASIS,
2785 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2786 * See the License for the specific language governing permissions and
2787 * limitations under the License.
2788 */class jm{constructor(t){this.comparator=t?(r,n)=>t(r,n)||Yt.comparator(r.key,n.key):(r,n)=>Yt.comparator(r.key,n.key),this.keyedMap=Ig(),this.sortedSet=new ea(this.comparator)}static emptySet(t){return new jm(t.comparator)}has(t){return this.keyedMap.get(t)!=null}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const r=this.keyedMap.get(t);return r?this.sortedSet.indexOf(r):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal((r,n)=>(t(r),!1))}add(t){const r=this.delete(t.key);return r.copy(r.keyedMap.insert(t.key,t),r.sortedSet.insert(t,null))}delete(t){const r=this.get(t);return r?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(r)):this}isEqual(t){if(!(t instanceof jm)||this.size!==t.size)return!1;const r=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;r.hasNext();){const a=r.getNext().key,i=n.getNext().key;if(!a.isEqual(i))return!1}return!0}toString(){const t=[];return this.forEach(r=>{t.push(r.toString())}),t.length===0?"DocumentSet ()":`DocumentSet (
2789  `+t.join(`  
2790`)+`
2791)`}copy(t,r){const n=new jm;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=r,n}}/**
2792 * @license
2793 * Copyright 2017 Google LLC
2794 *
2795 * Licensed under the Apache License, Version 2.0 (the "License");
2796 * you may not use this file except in compliance with the License.
2797 * You may obtain a copy of the License at
2798 *
2799 *   http://www.apache.org/licenses/LICENSE-2.0
2800 *
2801 * Unless required by applicable law or agreed to in writing, software
2802 * distributed under the License is distributed on an "AS IS" BASIS,
2803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2804 * See the License for the specific language governing permissions and
2805 * limitations under the License.
2806 */class W3{constructor(){this.W_=new ea(Yt.comparator)}track(t){const r=t.doc.key,n=this.W_.get(r);n?t.type!==0&&n.type===3?this.W_=this.W_.insert(r,t):t.type===3&&n.type!==1?this.W_=this.W_.insert(r,{type:n.type,doc:t.doc}):t.type===2&&n.type===2?this.W_=this.W_.insert(r,{type:2,doc:t.doc}):t.type===2&&n.type===0?this.W_=this.W_.insert(r,{type:0,doc:t.doc}):t.type===1&&n.type===0?this.W_=this.W_.remove(r):t.type===1&&n.type===2?this.W_=this.W_.insert(r,{type:1,doc:n.doc}):t.type===0&&n.type===1?this.W_=this.W_.insert(r,{type:2,doc:t.doc}):ur():this.W_=this.W_.insert(r,t)}G_(){const t=[];return this.W_.inorderTraversal((r,n)=>{t.push(n)}),t}}class sh{constructor(t,r,n,a,i,o,l,c,u){this.query=t,this.docs=r,this.oldDocs=n,this.docChanges=a,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=l,this.excludesMetadataChanges=c,this.hasCachedResults=u}static fromInitialDocuments(t,r,n,a,i){const o=[];return r.forEach(l=>{o.push({type:0,doc:l})}),new sh(t,r,jm.emptySet(r),o,n,a,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.hasCachedResults===t.hasCachedResults&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&u2(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const r=this.docChanges,n=t.docChanges;if(r.length!==n.length)return!1;for(let a=0;a<r.length;
2806a++)if(r[a].type!==n[a].type||!r[a].doc.isEqual(n[a].doc))return!1;return!0}}/**
2807 * @license
2808 * Copyright 2017 Google LLC
2809 *
2810 * Licensed under the Apache License, Version 2.0 (the "License");
2811 * you may not use this file except in compliance with the License.
2812 * You may obtain a copy of the License at
2813 *
2814 *   http://www.apache.org/licenses/LICENSE-2.0
2815 *
2816 * Unless required by applicable law or agreed to in writing, software
2817 * distributed under the License is distributed on an "AS IS" BASIS,
2818 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2819 * See the License for the specific language governing permissions and
2820 * limitations under the License.
2821 */class ife{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(t=>t.J_())}}class ofe{constructor(){this.queries=q3(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(r,n){const a=fr(r),i=a.queries;a.queries=q3(),i.forEach((o,l)=>{for(const c of l.j_)c.onError(n)})})(this,new Ht(st.ABORTED,"Firestore shutting down"))}}function q3(){return new ep(e=>jU(e),u2)}async function lfe(e,t){const r=fr(e);let n=3;const a=t.query;let i=r.queries.get(a);i?!i.H_()&&t.J_()&&(n=2):(i=new ife,n=t.J_()?0:1);try{switch(n){case 0:i.z_=await r.onListen(a,!0);break;case 1:i.z_=await r.onListen(a,!1);break;case 2:await r.onFirstRemoteStoreListen(a)}}catch(o){const l=iE(o,`Initialization of query '${tm(t.query)}' failed`);return void t.onError(l)}r.queries.set(a,i),i.j_.push(t),t.Z_(r.onlineState),i.z_&&t.X_(i.z_)&&oE(r)}async function cfe(e,t){const r=fr(e),n=t.query;let a=3;const i=r.queries.get(n);if(i){const o=i.j_.indexOf(t);o>=0&&(i.j_.splice(o,1),i.j_.length===0?a=t.J_()?0:1:!i.H_()&&t.J_()&&(a=2))}switch(a){case 0:return r.queries.delete(n),r.onUnlisten(n,!0);case 1:return r.queries.delete(n),r.onUnlisten(n,!1);case 2:return r.onLastRemoteStoreUnlisten(n);default:return}}function ufe(e,t){const r=fr(e);let n=!1;for(const a of t){const i=a.query,o=r.queries.get(i);if(o){for(const l of o.j_)l.X_(a)&&(n=!0);o.z_=a}}n&&oE(r)}function dfe(e,t,r){const n=fr(e),a=n.queries.get(t);if(a)for(const i of a.j_)i.onError(r);n.queries.delete(t)}function oE(e){e.Y_.forEach(t=>{t.next()})}var xk,G3;(G3=xk||(xk={})).ea="default",G3.Cache="cache";class ffe{constructor(t,r,n){this.query=t,this.ta=r,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=n||{}}X_(t){if(!this.options.includeMetadataChanges){const n=[];for(const a of t.docChanges)a.type!==3&&n.push(a);t=new sh(t.query,t.docs,t.oldDocs,n,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0,t.hasCachedResults)}let r=!1;return this.na?this.ia(t)&&(this.ta.next(t),r=!0):this.sa(t,this.onlineState)&&(this.oa(t),r=!0),this.ra=t,r}onError(t){this.ta.error(t)}Z_(t){this.onlineState=t;let r=!1;return this.ra&&!this.na&&this.sa(this.ra,t)&&(this.oa(this.ra),r=!0),r}sa(t,r){if(!t.fromCache||!this.J_())return!0;const n=r!=="Offline";return(!this.options._a||!n)&&(!t.docs.isEmpty()||t.hasCachedResults||r==="Offline")}ia(t){if(t.docChanges.length>0)return!0;const r=this.ra&&this.ra.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!r)&&this.options.includeMetadataChanges===!0}oa(t){t=sh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache,t.hasCachedResults),this.na=!0,this.ta.next(t)}J_(){return this.options.source!==xk.Cache}}/**
2822 * @license
2823 * Copyright 2017 Google LLC
2824 *
2825 * Licensed under the Apache License, Version 2.0 (the "License");
2826 * you may not use this file except in compliance with the License.
2827 * You may obtain a copy of the License at
2828 *
2829 *   http://www.apache.org/licenses/LICENSE-2.0
2830 *
2831 * Unless required by applicable law or agreed to in writing, software
2832 * distributed under the License is distributed on an "AS IS" BASIS,
2833 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2834 * See the License for the specific language governing permissions and
2835 * limitations under the License.
2836 */class t7{constructor(t){this.key=t}}class r7{constructor(t){this.key=t}}class mfe{constructor(t,r){this.query=t,this.Ta=r,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=Pr(),this.mutatedKeys=Pr(),this.Aa=NU(t),this.Ra=new jm(this.Aa)}get Va(){return this.Ta}ma(t,r){const n=r?r.fa:new W3,a=r?r.Ra:this.Ra;let i=r?r.mutatedKeys:this.mutatedKeys,o=a,l=!1;const c=this.query.limitType==="F"&&a.size===this.query.limit?a.last():null,u=this.query.limitType==="L"&&a.size===this.query.limit?a.first():null;if(t.inorderTraversal((d,f)=>{const m=a.get(d),h=d2(this.query,f)?f:null,p=!!m&&this.mutatedKeys.has(m.ke
2836y),g=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let y=!1;m&&h?m.data.isEqual(h.data)?p!==g&&(n.track({type:3,doc:h}),y=!0):this.ga(m,h)||(n.track({type:2,doc:h}),y=!0,(c&&this.Aa(h,c)>0||u&&this.Aa(h,u)<0)&&(l=!0)):!m&&h?(n.track({type:0,doc:h}),y=!0):m&&!h&&(n.track({type:1,doc:m}),y=!0,(c||u)&&(l=!0)),y&&(h?(o=o.add(h),i=g?i.add(d):i.delete(d)):(o=o.delete(d),i=i.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),i=i.delete(d.key),n.track({type:1,doc:d})}return{Ra:o,fa:n,ns:l,mutatedKeys:i}}ga(t,r){return t.hasLocalMutations&&r.hasCommittedMutations&&!r.hasLocalMutations}applyChanges(t,r,n,a){const i=this.Ra;this.Ra=t.Ra,this.mutatedKeys=t.mutatedKeys;const o=t.fa.G_();o.sort((d,f)=>function(h,p){const g=y=>{switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ur()}};return g(h)-g(p)}(d.type,f.type)||this.Aa(d.doc,f.doc)),this.pa(n),a=a!=null&&a;const l=r&&!a?this.ya():[],c=this.da.size===0&&this.current&&!a?1:0,u=c!==this.Ea;return this.Ea=c,o.length!==0||u?{snapshot:new sh(this.query,t.Ra,i,o,t.mutatedKeys,c===0,u,!1,!!n&&n.resumeToken.approximateByteSize()>0),wa:l}:{wa:l}}Z_(t){return this.current&&t==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new W3,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(t){return!this.Ta.has(t)&&!!this.Ra.has(t)&&!this.Ra.get(t).hasLocalMutations}pa(t){t&&(t.addedDocuments.forEach(r=>this.Ta=this.Ta.add(r)),t.modifiedDocuments.forEach(r=>{}),t.removedDocuments.forEach(r=>this.Ta=this.Ta.delete(r)),this.current=t.current)}ya(){if(!this.current)return[];const t=this.da;this.da=Pr(),this.Ra.forEach(n=>{this.Sa(n.key)&&(this.da=this.da.add(n.key))});const r=[];return t.forEach(n=>{this.da.has(n)||r.push(new r7(n))}),this.da.forEach(n=>{t.has(n)||r.push(new t7(n))}),r}ba(t){this.Ta=t.Ts,this.da=Pr();const r=this.ma(t.documents);return this.applyChanges(r,!0)}Da(){return sh.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class hfe{constructor(t,r,n){this.query=t,this.targetId=r,this.view=n}}class pfe{constructor(t){this.key=t,this.va=!1}}class gfe{constructor(t,r,n,a,i,o){this.localStore=t,this.remoteStore=r,this.eventManager=n,this.sharedClientState=a,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new ep(l=>jU(l),u2),this.Ma=new Map,this.xa=new Set,this.Oa=new ea(Yt.comparator),this.Na=new Map,this.La=new ZI,this.Ba={},this.ka=new Map,this.qa=ah.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function yfe(e,t,r=!0){const n=l7(e);let a;const i=n.Fa.get(t);return i?(n.sharedClientState.addLocalQueryTarget(i.targetId),a=i.view.Da()):a=await n7(n,t,r,!0),a}async function bfe(e,t){const r=l7(e);await n7(r,t,!0,!1)}async function n7(e,t,r,n){const a=await Rde(e.localStore,Ko(t)),i=a.targetId,o=e.sharedCl
2836ientState.addLocalQueryTarget(i,r);let l;return n&&(l=await vfe(e,t,i,o==="current",a.resumeToken)),e.isPrimaryClient&&r&&QU(e.remoteStore,a),l}async function vfe(e,t,r,n,a){e.Ka=(f,m,h)=>async function(g,y,v,x){let j=y.view.ma(v);j.ns&&(j=await z3(g.localStore,y.query,!1).then(({documents:M})=>y.view.ma(M,j)));const C=x&&x.targetChanges.get(y.targetId),N=x&&x.targetMismatches.get(y.targetId)!=null,S=y.view.applyChanges(j,g.isPrimaryClient,C,N);return Y3(g,y.targetId,S.wa),S.snapshot}(e,f,m,h);const i=await z3(e.localStore,t,!0),o=new mfe(t,i.Ts),l=o.ma(i.documents),c=Yy.createSynthesizedTargetChangeForCurrentChange(r,n&&e.onlineState!=="Offline",a),u=o.applyChanges(l,e.isPrimaryClient,c);Y3(e,r,u.wa);const d=new hfe(t,r,o);return e.Fa.set(t,d),e.Ma.has(r)?e.Ma.get(r).push(t):e.Ma.set(r,[t]),u.snapshot}async function xfe(e,t,r){const n=fr(e),a=n.Fa.get(t),i=n.Ma.get(a.targetId);if(i.length>1)return n.Ma.set(a.targetId,i.filter(o=>!u2(o,t))),void n.Fa.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(a.targetId),n.sharedClientState.isActiveQueryTarget(a.targetId)||await vk(n.localStore,a.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(a.targetId),r&&tE(n.remoteStore,a.targetId),wk(n,a.targetId)}).catch(Gy)):(wk(n,a.targetId),await vk(n.localStore,a.targetId,!0))}async function wfe(e,t){const r=fr(e),n=r.Fa.get(t),a=r.Ma.get(n.targetId);r.isPrimaryClient&&a.length===1&&(r.sharedClientState.removeLocalQueryTarget(n.targetId),tE(r.remoteStore,n.targetId))}async function jfe(e,t,r){const n=Efe(e);try{const a=await function(o,l){const c=fr(o),u=Pa.now(),d=l.reduce((h,p)=>h.add(p.key),Pr());let f,m;return c.persistence.runTransaction("Locally write mutations","readwrite",h=>{let p=ic(),g=Pr();return c.cs.getEntries(h,d).next(y=>{p=y,p.forEach((v,x)=>{x.isValidDocument()||(g=g.add(v))})}).next(()=>c.localDocuments.getOverlayedDocuments(h,p)).next(y=>{f=y;const v=[];for(const x of l){const j=Bue(x,f.get(x.key).overlayedDocument);j!=null&&v.push(new vf(x.key,j,pU(j.value.mapValue),Wl.exists(!0)))}return c.mutationQueue.addMutationBatch(h,u,v,l)}).next(y=>{m=y;const v=y.applyToLocalDocumentSet(f,g);return c.documentOverlayCache.saveOverlays(h,y.batchId,v)})}).then(()=>({batchId:m.batchId,changes:CU(f)}))}(n.localStore,t);n.sharedClientState.addPendingMutation(a.batchId),function(o,l,c){let u=o.Ba[o.currentUser.toKey()];u||(u=new ea(Zr)),u=u.insert(l,c),o.Ba[o.currentUser.toKey()]=u}(n,a.batchId,r),await Ky(n,a.changes),await b2(n.remoteStore)}catch(a){const i=iE(a,"Failed to persist write");r.reject(i)}}async function a7(e,t){const r=fr(e);try{const n=await Lde(r.localStore,t);
2836t.targetChanges.forEach((a,i)=>{const o=r.Na.get(i);o&&(xn(a.addedDocuments.size+a.modifiedDocuments.size+a.removedDocuments.size<=1),a.addedDocuments.size>0?o.va=!0:a.modifiedDocuments.size>0?xn(o.va):a.removedDocuments.size>0&&(xn(o.va),o.va=!1))}),await Ky(r,n,t)}catch(n){await Gy(n)}}function H3(e,t,r){const n=fr(e);if(n.isPrimaryClient&&r===0||!n.isPrimaryClient&&r===1){const a=[];n.Fa.forEach((i,o)=>{const l=o.view.Z_(t);l.snapshot&&a.push(l.snapshot)}),function(o,l){const c=fr(o);c.onlineState=l;let u=!1;c.queries.forEach((d,f)=>{for(const m of f.j_)m.Z_(l)&&(u=!0)}),u&&oE(c)}(n.eventManager,t),a.length&&n.Ca.d_(a),n.onlineState=t,n.isPrimaryClient&&n.sharedClientState.setOnlineState(t)}}async function Nfe(e,t,r){const n=fr(e);n.sharedClientState.updateQueryState(t,"rejected",r);const a=n.Na.get(t),i=a&&a.key;if(i){let o=new ea(Yt.comparator);o=o.insert(i,ds.newNoDocument(i,dr.min()));const l=Pr().add(i),c=new p2(dr.min(),new Map,new ea(Zr),o,l);await a7(n,c),n.Oa=n.Oa.remove(i),n.Na.delete(t),lE(n)}else await vk(n.localStore,t,!1).then(()=>wk(n,t,r)).catch(Gy)}async function Sfe(e,t){const r=fr(e),n=t.batch.batchId;try{const a=await _de(r.localStore,t);
2836i7(r,n,null),s7(r,n),r.sharedClientState.updateMutationState(n,"acknowledged"),await Ky(r,a)}catch(a){await Gy(a)}}async function Cfe(e,t,r){const n=fr(e);try{const a=await function(o,l){const c=fr(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",u=>{let d;return c.mutationQueue.lookupMutationBatch(u,l).next(f=>(xn(f!==null),d=f.keys(),c.mutationQueue.removeMutationBatch(u,f))).next(()=>c.mutationQueue.performConsistencyCheck(u)).next(()=>c.documentOverlayCache.removeOverlaysForBatchId(u,d,l)).next(()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(u,d)).next(()=>c.localDocuments.getDocuments(u,d))})}(n.localStore,t);i7(n,t,r),s7(n,t),n.sharedClientState.updateMutationState(t,"rejected",r),await Ky(n,a)}catch(a){await Gy(a)}}function s7(e,t){(e.ka.get(t)||[]).forEach(r=>{r.resolve()}),e.ka.delete(t)}function i7(e,t,r){const n=fr(e);let a=n.Ba[n.currentUser.toKey()];if(a){const i=a.get(t);i&&(r?i.reject(r):i.resolve(),a=a.remove(t)),n.Ba[n.currentUser.toKey()]=a}}function wk(e,t,r=null){e.sharedClientState.removeLocalQueryTarget(t);for(const n of e.Ma.get(t))e.Fa.delete(n),r&&e.Ca.$a(n,r);e.Ma.delete(t),e.isPrimaryClient&&e.La.gr(t).forEach(n=>{e.La.containsKey(n)||o7(e,n)})}function o7(e,t){e.xa.delete(t.path.canonicalString());const r=e.Oa.get(t);r!==null&&(tE(e.remoteStore,r),e.Oa=e.Oa.remove(t),e.Na.delete(r),lE(e))}function Y3(e,t,r){for(const n of r)n instanceof t7?(e.La.addReference(n.key,t),kfe(e,n)):n instanceof r7?(Dt("SyncEngine","Document no longer in limbo: "+n.key),e.La.removeReference(n.key,t),e.La.containsKey(n.key)||o7(e,n.key)):ur()}function kfe(e,t){const r=t.key,n=r.path.canonicalString();e.Oa.get(r)||e.xa.has(n)||(Dt("SyncEngine","New document in limbo: "+r),e.xa.add(n),lE(e))}function lE(e){for(;e.xa.size>0&&e.Oa.size<e.maxConcurrentLimboResolutions;){const t=e.xa.values().next().value;e.xa.delete(t);const r=new Yt(sa.fromString(t)),n=e.qa.next();e.Na.set(n,new pfe(r)),e.Oa=e.Oa.insert(r,n),QU(e.remoteStore,new su(Ko(HI(r.path)),n,"TargetPurposeLimboResolution",BI.oe))}}async function Ky(e,t,r){const n=fr(e),a=[],i=[],o=[];n.Fa.isEmpty()||(n.Fa.forEach((l,c)=>{o.push(n.Ka(c,t,r).then(u=>{var d;if((u||r)&&n.isPrimaryClient){const f=u?!u.fromCache:(d=r==null?void 0:r.targetChanges.get(c.targetId))===null||d===void 0?void 0:d.current;n.sharedClientState.updateQueryState(c.targetId,f?"current":"not-current")}if(u){a.push(u);const f=eE.Wi(c.targetId,u);i.push(f)}}))}),await Promise.all(o),n.Ca.d_(a),await async function(c,u){const d=fr(c);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>rt.forEach(u,m=>rt.forEach(m.$i,h=>d.persistence.referenceDelegate.addReference(f,m.targetId,h)).next(()=>rt.forEach(m.Ui,h=>d.persistence.referenceDelegate.removeReference(f,m.targetId,h)))))}catch(f){if(!Hy(f))throw f;Dt("LocalStore","Failed to update sequence numbers: "+f)}for(const f of u){const m=f.targetId;if(!f.fromCache){const h=d.os.get(m),p=h.snapshotVersion,g=h.withLastLimboFreeSnapshotVersion(p);d.os=d.os.insert(m,g)}}}(n.localStore,i))}async function Mfe(e,t){const r=fr(e);if(!r.currentUser.isEqual(t)){Dt("SyncEngine","User change. New user:",t.toKey());const n=await qU(r.localStore,t);r.currentUser=t,function(i,o){i.ka.forEach(l=>{l.forEach(c=>{c.reject(new Ht(st.CANCELLED,o))})}),i.ka.clear()}(r,"'waitForPendingWrites' promise is rejected due to a user change."),r.sharedClientState.handleUserChange(t,n.removedBatchIds,n.addedBatchIds),await Ky(r,n.hs)}}function Ife(e,t){const r=fr(e),n=r.Na.get(t);if(n&&n.va)return Pr().add(n.key);{let a=Pr();const i=r.Ma.get(t);if(!i)return a;for(const o of i){const l=r.Fa.get(o);a=a.unionWith(l.view.Va)}return a}}function l7(e){const t=fr(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=a7.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=Ife.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=Nfe.bind(null,t),t.Ca.d_=ufe.bind(null,t.eventManager),t.Ca.$a=dfe.bind(null,t.eventManager),t}function Efe(e){const t=fr(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Sfe.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Cfe.bind(null,t),t}class Yx{constructor(){this.kind="memory",this.synchronizeTabs=!1}
2836async initialize(t){this.serializer=g2(t.databaseInfo.databaseId),this.sharedClientState=this.Wa(t),this.persistence=this.Ga(t),await this.persistence.start(),this.localStore=this.za(t),this.gcScheduler=this.ja(t,this.localStore),this.indexBackfillerScheduler=this.Ha(t,this.localStore)}ja(t,r){return null}Ha(t,r){return null}za(t){return Pde(this.persistence,new Tde,t.initialUser,this.serializer)}Ga(t){return new Mde(XI.Zr,this.serializer)}Wa(t){return new Fde}async terminate(){var t,r;(t=this.gcScheduler)===null||t===void 0||t.stop(),(r=this.indexBackfillerScheduler)===null||r===void 0||r.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Yx.provider={build:()=>new Yx};class jk{async initialize(t,r){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(r),this.remoteStore=this.createRemoteStore(r),this.eventManager=this.createEventManager(r),this.syncEngine=this.createSyncEngine(r,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=n=>H3(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=Mfe.bind(null,this.syncEngine),await sfe(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return function(){return new ofe}()}createDatastore(t){const r=g2(t.databaseInfo.databaseId),n=function(i){return new Vde(i)}(t.databaseInfo);return function(i,o,l,c){return new Gde(i,o,l,c)}(t.authCredentials,t.appCheckCredentials,n,r)}createRemoteStore(t){return function(n,a,i,o,l){return new Yde(n,a,i,o,l)}(this.localStore,this.datastore,t.asyncQueue,r=>H3(this.syncEngine,r,0),function(){return U3.D()?new U3:new zde}())}createSyncEngine(t,r){return function(a,i,o,l,c,u,d){const f=new gfe(a,i,o,l,c,u);return d&&(f.Qa=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,r)}async terminate(){var t,r;await async function(a){const i=fr(a);Dt("RemoteStore","RemoteStore shutting down."),i.L_.add(5),await Qy(i),i.k_.shutdown(),i.q_.set("Unknown")}(this.remoteStore),(t=this.datastore)===null||t===void 0||t.terminate(),(r=this.eventManager)===null||r===void 0||r.terminate()}}jk.provider={build:()=>new jk};/**
2837 * @license
2838 * Copyright 2020 Google LLC
2839 *
2840 * Licensed under the Apache License, Version 2.0 (the "License");
2841 * you may not use this file except in compliance with the License.
2842 * You may obtain a copy of the License at
2843 *
2844 *   http://www.apache.org/licenses/LICENSE-2.0
2845 *
2846 * Unless required by applicable law or agreed to in writing, software
2847 * distributed under the License is distributed on an "AS IS" BASIS,
2848 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2849 * See the License for the specific language governing permissions and
2850 * limitations under the License.
2851 *//**
2852 * @license
2853 * Copyright 2017 Google LLC
2854 *
2855 * Licensed under the Apache License, Version 2.0 (the "License");
2856 * you may not use this file except in compliance with the License.
2857 * You may obtain a copy of the License at
2858 *
2859 *   http://www.apache.org/licenses/LICENSE-2.0
2860 *
2861 * Unless required by applicable law or agreed to in writing, software
2862 * distributed under the License is distributed on an "AS IS" BASIS,
2863 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2864 * See the License for the specific language governing permissions and
2865 * limitations under the License.
2866 */class Tfe{constructor(t){this.observer=t,this.muted=!1}next(t){this.muted||this.observer.next&&this.Ya(this.observer.next,t)}error(t){this.muted||(this.observer.error?this.Ya(this.observer.error,t):sc("Uncaught Error in snapshot listener:",t.toString()))}Za(){this.muted=!0}Ya(t,r){setTimeout(()=>{this.muted||t(r)},0)}}/**
2867 * @license
2868 * Copyright 2017 Google LLC
2869 *
2870 * Licensed under the Apache License, Version 2.0 (the "License");
2871 * you may not use this file except in compliance with the License.
2872 * You may obtain a copy of the License at
2873 *
2874 *   http://www.apache.org/licenses/LICENSE-2.0
2875 *
2876 * Unless required by applicable law or agreed to in writing, softw
2876are
2877 * distributed under the License is distributed on an "AS IS" BASIS,
2878 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2879 * See the License for the specific language governing permissions and
2880 * limitations under the License.
2881 */class Afe{constructor(t,r,n,a,i){this.authCredentials=t,this.appCheckCredentials=r,this.asyncQueue=n,this.databaseInfo=a,this.user=us.UNAUTHENTICATED,this.clientId=fU.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(n,async o=>{Dt("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(n,o=>(Dt("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}terminate(){this.asyncQueue.enterRestrictedMode();const t=new pu;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(r){const n=iE(r,"Failed to shutdown persistence");t.reject(n)}}),t.promise}}async function FN(e,t){e.asyncQueue.verifyOperationInProgress(),Dt("FirestoreClient","Initializing OfflineComponentProvider");const r=e.configuration;await t.initialize(r);let n=r.initialUser;e.setCredentialChangeListener(async a=>{n.isEqual(a)||(await qU(t.localStore,a),n=a)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function Q3(e,t){e.asyncQueue.verifyOperationInProgress();const r=await Pfe(e);Dt("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(r,e.configuration),e.setCredentialChangeListener(n=>V3(t.remoteStore,n)),e.setAppCheckTokenChangeListener((n,a)=>V3(t.remoteStore,a)),e._onlineComponents=t}async function Pfe(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Dt("FirestoreClient","Using user provided OfflineComponentProvider");try{await FN(e,e._uninitializedComponentsProvider._offline)}catch(t){const r=t;if(!function(a){return a.name==="FirebaseError"?a.code===st.FAILED_PRECONDITION||a.code===st.UNIMPLEMENTED:!(typeof DOMException<"u"&&a instanceof DOMException)||a.code===22||a.code===20||a.code===11}(r))throw r;eh("Error using user provided cache. Falling back to memory cache: "+r),await FN(e,new Yx)}}else Dt("FirestoreClient","Using default OfflineComponentProvider"),await FN(e,new Yx);return e._offlineComponents}async function c7(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Dt("FirestoreClient","Using user provided OnlineComponentProvider"),await Q3(e,e._uninitializedComponentsProvider._online)):(Dt("FirestoreClient","Using default OnlineComponentProvider"),await Q3(e,new jk))),e._onlineComponents}function _fe(e){return c7(e).then(t=>t.syncEngine)}async function Lfe(e){const t=await c7(e),r=t.eventManager;return r.onListen=yfe.bind(null,t.syncEngine),r.onUnlisten=xfe.bind(null,t.syncEngine),r.onFirstRemoteStoreListen=bfe.bind(null,t.syncEngine),r.onLastRemoteStoreUnlisten=wfe.bind(null,t.syncEngine),r}function Dfe(e,t,r={}){const n=new pu;return e.asyncQueue.enqueueAndForget(async()=>function(i,o,l,c,u){const d=new Tfe({next:m=>{d.Za(),o.enqueueAndForget(()=>cfe(i,f));const h=m.docs.has(l);!h&&m.fromCache?u.reject(new Ht(st.UNAVAILABLE,"Failed to get document because the client is offline.")):h&&m.fromCache&&c&&c.source==="server"?u.reject(new Ht(st.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):u.resolve(m)},error:m=>u.reject(m)}),f=new ffe(HI(l.path),d,{includeMetadataChanges:!0,_a:!0});return lfe(i,f)}(await Lfe(e),e.asyncQueue,t,r,n)),n.promise}/**
2882 * @license
2883 * Copyright 2023 Google LLC
2884 *
2885 * Licensed under the Apache License, Version 2.0 (the "License");
2886 * you may not use this file except in compliance with the License.
2887 * You may obtain a copy of the License at
2888 *
2889 *   http://www.apache.org/licenses/LICENSE-2.0
2890 *
2891 * Unless required by applicable law or agreed to in writing, software
2892 * distributed under the License is distributed on an "AS IS" BASIS,
2893 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2894 * See the License for the specific language governing permissions and
2895 * limitations under the License.
2896 */function u7(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),t}/**
2897 * @license
2898 * Copyright 2020 Google LLC
2899 *
2900 * Licensed under the Apache License, Version 2.0 (the "License");
2901 * you may not use this file except in compliance with the License.
2902 * You may obtain a copy of the License at
2903 *
2904 *   http://www.apache.org/licenses/LICENSE-2.0
2905 *
2906 * Unless required by applicable law or agreed to in writing, software
2907 * distributed under the License is distributed on an "AS IS" BASIS,
2908 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2909 * See the License for the specific language governing permissions and
2910 * limitations under the License.
2911 */const K3=new Map;/**
2912 * @license
2913 * Copyright 2017 Google LLC
2914 *
2915 * Licensed under the Apache License, Version 2.0 (the "License");
2916 * you may not use this file except in compliance with the License.
2917 * You may obtain a copy of the License at
2918 *
2919 *   http://www.apache.org/licenses/LICENSE-2.0
2920 *
2921 * Unless required by applicable law or agreed to in writing, software
2922 * distributed under the License is distributed on an "AS IS" BASIS,
2923 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2924 * See the License for the specific language governing permissions and
2925 * limitations under the License.
2926 */function Ofe(e,t,r){if(!r)throw new Ht(st.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function Rfe(e,t,r,n){if(t===!0&&n===!0)throw new Ht(st.INVALID_ARGUMENT,`${e} and ${r} cannot be used together.`)}function J3(e){if(!Yt.isDocumentKey(e))throw new Ht(st.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function cE(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(n){return n.constructor?n.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":ur()}function b0(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new Ht(st.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const r=cE(e);throw new Ht(st.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${r}`)}}return e}/**
2927 * @license
2928 * Copyright 2020 Google LLC
2929 *
2930 * Licensed under the Apache License, Version 2.0 (the "License");
2931 * you may not use this file except in compliance with the License.
2932 * You may obtain a copy of the License at
2933 *
2934 *   http://www.apache.org/licenses/LICENSE-2.0
2935 *
2936 * Unless required by applicable law or agreed to in writing, software
2937 * distributed under the License is distributed on an "AS IS" BASIS,
2938 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2939 * See the License for the specific language governing permissions and
2940 * limitations under the License.
2941 */class Z3{constructor(t){var r,n;if(t.host===void 0){if(t.ssl!==void 0)throw new Ht(st.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(r=t.ssl)===null||r===void 0||r;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new Ht(st.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}Rfe("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=u7((n=t.experimentalLongPollingOptions)!==null&&n!==void 0?n:{}),function(i){if(i.timeoutSeconds!==void 0){if(isNaN(i.timeoutSeconds))throw new Ht(st.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (must not be NaN)`);if(i.timeoutSeconds<5)throw new Ht(st.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (minimum allowed value is 5)`);if(i.timeoutSeconds>30)throw new Ht(st.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(n,a){return n.timeoutSeconds===a.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class uE{constructor(t,r,n,a){this._authCredentials=t,this._appCheckCredentials=r,this._databaseId=n,this._app=a,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Z3({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Ht(st.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(t){if(this._settingsFrozen)throw new Ht(st.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Z3(t),t.credentials!==void 0&&(this._authCredentials=function(n){if(!n)return new Qce;switch(n.type){case"firstParty":return new Xce(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new Ht(st.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2941d credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(r){const n=K3.get(r);n&&(Dt("ComponentProvider","Removing Datastore"),K3.delete(r),n.terminate())}(this),Promise.resolve()}}function $fe(e,t,r,n={}){var a;const i=(e=b0(e,uE))._getSettings(),o=`${t}:${r}`;if(i.host!=="firestore.googleapis.com"&&i.host!==o&&eh("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},i),{host:o,ssl:!1})),n.mockUserToken){let l,c;if(typeof n.mockUserToken=="string")l=n.mockUserToken,c=us.MOCK_USER;else{l=lie(n.mockUserToken,(a=e._app)===null||a===void 0?void 0:a.options.projectId);const u=n.mockUserToken.sub||n.mockUserToken.user_id;if(!u)throw new Ht(st.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");c=new us(u)}e._authCredentials=new Kce(new dU(l,c))}}/**
2942 * @license
2943 * Copyright 2020 Google LLC
2944 *
2945 * Licensed under the Apache License, Version 2.0 (the "License");
2946 * you may not use this file except in compliance with the License.
2947 * You may obtain a copy of the License at
2948 *
2949 *   http://www.apache.org/licenses/LICENSE-2.0
2950 *
2951 * Unless required by applicable law or agreed to in writing, software
2952 * distributed under the License is distributed on an "AS IS" BASIS,
2953 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2954 * See the License for the specific language governing permissions and
2955 * limitations under the License.
2956 */class dE{constructor(t,r,n){this.converter=r,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new dE(this.firestore,t,this._query)}}class _i{constructor(t,r,n){this.converter=r,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new v0(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new _i(this.firestore,t,this._key)}}class v0 extends dE{constructor(t,r,n){super(t,r,HI(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new _i(this.firestore,null,new Yt(t))}withConverter(t){return new v0(this.firestore,t,this._path)}}function fE(e,t,...r){if(e=es(e),arguments.length===1&&(t=fU.newId()),Ofe("doc","path",t),e instanceof uE){const n=sa.fromString(t,...r);return J3(n),new _i(e,null,new Yt(n))}{if(!(e instanceof _i||e instanceof v0))throw new Ht(st.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=e._path.child(sa.fromString(t,...r));return J3(n),new _i(e.firestore,e instanceof v0?e.converter:null,new Yt(n))}}/**
2957 * @license
2958 * Copyright 2020 Google LLC
2959 *
2960 * Licensed under the Apache License, Version 2.0 (the "License");
2961 * you may not use this file except in compliance with the License.
2962 * You may obtain a copy of the License at
2963 *
2964 *   http://www.apache.org/licenses/LICENSE-2.0
2965 *
2966 * Unless required by applicable law or agreed to in writing, software
2967 * distributed under the License is distributed on an "AS IS" BASIS,
2968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2969 * See the License for the specific language governing permissions and
2970 * limitations under the License.
2971 */class X3{constructor(t=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new HU(this,"async_queue_retry"),this.Vu=()=>{const n=$N();n&&Dt("AsyncQueue","Visibility state changed to "+n.visibilityState),this.t_.jo()},this.mu=t;const r=$N();r&&typeof r.addEventListener=="function"&&r.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.fu(),this.gu(t)}enterRestrictedMode(t){if(!this.Iu){this.Iu=!0,this.Au=t||!1;const r=$N();r&&typeof r.removeEventListener=="function"&&r.removeEventListener("visibilitychange",this.Vu)}}enqueue(t){if(this.fu(),this.Iu)return new Promise(()=>{});const r=new pu;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(t().then(r.resolve,r.reject),r.promise)).then(()=>r.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.Pu.push(t),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(t){if(!Hy(t))throw t;Dt("AsyncQueue","Operation failed with retryable error: "+t)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(t){const r=this.mu.then(()=>(this.du=!0,t().catch(n=>{this.Eu=n,this.du=!1;const a=function(o){let l=o.message||"";return o.stack&&(l=o.stack.includes(o.message)?o.stack:o.message+`
2972`+o.stack),l}(n);throw sc("INTERNAL UNHANDLED ERROR: ",a),n}).then(n=>(this.du=!1,n))));return this.mu=r,r}enqueueAfterDelay(t,r,n){this.fu(),this.Ru.indexOf(t)>-1&&(r=0);const a=sE.createAndSchedule(this,t,r,n,i=>this.yu(i));return this.Tu.push(a),a}fu(){this.Eu&&ur()}verifyOperationInProgress(){}async wu(){let t;do t=this.mu,await t;while(t!==this.mu)}Su(t){for(const r of this.Tu)if(r.timerId===t)return!0;return!1}bu(t){return this.wu().then(()=>{this.Tu.sort((r,n)=>r.targetTimeMs-n.targetTimeMs);for(const r of this.Tu)if(r.skipDelay(),t!=="all"&&r.timerId===t)break;return this.wu()})}Du(t){this.Ru.push(t)}yu(t){const r=this.Tu.indexOf(t);this.Tu.splice(r,1)}}class mE extends uE{constructor(t,r,n,a){super(t,r,n,a),this.type="firestore",this._queue=new X3,this._persistenceKey=(a==null?void 0:a.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const t=this._firestoreClient.terminate();this._queue=new X3(t),this._firestoreClient=void 0,await t}}}function v2(e,t){const r=typeof e=="object"?e:wB(),n=typeof e=="string"?e:"(default)",a=II(r,"firestore").getImmediate({identifier:n});if(!a._initialized){const i=iie("firestore");i&&$fe(a,...i)}return a}function d7(e){if(e._terminated)throw new Ht(st.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||Ffe(e),e._firestoreClient}function Ffe(e){var t,r,n;const a=e._freezeSettings(),i=function(l,c,u,d){return new fue(l,c,u,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,u7(d.experimentalLongPollingOptions),d.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,a);e._componentsProvider||!((r=a.localCache)===null||r===void 0)&&r._offlineComponentProvider&&(!((n=a.localCache)===null||n===void 0)&&n._onlineComponentProvider)&&(e._componentsProvider={_offline:a.localCache._offlineComponentProvider,_online:a.localCache._onlineComponentProvider}),e._firestoreClient=new Afe(e._authCredentials,e._appCheckCredentials,e._queue,i,e._componentsProvider&&function(l){const c=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(c),_online:c}}(e._componentsProvider))}/**
2973 * @license
2974 * Copyright 2020 Google LLC
2975 *
2976 * Licensed under the Apache License, Version 2.0 (the "License");
2977 * you may not use this file except in compliance with the License.
2978 * You may obtain a copy of the License at
2979 *
2980 *   http://www.apache.org/licenses/LICENSE-2.0
2981 *
2982 * Unless required by applicable law or agreed to in writing, software
2983 * distributed under the License is distributed on an "AS IS" BASIS,
2984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2985 * See the License for the specific language governing permissions and
2986 * limitations under the License.
2987 */class ih{constructor(t){this._byteString=t}static fromBase64String(t){try{return new ih(ts.fromBase64String(t))}catch(r){throw new Ht(st.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+r)}}static fromUint8Array(t){return new ih(ts.fromUint8Array(t))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(t){return this._byteString.isEqual(t._byteString)}}/**
2988 * @license
2989 * Copyright 2020 Google LLC
2990 *
2991 * Licensed under the Apache License, Version 2.0 (the "License");
2992 * you may not use this file except in compliance with the License.
2993 * You may obtain a copy of the License at
2994 *
2995 *   http://www.apache.org/licenses/LICENSE-2.0
2996 *
2997 * Unless required by applicable law or agreed to in writing, software
2998 * distributed under the License is distributed on an "AS IS" BASIS,
2999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3000 * See the License for the specific language governing permissions and
3001 * limitations under the License.
3002 */class x2{constructor(...t){for(let r=0;r<t.length;++r)if(t[r].length===0)throw new Ht(st.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Qa(t)}isEqual(t){return this._internalPath.isEqual(t._internalPath)}}/**
3003 * @license
3004 * Copyright 2020 Google LLC
3005 *
3006 * Licensed under the Apache License, Version 2.0 (the "License");
3007 * you may not use this file except in compliance with the License.
3008 * You may obtain a copy of the License at
3009 *
3010 *   http://www.apache.org/licenses/LICENSE-2.0
3011 *
3012 * Unless required by applicable law or agreed to in writing, software
3013 * distributed under the License is distributed on an "AS IS" BASIS,
3014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3015 * See the License for the specific language governing permissions and
3016 * limitations under the License.
3017 */class hE{constructor(t){this._methodName=t}}/**
3018 * @license
3019 * Copyright 2017 Google LLC
3020 *
3021 * Licensed under the Apache License, Version 2.0 (the "License");
3022 * you may not use this file except in compliance with the License.
3023 * You may obtain a copy of the License at
3024 *
3025 *   http://www.apache.org/licenses/LICENSE-2.0
3026 *
3027 * Unless required by applicable law or agreed to in writing, software
3028 * distributed under the License is distributed on an "AS IS" BASIS,
3029 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3030 * See the License for the specific language governing permissions and
3031 * limitations under the License.
3032 */class pE{constructor(t,r){if(!isFinite(t)||t<-90||t>90)throw new Ht(st.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(r)||r<-180||r>180)throw new Ht(st.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+r);this._lat=t,this._long=r}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return Zr(this._lat,t._lat)||Zr(this._long,t._long)}}/**
3033 * @license
3034 * Copyright 2024 Google LLC
3035 *
3036 * Licensed under the Apache License, Version 2.0 (the "License");
3037 * you may not use this file except in compliance with the License.
3038 * You may obtain a copy of the License at
3039 *
3040 *   http://www.apache.org/licenses/LICENSE-2.0
3041 *
3042 * Unless required by applicable law or agreed to in writing, software
3043 * distributed under the License is distributed on an "AS IS" BASIS,
3044 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3045 * See the License for the specific language governing permissions and
3046 * limitations under the License.
3047 */class gE{constructor(t){this._values=(t||[]).map(r=>r)}toArray(){return this._values.map(t=>t)}isEqual(t){return function(n,a){if(n.length!==a.length)return!1;for(let i=0;i<n.length;++i)if(n[i]!==a[i])return!1;return!0}(this._values,t._values)}}/**
3048 * @license
3049 * Copyright 2017 Google LLC
3050 *
3051 * Licensed under the Apache License, Version 2.0 (the "License");
3052 * you may not use this file except in compliance with the License.
3053 * You may obtain a copy of the License at
3054 *
3055 *   http://www.apache.org/licenses/LICENSE-2.0
3056 *
3057 * Unless required by applicable law or agreed to in writing, software
3058 * distributed under the License is distributed on an "AS IS" BASIS,
3059 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3060 * See the License for the specific language governing permissions and
3061 * limitations under the License.
3062 */const zfe=/^__.*__$/;class f7{constructor(t,r,n){this.data=t,this.fieldMask=r,this.fieldTransforms=n}toMutation(t,r){return new vf(t,this.data,this.fieldMask,r,this.fieldTransforms)}}function m7(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ur()}}class yE{constructor(t,r,n,a,i,o){this.settings=t,this.databaseId=r,this.serializer=n,this.ignoreUndefinedProperties=a,i===void 0&&this.vu(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(t){return new yE(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(t){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(t),a=this.Fu({path:n,xu:!1});return a.Ou(t),a}Nu(t){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(t),a=this.Fu({path:n,xu:!1});return a.vu(),a}Lu(t){return this.Fu({path:void 0,xu:!0})}Bu(t){return Qx(t,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(t){return this.fieldMask.find(r=>t.isPrefixOf(r))!==void 0||this.fieldTransforms.find(r=>t.isPrefixOf(r.field))!==void 0}vu(){if(this.path)for(let t=0;t<this.path.length;t++)this.Ou(this.path.get(t))}Ou(t){if(t.length===0)throw this.Bu("Document fields must not be empty");if(m7(this.Cu)&&zfe.test(t))throw this.Bu('Document fields cannot begin and end with "__"')}}class Bfe{constructor(t,r,n){this.databaseId=t,this.ignoreUndefinedProperties=r,this.serializer=n||g2(t)}Qu(t,r,n,a=!1){return new yE({Cu:t,methodName:r,qu:n,path:Qa.emptyPath(),xu:!1,ku:a},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Ufe(e){const t=e._freezeSettings(),r=g2(e._databaseId);return new Bfe(e._databaseId,!!t.ignoreUndefinedProperties,r)}class w2 extends hE{_toFieldTransform(t){if(t.Cu!==2)throw t.Cu===1?t.Bu(`${this._methodName}() can only appear at the top level of your update data`):t.Bu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof w2}}function Vfe(e,t,r,n){const a=e.Qu(1,t,r);p7("Data must be an object, but it was:",a,n);const i=[],o=Xs.empty();bf(n,(c,u)=>{const d=bE(t,c,r);u=es(u);const f=a.Nu(d);if(u instanceof w2)i.push(d);else{const m=j2(u,f);m!=null&&(i.push(d),o.set(d,m))}});const l=new lo(i);return new f7(o,l,a.fieldTransforms)}function Wfe(e,t,r,n,a,i){const o=e.Qu(1,t,r),l=[eL(t,n,r)],c=[a];if(i.length%2!=0)throw new Ht(st.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let m=0;m<i.length;m+=2)l.push(eL(t,i[m])),c.push(i[m+1]);const u=[],d=Xs.empty();for(let m=l.length-1;m>=0;--m)if(!Hfe(u,l[m])){const h=l[m];let p=c[m];p=es(p);const g=o.Nu(h);if(p instanceof w2)u.push(h);else{const y=j2(p,g);y!=null&&(u.push(h),d.set(h,y))}}const f=new lo(u);return new f7(d,f,o.fieldTransforms)}function j2(e,t){if(h7(e=es(e)))return p7("Unsupported field value:",t,e),qfe(e,t);if(e instanceof hE)return function(n,a){if(!m7(a.Cu))throw a.Bu(`${n._methodName}() can only be used with update() and set()`);if(!a.path)throw a.Bu(`${n._methodName}() is not currently supported inside arrays`);const i=n._toFieldTransform(a);i&&a.fieldTransforms.push(i)}(e,t),null;if(e===void 0&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.xu&&t.Cu!==4)throw t.Bu("Nested arrays are not supported");return function(n,a){const i=[];let o=0;for(const l of n){let c=j2(l,a.Lu(o));c==null&&(c={nullValue:"NULL_VALUE"}),i.push(c),o++}return{arrayValue:{values:i}}}(e,t)}return function(n,a){if((n=es(n))===null)return{nullValue:"NULL_VALUE"};if(typeof n=="number")return Due(a.serializer,n);if(typeof n=="boolean")return{booleanValue:n};if(typeof n=="string")return{stringValue:n};if(n instanceof Date){const i=Pa.fromDate(n);return{timestampValue:Gx(a.serializer,i)}}if(n instanceof Pa){const i=new Pa(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:Gx(a.serializer,i)}}if(n instanceof pE)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof ih)return{bytesValue:$U(a.serializer,n._byteString)};if(n instanceof _i){const i=a.databaseId,o=n.firestore._databaseId;if(!o.isEqual(i))throw a.Bu(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:JI(n.firestore._databaseId||a.databaseId,n._key.path)}}if(n instanceof gE)return function(o,l){return{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw l.Bu("VectorValues must only contain numeric values.");return YI(l.serializer,c)})}}}}}}(n,a);throw a.Bu(`Unsupported field value: ${cE(n)}`)}(e,t)}function qfe(e,t){const r={};return mU(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):bf(e,(n,a)=>{const i=j2(a,t.Mu(n));i!=null&&(r[n]=i)}),{mapValue:{fields:r}}}function h7(e){return!(typeof e!="object"||e===null||e instanceof Array||e instanceof Date||e instanceof Pa||e instanceof pE||e instanceof ih||e instanceof _i||e instanceof hE||e instanceof gE)}function p7(e,t,r){if(!h7(r)||!function(a){return typeof a=="object"&&a!==null&&(Object.getPrototypeOf(a)===Object.prototype||Ob
3062ject.getPrototypeOf(a)===null)}(r)){const n=cE(r);throw n==="an object"?t.Bu(e+" a custom object"):t.Bu(e+" "+n)}}function eL(e,t,r){if((t=es(t))instanceof x2)return t._internalPath;if(typeof t=="string")return bE(e,t);throw Qx("Field path arguments must be of type string or ",e,!1,void 0,r)}const Gfe=new RegExp("[~\\*/\\[\\]]");function bE(e,t,r){if(t.search(Gfe)>=0)throw Qx(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,r);try{return new x2(...t.split("."))._internalPath}catch{throw Qx(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,r)}}function Qx(e,t,r,n,a){const i=n&&!n.isEmpty(),o=a!==void 0;let l=`Function ${t}() called with invalid data`;r&&(l+=" (via `toFirestore()`)"),l+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${n}`),o&&(c+=` in document ${a}`),c+=")"),new Ht(st.INVALID_ARGUMENT,l+e+c)}function Hfe(e,t){return e.some(r=>r.isEqual(t))}/**
3063 * @license
3064 * Copyright 2020 Google LLC
3065 *
3066 * Licensed under the Apache License, Version 2.0 (the "License");
3067 * you may not use this file except in compliance with the License.
3068 * You may obtain a copy of the License at
3069 *
3070 *   http://www.apache.org/licenses/LICENSE-2.0
3071 *
3072 * Unless required by applicable law or agreed to in writing, software
3073 * distributed under the License is distributed on an "AS IS" BASIS,
3074 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3075 * See the License for the specific language governing permissions and
3076 * limitations under the License.
3077 */class g7{constructor(t,r,n,a,i){this._firestore=t,this._userDataWriter=r,this._key=n,this._document=a,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new _i(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const t=new Yfe(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const r=this._document.data.field(y7("DocumentSnapshot.get",t));if(r!==null)return this._userDataWriter.convertValue(r)}}}class Yfe extends g7{data(){return super.data()}}function y7(e,t){return typeof t=="string"?bE(e,t):t instanceof x2?t._internalPath:t._delegate._internalPath}class Qfe{convertValue(t,r="none"){switch(tf(t)){case 0:return null;case 1:return t.booleanValue;case 2:return ua(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,r);case 5:return t.stringValue;case 6:return this.convertBytes(ef(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,r);case 11:return this.convertObject(t.mapValue,r);case 10:return this.convertVectorValue(t.mapValue);default:throw ur()}}convertObject(t,r){return this.convertObjectMap(t.fields,r)}convertObjectMap(t,r="none"){const n={};return bf(t,(a,i)=>{n[a]=this.convertValue(i,r)}),n}convertVectorValue(t){var r,n,a;const i=(a=(n=(r=t.fields)===null||r===void 0?void 0:r.value.arrayValue)===null||n===void 0?void 0:n.values)===null||a===void 0?void 0:a.map(o=>ua(o.doubleValue));return new gE(i)}convertGeoPoint(t){return new pE(ua(t.latitude),ua(t.longitude))}convertArray(t,r){return(t.values||[]).map(n=>this.convertValue(n,r))}convertServerTimestamp(t,r){switch(r){case"previous":const n=VI(t);return n==null?null:this.convertValue(n,r);case"estimate":return this.convertTimestamp(m0(t));default:return null}}convertTimestamp(t){const r=ku(t);return new Pa(r.seconds,r.nanos)}convertDocumentKey(t,r){const n=sa.fromString(t);xn(WU(n));const a=new h0(n.get(1),n.get(3)),i=new Yt(n.popFirst(5));return a.isEqual(r)||sc(`Document ${i} contains a document reference within a different database (${a.projectId}/${a.database}) which is not supported. It will be treated as a reference in the current database (${r.projectId}/${r.database}) instead.`),i}}/**
3078 * @license
3079 * Copyright 2020 Google LLC
3080 *
3081 * Licensed under the Apache License, Version 2.0 (the "License");
3082 * you may not use this file except in compliance with the License.
3083 * You may obtain a copy of the License at
3084 *
3085 *   http://www.apache.org/licenses/LICENSE-2.0
3086 *
3087 * Unless required by applicable law or agreed to in writing, software
3088 * distributed under the License is distributed on an "AS IS" BASIS,
3089 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3090 * See the License for the specific language governing permissions and
3091 * limitations under the License.
3092 */class Kfe{constructor(t,r){this.hasPendingWrites=t,this.fromCache=r}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class b7 extends g7{constructor(t,r,n,a,i,o){super(t,r,n,a,o),this._firestore=t,this._firestoreImpl=t,this.metadata=i}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const r=new Jfe(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(r,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,r={}){if(this._document){const n=this._document.data.field(y7("DocumentSnapshot.get",t));if(n!==null)return this._userDataWriter.convertValue(n,r.serverTimestamps)}}}class Jfe extends b7{data(t={}){return super.data(t)}}/**
3093 * @license
3094 * Copyright 2020 Google LLC
3095 *
3096 * Licensed under the Apache License, Version 2.0 (the "License");
3097 * you may not use this file except in compliance with the License.
3098 * You may obtain a copy of the License at
3099 *
3100 *   http://www.apache.org/licenses/LICENSE-2.0
3101 *
3102 * Unless required by applicable law or agreed to in writing, software
3103 * distributed under the License is distributed on an "AS IS" BASIS,
3104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3105 * See the License for the specific language governing permissions and
3106 * limitations under the License.
3107 */function Zfe(e){e=b0(e,_i);const t=b0(e.firestore,mE);return Dfe(d7(t),e._key).then(r=>tme(t,e,r))}class Xfe extends Qfe{constructor(t){super(),this.firestore=t}convertBytes(t){return new ih(t)}convertReference(t){const r=this.convertDocumentKey(t,this.firestore._databaseId);return new _i(this.firestore,null,r)}}function v7(e,t,r,...n){e=b0(e,_i);const a=b0(e.firestore,mE),i=Ufe(a);let o;return o=typeof(t=es(t))=="string"||t instanceof x2?Wfe(i,"updateDoc",e._key,t,r,n):Vfe(i,"updateDoc",e._key,t),eme(a,[o.toMutation(e._key,Wl.exists(!0))])}function eme(e,t){return function(n,a){const i=new pu;return n.asyncQueue.enqueueAndForget(async()=>jfe(await _fe(n),a,i)),i.promise}(d7(e),t)}function tme(e,t,r){const n=r.docs.get(t._key),a=new Xfe(e);return new b7(e,a,t._key,n,new Kfe(r.hasPendingWrites,r.fromCache),t.converter)}(function(t,r=!0){(function(a){Xh=a})(Kh),Zm(new Jd("firestore",(n,{instanceIdentifier:a,options:i})=>{const o=n.getProvider("app").getImmediate(),l=new mE(new Jce(n.getProvider("auth-internal")),new tue(n.getProvider("app-check-internal")),function(u,d){if(!Object.prototype.hasOwnProperty.apply(u.options,["projectId"]))throw new Ht(st.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new h0(u.options.projectId,d)}(o,a),o);return i=Object.assign({useFetchStreams:r},i),l._setSettings(i),l},"PUBLIC").setMultipleInstances(!0)),hu(v3,"4.7.3",t),hu(v3,"4.7.3","esm2017")})();var rme="firebase",nme="10.14.1";/**
3108 * @license
3109 * Copyright 2020 Google LLC
3110 *
3111 * Licensed under the Apache License, Version 2.0 (the "License");
3112 * you may not use this file except in compliance with the License.
3113 * You may obtain a copy of the License at
3114 *
3115 *   http://www.apache.org/licenses/LICENSE-2.0
3116 *
3117 * Unless required by applicable law or agreed to in writing, software
3118 * distributed under the License is distributed on an "AS IS" BASIS,
3119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3120 * See the License for the specific language governing permissions and
3121 * limitations under the License.
3122 */hu(rme,nme,"app");const Gc=e=>{if(!e)return!1;const t=typeof e=="string"?e:e.message||"",r=e.name||"";return["Connection to Indexed Database server lost","IndexedDB","IDBDatabase","IDBTransaction","IDBRequest","QuotaExceededError","InvalidStateError","UnknownError","The operation failed for reasons unrelated to the database itself","The database connection is closing","The transaction was aborted"].some(a=>t.includes(a)||r.includes(a))},x7=e=>{const t=typeof e=="string"?e:e.message||"",r=e.name||"";return Gc(e)?t.includes("Connection to Indexed Database server lost")||t.includes("server lost")?{isIndexedDBError:!0,errorType:"connection_lost",userMe
3122ssage:"Database connection was lost. Please refresh the page to reconnect.",canRetry:!1,shouldRefresh:!0}:r==="QuotaExceededError"||t.includes("quota")?{isIndexedDBError:!0,errorType:"quota_exceeded",userMessage:"Browser storage is full. Please clear your browser data and refresh.",canRetry:!1,shouldRefresh:!0}:r==="BlockedError"||t.includes("blocked")?{isIndexedDBError:!0,errorType:"blocked",userMessage:"Database is blocked. Please close other tabs and refresh.",canRetry:!1,shouldRefresh:!0}:{isIndexedDBError:!0,errorType:"unknown",userMessage:"Database error occurred. Please refresh the page to continue.",canRetry:!1,shouldRefresh:!0}:{isIndexedDBError:!1,errorType:"unknown",userMessage:"An unexpected error occurred.",canRetry:!0,shouldRefresh:!1}},w7=async()=>{try{return"indexedDB"in window?((await new Promise((t,r)=>{const n=indexedDB.open("socialness-test-db",1);n.onerror=()=>r(n.error),n.onsuccess=()=>t(n.result),n.onupgradeneeded=a=>{const i=a.target.result;i.objectStoreNames.contains("test")||i.createObjectStore("test")}})).close(),await new Promise((t,r)=>{const n=indexedDB.deleteDatabase("socialness-test-db");n.onerror=()=>r(n.error),n.onsuccess=()=>t()}),!0):!1}catch(e){return console.error("IndexedDB recovery failed:",e),!1}},ame=e=>{const t=document.createElement("div");t.className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",t.innerHTML=`
3123    <div class="bg-white rounded-lg p-6 max-w-md mx-4 shadow-xl">
3124      <div class="flex items-center mb-4">
3125        <svg class="w-8 h-8 text-red-500 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
3126          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L4.314 15.5c-.77.833.192 2.5 1.732 2.5z"></path>
3127        </svg>
3128        <h2 class="text-lg font-semibold text-gray-900">Database Connection Issue</h2>
3129      </div>
3130      
3131      <p class="text-gray-600 mb-4">${e.userMessage}</p>
3132      
3133      <div class="flex justify-end space-x-3">
3134        ${e.canRetry?`
3135          <button id="retry-btn" class="px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50">
3136            Try Again
3137          </button>
3138        `:""}
3139        <button id="refresh-btn" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
3140          ${e.shouldRefresh?"Refresh Page":"OK"}
3141        </button>
3142      </div>
3143    </div>
3144  `,document.body.appendChild(t);const r=t.querySelector("#refresh-btn"),n=t.querySelector("#retry-btn");r==null||r.addEventListener("click",()=>{e.shouldRefresh?window.location.reload():document.body.removeChild(t)}),n==null||n.addEventListener("click",async()=>{if(await w7())document.body.removeChild(t),window.location.reload();else{const i=t.querySelector("#retry-btn");i&&(i.textContent="Recovery Failed",i.disabled=!0)}})},Ei=(e,t)=>{const r=x7(e);if(r.isIndexedDBError){if(console.error(`IndexedDB Error in ${t||"unknown context"}:`,e),window.Sentry)try{window.Sentry.captureException(e,{tags:{errorType:"indexeddb",errorSubtype:r.errorType,context:t||"unknown",userAgent:navigator.userAgent.
3144substring(0,100),url:window.location.pathname}})}catch(n){console.error("Failed to send IndexedDB error to Sentry:",n)}ame(r)}},sme={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_FIREBASE_API_KEY:"AIzaSyCmIJMficJ7_r-8kHyeBiVVfjoSQcJpnDc",VITE_FIREBASE_APP_ID:"1:309259310415:web:f9647da4c595f2854ba13a",VITE_FIREBASE_AUTH_DOMAIN:"socialness-dedba",VITE_FIREBASE_MESSAGING_SENDER_ID:"309259310415",VITE_FIREBASE_PROJECT_ID:"socialness-dedba",VITE_FIREBASE_STORAGE_BUCKET:"socialness-dedba.firebasestorage.app"},ime=["VITE_FIREBASE_API_KEY","VITE_FIREBASE_AUTH_DOMAIN","VITE_FIREBASE_PROJECT_ID","VITE_FIREBASE_STORAGE_BUCKET","VITE_FIREBASE_MESSAGING_SENDER_ID","VITE_FIREBASE_APP_ID"],tL=ime.filter(e=>!sme[e]);if(tL.length>0)throw new Error(`Missing required environment variables: ${tL.join(", ")}`);const ome={apiKey:"AIzaSyCmIJMficJ7_r-8kHyeBiVVfjoSQcJpnDc",authDomain:"socialness-dedba",projectId:"socialness-dedba",storageBucket:"socialness-dedba.firebasestorage.app",messagingSenderId:"309259310415",appId:"1:309259310415:web:f9647da4c595f2854ba13a"},j7=xB(ome);let Qe;try{Qe=Hce(j7)}catch(e){throw console.error("Failed to initialize Firebase Auth:",e),e}let vE;try{if(vE=v2(j7),typeof window<"u"){window.addEventListener("unhandledrejection",t=>{const r=t.reason;if(r&&typeof r=="object"){const n=r.message||"",a=r.code||"";(n.includes("IndexedDB")||n.includes("Connection to Indexed Database server lost")||a==="failed-precondition"||a==="unavailable")&&(console.error("Firestore IndexedDB error detected:",r),Ei(r,"firestore"),t.preventDefault())}});const e=console.error;console.error=(...t)=>{const r=t.join(" ");if(r.includes("Firestore")&&(r.includes("network")||r.includes("offline")||r.includes("unavailable"))){const n=new Error(r);Ei(n,"firestore-network")}e.apply(console,t)}}}catch(e){if(console.error("Failed to initialize Firestore:",e),e&&typeof e=="object"){const t=e.message||"";(t.includes("IndexedDB")||t.includes("database"))&&Ei(e,"firestore-init")}throw e}typeof window<"u"&&(window.addEventListener("online",()=>{console.log("Connection restored, Firestore should reconnect automatically")}),window.addEventListener("offline",()=>{console.log("Connection lost, Firestore will attempt to reconnect when online")}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&console.log("Page visible again, checking connection health")}));const lme={},rL=e=>{let t;const r=new Set,n=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(p=>p(t,h))}},a=()=>t,c={setState:n,getState:a,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(lme?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,c);return c},cme=e=>e?rL(e):rL;var N7={exports:{}},S7={},C7={exports:{}},k7={};/**
3145 * @license React
3146 * use-sync-external-store-shim.production.js
3147 *
3148 * Copyright (c) Meta Platforms, Inc. and affiliates.
3149 *
3150 * This source code is licensed under the MIT license found in the
3151 * LICENSE file in the root directory of this source tree.
3152 */var oh=b;function ume(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dme=typeof Object.is=="function"?Object.is:ume,fme=oh.useState,mme=oh.useEffect,hme=oh.useLayoutEffect,pme=oh.useDebugValue;function gme(e,t){var r=t(),n=fme({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return hme(function(){a.value=r,a.getSnapshot=t,zN(a)&&i({inst:a})},[e,r,t]),mme(function(){return zN(a)&&i({inst:a}),e(function(){zN(a)&&i({inst:a})})},[e]),pme(r),r}function zN(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dme(e,r)}catch{return!0}}function yme(e,t){return t()}var bme=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yme:gme;k7.useSyncExternalStore=oh.useSyncExternalStore!==void 0?oh.useSyncExternalStore:bme;C7.exports=k7;var vme=C7.exports;/**
3153 * @license React
3154 * use-sync-external-store-shim/with-selector.production.js
3155 *
3156 * Copyright (c) Meta Platforms, Inc. and affiliates.
3157 *
3158 * This source code is licensed under the MIT license found in the
3159 * LICENSE file in the root directory of this source tree.
3160 */var N2=b,xme=vme;function wme(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jme=typeof Object.is=="function"?Object.is:wme,Nme=xme.useSyncExternalStore,Sme=N2.useRef,Cme=N2.useEffect,kme=N2.useMemo,Mme=N2.useDebugValue;S7.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=Sme(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=kme(function(){function c(h){if(!u){if(u=!0,d=h,h=n(h),a!==void 0&&o.hasValue){var p=o.value;if(a(p,h))return f=p}return f=h}if(p=f,jme(d,h))return p;var g=n(h);return a!==void 0&&a(p,g)?(d=h,p):(d=h,f=g)}var u=!1,d,f,m=r===void 0?null:r;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,r,n,a]);var l=Nme(e,i[0],i[1]);return Cme(function(){o.hasValue=!0,o.value=l},[l]),Mme(l),l};N7.exports=S7;var Ime=N7.exports;const Eme=hn(Ime),M7={},{useDebugValue:Tme}=U,{useSyncExternalStoreWithSelector:Ame}=Eme;let nL=!1;const Pme=e=>e;function _me(e,t=Pme,r){(M7?"production":void 0)!=="production"&&r&&!nL&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),nL=!0);const n=Ame(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Tme(n),n}const aL=e=>
3160{(M7?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?cme(e):e,r=(n,a)=>_me(t,n,a);return Object.assign(r,t),r},wf=e=>e?aL(e):aL,Ps=wf(e=>({user:null,isLoading:!0,setUser:t=>e({user:t}),setLoading:t=>e({isLoading:t}),clearStore:()=>e({user:null,isLoading:!1})})),I7={capture:(e,t)=>{},identify:()=>{},reset:()=>{},register:()=>{},opt_in_capturing:()=>{},opt_out_capturing:()=>{},isFeatureEnabled:()=>!1,getFeatureFlag:()=>{},reloadFeatureFlags:()=>Promise.resolve(),init:(e,t)=>I7};let Oo={...I7};const Lme=async()=>{if(console.log("Initializing PostHog..."),console.log("Environment:","production"),console.log("PROD:",!0),typeof navigator<"u"&&navigator.doNotTrack==="1"||typeof window<"u"&&(window.doNotTrack==="1"||window.msDoNotTrack==="1")){console.warn("DNT enabled - skipping PostHog initialization");return}console.log("PostHog Configuration Status:",{hasApiKey:!1,apiHost:"https://eu.i.posthog.com",environment:"production"});{console.warn("PostHog API key is missing. Analytics will be disabled.");return}},S2=(e,...t)=>{try{if(typeof Oo>"u"||typeof Oo[e]!="function"){console.warn(`PostHog or method ${e} not initialized yet. Operation queued.`),setTimeout(()=>{typeof Oo<"u"&&typeof Oo[e]=="function"?Oo[e](...t):console.error(`PostHog or method ${e} still not initialized after delay`)},1e3);return}return Oo[e](...t)}catch(r){return console.error(`PostHog error calling ${e}:`,r),null}},Nk=(e,t,r)=>{const n=`${e}_${t}`;S2("capture",n,{category:e,action:t,...r})},E7=(e,t={})=>{S2("identify",e,{distinct_id:e,$set:{email:t.email,name:t.name,role:t.role||"user",last_login:t.lastLoginAt||new Date().toISOString(),is_new_user:t.isNewUser,$email:t.email,$name:t.name,$initial_os:"web",$initial_browser:navigator.userAgent,$initial_device_type:"web",$initial_referrer:document.referrer,$initial_referring_domain:document.referrer?new URL(document.referrer).hostname:"",$initial_current_url:window.location.href},$set_once:{first_login:new Date().toISOString(),created_at:t.createdAt||new Date().toISOString()}}),Nk("user","login",{distinct_id:e,user_id:e,email:t.email,name:t.name,is_new_user:t.isNewUser,role:t.role||"user"})},Dme=()=>{let e=null;if(typeof Oo<"u"&&typeof Oo.get_distinct_id=="function")try{e=Oo.get_distinct_id()}catch(t){console.warn("PostHog: Could not get distinct_id before reset.",t)}else console.warn("PostHog: get_distinct_id function not available when attempting reset.");e?Nk("user","logout",{distinct_id:e}):Nk("user","logout",{}),S2("reset",!0)},sL=(e,t)=>{S2("capture","$pageview",{page:e,...t})},Ome=({children:e})=>{const{user:t,isLoading:r}=Ps(),n=vs();if(b.useEffect(()=>{t?E7(t.id,{email:t.email,name:t.name,role:t.role}):Dme()},[t]),r)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});if(!t&&!n.pathname.startsWith("/auth")){const a=`/auth/login${n.search}`;return s.jsx(Bl,{to:a,state:{from:n},replace:!0})}return t&&n.pathname.startsWith("/auth")?s.jsx(Bl,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:e})};/**
3161 * @license lucide-react v0.344.0 - ISC
3162 *
3163 * This source code is licensed under the ISC license.
3164 * See the LICENSE file in the root directory of this source tree.
3165 */var Rme={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
3166 * @license lucide-react v0.344.0 - ISC
3167 *
3168 * This source code is licensed under the ISC license.
3169 * See the LICENSE file in the root directory of this source tree.
3170 */const $me=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),He=(e,t)=>{const r=b.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},d)=>b.createElement("svg",{ref:d,...Rme,width:a,height:a,stroke:n,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${$me(e)}`,l].join(" "),...u},[...t.map(([f,m])=>
3170b.createElement(f,m)),...Array.isArray(c)?c:[c]]));return r.displayName=`${e}`,r};/**
3171 * @license lucide-react v0.344.0 - ISC
3172 *
3173 * This source code is licensed under the ISC license.
3174 * See the LICENSE file in the root directory of this source tree.
3175 */const bs=He("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
3176 * @license lucide-react v0.344.0 - ISC
3177 *
3178 * This source code is licensed under the ISC license.
3179 * See the LICENSE file in the root directory of this source tree.
3180 */const qs=He("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
3181 * @license lucide-react v0.344.0 - ISC
3182 *
3183 * This source code is licensed under the ISC license.
3184 * See the LICENSE file in the root directory of this source tree.
3185 */const Fme=He("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
3186 * @license lucide-react v0.344.0 - ISC
3187 *
3188 * This source code is licensed under the ISC license.
3189 * See the LICENSE file in the root directory of this source tree.
3190 */const Mo=He("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/**
3191 * @license lucide-react v0.344.0 - ISC
3192 *
3193 * This source code is licensed under the ISC license.
3194 * See the LICENSE file in the root directory of this source tree.
3195 */const zme=He("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/**
3196 * @license lucide-react v0.344.0 - ISC
3197 *
3198 * This source code is licensed under the ISC license.
3199 * See the LICENSE file in the root directory of this source tree.
3200 */const lh=He("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
3201 * @license lucide-react v0.344.0 - ISC
3202 *
3203 * This source code is licensed under the ISC license.
3204 * See the LICENSE file in the root directory of this source tree.
3205 */const Jy=He("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
3206 * @license lucide-react v0.344.0 - ISC
3207 *
3208 * This source code is licensed under the ISC license.
3209 * See the LICENSE file in the root directory of this source tree.
3210 */const Bme=He("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
3211 * @license lucide-react v0.344.0 - ISC
3212 *
3213 * This source code is licensed under the ISC license.
3214 * See the LICENSE file in the root directory of this source tree.
3215 */const Io=He("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
3216 * @license lucide-react v0.344.0 - ISC
3217 *
3218 * This source code is licensed under the ISC license.
3219 * See the LICENSE file in the root directory of this source tree.
3220 */const xE=He("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
3221 * @license lucide-react v0.344.0 - ISC
3222 *
3223 * This source code is licensed under the ISC license.
3224 * See the LICENSE file in the root directory of this source tree.
3225 */const Bf=He("BarChart",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}
3225],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/**
3226 * @license lucide-react v0.344.0 - ISC
3227 *
3228 * This source code is licensed under the ISC license.
3229 * See the LICENSE file in the root directory of this source tree.
3230 */const Ume=He("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]);/**
3231 * @license lucide-react v0.344.0 - ISC
3232 *
3233 * This source code is licensed under the ISC license.
3234 * See the LICENSE file in the root directory of this source tree.
3235 */const Kx=He("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
3236 * @license lucide-react v0.344.0 - ISC
3237 *
3238 * This source code is licensed under the ISC license.
3239 * See the LICENSE file in the root directory of this source tree.
3240 */const x0=He("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
3241 * @license lucide-react v0.344.0 - ISC
3242 *
3243 * This source code is licensed under the ISC license.
3244 * See the LICENSE file in the root directory of this source tree.
3245 */const Vme=He("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
3246 * @license lucide-react v0.344.0 - ISC
3247 *
3248 * This source code is licensed under the ISC license.
3249 * See the LICENSE file in the root directory of this source tree.
3250 */const Wme=He("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
3251 * @license lucide-react v0.344.0 - ISC
3252 *
3253 * This source code is licensed under the ISC license.
3254 * See the LICENSE file in the root directory of this source tree.
3255 */const vo=He("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
3256 * @license lucide-react v0.344.0 - ISC
3257 *
3258 * This source code is licensed under the ISC license.
3259 * See the LICENSE file in the root directory of this source tree.
3260 */const Nm=He("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
3261 * @license lucide-react v0.344.0 - ISC
3262 *
3263 * This source code is licensed under the ISC license.
3264 * See the LICENSE file in the root directory of this source tree.
3265 */const Ba=He("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
3266 * @license lucide-react v0.344.0 - ISC
3267 *
3268 * This source code is licensed under the ISC license.
3269 * See the LICENSE file in the root directory of this source tree.
3270 */const iL=He("CheckSquare",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);/**
3271 * @license lucide-react v0.344.0 - ISC
3272 *
3273 * This source code is licensed under the ISC license.
3274 * See the LICENSE file in the root directory of this source tree.
3275 */const ma=He("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
3276 * @license lucide-react v0.344.0 - ISC
3277 *
3278 * This source code is licensed under the ISC license.
3279 * See the LICENSE file in the root directory of this source tree.
3280 */const Vr=He("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
3281 * @license lucide-react v0.344.0 - ISC
3282 *
3283 * This source code is licensed under the ISC license.
3284 * See the LICENSE file in the root directory of this source tree.
3285 */const wE=He("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
3286 * @license lucide-react v0.344.0 - ISC
3287 *
3288 * This source code is licensed under the ISC license.
3289 * See the LICENSE file in the root directory of this source tree.
3290 */const jE=He("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
3291 * @license lucide-react v0.344.0 - ISC
3292 *
3293 * This source code is licensed under the ISC license.
3294 * See the LICENSE file in the root directory of this source tree.
3295 */const T7=He("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
3296 * @license lucide-react v0.344.0 - ISC
3297 *
3298 * This source code is licensed under the ISC license.
3299 * See the LICENSE file in the root directory of this source tree.
3300 */const BN=He("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
3301 * @license lucide-react v0.344.0 - ISC
3302 *
3303 * This source code is licensed under the ISC license.
3304 * See the LICENSE file in the root directory of this source tree.
3305 */const ql=He("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
3306 * @license lucide-react v0.344.0 - ISC
3307 *
3308 * This source code is licensed under the ISC license.
3309 * See the LICENSE file in the root directory of this source tree.
3310 */const Iu=He("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
3311 * @license lucide-react v0.344.0 - ISC
3312 *
3313 * This source code is licensed under the ISC license.
3314 * See the LICENSE file in the root directory of this source tree.
3315 */const qg=He("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
3316 * @license lucide-react v0.344.0 - ISC
3317 *
3318 * This source code is licensed under the ISC license.
3319 * See the LICENSE file in the root directory of this source tree.
3320 */const oL=He("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
3321 * @license lucide-react v0.344.0 - ISC
3322 *
3323 * This source code is licensed under the ISC license.
3324 * See the LICENSE file in the root directory of this source tree.
3325 */const lL=He("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
3326 * @license lucide-react v0.344.0 - ISC
3327 *
3328 * This source code is licensed under the ISC license.
3329 * See the LICENSE file in the root directory of this source tree.
3330 */const yd=He("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
3331 * @license lucide-react v0.344.0 - ISC
3332 *
3333 * This source code is licensed under the ISC license.
3334 * See the LICENSE file in the root directory of this source tree.
3335 */const C2=He("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
3336 * @license lucide-react v0.344.0 - ISC
3337 *
3338 * This source code is licensed under the ISC license.
3339 * See the LICENSE file in the root directory of this source tree.
3340 */const ch=He("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
3341 * @license lucide-react v0.344.0 - ISC
3342 *
3343 * This source code is licensed under the ISC license.
3344 * See the LICENSE file in the root directory of this source tree.
3345 */const xa=He("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
3346 * @license lucide-react v0.344.0 - ISC
3347 *
3348 * This source code is licensed under the ISC license.
3349 * See the LICENSE file in the root directory of this source tree.
3350 */const qme=He("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
3351 * @license lucide-react v0.344.0 - ISC
3352 *
3353 * This source code is licensed under the ISC license.
3354 * See the LICENSE file in the root directory of this source tree.
3355 */const da=He("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
3356 * @license lucide-react v0.344.0 - ISC
3357 *
3358 * This source code is licensed under the ISC license.
3359 * See the LICENSE file in the root directory of this source tree.
3360 */const A7=He("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
3361 * @license lucide-react v0.344.0 - ISC
3362 *
3363 * This source code is licensed under the ISC license.
3364 * See the LICENSE file in the root directory of this source tree.
3365 */const k2=He("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
3366 * @license lucide-react v0.344.0 - ISC
3367 *
3368 * This source code is licensed under the ISC license.
3369 * See the LICENSE file in the root directory of this source tree.
3370 */const cL=He("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
3371 * @license lucide-react v0.344.0 - ISC
3372 *
3373 * This source code is licensed under the ISC license.
3374 * See the LICENSE file in the root directory of this source tree.
3375 */const Zs=He("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
3376 * @license lucide-react v0.344.0 - ISC
3377 *
3378 * This source code is licensed under the ISC license.
3379 * See the LICENSE file in the root directory of this source tree.
3380 */const P7=He("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
3381 * @license lucide-react v0.344.0 - ISC
3382 *
3383 * This source code is licensed under the ISC license.
3384 * See the LICENSE file in the root directory of this source tree.
3385 */const Sk=He("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
3385]]);/**
3386 * @license lucide-react v0.344.0 - ISC
3387 *
3388 * This source code is licensed under the ISC license.
3389 * See the LICENSE file in the root directory of this source tree.
3390 */const w0=He("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
3391 * @license lucide-react v0.344.0 - ISC
3392 *
3393 * This source code is licensed under the ISC license.
3394 * See the LICENSE file in the root directory of this source tree.
3395 */const rf=He("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
3396 * @license lucide-react v0.344.0 - ISC
3397 *
3398 * This source code is licensed under the ISC license.
3399 * See the LICENSE file in the root directory of this source tree.
3400 */const uh=He("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
3401 * @license lucide-react v0.344.0 - ISC
3402 *
3403 * This source code is licensed under the ISC license.
3404 * See the LICENSE file in the root directory of this source tree.
3405 */const Gme=He("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
3406 * @license lucide-react v0.344.0 - ISC
3407 *
3408 * This source code is licensed under the ISC license.
3409 * See the LICENSE file in the root directory of this source tree.
3410 */const Hme=He("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
3411 * @license lucide-react v0.344.0 - ISC
3412 *
3413 * This source code is licensed under the ISC license.
3414 * See the LICENSE file in the root directory of this source tree.
3415 */const Yme=He("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
3416 * @license lucide-react v0.344.0 - ISC
3417 *
3418 * This source code is licensed under the ISC license.
3419 * See the LICENSE file in the root directory of this source tree.
3420 */const NE=He("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
3421 * @license lucide-react v0.344.0 - ISC
3422 *
3423 * This source code is licensed under the ISC license.
3424 * See the LICENSE file in the root directory of this source tree.
3425 */const Fs=He("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
3426 * @license lucide-react v0.344.0 - ISC
3427 *
3428 * This source code is licensed under the ISC license.
3429 * See the LICENSE file in the root directory of this source tree.
3430 */const Qme=He("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
3431 * @license lucide-react v0.344.0 - ISC
3432 *
3433 * This source code is licensed under the ISC license.
3434 * See the LICENSE file in the root directory of this source tree.
3435 */const Jx=He("Link2Off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
3436 * @license lucide-react v0.344.0 - ISC
3437 *
3438 * This source code is licensed under the ISC license.
3439 * See the LICENSE file in the root directory of this source tree.
3440 */const j0=He("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
3441 * @license lucide-react v0.344.0 - ISC
3442 *
3443 * This source code is licensed under the ISC license.
3444 * See the LICENSE file in the root directory of this source tree.
3445 */const Ti=He("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
3446 * @license lucide-react v0.344.0 - ISC
3447 *
3448 * This source code is licensed under the ISC license.
3449 * See the LICENSE file in the root directory of this source tree.
3450 */const Kme=He("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
3451 * @license lucide-react v0.344.0 - ISC
3452 *
3453 * This source code is licensed under the ISC license.
3454 * See the LICENSE file in the root directory of this source tree.
3455 */const Jme=He("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
3456 * @license lucide-react v0.344.0 - ISC
3457 *
3458 * This source code is licensed under the ISC license.
3459 * See the LICENSE file in the root directory of this source tree.
3460 */const _7=He("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
3461 * @license lucide-react v0.344.0 - ISC
3462 *
3463 * This source code is licensed under the ISC license.
3464 * See the LICENSE file in the root directory of this source tree.
3465 */const Rn=He("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
3466 * @license lucide-react v0.344.0 - ISC
3467 *
3468 * This source code is licensed under the ISC license.
3469 * See the LICENSE file in the root directory of this source tree.
3470 */const uL=He("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
3471 * @license lucide-react v0.344.0 - ISC
3472 *
3473 * This source code is licensed under the ISC license.
3474 * See the LICENSE file in the root directory of this source tree.
3475 */const N0=He("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
3476 * @license lucide-react v0.344.0 - ISC
3477 *
3478 * This source code is licensed under the ISC license.
3479 * See the LICENSE file in the root directory of this source tree.
3480 */const Zme=He("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
3481 * @license lucide-react v0.344.0 - ISC
3482 *
3483 * This source code is licensed under the ISC license.
3484 * See the LICENSE file in the root directory of this source tree.
3485 */const Xme=He("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
3486 * @license lucide-react v0.344.0 - ISC
3487 *
3488 * This source code is licensed under the ISC license.
3489 * See the LICENSE file in the root directory of this source tree.
3490 */const rp=He("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
3491 * @license lucide-react v0.344.0 - ISC
3492 *
3493 * This source code is licensed under the ISC license.
3494 * See the LICENSE file in the root directory of this source tree.
3495 */const dL=He("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
3496 * @license lucide-react v0.344.0 - ISC
3497 *
3498 * This source code is licensed under the ISC license.
3499 * See the LICENSE file in the root directory of this source tree.
3500 */const ehe=He("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
3501 * @license lucide-react v0.344.0 - ISC
3502 *
3503 * This source code is licensed under the ISC license.
3504 * See the LICENSE file in the root directory of this source tree.
3505 */const sl=He("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
3506 * @license lucide-react v0.344.0 - ISC
3507 *
3508 * This source code is licensed under the ISC license.
3509 * See the LICENSE file in the root directory of this source tree.
3510 */const jf=He("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
3511 * @license lucide-react v0.344.0 - ISC
3512 *
3513 * This source code is licensed under the ISC license.
3514 * See the LICENSE file in the root directory of this source tree.
3515 */const the=He("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
3516 * @license lucide-react v0.344.0 - ISC
3517 *
3518 * This source code is licensed under the ISC license.
3519 * See the LICENSE file in the root directory of this source tree.
3520 */const rhe=He("MinusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
3521 * @license lucide-react v0.344.0 - ISC
3522 *
3523 * This source code is licensed under the ISC license.
3524 * See the LICENSE file in the root directory of this source tree.
3525 */const oc=He("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
3526 * @license lucide-react v0.344.0 - ISC
3527 *
3528 * This source code is licensed under the ISC license.
3529 * See the LICENSE file in the root directory of this source tree.
3530 */const M2=He("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
3531 * @license lucide-react v0.344.0 - ISC
3532 *
3533 * This source code is licensed under the ISC license.
3534 * See the LICENSE file in the root directory of this source tree.
3535 */const UN=He("MousePointer",[["path",{d:"m3 3 7.07 16.97 2.51-7.39 7.39-2.51L3 3z",key:"y2ucgo"}],["path",{d:"m13 13 6 6",key:"1nhxnf"}]]);/**
3536 * @license lucide-react v0.344.0 - ISC
3537 *
3538 * This source code is licensed under the ISC license.
3539 * See the LICENSE file in the root directory of this source tree.
3540 */const SE=He("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
3541 * @license lucide-react v0.344.0 - ISC
3542 *
3543 * This source code is licensed under the ISC license.
3544 * See the LICENSE file in the root directory of this source tree.
3545 */const nhe=He("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}
3545],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M18.4 2.6a2.17 2.17 0 0 1 3 3L16 11l-4 1 1-4Z",key:"1dba1m"}]]);/**
3546 * @license lucide-react v0.344.0 - ISC
3547 *
3548 * This source code is licensed under the ISC license.
3549 * See the LICENSE file in the root directory of this source tree.
3550 */const VN=He("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
3551 * @license lucide-react v0.344.0 - ISC
3552 *
3553 * This source code is licensed under the ISC license.
3554 * See the LICENSE file in the root directory of this source tree.
3555 */const no=He("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
3556 * @license lucide-react v0.344.0 - ISC
3557 *
3558 * This source code is licensed under the ISC license.
3559 * See the LICENSE file in the root directory of this source tree.
3560 */const L7=He("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
3561 * @license lucide-react v0.344.0 - ISC
3562 *
3563 * This source code is licensed under the ISC license.
3564 * See the LICENSE file in the root directory of this source tree.
3565 */const Ck=He("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
3566 * @license lucide-react v0.344.0 - ISC
3567 *
3568 * This source code is licensed under the ISC license.
3569 * See the LICENSE file in the root directory of this source tree.
3570 */const WN=He("Pin",[["line",{x1:"12",x2:"12",y1:"17",y2:"22",key:"1jrz49"}],["path",{d:"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z",key:"13yl11"}]]);/**
3571 * @license lucide-react v0.344.0 - ISC
3572 *
3573 * This source code is licensed under the ISC license.
3574 * See the LICENSE file in the root directory of this source tree.
3575 */const ahe=He("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
3576 * @license lucide-react v0.344.0 - ISC
3577 *
3578 * This source code is licensed under the ISC license.
3579 * See the LICENSE file in the root directory of this source tree.
3580 */const fL=He("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
3581 * @license lucide-react v0.344.0 - ISC
3582 *
3583 * This source code is licensed under the ISC license.
3584 * See the LICENSE file in the root directory of this source tree.
3585 */const I2=He("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
3586 * @license lucide-react v0.344.0 - ISC
3587 *
3588 * This source code is licensed under the ISC license.
3589 * See the LICENSE file in the root directory of this source tree.
3590 */const she=He("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
3591 * @license lucide-react v0.344.0 - ISC
3592 *
3593 * This source code is licensed under the ISC license.
3594 * See the LICENSE file in the root directory of this source tree.
3595 */const tn=He("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
3596 * @license lucide-react v0.344.0 - ISC
3597 *
3598 * This source code is licensed under the ISC license.
3599 * See the LICENSE file in the root directory of this source tree.
3600 */const D7=He("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
3601 * @license lucide-react v0.344.0 - ISC
3602 *
3603 * This source code is licensed under the ISC license.
3604 * See the LICENSE file in the root directory of this source tree.
3605 */const ai=He("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
3606 * @license lucide-react v0.344.0 - ISC
3607 *
3608 * This source code is licensed under the ISC license.
3609 * See the LICENSE file in the root directory of this source tree.
3610 */const O7=He("Repeat2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);/**
3611 * @license lucide-react v0.344.0 - ISC
3612 *
3613 * This source code is licensed under the ISC license.
3614 * See the LICENSE file in the root directory of this source tree.
3615 */const ihe=He("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
3615kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
3616 * @license lucide-react v0.344.0 - ISC
3617 *
3618 * This source code is licensed under the ISC license.
3619 * See the LICENSE file in the root directory of this source tree.
3620 */const il=He("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
3621 * @license lucide-react v0.344.0 - ISC
3622 *
3623 * This source code is licensed under the ISC license.
3624 * See the LICENSE file in the root directory of this source tree.
3625 */const $i=He("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
3626 * @license lucide-react v0.344.0 - ISC
3627 *
3628 * This source code is licensed under the ISC license.
3629 * See the LICENSE file in the root directory of this source tree.
3630 */const nf=He("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
3631 * @license lucide-react v0.344.0 - ISC
3632 *
3633 * This source code is licensed under the ISC license.
3634 * See the LICENSE file in the root directory of this source tree.
3635 */const ohe=He("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
3636 * @license lucide-react v0.344.0 - ISC
3637 *
3638 * This source code is licensed under the ISC license.
3639 * See the LICENSE file in the root directory of this source tree.
3640 */const li=He("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
3641 * @license lucide-react v0.344.0 - ISC
3642 *
3643 * This source code is licensed under the ISC license.
3644 * See the LICENSE file in the root directory of this source tree.
3645 */const mL=He("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
3646 * @license lucide-react v0.344.0 - ISC
3647 *
3648 * This source code is licensed under the ISC license.
3649 * See the LICENSE file in the root directory of this source tree.
3650 */const R7=He("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
3651 * @license lucide-react v0.344.0 - ISC
3652 *
3653 * This source code is licensed under the ISC license.
3654 * See the LICENSE file in the root directory of this source tree.
3655 */const Hn=He("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
3656 * @license lucide-react v0.344.0 - ISC
3657 *
3658 * This source code is licensed under the ISC license.
3659 * See the LICENSE file in the root directory of this source tree.
3660 */const S0=He("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
3661 * @license lucide-react v0.344.0 - ISC
3662 *
3663 * This source code is licensed under the ISC license.
3664 * See the LICENSE file in the root directory of this source tree.
3665 */const $7=He("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
3666 * @license lucide-react v0.344.0 - ISC
3667 *
3668 * This source code is licensed under the ISC license.
3669 * See the LICENSE file in the root directory of this source tree.
3670 */const Fc=He("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
3671 * @license lucide-react v0.344.0 - ISC
3672 *
3673 * This source code is licensed under the ISC license.
3674 * See the LICENSE file in the root directory of this source tree.
3675 */const hL=He("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z",key:"s6e0r"}]]);/**
3676 * @license lucide-react v0.344.0 - ISC
3677 *
3678 * This source code is licensed under the ISC license.
3679 * See the LICENSE file in the root directory of this source tree.
3680 */const co=He("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z",key:"y3tblf"}]]);/**
3681 * @license lucide-react v0.344.0 - ISC
3682 *
3683 * This source code is licensed under the ISC license.
3684 * See the LICENSE file in the root directory of this source tree.
3685 */const lc=He("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
3686 * @license lucide-react v0.344.0 - ISC
3687 *
3688 * This source code is licensed under the ISC license.
3689 * See the LICENSE file in the root directory of this source tree.
3690 */const Tg=He("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
3691 * @license lucide-react v0.344.0 - ISC
3692 *
3693 * This source code is licensed under the ISC license.
3694 * See the LICENSE file in the root directory of this source tree.
3695 */const C0=He("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
3696 * @license lucide-react v0.344.0 - ISC
3697 *
3698 * This source code is licensed under the ISC license.
3699 * See the LICENSE file in the root directory of this source tree.
3700 */const lhe=He("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
3701 * @license lucide-react v0.344.0 - ISC
3702 *
3703 * This source code is licensed under the ISC license.
3704 * See the LICENSE file in the root directory of this source tree.
3705 */const Zy=He("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
3706 * @license lucide-react v0.344.0 - ISC
3707 *
3708 * This source code is licensed under the ISC license.
3709 * See the LICENSE file in the root directory of this source tree.
3710 */const pL=He("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
3711 * @license lucide-react v0.344.0 - ISC
3712 *
3713 * This source code is licensed under the ISC license.
3714 * See the LICENSE file in the root directory of this source tree.
3715 */const kk=He("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
3716 * @license lucide-react v0.344.0 - ISC
3717 *
3718 * This source code is licensed under the ISC license.
3719 * See the LICENSE file in the root directory of this source tree.
3720 */const Fi=He("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
3721 * @license lucide-react v0.344.0 - ISC
3722 *
3723 * This source code is licensed under the ISC license.
3724 * See the LICENSE file in the root directory of this source tree.
3725 */const che=He("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
3726 * @license lucide-react v0.344.0 - ISC
3727 *
3728 * This source code is licensed under the ISC license.
3729 * See the LICENSE file in the root directory of this source tree.
3730 */const Jr=He("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
3731 * @license lucide-react v0.344.0 - ISC
3732 *
3733 * This source code is licensed under the ISC license.
3734 * See the LICENSE file in the root directory of this source tree.
3735 */const CE=He("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]);/**
3736 * @license lucide-react v0.344.0 - ISC
3737 *
3738 * This source code is licensed under the ISC license.
3739 * See the LICENSE file in the root directory of this source tree.
3740 */const Eu=He("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
3741 * @license lucide-react v0.344.0 - ISC
3742 *
3743 * This source code is licensed under the ISC license.
3744 * See the LICENSE file in the root directory of this source tree.
3745 */const uhe=He("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
3745],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
3746 * @license lucide-react v0.344.0 - ISC
3747 *
3748 * This source code is licensed under the ISC license.
3749 * See the LICENSE file in the root directory of this source tree.
3750 */const gL=He("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
3751 * @license lucide-react v0.344.0 - ISC
3752 *
3753 * This source code is licensed under the ISC license.
3754 * See the LICENSE file in the root directory of this source tree.
3755 */const E2=He("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
3756 * @license lucide-react v0.344.0 - ISC
3757 *
3758 * This source code is licensed under the ISC license.
3759 * See the LICENSE file in the root directory of this source tree.
3760 */const _t=He("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
3761 * @license lucide-react v0.344.0 - ISC
3762 *
3763 * This source code is licensed under the ISC license.
3764 * See the LICENSE file in the root directory of this source tree.
3765 */const F7=He("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
3766 * @license lucide-react v0.344.0 - ISC
3767 *
3768 * This source code is licensed under the ISC license.
3769 * See the LICENSE file in the root directory of this source tree.
3770 */const dhe=He("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),fhe=({message:e,type:t="info",onClose:r,duration:n=5e3,isOpen:a})=>{const[i,o]=b.useState(!1);if(b.useEffect(()=>{if(a){o(!0);const u=setTimeout(()=>{o(!1),setTimeout(r,300)},n);return()=>clearTimeout(u)}},[a,n,r]),!a&&!i)return null;const l=()=>{switch(t){case"success":return s.jsx(Ba,{className:"w-5 h-5 text-white"});case"error":return s.jsx(bs,{className:"w-5 h-5 text-white"});case"info":default:return s.jsx(uh,{className:"w-5 h-5 text-white"})}},c=()=>{switch(t){case"success":return"bg-green-600";case"error":return"bg-red-600";case"info":default:return"bg-primary-600"}};return s.jsx("div",{className:`fixed top-4 right-4 z-50 transition-all duration-300 ${i?"opacity-100 translate-y-0":"opacity-0 -translate-y-4"}`,children:s.jsxs("div",{className:`flex items-center p-4 rounded-lg shadow-lg ${c()}`,children:[s.jsx("div",{className:"flex-shrink-0 mr-3",children:l()}),s.jsx("div",{className:"mr-8 text-white",children:e}),s.jsx("button",{onClick:()=>{o(!1),setTimeout(r,300)},className:"ml-auto text-white hover:text-gray-200",children:s.jsx(_t,{className:"w-5 h-5"})})]})})},z7=b.createContext(void 0),mhe=({children:e})=>{const[t,r]=b.useState({message:"",type:"info",isOpen:!1}),n=(i,o="info")=>{r({message:i,type:o,isOpen:!0})},a=()=>{r(i=>({...i,isOpen:!1}))};return s.jsxs(z7.Provider,{value:{showToast:n,hideToast:a}
3770,children:[e,s.jsx(fhe,{message:t.message,type:t.type,isOpen:t.isOpen,onClose:a})]})},bc=()=>{const e=b.useContext(z7);if(e===void 0)throw new Error("useToast must be used within a ToastProvider");return e},hhe=b.createContext(null),phe=({children:e})=>s.jsx(hhe.Provider,{value:Oo,children:e}),oa=()=>Wa({queryKey:["brands"],staleTime:30*1e3,gcTime:60*1e3,queryFn:async()=>{var r;const e=await((r=Qe.currentUser)==null?void 0:r.getIdToken());if(!e)throw new Error("No authentication token available");const t=await fetch("https://api.socialness.ai/management/brands",{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch brands");return t.json()}}),B7=b.createContext({currentBrandId:void 0,setCurrentBrandId:()=>{}}),ghe=({children:e})=>{const[t,r]=b.useState(void 0),{data:n}=oa();return b.useEffect(()=>{var a;!t&&n&&((a=n.brands)==null?void 0:a.length)>0&&r(n.brands[0].id)},[n,t]),s.jsx(B7.Provider,{value:{currentBrandId:t,setCurrentBrandId:r},children:e})},yhe=()=>b.useContext(B7),bhe=e=>{var r;if((r=window.$chatwoot)!=null&&r.hasLoaded){e(window.$chatwoot);return}const t=()=>{var n;(n=window.$chatwoot)!=null&&n.hasLoaded&&(window.removeEventListener("chatwoot:ready",t),e(window.$chatwoot))};return window.addEventListener("chatwoot:ready",t),()=>window.removeEventListener("chatwoot:ready",t)},vhe=()=>{const{user:e}=Ps(),t=b.useRef(null);return b.useEffect(()=>{var n;if(!e){if(t.current){t.current=null;try{(n=window.$chatwoot)==null||n.reset()}catch(a){console.error("Chatwoot: failed to reset the session",a)}}return}return t.current===e.id?void 0:bhe(a=>{var i;try{a.setUser(e.id,{email:e.email,name:e.name||e.firstName||((i=e.email)==null?void 0:i.split("@")[0])||"",...e.photoURL?{avatar_url:e.photoURL}:{}}),t.current=e.id}catch(o){console.error("Chatwoot: failed to identify the user",o)}})},[e]),null};var xhe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const whe=hn(xhe);var jhe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function yL(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(t.name=r[1],(whe[r[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("-->");return{type:"comment",comment:n!==-1?e.slice(4,n):""}}for(var a=new RegExp(jhe),i=null;(i=a.exec(e))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),t.attrs[l[0]]=l[1],a.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var Nhe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,She=/^\s*$/,Che=Object.create(null);function U7(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(r){var n=[];for(var a in r)n.push(a+'="'+r[a]+'"');return n.length?" "+n.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(U7,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var khe={parse:function(e,t){t||(t={}),t.components||(t.components=Che);var r,n=[],a=[],i=-1,o=!1;if(e.indexOf("<")!==0){var l=e.indexOf("<");n.push({type:"text",content:l===-1?e:e.substring(0,l)})}return e.replace(Nhe,function(c,u){if(o){if(c!=="</"+r.name+">")return;o=!1}var d,f=c.charAt(1)!=="/",m=c.startsWith("<!--"),h=u+c.length,p=e.charAt(h);if(m){var g=yL(c);return i<0?(n.push(g),n):((d=a[i]).children.push(g),n)}if(f&&(i++,(r=yL(c)).type==="tag"&&t.components[r.name]&&(r.type="component",o=!0),r.voidElement||o||!p||p==="<"||r.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),i===0&&n.push(r),(d=a[i-1])&&d.children.push(r),a[i]=r),(!f||r.voidElement)&&(i>-1&&(r.voidElement||r.name===c.slice(2,-1))&&(i--,r=i===-1?n:a[i]),!o&&p!=="<"&&p)){d=i===-1?n:a[i].children;var y=e.indexOf("<",h),v=e.slice(h,y===-1?void 0:y);She.test(v)&&(v=" "),(y>-1&&i+d.length>=0||v!==" ")&&d.push({type:"text",content:v})}}),n},stringify:function(e){return e.reduce(function(t,r){return t+U7("",r)},"")}};function Hv(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Li(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const bL={};function Zx(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Li(t[0])&&bL[t[0]]||(Li(t[0])&&(bL[t[0]]=new Date),Hv(...t))}const V7=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},vL=(e,t,r)=>{e.loadNamespaces(t,V7(e,r))},xL=(e,t,r,n)=>{Li(r)&&(r=[r]),r.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,V7(e,n))},Mhe=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=t.languages[0],a=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=t.services.backendConnector.state[`${l}|${c}`];return u===-1||u===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!a||o(i,e)))},Ihe=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};
3770return!t.languages||!t.languages.length?(Zx("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:r.lng,precheck:(a,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!i(a.isLanguageChangingTo,e))return!1}}):Mhe(e,t,r)},Li=e=>typeof e=="string",fm=e=>typeof e=="object"&&e!==null,Ehe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,The={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ahe=e=>The[e],Phe=e=>e.replace(Ehe,Ahe);let Mk={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Phe};const _he=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mk={...Mk,...e}},W7=()=>Mk;let q7;const Lhe=e=>{q7=e},kE=()=>q7,qN=(e,t)=>{if(!e)return!1;const r=e.props?e.props.children:e.children;return t?r.length>0:!!r},GN=e=>{if(!e)return[];const t=e.props?e.props.children:e.children;return e.props&&e.props.i18nIsDynamicList?mm(t):t},Dhe=e=>Array.isArray(e)&&e.every(b.isValidElement),mm=e=>Array.isArray(e)?e:[e],Ohe=(e,t)=>{const r={...t};return r.props=Object.assign(e.props,t.props),r},G7=(e,t)=>{if(!e)return"";let r="";const n=mm(e),a=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return n.forEach((i,o)=>{if(Li(i))r+=`${i}`;else if(b.isValidElement(i)){const{props:l,type:c}=i,u=Object.keys(l).length,d=a.indexOf(c)>-1,f=l.children;if(!f&&d&&!u)r+=`<${c}/>`;else if(!f&&(!d||u)||l.i18nIsDynamicList)r+=`<${o}></${o}>`;else if(d&&u===1&&Li(f))r+=`<${c}>${f}</${c}>`;else{const m=G7(f,t);r+=`<${o}>${m}</${o}>`}}else if(i===null)Hv("Trans: the passed in value is invalid - seems you passed in a null child.");else if(fm(i)){const{format:l,...c}=i,u=Object.keys(c);if(u.length===1){const d=l?`${u[0]}, ${l}`:u[0];r+=`{{${d}}}`}else Hv("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else Hv("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),r},Rhe=(e,t,r,n,a,i)=>{if(t==="")return[];const o=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(y=>`<${y}`).join("|")).test(t);if(!e&&!l&&!i)return[t];const c={},u=y=>{mm(y).forEach(x=>{Li(x)||(qN(x)?u(GN(x)):fm(x)&&!b.isValidElement(x)&&Object.assign(c,x))})};u(e);const d=khe.parse(`<0>${t}</0>`),f={...c,...a},m=(y,v,x)=>{const j=GN(y),C=p(j,v.children,x);return Dhe(j)&&C.length===0||y.props&&y.props.i18nIsDynamicList?j:C},h=(y,v,x,j,C)=>{y.dummy?(y.children=v,x.push(b.cloneElement(y,{key:j},C?void 0:v))):x.push(...b.Children.map([y],N=>{const S={...N.props};return delete S.i18nIsDynamicList,b.createElement(N.type,{...S,key:j,ref:N.ref},C?null:v)}))},p=(y,v,x)=>{const j=mm(y);return mm(v).reduce((N,S,M)=>{const k=S.children&&S.children[0]&&S.children[0].content&&r.services.interpolator.interpolate(S.children[0].content,f,r.language);if(S.type==="tag"){let I=j[parseInt(S.name,10)];x.length===1&&!I&&(I=x[0][S.name]),I||(I={});const T=Object.keys(S.attrs).length!==0?Ohe({props:S.attrs},I):I,L=b.isValidElement(T),R=L&&qN(S,!0)&&!S.voidElement,_=l&&fm(T)&&T.dummy&&!L,B=fm(e)&&Object.hasOwnProperty.call(e,S.name);if(Li(T)){const z=r.services.interpolator.interpolate(T,f,r.language);N.push(z)}else if(qN(T)||R){const z=m(T,S,x);h(T,z,N,M)}else if(_){const z=p(j,S.children,x);h(T,z,N,M)}else if(Number.isNaN(parseFloat(S.name)))if(B){const z=m(T,S,x);h(T,z,N,M,S.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(S.name)>-1)if(S.voidElement)N.push(b.createElement(S.name,{key:`${S.name}-${M}`}));else{const z=p(j,S.children,x);N.push(b.createElement(S.name,{key:`${S.name}-${M}`},z))}else if(S.voidElement)N.push(`<${S.name} />`);else{const z=p(j,S.children,x);N.push(`<${S.name}>${z}</${S.name}>`)}else if(fm(T)&&!L){const z=S.children[0]?k:null;z&&N.push(z)}else h(T,k,N,M,S.children.length!==1||!k)}else if(S.type==="text"){const I=n.transWrapTextNodes,T=i?n.unescape(r.services.interpolator.interpolate(S.content,f,r.language)):r.services.interpolator.interpolate(S.content,f,r.language);I?N.push(b.createElement(I,{key:`${S.name}-${M}`},T)):N.push(T)}return N},[])},g=p([{dummy:!0,children:e||[]}],d,mm(e||[]));return GN(g[0])};function $he(e){let{children:t,count:r,parent:n,i18nKey:a,context:i,tOptions:o={}
3770,values:l,defaults:c,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...p}=e;const g=f||kE();if(!g)return Zx("You will need to pass in an i18next instance by using i18nextReactModule"),t;const y=m||g.t.bind(g)||(R=>R),v={...W7(),...g.options&&g.options.react};let x=d||y.ns||g.options&&g.options.defaultNS;x=Li(x)?[x]:x||["translation"];const j=G7(t,v),C=c||j||v.transEmptyNodeValue||a,{hashTransKey:N}=v,S=a||(N?N(j||C):j||C);g.options&&g.options.interpolation&&g.options.interpolation.defaultVariables&&(l=l&&Object.keys(l).length>0?{...l,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables});const M=l||r!==void 0||!t?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},k={...o,context:i||o.context,count:r,...l,...M,defaultValue:C,ns:x},I=S?y(S,k):C;u&&Object.keys(u).forEach(R=>{const _=u[R];if(typeof _.type=="function"||!_.props||!_.props.children||I.indexOf(`${R}/>`)<0&&I.indexOf(`${R} />`)<0)return;function B(){return b.createElement(b.Fragment,null,_)}u[R]=b.createElement(B)});const T=Rhe(u||t,I,g,v,k,h),L=n!==void 0?n:v.defaultTransParent;return L?b.createElement(L,p,T):T}const Fhe={type:"3rdParty",init(e){_he(e.options.react),Lhe(e)}},H7=b.createContext();class zhe{constructor(){vt(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}}function k0(e){let{children:t,count:r,parent:n,i18nKey:a,context:i,tOptions:o={},values:l,defaults:c,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...p}=e;const{i18n:g,defaultNS:y}=b.useContext(H7)||{},v=f||g||kE(),x=m||v&&v.t.bind(v);return $he({children:t,count:r,parent:n,i18nKey:a,context:i,tOptions:o,values:l,defaults:c,components:u,ns:d||x&&x.ns||y||v&&v.options&&v.options.defaultNS,i18n:v,t:m,shouldUnescape:h,...p})}const Bhe=(e,t)=>{const r=b.useRef();return b.useEffect(()=>{r.current=e},[e,t]),r.current},Y7=(e,t,r,n)=>e.getFixedT(t,r,n),Uhe=(e,t,r,n)=>b.useCallback(Y7(e,t,r,n),[e,t,r,n]),Te=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:r}=t,{i18n:n,defaultNS:a}=b.useContext(H7)||{},i=r||n||kE();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new zhe),!i){Zx("You will need to pass in an i18next instance by using initReactI18next");const C=(S,M)=>Li(M)?M:fm(M)&&Li(M.defaultValue)?M.defaultValue:Array.isArray(S)?S[S.length-1]:S,N=[C,{},!1];return N.t=C,N.i18n={},N.ready=!1,N}i.options.react&&i.options.react.wait!==void 0&&Zx("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...W7(),...i.options.react,...t},{useSuspense:l,keyPrefix:c}=o;let u=a||i.options&&i.options.defaultNS;u=Li(u)?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(C=>Ihe(C,i,o)),f=Uhe(i,t.lng||null,o.nsMode==="fallback"?u:u[0],c),m=()=>f,h=()=>Y7(i,t.lng||null,o.nsMode==="fallback"?u:u[0],c),[p,g]=b.useState(m);let y=u.join();t.lng&&(y=`${t.lng}${y}`);const v=Bhe(y),x=b.useRef(!0);b.useEffect(()=>{const{bindI18n:C,bindI18nStore:N}=o;x.current=!0,!d&&!l&&(t.lng?xL(i,t.lng,u,()=>{x.current&&g(h)}):vL(i,u,()=>{x.current&&g(h)})),d&&v&&v!==y&&x.current&&g(h);const S=()=>{x.current&&g(h)};return C&&i&&i.on(C,S),N&&i&&i.store.on(N,S),()=>{x.current=!1,C&&i&&C.split(" ").forEach(M=>i.off(M,S)),N&&i&&N.split(" ").forEach(M=>i.store.off(M,S))}},[i,y]),b.useEffect(()=>{x.current&&d&&g(m)},[i,c,d]);const j=[p,i,d];if(j.t=p,j.i18n=i,j.ready=d,d||!d&&!l)return j;throw new Promise(C=>{t.lng?xL(i,t.lng,u,()=>C()):vL(i,u,()=>C())})},Vhe=(e,t)=>{const r=[],n=["brands","personas","socials","links / QR Codes","ideas","posts","users"];return n.forEach(a=>{const i=e[a];if(i)switch(a){case"brands":r.push(`${i==="1000"?"Unlimited":i} brand${parseInt(i)>1?"s":""}`);break;case"personas":r.push(`${i==="1000"?"Unlimited":i} persona${parseInt(i)>1?"s":""}`);break;case"socials":r.push(`${i} social platform${parseInt(i)>1?"s":""}`);break;case"links / QR Codes":r.push(`${i} links / QR codes`);break;case"ideas":r.push(`${i==="Unlimited"?"Unlimited":i} content ideas`);break;case"posts":r.push(`${i==="Unlimited"?"Unlimited":i} posts per month`);break;case"users":r.push(`Up to ${i} team member${parseInt(i)>1?"s":""}`);break}}),Object.entries(e).forEach(([a,i])=>{if(!(a.startsWith("description_")||n.includes(a)))switch(a){case"ai-credits":r.push(`${i} AI credits per month`);break;default:r.push(`${a}: ${i}`)}}),r},T2=()=>Wa({queryKey:["billing-page"],staleTime:5*60*1e3,gcTime:30*60*1e3,refetchOnWindowFocus:!1,queryFn:async()=>{var a;const e=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!e)throw new Error("No authentication token available");const t=await fetch("https://api.socialness.ai/stripe/billing-page",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({returnUrl:window.location.origin+"/billing"})});if(!t.ok)throw new Error("Failed to fetch billing page data");const r=await t.json(),n=i=>i.map(o=>{const l=r.availableProducts.find(u=>u.id===o.product);if(!l)return console.warn(`Product not found for price option: ${o.product}`),{priceId:o.id,productId:o.product,productName:"Unknown Product",description:"Product description not available",formattedPrice:o.formatted_price,buttonText:"Subscribe",features:[],amount:o.unit_amount,currency:o.currency};let c;if(o.interval==="year"){const u=Math.round(o.unit_amount/12);c=new Intl.NumberFormat("fr-FR",{style:"currency",currency:o.currency.toUpperCase(),minimumFractionDigits:2}).format(u/100)}return{priceId:o.id,productId:l.id,productName:l.name,description:l.description,formattedPrice:o.formatted_price,formattedMonthlyPrice:c,buttonText:"Subscribe",features:Vhe(l.metadata),amount:o.unit_amount,currency:o.currency}});return{success:r.success,hasCustomer:r.hasCustomer,hasSubscription:r.hasSubscription,availableProducts:r.availableProducts,customerId:r.customerId,currentSubscription:r.currentSubscription,portalUrl:r.portalUrl,invoices:r.invoices,planOptions:{monthly:n(r.planOptions.monthly),yearly:n(r.planOptions.yearly)}}}}),Q7=()=>Wa({queryKey:["access"],staleTime:5*60*1e3,gcTime:30*60*1e3,refetchOnWindowFocus:!1,retry:!1,queryFn:async()=>{var r;const e=await((r=Qe.currentUser)==null?void 0:r.getIdToken());if(!e)throw new Error("No authentication token available");const t=await fetch("https://api.socialness.ai/management/access",{method:"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch access (status: ${t.status})`);return t.json()}}),Whe=()=>{var f,m,h,p,g;const{t:e}=Te(),[t,r]=b.useState(!0),[n,a]=b.useState(null),{data:i}=T2(),{data:o}=Q7(),l=(((f=i==null?void 0:i.currentSubscription)==null?void 0:f.status)||"").toLowerCase(),c=!!(i!=null&&i.hasSubscription&&((m=i==null?void 0:i.currentSubscription)!=null&&m.isActive||l==="active"||l==="trialing")&&(!((h=i==null?void 0:i.currentSubscription)!=null&&h.currentPlan)||(((p=i.currentSubscription.currentPlan)==null?void 0:p.productName)||"").toLowerCase()!=="free")),u=!!((g=o==null?void 0:o.access)!=null&&g.isEntitled);b.useEffect(()=>{var M;const y=Qe.currentUser,v=(M=y==null?void 0:y.metadata)==null?void 0:M.creationTime;if(!v){a(null);return}const x=new Date(v);if(Number.isNaN(x.getTime())){a(null);return}const N=(new Date().getTime()-x.getTime())/(1e3*60*60*24),S=Math.max(0,Math.min(7,7-Math.floor(N-1)));a(S)},[]);const d=b.useMemo(()=>typeof n=="number"&&n<=0,[n]);return b.useMemo(()=>{const y=new Date("2025-08-22T00:00:00Z"),v=y.getUTCDate(),x=y.toLocaleStr
3770ing("en-US",{month:"long",timeZone:"UTC"});return`${v}${(C=>C%10===1&&C%100!==11?"st":C%10===2&&C%100!==12?"nd":C%10===3&&C%100!==13?"rd":"th")(v)} of ${x}`},[]),!t||c||u?null:s.jsx("div",{className:"text-white px-4 py-3 sticky top-0 z-50",style:{backgroundColor:"rgb(235 76 22)"},children:s.jsxs("div",{className:"max-w-7xl mx-auto relative",children:[s.jsx("div",{className:"flex items-center justify-center gap-2",children:d?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-base",children:"⚠️"}),s.jsxs("p",{className:"text-sm font-medium text-center",children:[e("beta.trial.overPrefix","Your trial period is over.")," "," ",s.jsx(Us,{to:"/billing",className:"underline font-semibold text-white/95 hover:text-white",children:e("beta.trial.subscribeNow","Subscribe now")})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-base",children:"⚠️"}),s.jsxs("p",{className:"text-sm font-medium text-center",children:[e("beta.trial.leftPrefix","Only")," ",n??7," ",e("beta.trial.leftDays","days left in your trial period.")," ",s.jsx(Us,{to:"/billing",className:"underline font-semibold text-white/95 hover:text-white",children:e("beta.trial.subscribeNow","Subscribe now")})]})]})}),s.jsx("button",{onClick:()=>r(!1),className:"absolute right-0 top-1/2 -translate-y-1/2 p-1 hover:bg-white/20 rounded-full transition-colors","aria-label":e("common.close","Close"),children:s.jsx(_t,{className:"w-4 h-4"})})]})})};v2();const wL="https://api.socialness.ai",ME=()=>{var h,p,g,y,v,x,j,C,N,S,M,k,I,T,L,R,_,B,z,D,A,P,E,F,$,H,X,ue,le,ae,te,ne,J,G,Q,W;const{user:e,isLoading:t}=Ps(),r=qr(),n=e==null?void 0:e.id,{data:a,isLoading:i,error:o}=Wa({queryKey:["onboarding",n],queryFn:async()=>{var Z;if(!n)throw new Error("User not authenticated");const Y=await((Z=Qe.currentUser)==null?void 0:Z.getIdToken());if(!Y)throw new Error("No authentication token available");const q=await fetch(`${wL}/management/onboarding/status`,{headers:{Authorization:`Bearer ${Y}`,"Content-Type":"application/json"}});if(!q.ok)throw new Error("Failed to fetch onboarding status");return q.json()},enabled:!!n&&!!e&&!t}),l=(a==null?void 0:a.onboarding)||((h=a==null?void 0:a.data)==null?void 0:h.onboarding),c=l?{userId:l.userId,steps:{brand_analysis:!!((g=(p=l.steps)==null?void 0:p.analyzeBrand)!=null&&g.completed),persona_creation:!!((v=(y=l.steps)==null?void 0:y.createPersona)!=null&&v.completed),content_creation:!!((j=(x=l.steps)==null?void 0:x.createContent)!=null&&j.completed),social_account_connection:!!((N=(C=l.steps)==null?void 0:C.connectAccount)!=null&&N.completed),post_review:!!((M=(S=l.steps)==null?void 0:S.reviewPost)!=null&&M.completed),shorten_link:!!((I=(k=l.steps)==null?void 0:k.shortenLink)!=null&&I.completed),ai_analytics:!!((L=(T=l.steps)==null?void 0:T.viewAnalytics)!=null&&L.completed)},percentageCompleted:l.progress}:void 0,u=l?{brand_analysis:(B=(_=(R=l.steps)==null?void 0:R.analyzeBrand)==null?void 0:_.displayData)==null?void 0:B.onboardingGrowth,persona_creation:(A=(D=(z=l.steps)==null?void 0:z.createPersona)==null?void 0:D.displayData)==null?void 0:A.onboardingGrowth,content_creation:(F=(E=(P=l.steps)==null?void 0:P.createContent)==null?void 0:E.displayData)==null?void 0:F.onboardingGrowth,social_account_connection:(X=(H=($=l.steps)==null?void 0:$.connectAccount)==null?void 0:H.displayData)==null?void 0:X.onboardingGrowth,post_review:(ae=(le=(ue=l.steps)==null?void 0:ue.reviewPost)==null?void 0:le.displayData)==null?void 0:ae.onboardingGrowth,shorten_link:(J=(ne=(te=l.steps)==null?void 0:te.shortenLink)==null?void 0:ne.displayData)==null?void 0:J.onboardingGrowth,ai_analytics:(W=(Q=(G=l.steps)==null?void 0:G.viewAnalytics)==null?void 0:Q.displayData)==null?void 0:W.onboardingGrowth}:void 0,d=mn({mutationFn:async({step:Y,completed:q})=>{var ie;if(!n)throw new Error("User not authenticated");const Z=await((ie=Qe.currentUser)==null?void 0:ie.getIdToken());if(!Z)throw new Error("No authentication token available");const we={brand_analysis:"analyzeBrand",persona_creation:"createPersona",content_creation:"createContent",social_account_connection:"connectAccount",post_review:"reviewPost",ai_analytics:"viewAnalytics"}[Y];if(!(await fetch(`${wL}/management/onboarding/update-step`,{method:"POST",headers:{Authorization:`Bearer ${Z}`,"Content-Type":"application/json"},body:JSON.stringify({step:we,completed:q})})).ok)throw new Error(`Failed to update onboarding step ${Y}`);return r.fetchQuery({queryKey:["onboarding",n]})},onSuccess:()=>{r.invalidateQueries({queryKey:["onboarding",n]})}}),f=Y=>{d.mutate({step:Y,completed:!0})},m=Y=>{d.mutate({step:Y,completed:!1})};return t||!e||!n?{onboardingProgress:void 0,isLoading:t||i,error:null,completeStep:()=>{},uncompleteStep:()=>{},isCompleting:!1,growth:void 0}:{onboardingProgress:c,isLoading:i,error:o,completeStep:f,uncompleteStep:m,isCompleting:d.isPending,growth:u}},lr=e=>typeof e=="string",Qp=()=>{let e,t;const r=new Promise((n,a)=>{e=n,t=a});return r.resolve=e,r.reject=t,r},jL=e=>e==null?"":""+e,qhe=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},Ghe=/###/g,NL=e=>e&&e.indexOf("###")>-1?e.replace(Ghe,"."):e,SL=e=>!e||lr(e),Gg=(e,t,r)=>{const n=lr(t)?t.split("."):t;let a=0;for(;a<n.length-1;){if(SL(e))return{};const i=NL(n[a]);!e[i]&&r&&(e[i]=new r),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++a}return SL(e)?{}:{obj:e,k:NL(n[a])}},CL=(e,t,r)=>{const{obj:n,k:a}=Gg(e,t,Object);if(n!==void 0||t.length===1){n[a]=r;return}let i=t[t.length-1],o=t.slice(0,t.length-1),l=Gg(e,o,Object);for(;l.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),l=Gg(e,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=r},Hhe=(e,t,r,n)=>{const{obj:a,k:i}=Gg(e,t,Object);a[i]=a[i]||[],a[i].push(r)},Xx=(e,t)=>{const{obj:r,k:n}=Gg(e,t);if(r)return r[n]},Yhe=(e,t,r)=>{const n=Xx(e,r);return n!==void 0?n:Xx(t,r)},K7=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?lr(e[n])||e[n]instanceof String||lr(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):K7(e[n],t[n],r):e[n]=t[n]);return e},Uf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Qhe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Khe=e=>lr(e)?e.replace(/[&<>
3770"'\/]/g,t=>Qhe[t]):e;class Jhe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const Zhe=[" ",",","?","!",";"],Xhe=new Jhe(20),epe=(e,t,r)=>{t=t||"",r=r||"";const n=Zhe.filter(o=>t.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const a=Xhe.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(e);if(!i){const o=e.indexOf(r);o>0&&!a.test(e.substring(0,o))&&(i=!0)}return i},Ik=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let a=e;for(let i=0;i<n.length;){if(!a||typeof a!="object")return;let o,l="";for(let c=i;c<n.length;++c)if(c!==i&&(l+=r),l+=n[c],o=a[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<n.length-1)continue;i+=c-i+1;break}a=o}return a},e1=e=>e&&e.replace("_","-"),tpe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};let rpe=class Ek{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||tpe,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,a){return a&&!this.debug?null:(lr(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new Ek(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Ek(this.logger,t)}};var Vo=new rpe;let A2=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const a=this.observers[n].get(r)||0;this.observers[n].set(r,a+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[l,c]=o;for(let u=0;u<c;u++)l(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,c]=o;for(let u=0;u<c;u++)l.apply(l,[t,...n])})}};class kL extends A2{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,r],n&&(Array.isArray(n)?l.push(...n):lr(n)&&i?l.push(...n.split(i)):l.push(n)));const c=Xx(this.data,l);return!c&&!r&&!n&&t.indexOf(".")>-1&&(t=l[0],r=l[1],n=l.slice(2).join(".")),c||!o||!lr(n)?c:Ik(this.data&&this.data[t]&&this.data[t][r],n,i)}addResource(t,r,n,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[t,r];
vendor: 1,645 bytes, line 3770
3770n&&(l=l.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(l=t.split("."),a=r,r=l[1]),this.addNamespaces(r),CL(this.data,l,a),i.silent||this.emit("added",t,r,n,a)}addResources(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in n)(lr(n[i])||Array.isArray(n[i]))&&this.addResource(t,r,i,n[i],{silent:!0});a.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,r];t.indexOf(".")>-1&&(l=t.split("."),a=n,n=r,r=l[1]),this.addNamespaces(r);let c=Xx(this.data,l)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),a?K7(c,n,i):c={...c,...n},CL(this.data,l,c),o.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,r)}:this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(a=>r[a]&&Object.keys(r[a]).length>0)}toJSON(){return this.data}}var J7={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,a){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,r,n,a))}),t}};const ML={};class t1 extends A2{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),qhe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
3770i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Vo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let i=r.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,l=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!epe(t,n,a);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:lr(i)?[i]:i};const u=t.split(n);(n!==a||n===a&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(a)}return{key:t,namespaces:lr(i)?[i]:i}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const a=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(t[t.length-1],r),c=l[l.length-1],u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const C=r.nsSeparator||this.options.nsSeparator;return a?{res:`${c}${C}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${C}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:o}const f=this.resolve(t,r);let m=f&&f.res;const h=f&&f.usedKey||o,p=f&&f.exactUsedKey||o,g=Object.prototype.toString.apply(m),y=["[object Number]","[object Function]","[object RegExp]"],v=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,j=!lr(m)&&typeof m!="boolean"&&typeof m!="number";if(x&&m&&j&&y.indexOf(g)<0&&!(lr(v)&&Array.isArray(m))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,m,{...r,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(f.res=C,f.usedParams=this.getUsedParamsDetails(r),f):C}if(i){const C=Array.isArray(m),N=C?[]:{},S=C?p:h;for(const M in m)if(Object.prototype.hasOwnProperty.call(m,M)){const k=`${S}${i}${M}`;N[M]=this.translate(k,{...r,joinArrays:!1,ns:l}),N[M]===k&&(N[M]=m[M])}m=N}}else if(x&&lr(v)&&Array.isArray(m))m=m.join(v),m&&(m=this.extendTranslation(m,t,r,n));else{let C=!1,N=!1;const S=r.count!==void 0&&!lr(r.count),M=t1.hasDefaultValue(r),k=S?this.pluralResolver.getSuffix(u,r.count,r):"",I=r.ordinal&&S?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",T=S&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),L=T&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${k}`]||r[`defaultValue${I}`]||r.defaultValue;!this.isValidLookup(m)&&M&&(C=!0,m=L),this.isValidLookup(m)||(N=!0,m=o);const _=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:m,B=M&&L!==m&&this.options.updateMissing;if(N||C||B){if(this.logger.log(B?"updateKey":"missingKey",u,c,o,B?L:m),i){const P=this.resolve(o,{...r,keySeparator:!1});P&&P.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 z=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let P=0;P<D.length;P++)z.push(D[P]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(r.lng||this.language):z.push(r.lng||this.language);const A=(P,E,F)=>{const $=M&&F!==m?F:_;this.options.missingKeyHandler?this.options.missingKeyHandler(P,c,E,$,B,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(P,c,E,$,B,r),this.emit
vendor: 12,013 bytes, line 3770
3770("missingKey",P,c,E,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?z.forEach(P=>{const E=this.pluralResolver.getSuffixes(P,r);T&&r[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(F=>{A([P],o+F,r[`defaultValue${F}`]||L)})}):A(z,o,L))}m=this.extendTranslation(m,t,r,f,n),N&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${o}`),(N||C)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,C?m:void 0):m=this.options.parseMissingKeyHandler(m))}return a?(f.res=m,f.usedParams=this.getUsedParamsDetails(r),f):m}extendTranslation(t,r,n,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=lr(t)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const m=t.match(this.interpolator.nestingRegexp);d=m&&m.length}let f=n.replace&&!lr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,n.lng||this.language||a.usedLng,n),u){const m=t.match(this.interpolator.nestingRegexp),h=m&&m.length;d<h&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(n.lng=this.language||a.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var m=arguments.length,h=new Array(m),p=0;p<m;p++)h[p]=arguments[p];return i&&i[0]===h[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${r[0]}`),null):o.translate(...h,r)},n)),n.interpolation&&this.interpolator.reset()}const l=n.postProcess||this.options.postProcess,c=lr(l)?[l]:l;return t!=null&&c&&c.length&&n.applyPostProcessor!==!1&&(t=J7.handle(c,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,a,i,o,l;return lr(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(c,r),d=u.key;a=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const m=r.count!==void 0&&!lr(r.count),h=m&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),p=r.context!==void 0&&(lr(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);f.forEach(y=>{this.isValidLookup(n)||(l=y,!ML[`${g[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(ML[`${g[0]}-${y}`]=!0,this.logger.warn(`key "${a}" for languages "${g.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),g.forEach(v=>{if(this.isValidLookup(n))return;o=v;const x=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(x,d,v,y,r);else{let C;m&&(C=this.pluralResolver.getSuffix(v,r.count,r));const N=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(x.push(d+C),r.ordinal&&C.indexOf(S)===0&&x.push(d+C.replace(S,this.options.pluralSeparator)),h&&x.push(d+N)),p){const M=`${d}${this.options.contextSeparator}${r.context}`;x.push(M),m&&(x.push(M+C),r.ordinal&&C.indexOf(S)===0&&x.push(M+C.replace(S,this.options.pluralSeparator)),h&&x.push(M+N))}}let j;for(;j=x.pop();)this.isValidLookup(n)||(i=j,n=this.getResource(v,y,j,r))}))})}),{res:n,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,a):this.resourceStore.getResource(t,r,n,a)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!lr(t.replace);let a=n?t.replace:t;if(n&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!n){a={...a};for(const i of r)delete a[i]}return a}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}const HN=e=>e.charAt(0).toUpperCase()+e.slice(1);class IL{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Vo.create("languageUtils")}getScriptPartFromCode(t){if(t=e1(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=e1(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(lr(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let a=Intl.getCanonicalLocales(t)[0];if(a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a)return a}catch{}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(a=>a.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=HN(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=HN(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=HN(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const a=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(a))&&(r=a)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),lr(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return lr(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):lr(t)&&i(this.formatLanguageCode(t)),n.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let npe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ape={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const spe=["v1","v2","v3"],ipe=["v4"],EL={zero:0,one:1,two:2,few:3,many:4,other:5},ope=()=>{const e={};return npe.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:ape[t.fc]}})}),e};class lpe{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=Vo.create("pluralResolver"),(!this.options.compatibilityJSON||ipe.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=ope(),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const n=e1(t==="dev"?"en":t),a=r.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:a});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:a})}catch{if(!t.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,r)}return this.pluralRulesCache[i]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};
vendor: 1,299 bytes, line 3770
3770return this.getSuffixes(t,n).map(a=>`${r}${a}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((a,i)=>EL[a]-EL[i]).map(a=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a}`):n.numbers.map(a=>this.getSuffix(t,a,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(t,n);return a?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a.select(r)}`:this.getSuffixRetroCompatible(a,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let a=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}
vendor: 24,804 bytes, line 3770
3770shouldUseIntlApi(){return!spe.includes(this.options.compatibilityJSON)}}const TL=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Yhe(e,t,r);return!i&&a&&lr(r)&&(i=Ik(e,r,n),i===void 0&&(i=Ik(t,r,n))),i},YN=e=>e.replace(/\$/g,"$$$$");class cpe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Vo.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:a,prefix:i,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:m,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:x}=t.interpolation;this.escape=r!==void 0?r:Khe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=i?Uf(i):o||"{{",this.suffix=l?Uf(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=m?Uf(m):h||Uf("$t("),this.nestingSuffix=p?Uf(p):g||Uf(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,n,a){let i,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const v=TL(r,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,n,{...a,...r,interpolationkey:h}):v}const p=h.split(this.formatSeparator),g=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(TL(r,c,g,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...a,...r,interpolationkey:g})};this.resetRegExp();const d=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,f=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>YN(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?YN(this.escape(h)):YN(h)}].forEach(h=>{for(l=0;i=h.regex.exec(t);){const p=i[1].trim();if(o=u(p),o===void 0)if(typeof d=="function"){const y=d(t,i,a);o=lr(y)?y:""}else if(a&&Object.prototype.hasOwnProperty.call(a,p))o="";else if(f){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${t}`),o="";else!lr(o)&&!this.useRawValueToEscape&&(o=jL(o));const g=h.safeValue(o);if(t=t.replace(i[0],g),f?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let m=`{${f[1]}`;c=f[0],m=this.interpolate(m,o);const h=m.match(/'/g),p=m.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(m=m.replace(/'/g,'"'));try{o=JSON.parse(m),u&&(o={...u,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${d}${m}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;a=this.nestingRegexp.exec(t);){let c=[];o={...n},o=o.replace&&!lr(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const d=a[1].split(this.formatSeparator).map(f=>f.trim());a[1]=d.shift(),c=d,u=!0}if(i=r(l.call(this,a[1].trim(),o),o),i&&a[0]===t&&!lr(i))return i;lr(i)||(i=jL(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),i=""),u&&(i=c.reduce((d,f)=>this.format(d,f,n.lng,{...n,interpolationkey:a[1].trim()}),i.trim())),t=t.replace(a[0],i),this.regexp.lastIndex=0}return t}}const upe=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const a=n[1].substring(0,n[1].length-1);t==="currency"&&a.indexOf(":")<0?r.currency||(r.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?r.range||(r.range=a.trim()):a.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:r}},Vf=e=>{const t={};return(r,n,a)=>{let i=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(i={...i,[a.interpolationkey]:void 0});const o=n+JSON.stringify(i);let l=t[o];return l||(l=e(e1(n),a),t[o]=l),l(r)}};class dpe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Vo.create("formatter"),this.options=t,this.formats={number:Vf((r,n)=>{const a=new Intl.NumberFormat(r,{...n});return i=>a.format(i)}),currency:Vf((r,n)=>{const a=new Intl.NumberFormat(r,{...n,style:"currency"});return i=>a.format(i)}),datetime:Vf((r,n)=>{const a=new Intl.DateTimeFormat(r,{...n});return i=>a.format(i)}),relativetime:Vf((r,n)=>{const a=new Intl.RelativeTimeFormat(r,{...n});return i=>a.format(i,n.range||"day")}),list:Vf((r,n)=>{const a=new Intl.ListFormat(r,{...n});return i=>a.format(i)})},this.init(t)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Vf(r)}format(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=r.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,c)=>{const{formatName:u,formatOptions:d}=upe(c);if(this.formats[u]){let f=l;try{const m=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},h=m.locale||m.lng||a.locale||a.lng||n;f=this.formats[u](l,h,{...d,...a,...m})}catch(m){this.logger.warn(m)}return f}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const fpe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mpe extends A2{constructor(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=a,this.logger=Vo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,a.backend,a)}queueLoad(t,r,n,a){const i={},o={},l={},c={};return t.forEach(u=>{let d=!0;r.forEach(f=>{const m=`${u}|${f}`;!n.reload&&this.store.hasResourceBundle(u,f)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?o[m]===void 0&&(o[m]=!0):(this.state[m]=1,d=!1,o[m]===void 0&&(o[m]=!0),i[m]===void 0&&(i[m]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,r,n){const a=t.split("|"),i=a[0],o=a[1];r&&this.emit("failedLoading",i,o,r),!r&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const l={};this.queue.forEach(c=>{Hhe(c.loaded,[i],o),fpe(c,t),r&&c.errors.push(r),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,r,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:a,wait:i,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,a+1,i*2,o)},i);return}o(u,d)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const u=c(t,r);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,r,l)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();lr(t)&&(t=this.languageUtils.toResolveHierarchy(t)),lr(r)&&(r=[r]);const i=this.queueLoad(t,r,n,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),a=n[0],i=n[1];this.read(a,i,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${r}loading namespace ${i} for language ${a} failed`,o),!o&&l&&this.logger.log(`${r}loaded namespace ${i} for language ${a}`,l),this.loaded(t,o,l)})}saveMissing(t,r,n,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,r,n,a,c):d=u(t,r,n,a),d&&typeof d.then=="function"?d.then(f=>l(null,f)).catch(l):l(null,d)}catch(d){l(d)}else u(t,r,n,a,l,c)}!t||!t[0]||this.store.addResource(t[0],r,n,a)}}}const AL=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),lr(e[1])&&(t.defaultValue=e[1]),lr(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),PL=e=>(lr(e.ns)&&(e.ns=[e.ns]),lr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),lr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Kb=()=>{},hpe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class M0 extends A2{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=PL(t),this.services={},this.logger=Vo,this.modules={external:[]},hpe(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(lr(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const a=AL();this.options={...a,...this.options,...PL(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Vo.init(i(this.modules.logger),this.options):Vo.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=dpe);const f=new IL(this.options);this.store=new kL(this.options.resources,this.options);const m=this.services;m.logger=Vo,m.resourceStore=this.store,m.languageUtils=f,m.pluralResolver=new lpe(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(m.formatter=i(d),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new cpe(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new mpe(i(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),y=1;y<p;y++)g[y-1]=arguments[y];t.emit(h,...g)}),this.modules.languageDetector&&(m.languageDetector=i(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=i(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new t1(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),y=1;y<p;y++)g[y-1]=arguments[y];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Kb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const c=Qp(),u=()=>{const d=(f,m)=>{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),c.resolve(m),n(f,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kb;const a=lr(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const i=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(t,r,n){const a=Qp();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=Kb),this.services.backendConnector.reload(t,r,i=>{a.resolve(),n(i)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&J7.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const a=Qp();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,a.resolve(function(){return n.t(...arguments)}),r&&r(c,function(){return n.t(...arguments)})},l=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=lr(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{o(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),a}getFixedT(t,r,n){var a=this;const i=function(o,l){let c;if(typeof l!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];c=a.options.overloadTranslationOptionHandler([o,l].concat(d))}else c={...l};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||i.keyPrefix);const m=a.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(o)?h=o.map(p=>`${c.keyPrefix}${m}${p}`):h=c.keyPrefix?`${c.keyPrefix}${m}${o}`:o,a.t(h,c)};return lr(t)?i.lng=t:i.lngs=t,i.ns=r,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(r.precheck){const l=r.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,t)&&(!a||o(i,t)))}loadNamespaces(t,r){const n=Qp();return this.options.ns?(lr(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=Qp();lr(t)&&(t=[t]);const a=this.options.preload||[],i=t.filter(o=>a.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new IL(AL());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new M0(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kb;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},i=new M0(a);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new kL(this.store.data,a),i.services.resourceStore=i.store),i.translator=new t1(i.services,a),i.translator.on("*",function(l){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];i.emit(l,...u)}),i.init(a,r),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ns=M0.createInstance();ns.createInstance=M0.createInstance;ns.createInstance;ns.dir;ns.init;ns.loadResources;ns.reloadResources;ns.use;ns.changeLanguage;ns.getFixedT;ns.t;ns.exists;ns.setDefaultNamespace;ns.hasLoadedNamespace;ns.loadNamespaces;ns.loadLanguages;function ppe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I0(e){"@babel/helpers - typeof";return I0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I0(e)}function gpe(e,t){if(I0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(I0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Z7(e){var t=gpe(e,"string");return I0(t)=="symbol"?t:t+""}function ype(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Z7(n.key),n)}}function bpe(e,t,r){return t&&ype(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
vendor: 4,245 bytes, line 3770
3770var X7=[],vpe=X7.forEach,xpe=X7.slice;function wpe(e){return vpe.call(xpe.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var _L=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,jpe=function(t,r,n){var a=n||{};a.path=a.path||"/";var i=encodeURIComponent(r),o="".concat(t,"=").concat(i);if(a.maxAge>0){var l=a.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(l))}if(a.domain){if(!_L.test(a.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(a.domain)}if(a.path){if(!_L.test(a.path))throw new TypeError("option path is invalid");o+="; Path=".concat(a.path)}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(a.expires.toUTCString())}if(a.httpOnly&&(o+="; HttpOnly"),a.secure&&(o+="; Secure"),a.sameSite){var c=typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite;switch(c){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},LL={create:function(t,r,n,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),a&&(i.domain=a),document.cookie=jpe(t,encodeURIComponent(r),i)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),a=0;a<n.length;a++){for(var i=n[a];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(r)===0)return i.substring(r.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},Npe={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document<"u"){var n=LL.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document<"u"&&LL.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},Spe={name:"querystring",lookup:function(t){var r;if(typeof window<"u"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var a=n.substring(1),i=a.split("&"),o=0;o<i.length;o++){var l=i[o].indexOf("=");if(l>0){var c=i[o].substring(0,l);c===t.lookupQuerystring&&(r=i[o].substring(l+1))}}}return r}},Kp=null,DL=function(){if(Kp!==null)return Kp;try{Kp=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Kp=!1}return Kp},Cpe={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&DL()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&DL()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Jp=null,OL=function(){if(Jp!==null)return Jp;try{Jp=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Jp=!1}return Jp},kpe={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&OL()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&OL()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Mpe={name:"navigator",lookup:function(t){var r=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Ipe={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Epe={name:"path",lookup:function(t){var r;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}}
vendor: 5,251 bytes, line 3770
3770,Tpe={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}},e8=!1;try{document.cookie,e8=!0}catch{}var t8=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];e8||t8.splice(1,1);function Ape(){return{order:t8,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var r8=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ppe(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return bpe(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r||{languageUtils:{}},this.options=wpe(n,this.options||{},Ape()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(i){return i.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(Npe),this.addDetector(Spe),this.addDetector(Cpe),this.addDetector(kpe),this.addDetector(Mpe),this.addDetector(Ipe),this.addDetector(Epe),this.addDetector(Tpe)}},{key:"addDetector",value:function(r){return this.detectors[r.name]=r,this}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var a=[];return r.forEach(function(i){if(n.detectors[i]){var o=n.detectors[i].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(a=a.concat(o))}}),a=a.map(function(i){return n.options.convertDetectedLanguage(i)}),this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var a=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(i){a.detectors[i]&&a.detectors[i].cacheUserLanguage(r,a.options)}))}}])}();r8.type="languageDetector";const Ppe={network:"The server response could not be received. Refresh My Content to check whether the post was deleted before trying again.",unknown:"Unable to delete the post. Please try again later.",partial:"Posts deleted: {{deleted}}. Deletions failed: {{failed}}."},_pe={network:"The server response could not be received. Your edits are still in this form. Check your connection and check My Content in another tab before trying again to avoid creating a duplicate.",server:"The server is temporarily unavailable. Your edits are still in this form. Please try again later.",unknown:"Unable to save the post. Your edits are still in this form."},Lpe={dashboard:"Dashboard",content:"Content",personas:"AI Personas Builder",strategy:"Brand Strategy",analytics:"Analytics",settings:"Settings",logout:"Logout",previous:"Previous",save:"Save",cancel:"Cancel",goBack:"Go Back",purge:"Purge",add:"Add",modify:"Modify",delete:"Delete",deleting:"Deleting...",saving:"Saving...",promoteToDraft:"Promote to Draft",accept:"Accept",decline:"Decline",billing:"Billing",confirm:"Confirm",create:"Create",noBrandsAvailable:"No Brands Available",connectAccountFirst:"Connect a social media account to get started",createBrandFirst:"Create your first brand to get started",connectAccount:"Connect Account",connectBrand:"Connect brand",createBrand:"Create a brand",loading:"Loading...",error:"Error",unknownError:"An unknown error occurred",languageSearchPlaceholder:"Type to search for a language or select from list",generating:"Generating...",boosting:"Boosting...",savingInProgress:"Saving...",sending:"Sending...",retry:"Retry",close:"Close",continue:"Continue",submit:"Submit",next:"Next",search:"Search",filter:"Filter",back:"Back",saveDraft:"Save Draft",success:"Success",warning:"Warning",info:"Information",linking:"Linking...",selectDate:"Select date",selectTime:"Select time",today:"Today",now:"Now",checkPostStatus:"Check Post Status",postStatusModalTitle:"Post Status",postStatusSuccess:"Your post has been successfully published!",postStatusProcessing:"Your post is currently being processed.",reviewSubmitError:"Failed to submit review",postLoadError:"Failed to load post",postNotFound:"Post not found. It may have been deleted.",draftSavedDueToMissingAccounts:"Post saved as draft due to missing account connections.",scheduleSuccess:"Post scheduled successfully!",draftSaveSuccess:"Draft saved successfully!",subtitle:"Track your social media performance across all platforms",summary:"Summary",dateRange:{thisMonth:"This Month",lastMonth:"Last Month",last15days:"Last 15 Days",last30days:"Last 30 Days",last90days:"Last 90 Days",last365days:"Last 12 Months",thisYear:"This year",custom:"Custom Range",days:"days",last:"Last",startDate:"Start Date",endDate:"End Date",apply:"Apply",cancel:"Cancel"},platformMetrics:"Platform Metrics",followers:"Followers",engagement:"Engagement",reach:"Reach",connectAccountForPlatform:"Connect a {{platform}}
3770 account to view analytics",metrics:{followers:"Followers",organicFollowers:"Organic Followers",paidFollowers:"Paid Followers",posts:"Posts",postsPublished:"Posts Published",impressions:"Impressions",uniqueImpressions:"Unique Impressions",clicks:"Clicks",pageClicks:"Page Clicks",reactions:"Reactions",comments:"Comments",reposts:"Reposts",ctr:"CTR",engagementRate:"Engagement Rate",pageViews:"Page Views",uniquePageViews:"Unique Page Views",accountsEngaged:"Accounts Engaged",likes:"Likes",mediaCount:"Media Count",profileViews:"Profile Views",reach:"Reach",saves:"Saves",shares:"Shares",totalEngagement:"Total Engagement",websiteClicks:"Website Clicks",followerGrowth:"Follower Growth",connectedPlatforms:"Connected Platforms",views:"Views",uniqueViews:"Unique Views",dislikes:"Dislikes",minutesWatched:"Minutes Watched",videosPosted:"Videos posted",followsAndUnfollows:"Follows and unfollows",averageViewDuration:"Avg. View Duration (sec)",newSubscribers:"New Subscribers",fanAdds:"New Fans",fanRemoves:"Fans Lost",impressionsPaid:"Paid Impressions",impressionsPaidUnique:"Unique Paid Impressions",impressionsUnique:"Unique Impressions",impressionsViral:"Viral Impressions",impressionsViralUnique:"Unique Viral Impressions",postEngagements:"Post Engagements",postImpressions:"Post Impressions",totalActions:"Total Actions",lostSubscribers:"Subscribers Lost",subscribersGain:"Subscribers Gained",subscribersGained:"Subscribers Gained",subscribersLost:"Subscribers Lost",dynamicFollowers:"{{platform}} Followers",dynamicSubscribers:"{{platform}} Subscribers",linkedinFollowers:"LinkedIn Followers",instagramFollowers:"Instagram Followers",facebookFollowers:"Facebook Followers",youtubeSubscribers:"YouTube Subscribers",tiktokFollowers:"TikTok Followers"},aiAnalysis:{title:"AI Post Analysis",summary:"Summary",strengths:"Strengths",improvements:"Areas for Improvement"},ai:{getAnalysisTitleGeneral:"Get AI Analysis",getAnalysisDescriptionNew:"Unlock AI-powered insights to better focus on what works and improve your social media strategy.",analyzeButton:"Analyze Now",analyzing:"Analyzing...",platformAnalysisTitle:"{{platform}} Analysis",title:"AI Performance Analysis"},specificPlatformsMetricsTitle:"Specific Platforms Metrics",moreMetricsTitle:"More {{platform}} Metrics",youtubeIngestionLag:"Some data can take up to 48h to be sent by YouTube.",secondaryMetrics:{seeMore:"See the {{count}} other metrics",hide:"Hide additional metrics"},topPosts:{title:"🏆 Your top posts from the last 30 days",subtitle:"Your most engaging content for the selected period.",empty:"No posts have been published last month.",none:"No posts have been published during this period",noText:"No text",view:"Open"},thirdMetricsSummaryTitle:"Other relevant metrics",timezoneDropdown:{searchPlaceholder:"Search timezones...",noResults:"No timezones found",group:{usCanada:"US/Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia",Pacific:"Pacific",Standard:"Standard"},timezoneLabel:"Timezone"},copy:"Copy",copied:"Copied!",trackingLink:"Tracking Link...",recentPosts:"Your {{count}} recent posts",activeMember:"{{count}} active member",activeMembers:"{{count}} active members",pendingMember:"{{count}} pending member",pendingMembers:"{{count}} pending members",duplicate:"Duplicate"},Dpe={notificationMessage:"Thanks for joining the beta. Write me on the Chat if any bugs 👇🏽",trial:{leftPrefix:"Only",leftDays:"days left in your trial period.",subscribeNow:"Subscribe now",overPrefix:"Your trial period is over."}},Ope={createPost:"Create Post",noPosts:"No posts for this brand",createWithAI:"Create with AI",createWithAIDescription:"Let AI help you create engaging content",createManually:"Create Manually",createManuallyDescription:"Write your own content from scratch",createIdea:"Save an Idea",createIdeaDescription:"Capture a post idea for later with a reminder"},Rpe={all:"All Media Types",allDesc:"Show posts with any type of media or content.",image:"Image",imageDesc:"Posts containing images only.",video:"Video",videoDesc:"Posts containing videos only.",carousel:"Carousel",carouselDesc:"Posts with multiple images or mixed media.",text:"Text Only",textDesc:"Posts with text content only, no media."},$pe={all:"All Formats",allDesc:"Show posts in all formats (regular and reel).",regular:"Regular Post",regularDesc:"Standard horizontal format posts for feeds.",reel:"Reel/Short",reelDesc:"Vertical format content for reels and shorts."},Fpe={categories:{summary:"SUMMARY",content:"CONTENT",aiStudio:"AI STUDIO",management:"MANAGEMENT",admin:"ADMIN",extra:"EXTRA"},media:"Media Library",team:"Team",integrations:"Integrations",links:"Smart Links",aiLinksBuilder:"AI Link Builder & Shortener",brands:"Brands & Strategy",personas:"Personas",smartLinks:"Smart Links",connectedAccounts:"Connected Accounts",analytics:"Analytics & Performance",createContent:"Create Content",aiCredits:"{{count}} AI Credits"},zpe={title:"Brand Strategy Lab",subtitle:"Manage your brands and their social media presence",values:"V
3770alues",keywords:"Keywords",accounts:"Accounts",connectedAccounts:"Connected Accounts",connectAccount:"Connect an account",noAccounts:"No accounts connected for this brand",brandKit:"Brand Kit",posts:"Posts",marketingStrategy:"Marketing Strategy",marketScope:"Market Scope",distributionType:"Distribution Type",businessModel:"Business Model",priorityMarkets:"Priority Markets",colors:{palette:"Colors"},typography:"Typography",addBrand:"Add Brand",search:"Search brands by name, description, or keywords...",noResults:"No brands found matching your search criteria",noBrands:"No brands created yet. Create your first brand to get started.",createFirst:"Create your first Brand",itemsLabel:"brand",itemsLabel_plural:"brands",create:{title:"Create Brand",subtitle:"Set up a new brand and its social media strategy",submit:"Save Brand"},edit:{title:"Edit Brand",subtitle:"Update brand information and strategy",recap:"Overview",keyInsights:"Key Insights",brandIdentity:{title:"Brand Identity",name:"Brand Name",website:"Website URL",description:"Brand Description",logo:{change:"Change Logo",upload:"Upload Logo"}},brandTone:{title:"Brand Tone",contentTone:"Content Tone",languages:"Languages",industry:"Industry"},brandGuidelines:{title:"Brand Guidelines",values:"Brand Values",voiceDescription:"Brand Voice Description",recommendedSocialNetworks:"Recommended Social Networks"},brandStrategy:{title:"Brand Strategy",usp:"Unique Selling Points",contentFormats:"Content Formats"},contentStrategy:{themes:{title:"Content Themes",placeholder:"Add a content theme"},gaps:{title:"Content Gaps",placeholder:"Add a content gap to address"},engagement:{title:"Engagement Strategy",placeholder:"Add an engagement tactic"},growth:{title:"Growth Opportunities",placeholder:"Add a growth opportunity"}},summary:{title:"Website Analysis Summary",recap:"Overview",recapDescription:"AI-generated summary of your website",takeaways:"Key Insights",takeawaysDescription:"Important observations about your website",noData:"No website analysis data available. Try analyzing your website to get insights."},brandStyles:{title:"Brand Styles",colors:{title:"Brand Colors",recommendations:"Color Recommendations",addColor:"Add Color",newColor:"New Color"},fonts:{title:"Brand Fonts",recommendations:"Typography Recommendations",noFonts:"No fonts defined",addFont:"Add Font",newFont:"New Font"},visual:{title:"Visual Strategy",colorUsage:"Color Usage Guidelines",typography:"Typography Guidelines",elements:"Visual Elements to Emphasize",consistency:"Design Consistency Tips"}},refresh:{button:"Refresh Data",refreshing:"Refreshing...",noWebsite:"No website URL found to analyze.",error:"Failed to analyze website",invalidResponse:"Invalid response from analysis",success:"Brand data refreshed successfully!",genericError:"Failed to refresh brand data. Please try again.",modal:{title:"Refresh Brand Data",description:"This will re-analyze your website and update all brand data including:",items:{colors:"Colors and visual identity",fonts:"Typography and fonts",content:"Content strategy",description:"Brand description and values"},warning:"Warning: All current data will be overwritten and cannot be undone.",confirm:"Yes, Refresh Data",successTitle:"Data Refreshed!"}},fillWithAI:{button:"Fill with AI",analyzing:"Analyzing...",serviceUnavailable:"The analysis service is temporarily unavailable. Please try again in a few minutes.",temporaryError:"Service temporarily unavailable ({status}). Please try again later.",invalidResponse:"Invalid response from analysis",genericError:"Failed to analyze website. Please try again.",modal:{title:"Fill Brand with AI",description:"This will analyze a website and populate all brand data including:",items:{colors:"Colors and visual identity",fonts:"Typography and fonts",content:"Content strategy",description:"Brand description and values"},warning:"Warning: All current data will be overwritten and cannot be undone.",confirm:"Continue"},urlModal:{title:"Enter Website URL",description:"Please enter the website URL you want to analyze:",placeholder:"https://example.com",analyze:"Analyze Website"}}},sections:{branding:"Branding",contentStrategy:"Content Strategy",brandStyles:"Brand Styles",summary:"Summary",recap:"Summary"},validation:{requiredFields:"The following fields are required: "},delete:{title:"Delete Brand",message:'Are you sure you want to delete the brand "{brandName}"? This action cannot be undone.',warning:"All associated data, including content, analytics, and settings will be permanently deleted."},websiteFetchModal:{title:"Add your brand's website",description:"Enter your website URL and we'll analyze it to help you get started faster",websiteLabel:"Website URL",websitePlaceholder:"www.example.com",analyze:"Analyze",skipAnalysis:"Skip Analysis",skipAndStart:"Skip and start from scratch",ariaLabel:{close:"Close modal"},loading:{title:"Analyzing your website...",step1:"Scanning website content",step2:"Identifying brand elements",step3:"Generating brand profile"},error:{fetch:"Failed to analyze website. Please try again or skip analysis."}}
3770,generation:{title:"Creating Your Brand Strategy",steps:{analyzing:"Analyzing brand information and target markets...",identifying:"Identifying brand values and unique selling points...",exploring:"Exploring your brand assets and your brand style...",creating:"Creating content strategy and recommendations...",optimizing:"Optimizing social media presence and channel recommendations...",finalizing:"Finalizing brand strategy profile..."}}},Bpe={title:"Team Members",subtitle:"Manage team members and their access to brands",addMember:"Add Member",searchPlaceholder:"Search members by name or email",tabs:{all:"All",active:"Active",pending:"Pending"},table:{member:"Member",brands:"Brands",orgRole:"Organization Role",joined:"Joined",actions:"Actions"},actions:{editAriaLabel:"Edit access for {email}",deleteAriaLabel:"Delete {email} from team",resendInvitation:"Resend invitation",resendInvitationAriaLabel:"Resend invitation to {email}"},brandAccess:{title:"Brand Access Management",addAccess:"Add Access",role:"Role",status:"Status"},roles:{admin:"Administrator",writer:"Writer",reviewer:"Reviewer",all:"All Roles",descriptions:{all:"Access to all roles and their capabilities",admin:"Full access to manage brands, content, and team members",writer:"Can create and edit content for assigned brands",reviewer:"Can review and approve content before publishing"}},advancedSettings:{title:"Advanced settings",orgRoleHint:"Choose the role you want to give to this new user. By default, he will be a member"},orgRoles:{owner:"Owner",billing_admin:"Billing Admin",admin:"Admin",member:"Member",guest:"Viewer",descriptions:{owner:"Full access to everything, including billing.",billing_admin:"Payment and billing management only.",admin:"Manage members and brands, no billing.",member:"Functional access to assigned brands.",guest:"Read-only access across the workspace."}},removeMember:{title:"Remove member",description:"You can either remove this member from the current brand only, or remove them completely from your organisation.",brand:{title:"Remove from brand",desc:"The member will lose access to this brand but will still belong to your organisation (seat still counted).",cta:"Remove from brand"},org:{title:"Remove from organisation",desc:"The member will lose access to all brands and will no longer count towards your seats.",cta:"Remove from organisation"}},status:{active:"Active",pending:"Pending",inactive:"Inactive"},deleteConfirmation:{title:"Delete team member",message:"Are you sure you want to delete <strong><em>{{email}}</em></strong> from the <strong><em>{{brandName}}</em></strong> team? This action cannot be undone.",warning:"They will lose access to all associated brands and content."},errors:{cannotDeleteAdmin:"Cannot delete an admin member. Please change their role first."},values:"Values",keywords:"Keywords",connectedAccounts:"Connected Accounts",emails:"Email Addresses",emailsPlaceholder:"Enter email addresses separated by commas",emailsHint:"Press Enter or comma after each email address",selectBrand:"Select Brand",selectRole:"Select Role",invite:"Invite Member",modifyAccesses:"Modify Access for",noResults:"No results found",inviteSuccess:"Congrats! You invited the following people to join your brand {{brandName}}:",noMembers:"No team members found. Start by inviting someone to your team!"},Upe={login:{title:"Sign in to your account",emailLabel:"Email address",emailPlaceholder:"Email address",passwordLabel:"Password",passwordPlaceholder:"Password",forgotPassword:"Forgot your password?",noAccount:"Don't have an account? Sign up",signInButton:"Sign in",signingIn:"Signing in...",orContinueWith:"Or continue with",google:"Google"},signup:{title:"Create your account",nameLabel:"Full name",namePlaceholder:"Enter your full name",firstNameLabel:"First Name",firstNamePlaceholder:"Enter your first name",lastNameLabel:"Last Name",lastNamePlaceholder:"Enter your last name",emailLabel:"Email address",emailPlaceholder:"Email address",passwordLabel:"Password",passwordPlaceholder:"Password",confirmPasswordLabel:"Confirm Password",confirmPasswordPlaceholder:"Confirm Password",referralLabel:"How did you hear about us?",referralPlaceholder:"Select an option",hasAccount:"Already have an account? Sign in",createButton:"Create account",creating:"Creating account...",orContinueWith:"Or continue with",google:"Google",termsText:"By creating an account, I accept the",termsLink:"terms of service",andThe:"and the",privacyLink:"privacy policy",errors:{passwordMatch:"Passwords do not match",referralRequired:"Please select how you heard about us",nameRequired:"Please enter your name",emailAlreadyInUse:"A Socialness account already exists with this email. Please log in or reset your password.",backendError:"Signup process failed. Please try again.",networkError:"An error occurred during signup. Please check your connection and try again.",passwordRequirements:"Password does not meet the security requirements."},passwordRules:{title:"Password must meet the following requirements:",minLength:"At least 8 characters long",uppercaseLetter:"Contains 1 uppercase character",numberOrSymbol:"Contains 1 number or symbol"}},verification:{title:"Verify Your Email",subtitle:"Please check your inbox to verify your email address",checkInbox:"We've sent a verification link to your email address. Please click on the link to verify your account.",resend:"Resend verification email",resending:"Sending...",resendSuccess:"Verification email has been sent",resendError:"Failed to send verification email. Please try again later.",signOut:"Sign out"},forgotPassword:{title:"Reset your password",subtitle:"We will send you an email with a link to reset your password",emailLabel:"Email",emailPlaceholder:"Enter your email address",resetButton:"Reset password",resetting:"Sending...",backToLogin:"Back",success:"Password reset email sent! Check your inbox.",successTitle:"Email sent!",successMessage:"Check your inbox, we just sent you an email at",error:"Error sending password reset email. Please try again."}},Vpe={settings:{title:"YouTube Settings",videoTitle:"Video Title",enterVideoTitle:"Enter a descriptive title for your video",charactersRemaining:"characters remaining",tags:"Tags",tagsPlaceholder:"Add a tag and press Enter",tagsHelp:"Add relevant tags to help viewers find your video",privacy:"Privacy",selectPrivacy:"Select privacy setting",removeTag:"Remove tag {{tag}}"}
3770,privacy:{public:{label:"Public",description:"Everyone can watch your video"},private:{label:"Private",description:"Only you can watch your video"},unlisted:{label:"Unlisted",description:"Anyone with the link can watch your video"}}},Wpe={compliance:{title:"TikTok Compliance",privacyQuestion:"Who can view this video?",allowUsersTo:"Allow users to",comment:"Comment",duet:"Duet",stitch:"Stitch",discloseTitle:"Disclose video content",discloseDescription:"Turn on to disclose that this video promotes goods or services in exchange for something of value. Your video could promote yourself, a third party, or both.",infoBoxText:'Your video will be labeled "Promotional content". This cannot be changed once your video is posted.',yourBrand:"Your brand",yourBrandDescription:"You are promoting yourself or your own business. This video will be classified as Brand Organic.",brandedContent:"Branded content",brandedContentDescription:"You are promoting another brand or a third party. This video will be classified as Branded Content.",brandedContentPrivateWarning:"Branded content visibility cannot be set to private",agreement:{prefix:"By posting, you agree to our",and:"and",suffix:".",musicOnly:"By posting, you agree to TikTok's <0>Music Usage Confirmation</0> *",brandedOnly:"By posting, you agree to TikTok's <0>Branded Content Policy</0> *",musicAndBranded:"By posting, you agree to TikTok's <0>Branded Content Policy</0> and <1>Music Usage Confirmation</1> *"},musicUsageConfirmation:"Music Usage Confirmation",brandedContentPolicy:"Branded Content Policy",publishOn:"This content will be published on",termsAgreementWarning:"You must agree to TikTok's terms before publishing.",disclosureNoOptionsWarning:"You must select a disclosure option to comply with TikTok's policies before publishing."},privacy:{select:"Choose privacy",selectDescription:"You must select a privacy option",public_to_everyone:{label:"Everyone",description:"Anyone can view this video"},mutual_follow_friends:{label:"Friends",description:"Only mutual followers can view this video"},follower_of_creator:{label:"Followers",description:"Only your followers can view this video"},self_only:{label:"Private",description:"Only you can view this video"}}},qpe={timeSeries:{title:"Daily evolution",summaryTitle:"Daily evolution by platform",daily:"Daily",weekly:"Weekly",current:"Current period",previous:"Previous period",currentShort:"Current",previousShort:"Previous"},title:"Performance Coach Analytics",subtitle:"Track your social media performance across all platforms",summary:"Summary",dateRange:{thisMonth:"This Month",lastMonth:"Last Month",last15days:"Last 15 Days",last30days:"Last 30 Days",last90days:"Last 90 Days",last365days:"Last 12 Months",thisYear:"This year",custom:"Custom Range",days:"days",last:"Last",startDate:"Start Date",endDate:"End Date",apply:"Apply",cancel:"Cancel"},platformMetrics:"Platform Metrics",followers:"Followers",engagement:"Engagement",reach:"Reach",connectAccountForPlatform:"Connect a {{platform}} account to view analytics",metrics:{followers:"Followers",organicFollowers:"Organic Followers",paidFollowers:"Paid Followers",posts:"Posts",impressions:"Impressions",uniqueImpressions:"Unique Impressions",clicks:"Clicks",reactions:"Reactions",comments:"Comments",reposts:"Reposts",ctr:"CTR",engagementRate:"Engagement Rate",pageViews:"Page Views",uniquePageViews:"Unique Page Views",accountsEngaged:"Accounts Engaged",likes:"Likes",mediaCount:"Media Count",profileViews:"Profile Views",reach:"Reach",saves:"Saves",shares:"Shares",totalEngagement:"Total Engagement",websiteClicks:"Website Clicks",followerGrowth:"Follower Growth",connectedPlatforms:"Connected Platforms",views:"Views",uniqueViews:"Unique Views",dislikes:"Dislikes",minutesWatched:"Minutes Watched",videosPosted:"Videos posted",averageViewDuration:"Avg. View Duration (sec)",newSubscribers:"New Subscribers",fanAdds:"New Fans",fanRemoves:"Fans Lost",impressionsPaid:"Paid Impressions",impressionsPaidUnique:"Unique Paid Impressions",impressionsUnique:"Unique Impressions",impressionsViral:"Viral Impressions",impressionsViralUnique:"Unique Viral Impressions",postEngagements:"Post Engagements",postImpressions:"Post Impressions",totalActions:"Total Actions",lostSubscribers:"Subscribers Lost",subscribersGain:"Subscribers Gained",subscribersGained:"Subscribers Gained",subscribersLost:"Subscribers Lost",dynamicFollowers:"{{platform}} Followers",dynamicSubscribers:"{{platform}} Subscribers",linkedinFollowers:"LinkedIn Followers",instagramFollowers:"Instagram Followers",facebookF
3770ollowers:"Facebook Followers",youtubeSubscribers:"YouTube Subscribers",tiktokFollowers:"TikTok Followers"},aiAnalysis:{title:"AI Performance Analysis",summary:"Summary",strengths:"Strengths",improvements:"Areas for Improvement"},ai:{getAnalysisTitleGeneral:"Get AI Analysis",getAnalysisDescriptionNew:"Unlock AI-powered insights to better focus on what works and improve your social media strategy.",analyzeButton:"Analyze Now",analyzing:"Analyzing...",platformAnalysisTitle:"{{platform}} Analysis",title:"AI Performance Analysis"},specificPlatformsMetricsTitle:"Specific Platforms Metrics",thirdMetricsSummaryTitle:"Other relevant metrics"},Gpe={title:"Billing & Subscription",manageSubscription:"Manage my subscription",manage:"Manage",getInvoices:"Get my invoices",upgrade:"Upgrade",downgrade:"Downgrade",saveWithYearly:"Save with yearly",noActiveSubscription:"No Active Subscription",noActiveSubscriptionMessage:"You currently don't have an active subscription. Choose a plan below to get started with Socialness.ai.",currentPlan:"Current Plan",active:"Active",paymentMethod:"Payment Method",noPaymentMethod:"No payment method on file",updatePaymentMethod:"Update payment method",monthly:"Monthly",yearly:"Yearly",save20Percent:"Save 20%",subscribe:"Subscribe",billingHistory:"Billing History",noBillingHistory:"No billing history available. Subscribe to a plan to view your invoices here.",invoiceNumber:"Invoice Number",amount:"Amount",date:"Date",status:"Status",actions:"Actions",loadingError:"Failed to load billing information. Please try again later.",currentPeriodEnds:"Current period ends on",validUntil:"Your current subscription is valid until",expires:"Expires",perMonth:"/mo",billedAnnually:"Billed annually at",currentPlanBadge:"Current Plan",mostPopular:"Most Popular",saveAmount:"Save {{amount}}",savedAmount:"{{amount}} saved",intervals:{month:"month",year:"year"},cardHolder:"Card Holder",edit:"Edit",subtitle:"Manage your subscription and payment methods",features:{brands:"brand",brands_plural:"brands",brands_one:"brand",brands_other:"brands",personas:"persona",personas_plural:"personas",socials:"social platform",socials_plural:"social platforms",links:"links / QR codes",ideas:"content ideas",posts:"posts per month",users:"team member",users_plural:"team members",unlimited:"Unlimited",upTo:"Up to"}},Hpe={title:"Your trial has expired…",progress:"So far you have analyzed <b><i>{{brands}}</i></b> {{brandsWord}}, created <b><i>{{personas}}</i></b> {{personasWord}}, connected <b><i>{{accounts}}</i></b> {{accountsWord}} and drafted <b><i>{{drafts}}</i></b> {{draftsWord}}.",description:"To continue enjoying your <1>own AI Social Media assistant</1>, you'll need to upgrade to Solo, Team or Agency Pro",words:{brand_singular:"brand",brand_plural:"brands",persona_singular:"persona",persona_plural:"personas",account_singular:"account",account_plural:"accounts",draft_singular:"post",draft_plural:"posts"},features:{unlimitedPosts:"Publish unlimited posts across all platforms",unlimitedAiContent:"Generate unlimited AI content (posts, captions, images)",analytics:"Access advanced analytics & AI-powered insights",algorithms:"Unlock our proprietary AI algorithm suite",support:"Priority support & faster processing",more:"And much more!"},upgradeCta:"Upgrade"},Ype={title:"Content Calendar",subtitle:"Plan and schedule your content across social networks",loading:{title:"Loading your calendar...",fetchingPosts:"Fetching posts and events...",refreshing:"Refreshing posts..."},filter:{columns:"Columns"},columns:{brand:"Brand",created:"Created",updated:"Updated",published:"Published"},addIdea:"Add Idea",ideaSaved:"Idea saved!",ideaError:"Failed to save idea.",ideaDeleted:"Idea deleted.",ideaDeleteError:"Failed to delete idea.",promotedToDraft:"Idea promoted to draft!",promoteError:"Failed to promote idea."},Qpe={title:"Post Idea",ideaTitle:"Title",description:"Notes",reminder:"Reminder:",promoteToDraft:"Turn into a post",ideaUpdated:"Idea updated!"},Kpe={title:"Save a Post Idea",ideaTitle:"Idea title",titlePlaceholder:"e.g. Behind-the-scenes reel of our process",description:"Notes",descriptionPlaceholder:"Quick notes about this idea...",brand:"Brand",selectBrand:"Select a brand",reminderDate:"Remind me on",reminderPlaceholder:"Pick a date (optional)",reminderHint:"The idea will appear on your calendar on this date.",s
3770ave:"Save Idea"},Jpe={title:"Settings",manageAccount:"Manage your account settings and preferences",profile:"Profile",uploadProfilePicture:"Upload a new profile picture. The image should be at least 400x400 pixels.","profile.firstName":"First Name","profile.lastName":"Last Name","profile.updateButton":"Save Changes","profile.success":"Profile updated successfully","profile.error.noAuth":"Authentication error. Please log in again.","profile.error.generic":"Failed to update profile. Please try again.",avatarUploadFailed:"Failed to upload avatar image. Please try again.",email:{title:"Email Address",current:"Current Email",new:"New Email",placeholder:"Enter your new email",update:"Update Email",success:"Email updated successfully"},security:{title:"Security",currentPassword:"Current Password",currentPasswordPlaceholder:"Enter your current password",newPassword:"New Password",newPasswordPlaceholder:"Enter your new password",confirmPassword:"Confirm New Password",confirmPasswordPlaceholder:"Confirm your new password",update:"Update Password",success:"Password updated successfully"}},Zpe={title:"AI Personas Builder",subtitle:"Create and manage audience personas to target your content strategy",create:"Create Persona",createFirst:"Create First Persona",analyzeWithAI:"Analyze with AI",search:"Search personas by name, job title, or tags...",noPersonas:"No personas created yet. Create your first persona to get started.",noPersona:"No personas for this brand",noSearchResults:"No personas found matching your search criteria",confirmDelete:"Are you sure you want to delete this persona? This action cannot be undone.",createPersona:"Create Persona",createWithAI:"Create with AI",createWithAIDescription:"Let AI help you create a realistic persona based on your brand",createManually:"Create Manually",createManuallyDescription:"Write your own persona from scratch",generation:{title:"Creating Your AI Persona",steps:{analyzing:"Analyzing brand identity and target audience...",creating:"Creating persona demographics and background...",defining:"Defining goals, motivations, and challenges...",determining:"Determining social media preferences and habits...",finalizing:"Finalizing persona details and generating avatar..."}},form:{createTitle:"Create New Persona",editTitle:"Edit Persona",createSubtitle:"Create a new target audience persona",editSubtitle:"Edit your persona details",create:"Create Persona",basicInfo:"Basic Information",name:"Name",namePlaceholder:"Enter persona name",jobTitle:"Job Title",jobTitlePlaceholder:"Enter job title",bio:"Bio",bioPlaceholder:"Write a brief description of this persona",age:"Age",ageRange:"Age Range",location:"Location",income:"Income",education:"Education",relationship:"Relationship Status",languages:"Languages",tags:"Tags",tagsPlaceholder:"Add tags (e.g., tech, marketing)",socialNetworks:"Social Networks",addNetwork:"Add Social Network",platform:"Platform",frequency:"Posting Frequency",pertinence:"Pertinence",problems:"Problems",problemsPlaceholder:"What challenges does this persona face?",goals:"Goals",goalsPlaceholder:"What are this persona's main objectives?",motivations:"Motivations",motivationsPlaceholder:"What drives this persona?",challenges:"Challenges",challengesPlaceholder:"What obstacles does this persona encounter?",contentFormat:"Content Format",brandAssociation:"Brand Association",selectBrand:"Select Brand",savePersona:"Save Persona",cancel:"Cancel",tabs:{profile:"Profile",reasons:"Reasons",behavior:"Behavior"},cardTitles:{keyInfo:"Key Information",format:"Format",communication:"Communication",story:"Persona's Story",problemsChallenges:"Problems & Challenges",goalsMotivations:"Goals & Motivations"},quote:"Quote",quoteDescription:"A representative quote for the persona.",buyingBehavior:"Buying Behavior",buyingBehaviorPlaceholder:"Describe how they make purchasing decisions...",buyingBehaviorDescription:"Example: Researches online, 
3770compares prices, seeks reviews.",buyingBehaviorLabel:"How They Buy",brandAffinity:"Brand Affinity",brandAffinityPlaceholder:"List brands they like or dislike...",brandAffinityDescription:"Example: Loyal to Apple, dislikes Microsoft.",formatLength:"Format Length",uploadImage:"Upload Image",errors:{invalidImageType:"Please upload an image file",imageTooLarge:"Image size should be less than 5MB"}},analysis:{title:"AI Analysis",summary:"Summary",strengths:"Strengths",improvements:"Areas for Improvement",recommendedPersonas:"Recommended New Personas",expertsInsights:"Experts Insights",demographicInsights:"Demographic Insights",brandPersonaAlignment:"Brand-Persona Alignment",gapAnalysis:"Gap Analysis",description:"Get AI insights about your current personas and recommendations for new ones to better understand your target audience."},delete:{title:"Delete Persona",message:"Are you sure you want to delete this persona? This action cannot be undone.",warning:"All associated data will be permanently removed."},errors:{noBrands:"No brands available. Please create a brand first.",noBrandSelected:"Please select a brand first",generationFailed:"Failed to generate persona. Please try again.",brandSetupIncomplete:"The following fields are missing, please update your brand to be able to generate relevant personas",brandSetupIncompleteTitle:"Brand Setup Incomplete",brandSetupIncompleteMessage:"The following fields are missing from your brand. Please complete them to generate relevant personas:",missingFields:"Missing fields:",brandSetupInstructions:'Go to the "Brand Strategy" section to complete this information.',goToBrandSetup:"Go to Brand Setup"},noPersonasForAnalysis:{title:"Personas Analysis",message:"You need to create a persona first before you can run an AI analysis.",createCTA:"Create a Persona"}},Xpe={title:"Content Creation",subtitle:"Generate engaging social media content with AI",generation:{title:"Creating Your AI Content",steps:{analyzing:"Analyzing your brand voice and style...",creating:"Creating engaging content tailored to your audience...",optimizing:"Optimizing for your selected platforms...",hashtags:"Adding hashtags and keywords for visibility...",polishing:"Polishing and finalizing your content...",generatingImage:"Generating creative imagery for your content...",designingVisuals:"Designing visuals that match your brand identity..."}},form:{brand:"Brand",selectBrand:"Select a brand",persona:"Persona",selectPersona:"Select a persona",platforms:"Platforms",selectPlatforms:"Select platforms",topic:"Topic",topicPlaceholder:"Enter a topic for your content",description:"Description",descriptionPlaceholder:"Describe what you'd like to create",keywords:"Keywords",keywordsPlaceholder:"Enter keywords",voice:"Voice",tone:"Tone",selectTone:"Select a tone",contentLength:"Content Length",selectContentLength:"Select content length",format:"Content Format",language:"Language",selectLanguage:"Select a language",sourceUrl:"URL Source (We even accept YouTube video URLs 📺)",sourceUrlPlaceholder:"Enter a reference URL (e.g. YouTube video)",goal:"Goal",selectGoal:"Select a goal",add:"Add",urlCheckError:"Failed to check URL. Please try again.",selectBrandAndPersona:"Please select a brand and persona to generate ideas",clickToGenerate:'Click "Generate ideas" to get started',generateIdeas:"Generate ideas",goals:{educate:"Educate",entertain:"Entertain",inform:"Inform",promote:"Promote"},goalDescriptions:{educate:"Educational content that teaches and shares knowledge with your audience",entertain:"Entertaining content that captivates and engages through humor, stories, or creativity",inform:"Informative content that shares news, updates, or important information",promote:"Promotional content that highlights products, services, or campaigns"},generate:"Generate Content",generating:"Generating...",regenerate:"Regenerate Content",reset:"Reset",errorSummary:"Please fix the following errors:",contentIdeas:"Content Ideas",contentCard:"Content",generateMoreIdeas:"Generate 5 more ideas",loadingIdeas:"Loading ideas...",ideasError:"Failed to load content ideas",noIdeas:"No content ideas available",noPersonas:"No personas available for this brand",createPersona:"Create a Persona",manuallyEdited:"You have manually edited this description",postImage:"Post Image",imageSelection:"Image Selection",textOnly:"Text Only",textOnlyDescription:"Generate content without an image",withImage:"With an Image",withImageDescription:"Generate content with a related image",useExtractedImage:"Use Existing Image",useExtractedImageDescription:"Use the image extracted from your link",imageStyle:"Image Style",imageSize:"Image Size",imageStyleDescription:"Choose the visual style for your generated image",imageStyles:{auto:"Auto",realistic:"Realistic",design:"Design","3d":"3D",artistic:"Artistic",modern:"Modern",ad:"Ad"},imageStyleDescriptions:{auto:"Selecting Auto lets the AI decide which style to apply to the generated image",realistic:"Best used when aiming for lifelike, photographic images with emphasis on realism and detail",design:"Perfect for creating logos, print-on-demand products, promotional materials, flyers, and graphic design","3d":"Creates three-dimensional styled images with depth, perspective, and volumetric effects",artistic:"A versatile style for creative works like abstract paintings, pencil sketches, and artistic interpretations",modern:"For contemporary visuals with clean, minimalist or trendy aesthetics, inspired by editorial or magazine styles",ad:"Perfect for creating eye-catching advertising visuals, promotional banners, and commercial marketing content"},imageSizes:{square:"Square (1:1)",portrait916:"Portrait (9:16)",portrait45:"Portrait (4:5)"},imageSizeDescriptions:{square:"Perfect for most social platforms",portrait916:"Ideal for Stories and TikTok",portrait45:"Good for Instagram and Pinterest"},tones:{inspirational:"Inspirational",professional:"Professional",casual:"Casual",educational:"Educational",friendly:"Friendly",funny:"Funny"},toneDescriptions:{inspirational:"Uplifting and motivational content that inspires action and positive change",professional:"Formal and business-oriented content that establishes expertise and authority",casual:"Relaxed and friendly content that creates a comfortable, approachable atmosphere",educational:"Informative content focused on teaching and sharing knowledge",friendly:"Warm and welcoming content that builds personal connections",funny:"Humorous and entertaining content that makes people laugh and engages through comedy"},languageSetFromBrand:"We have selected this default language based on the language that you put in your brand analysis",imageStyleSetFromBrand:"We have selected this default image style based on the image style that you put in your brand analysis"},results:{title:"Generated Content",copyAll:"Copy All",copyToClipboard:"Copy to Clipboard",copied:"Copied!",createPost:"Create Post",regenerate:"Regenerate",regenerateImage:"Regenerate the image",generatedImage:"Generated Image",generatedImageAlt:"AI generated image for content",n
3770oContent:"No content generated yet. Fill out the form and click 'Generate Content' to get started."},errors:{brandRequired:"Please select a brand",platformsRequired:"Please select at least one platform",topicRequired:"Please enter a topic",descriptionRequired:"Please provide a description",descriptionOrSourceRequired:"Please provide either a description or a source URL",toneRequired:"Please select a tone",contentLengthRequired:"Please select a content length",languageRequired:"Please select a language",generationFailed:"Failed to generate content. Please try again."},modals:{aiPostDraft:{title:"Handle Other Generated Posts",message:"You are about to edit 1 of {{totalPosts}} posts. What do you want to do with the {{count}} remaining post(s)?",discard:"Discard Others & Continue",saveAndEdit:"Save Others as Drafts & Continue"},savingDrafts:{title:"Saving Drafts",message:"Please wait while we save the other generated posts as drafts..."},regenerateImage:{title:"Regenerate Image",description:"Choose your preferred image style and size to generate a new image for your content.",generate:"Generate New Image",generating:"Generating...",regenerate:"Generate Another",validate:"Use This Image",preview:"Generated Image Preview",previewAlt:"Generated image preview",hoverForFullSize:"Hover for 2x zoom",fullSizePreview:"2x zoom preview",fullSizeHint:"2x zoom"}}},ege="en",tge={title:"Social Media Hub",subtitle:"Manage your connected social media accounts",connect:"Connect Account",connectFirst:"Connect Your First Account",followers:"followers",viewProfile:"View Profile",linkToBrand:"Link to Brand",unlinkBrand:"Unlink Brand",reconnect:"Reconnect",reconnecting:"Reconnecting...",disconnect:"Disconnect",follow:"Follow",errors:{linkFailed:"Failed to link account to brand. Please try again.",unlinkFailed:"Failed to unlink account from brand. Please try again."},linkedin:{organizationSelectionTitle:"Select LinkedIn Organizations",selectAtLeastOne:"Please select at least one organization to connect",connectionFailed:"Failed to connect LinkedIn pages",loadingOrganizations:"Loading your LinkedIn organizations...",loadFailed:"Failed to load LinkedIn organizations",noOrganizationsFound:"No LinkedIn organizations found",noOrganizationsFoundSubtext:"Please make sure you have access to LinkedIn company pages",selectionDescription:"Choose which LinkedIn organizations you'd like to connect to your account. You can publish content to these pages once connected.",selectAll:"Select All",deselectAll:"Deselect All",organizationsSelected:"{{count}} of {{total}} organizations selected",companyPage:"Company Page",organizationsExpire:"Organizations expire: {{date}}",connectButton:"Connect {{count}} Organization",connectButton_plural:"Connect {{count}} Organizations",connecting:"Connecting...",linkedInPageFallback:"LinkedIn Page {{id}}",organizationType:{educational:"Educational",publicCompany:"Public Company",privatelyHeld:"Private Company",selfEmployed:"Self-Employed",selfOwned:"Self-Owned",partnership:"Partnership",nonProfit:"Non-Profit",governmentAgency:"Government Agency",unknown:"Organization"}}},rge={title:"Media Gallery",subtitle:"Manage your media assets across all brands",upload:"Upload Media",search:"Search media by name, type, or tags...",selectMultiple:"Select Multiple",exitSelection:"Exit Selection",selectedCount:"{{count}} items selected",clearSelection:"Clear Selection",loading:"Loading media files...",error:"Error loading media files",uploading:"Uploading...",pleaseWait:"Please wait while your file is being uploaded",uploadError:"Upload Failed",tryAgain:"Try Again",uploadSuccess:"Upload Successful",fileUploaded:"Your file has been uploaded successfully and will appear in the gallery shortly.",closeUploadModal:"Close",filters:{all:"All Media",images:"Images",videos:"Videos",documents:"Documents",brand:"Filter by brand",allBrands:"All Brands",date:"Filter by date"},totalMedia:"Total media: {{count}}",sort:{label:"Sort by",newest:"Newest",oldest:"Oldest",nameAZ:"Name A-Z",nameZA:"Name Z-A",size:"Size"},view:{grid:"Grid view",list:"List view"},item:{name:"Name",size:"Size",dimensions:"Dimensions",uploadedBy:"Uploaded by",uploadedAt:"Uploaded at",brand:"Brand",tags:"Tags",edit:"Edit",delete:"Delete",download:"Download",copyUrl:"Copy URL",urlC
3770opied:"URL copied to clipboard",preview:"Preview",profilePictureBadge:"Current Profile Picture",close:"Close"},deleteConfirm:{title:"Delete Media",message:"Are you sure you want to delete this media? This action cannot be undone.",cancel:"Cancel",confirm:"Delete"},bulkDeleteConfirm:{title:"Bulk Delete Media",message:"Are you sure you want to delete {{count}} media items? This action cannot be undone.",cancel:"Cancel",confirm:"Delete"},bulkDelete:"Delete {{count}} items",bulkDeleteProgress:{title:"Deleting media files...",message:"Please wait while your files are being deleted"},bulkDeleteSuccess:"Files successfully deleted","bulkDeleteSuccess.message":"Your files have been successfully removed from the media gallery",noResults:"No media items found matching your search criteria",dropzone:{title:"Drag & Drop Files",subtitle:"or click to browse",maxSize:"Max file size: 10MB"}},nge={title:"Post Content",contentCreationTooltip:"Create your content for this post",contentTextPlaceholder:"What would you like to share?",selectBrand:"Select or add a brand to continue",uploadMediaTooltip:"Upload media",removeMediaTooltip:"Remove media",removeMediaConfirm:"Are you sure you want to remove this media?",characterLimit:"{{count}}/{{limit}} characters",formats:"Formats",mediaSizeError:"File size is larger than 25MB",mediaTypeError:"Unsupported file type",regularFormat:"Classic (Horizontal)",reelFormat:"Reel (Vertical)",addMoreImages:"Add more images",boldTooltip:"Bold",italicTooltip:"Italic",underlineTooltip:"Underline",emojiTooltip:"Emoji",emojiSearch:"Search emoji...",utmModal:{title:"Enhanced UTM link generated 
3770with AI",description:"This smart link works just like your original one, but now you can track clicks in Google Analytics, for free.",finalUrl:"New Link with UTM:",utmParams:"UTM Parameters:",keepOld:"No, keep old link",updateLink:"Yes, update link",createShortLink:"Create Short Link"}},age={title:"Onboarding",welcome:"Welcome {{firstName}}",subtitle:"Choose your path and complete the essentials to get value fast. Start with your website or explore step by step below.",gettingStarted:"Getting Started",completed:"completed",steps:{brand_analysis:{title:"Analyze your brand",description:"Use AI to analyze your website and get a complete, personalized brand strategy"},persona_creation:{title:"Create your first persona",description:"Generate detailed profiles of your ideal audience with AI to better target your content"},content_creation:{title:"Create relevant content with AI",description:"Create content for your social networks tailored to your brand and personas using AI"},social_account_connection:{title:"Connect your first social media account",description:"Connect your social network accounts to schedule and publish automatically"},shorten_link:{title:"Create a smart trackable link",description:"Use the Smart Link Builder and Shortener to generated automatically a trackable link and shorten it to make it easier to share."},post_review:{title:"Ask AI to review your post",description:"Not sure about your next post? Ask AI directly in the app to check what can be improved and why?"},ai_analytics:{title:"Check your analytics analyzed by AI",description:"Get intelligent insights on your publications' performance through AI analysis"}},actions:{start:"Start",review:"Review",locked:"Locked",redo:"Do again",startAnalyze:"Start Analyzing Brand",startCreatePersona:"Start Creating Persona",startCreateContent:"Start Creating Content",startConnectAccount:"Start Connecting Account",startReviewPost:"Start Reviewing Post",startViewAnalytics:"Start Viewing Analytics",trackYourLink:"Track your link",reject:"Reject",approve:"Approve",schedule:"Schedule",generateImage:"Generate an image"},tooltips:{locked:"Complete the previous step to unlock"},encouragement:{start:"Let's get started!",goodStart:"Good start, keep going!",halfway:"Great job! You're over halfway there!",almostThere:"Almost there, just a few more steps!",done:"Congratulations! You completed the onboarding!"},progress:{title:"Your Progress 🤩",completed:"Well done!",allSteps:"You completed all steps.",lowCompletion:"You're just getting started!",highCompletion:"Almost there!"},videoCall:{title:"Book your personalized video call",description:"You'll get a 30 minute product tour to ensure your set-up goes smoothly",cta:"Schedule time",learnMore:"Learn more",demoRequestMessage:"Hey, I want to book a demo!"},choosePlan:{title:"Choose your plan",description:"Select the right plan for your business and unlock all premium features",cta:"View plans",learnMore:"Compare plans"},pageBuilder:{title:"New Page Builder",description:"Unlock new design possibilities and experience the evolution of page creation",cta:"Try it out",learnMore:"Learn more"},banner:{title:"Ready to start your journey {{firstName}}?",description:"We know some of you want to skip to the finish line, and others prefer exploring every step. That's why you have two options:",destinationTitle:"The destination",destinationText:"Enter your website URL to generate your marketing strategy, personas, and first posts in 5 minutes. Then explore the app on your own.",journeyTitle:"The journey",journeyText:"Go through each step below to learn how every feature works and how you can leverage them.",featuresIntro:"Go through your own onboarding to enjoy our unique features:",supportHint:"Have any question? Reach out to us via the chat on the bottom right.",urlPlaceholder:"Enter your website URL",cta:"Let's go",analyzing:"Analyzing...",urlRequired:"Please enter a website URL"}},sge={title:"My Content",subtitle:"Manage all your posts and ideas in one place",loading:{title:"Loading your content...",fetchingPosts:"Fetching your posts from the server...",refreshing:"Refreshing posts..."},view:{list:"List",grid:"Grid",board:"Board"},table:{content:"Content",platforms:"Platforms",brand:"Brand",status:"Status",stats:"Stats",date:"Date",actions:"Actions"},filter:{columns:"Columns"},columns:{brand:"Brand",created:"Created",updated:"Updated",published:"Published"},noStatsYet:"No stats yet"},ige={title:"Hello {{firstName}}, Here's your Social Media overview",subtitle:"This is your content command center. Track, plan and optimize your content with the help of AI insights and recommendations.",pageTitle:"Dashboard",seeAnalytics:"See my analytics",metrics:{youtubeSubscribers:"YouTube Subscribers",facebookF
3770ollowers:"Facebook Followers",instagramFollowers:"Instagram Followers",linkedinFollowers:"LinkedIn Followers",tiktokFollowers:"TikTok Followers"}},oge={google:"Google Business"},lge={brandsAndPlatforms:{title:"Publishing channels"},platforms:{sectionTitle:"Channels"},mediaPost:{title:"Media",formats:"Formats",regular:"Regular",horizontal:"(Horizontal)",reel:"Reel",vertical:"(Vertical)"},schedule:{title:"Schedule",toggleLabel:"Schedule this post",toggleDescription:"Schedule this post for a later date and time. You can check the AI suggestion for your brand to help you.",scheduledFor:"Scheduled for:",invalidDateWarning:"Please select a future date and time.",timeLabel:"Time",dateLabel:"Date",notScheduled:"Not scheduled (Will publish immediately)"},approval:{title:"Approval Required",toggleLabel:"Send for approval",toggleDescription:"This post will require approval from the reviewer you select below.",reviewerLabel:"Select Reviewer",selectPlaceholder:"Select a reviewer...",selectReviewerWarning:"Please select a reviewer for this post.",noReviewersError:"No eligible reviewers found for the selected brand. Cannot request approval.",statusTitle:"Approval Status",statusRequired:"Will be reviewed by {{reviewerName}}",statusPendingSelection:"Pending reviewer selection",statusNoReviewersAvailable:"No reviewers available",statusNotRequired:"Will not be reviewed"},aiContent:{title:"AI Enhanced Content",originalScore:"Original Score",enhancedScore:"Enhanced Score",apply:"Apply",copyToClipboard:"Copy to clipboard",detailedScores:"Detailed Analysis",hookStrength:"Hook Strength",brandAlignment:"Brand Alignment",ctaEffectiveness:"CTA Effectiveness",platformOptimization:"Platform Optimization",contentQuality:"Content Quality"}},cge={approve:"Approve",trackYourLink:"Track your link",generateImage:"Generate an image",addFromDesktop:"Add from desktop",addFromCanva:"Add from Canva"},uge={modal:{title:"Create with Canva",instructions:"Create your design, then download it to import into Socialness"},selectDesign:"Select a Canva Design",selectDesignSingular:"Select a Canva Design ({{count}} selected)",selectDesignsPlural:"Select Canva Designs ({{count}} selected)",exporting:"Exporting...",addMedia:"Add 1 media",addMedias:"Add {{count}} medias",page:"Page {{current}} of {{total}}",exportingDesigns:"Exporting designs...",preparingImages:"Please wait while we prepare your images",waitForExport:"Please wait for export to complete",refreshDesigns:"Refresh designs",noDesigns:"No designs found",noDesignsDesc:"You don't have any designs in your Canva account yet.",createNew:"Create new design"},dge={loading:{title:"Processing Canva Integration...",processing:"Connecting your design..."},error:{title:"Canva Integration Error",redirecting:"Redirecting to dashboard..."}},fge={authRequiredAi:"You must be logged in to use AI features.",contentRequiredAi:"Please enter some content before using AI Boost.",boostFailed:"AI Boost failed",authRequired:"Authentication required",missingBrandOrPersona:"Missing brand or persona for image generation",missingBrand:"Missing brand for image generation",imageGenerationFailed:"Image generation failed",canvaOpenFailed:"Failed to open Canva",captionRequired:"Please add a caption before creating an image",platformRequired:"Please select a publishing channel before creating an image",captionAndPlatformRequired:"Please add a caption and select a publishing channel before creating an image"},mge={publishDisabled:{tiktokDisclosure:"You need to indicate if your content promotes yourself, a third party, or both."},locked:"Complete the previous step to unlock"}
3770,hge={createPost:{title:"Create Post",subtitle:"Create a new social media post"},editPost:{title:"Edit Post",subtitle:"Update your social media post"},status:{draft:"Draft",scheduled:"Scheduled",waiting_for_approval:"Waiting Approval",needsYourApproval:"Needs Your Review",published:"Published",rejected:"Rejected",error:"Error",processing:"Processing",pending:"Pending"},days:{monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},aiBestTime:{selectPrompt:"Select a Brand and at least one Platform to see AI recommendations.",errorLoading:"Error loading recommendations:",noData:"No recommendations available for the selected criteria.",noDataForDay:"Please choose a brand AND a platform to start",tooltipHour:"Hour:",tooltipScore:"Score:",tooltipReason:"Reason:",title:"AI Best Time to Post",titleForBrandPrefix:"AI Best time to post for",description:"Hourly engagement score based on AI analysis, following an in-depth review of your brand and audience",suggestionPrefix:"AI Suggestion:",suggestionBody:"Next best time to post is",bestDays:"Best Days",avoidDays:"Days to Avoid",topRecommendationsTitle:"Top Recommended Times:"}},pge={saveDraftInstead:{title:"Account Connection Missing",message:"The selected brand '{{brandName}}' does not have a connected account for the following platform(s): {{platformList}}. You can save this post as a draft and connect the accounts later.",question:"Would you like to save this post as a draft instead?"}},gge={title:"Choose Instagram Connection Type",option1:{titleLine1:"Personal Profile",titleLine2:"(Your personal account)",description:"Using it for business? Switch to a professional account and access all the tools you need.",tag:"Not available"},option2:{title:"Professional Profile + Facebook",description:"Connect your facebook and instagram accounts in one step",tag:"Recommended",cta:"Connect via Facebook"},option3:{title:"Professional Account (Instagram Only)",description:"Connect your Instagram business or creator account directly.",cta:"Connect via Instagram"}},yge={noBrands:"No brands available",allBrands:"All Brands"},bge={title:"Integrations",subtitle:"Connect your favorite tools and services",searchPlaceholder:"Search integrations...",allStatuses:"All Statuses",allCategories:"All Categories",resultsCount:"Showing {{count}} of {{total}} integrations",noResults:"No integrations found",noResultsFiltered:"Try adjusting your search or filter criteria",noIntegrations:"No integrations are available at the moment",filters:"Filters",filterByStatus:"Filter by Status",filterByCategory:"Filter by Category",clearFilters:"Clear all filters",showOnlyConnected:"Show only connected",showOnlyConnectedDesc:"Only show integrations that have connected accounts",categories:{link_shortener:"Link Shortener",social_media:"Social Media",analytics:"Analytics",email_marketing:"Email Marketing",crm:"CRM",payment:"Payment",productivity:"Productivity",design:"Design",communication:"Communication",automation:"Automation",link_shortenerDesc:"URL shortening and link management tools for tracking and analytics.",social_mediaDesc:"Connect your social media accounts to manage posts, analytics, and engagement across platforms.",analyticsDesc:"Track performance, audience insights, and engagement metrics for your content.",email_marketingDesc:"Manage email campaigns, subscriber lists, and newsletter automation.",crmDesc:"Customer relationship management tools to organize contacts and interactions.",paymentDesc:"Payment processors and financial tools for transactions and billing.",productivityDesc:"Tools to streamline workflows, task management, and team collaboration.",designDesc:"Graphic design tools, creative software, and media editing platforms for content creation.",communicationDesc:"Messaging, chat, and communication platforms for team coordination.",automationDesc:"Workflow automation, API integrations, and process optimization tools."},statuses:{connected:"Connected",disconnected:"Disconnected",active:"Active",inactive:"Inactive",pending:"Pending",available:"Available",coming_soon:"Coming Soon",maintenance:"Maintenance",beta:"Beta",availableDesc:"Integration is available for connection. Click to set up and start using it.",betaDesc:"This integration is in beta testing phase. Features may be limited or unstable.",coming_soonDesc:"This integration is under development and will be available soon.",maintenanceDesc:"Integration is temporarily unavailable due to maintenance. Check back later.",disconnectedDesc:"Integration was connected but is now disconnected. Reconnect to restore functionality.",pendingDesc:"Integration setup is in progress. Please wait while we complete the connection."},authTypes:{oauth:"OAuth",oauth2:"OAuth 2.0",api_key:"API Key","api-key":"API Key",basic:"Basic Auth",token:"Token",webhook:"Webhook",none:"No Auth Required"},statusDescriptions:{all:"View integrations in all statuses",connected:"Filter by integrations currently connected and active",disconnected:"Filter by integrations that are not connected",active:"Filter by integrations that are currently active",inactive:"Filter by integrations that are currently inactive",pending:"Filter by integrations with pending connection status",available:"Filter by integrations available for connection",coming_soon:"Filter by integrations that are coming soon",maintenance:"Filter by integrations under maintenance"},categoryDescriptions:{all:"View all integration categories",link_shortener:"Filter by link shortening and URL management tools",social_media:"Filter by social media platforms and tools",analytics:"Filter by analytics and tracking platforms",email_marketing:"Filter by email marketing and automation tools",crm:"Filter by customer relationship management systems",payment:"Filter by payment processing and e-commerce tools",productivity:"Filter by productivity and workflow tools",design:"Filter by design and creative tools",communication:"Filter by communication and messaging platforms",automation:"Filter by automation and workflow tools"}},vge={noAccountConnectedForBrand:"{{brandName}} does not have a connected account for {{platform}}.",noAccountConnectedForBrandMultiple:"{{brandName}} does not have connected accounts for: {{platformList}}.",saveAsDraftOnly:"You can save as draft but not post yet.",saveAsDraftOnlyNote:"You can save as draft but not publish yet."},xge={title:"AI Link Builder & Shortener",subtitle:"Manage and track y
3770our shortened links",createSmartLink:"Create a smart link",searchPlaceholder:"Search links by URL...",resultsCount:"Showing {{count}} of {{total}} links",originalUrl:"Original URL",shortUrl:"Short URL",copyUrl:"Copy URL",openUrl:"Open URL",clicks:"clicks",created:"Created",createdBy:"Created by",lastClicked:"Last clicked on",source:"Source",errorLoading:"Failed to load links",noResults:"No links found",noResultsFiltered:"Try adjusting your search criteria",noLinks:"You haven't created any smart links yet",createFirstLink:"Create your first smart link",createSuccess:"Short link created successfully!",createError:"Failed to create short link. Please try again.",statuses:{active:"Active",inactive:"Inactive",pending:"Pending",expired:"Expired"},analytics:{totalClicks:"Total Clicks",uniqueUsers:"Unique Users",totalLinks:"Total Links",clicks:"Clicks",clicksOverTime:"Clicks Over Time",last30Days:"Last 30 days performance"}},wge={followers:"followers",follow:"Follow",comments:"comments",reposts:"reposts",viewAllComments:"View all {{count}} comments",originalAudio:"Original audio",time:{hoursAgo:"{{count}} HOURS AGO",hourAgo:"{{count}} HOUR AGO"},actions:{like:"Like",comment:"Comment",repost:"Repost",send:"Send",share:"Share"}},jge={title:"Payment Successful - Socialness.ai",loading:"Loading payment details...",successTitle:"Payment Successful! 🎉",successMessage:"Your payment has been successful.",subscriptionMessage:"You just subscribed on a {{billingInterval}} basis to the {{planName}} plan.",subscriptionDetails:"Subscription Details",plan:"Plan:",price:"Price:",billing:"Billing:",yearly:"Yearly",monthly:"Monthly",nextBilling:"Next billing:",redirectMessage:"You will be redirected to your billing page in <1>{{countdown}}</1> seconds.",goToBilling:"Go to Billing Now",welcomeMessage:"Welcome to Socialness.ai! Start managing your social media like a pro."},Nge={title:"Payment Cancelled - Socialness.ai",cancelTitle:"Payment Cancelled or Error Occurred. Please try again from the billing page. ❌",supportMessage:"If the error persists, please reach out to us directly via the live chat on the bottom right.",redirectMessage:"You will be redirected to your billing page in <1>{{countdown}}</1> seconds.",goToBilling:"Go to Billing Now"},Sge={title:"Boost Mode",subtitle:"Generate content ideas and create multiple posts at once with AI",selectBrand:"Select Brand",selectPersona:"Select Persona",contentIdeas:"Content Ideas",generateMore:"Generate 5 more",createManually:"Create Manually",createPosts:"Create posts",topicsGenerated:"topics generated",noPersonas:"No personas available for this brand",createPersona:"Create a Persona",ideasError:"Failed to load content ideas",noIdeas:"No content ideas available yet. Generate some ideas to get started!",welcomeTitle:"Welcome to Boost Mode!",welcomeDescription:"Boost your productivity! Select a brand and persona to generate content ideas and create multiple complete posts at once, perfectly tailored to your audience.",step1:"Choose your brand and target persona",step2:"Browse content ideas and generate complete posts",step3:"Select multiple ideas to create posts in bulk",saveAll:"Save all",personasPage:"Page {{current}} of {{total}} ({{count}} personas total)",performanceTip:"Tip: Select 1-3 ideas for faster generation",generatedContent:"Generated Content",selectAll:"Select All",saveSelected:"Save Selected",quota:{free:"{{remaining}}/{{total}} trial boosts left today",paid:"{{remaining}}/{{total}} boosts left today"},cooldown:{wait:"Please wait {{seconds}} seconds"},rateLimiting:{dailyLimitReached:"Daily limit reached",dailyLimitReachedMessage:"You've used all your boosts for today. Come back tomorrow or upgrade to a higher plan.",upgradeFromFree:"Upgrade to a paid plan for more boosts"},quotaCard:{title:"Boost Quota",used:"Used",total:"Total",lastBoostToday:"Last boost available today",remainingBoosts:"{{count}} boosts left today"},toasts:{functionCalled:"🔄 Function called successfully!",noIdeasSelected:"⚠️ No ideas selected",noBrandSelected:"⚠️ No brand selected",noPersonaSelected:"⚠️ No persona selected",generatingPosts:"🚀 Generating posts...",brandDataUnavailable:"❌ Brand data unavailable",postsGeneratedSuccess:"🎉 {{count}} posts generated successfully!",noContentGenerated:"⚠️ No content generated",generationFailed:"❌ Generation failed: {{message}}",noContentToSave:"⚠️ No content to save",draftsAllSavedSuccess:"✅ {{count}} drafts saved successfully",draftsPartialSuccess:"⚠️ {{successCount}} drafts saved, {{errorCount}} errors",draftsSaveFailed:"❌ Error saving all drafts",saveAllError:"❌ General error while saving",noPostsSelected:"⚠️ No posts selected",selectedPostsSavedSuccess:"✅ {{successCount}} selected posts saved successfully",selectedPostsPartialSuccess:"⚠️ {{successCount}} posts saved, {{errorCount}} errors",selectedPostsSaveFailed:"❌ Error saving selected posts",saveSelectedError:"❌ General error while saving selected posts",draftSaveError:"❌ Error saving drafts",timeoutError:"⏱️ Generation too slow... Try with fewer ideas (1-3) or try again later.",rateLimitReached:"❌ Boost limit reached",cooldownActive:"⏳ Cooldown active, please wait"}},Cge={platformCapNamed:"{{platform}} allows multi-images up to {{cap}} images"},kge={settings:{title:"LinkedIn Settings",companyPage:"LinkedIn Company Page",publishingAsCompany:"Publishing as company page",visibility:"Post Visibility",visibilityPublic:"Public",visibilityConnections:"Connections only"}},Mge={preview:"Preview",aiTimeSuggestions:"AI Time Suggestions",planning:"Planning"},Ige={title:"Confirm Publication",successTitle:"Success!",successMessage:"Your post has been published successfully.",brandPublishingAs:"Publishing as brand",schedule:{title:"Scheduled Publication",willPublishOn:"Will be published on {{datetime}}"},content:{title:"Content"},media:{unavailable:"Media preview unavailable",noMedia:"No media",type:{image:"image",video:"video"},format:{reel:"reel",attachment:"attachment"}},badge:{reel:"Reel format"},list:{title:"Will be published on"},warning:{scheduled:"This post will be published at the scheduled time.",publishAll:"This action will publish your post to all selected platforms. This cannot be undone."}
3770,errors:{title:"Publication Errors",generic:"Failed to publish post"},buttons:{cancel:"Cancel",publishing:"Publishing...",schedulePost:"Schedule Post",publishNow:"Publish Now"}},Ege={title:"Congrats, you have reached your limit 🥳",description:"You want to get more you can delete a {{singular}} or upgrade now to get more {{plural}}.",cta:"Upgrade now"},Tge={postDeleteErrors:Ppe,postSaveErrors:_pe,common:Lpe,beta:Dpe,posts:Ope,mediaFormatDropdown:Rpe,postFormatDropdown:$pe,sidebar:Fpe,brands:zpe,teamMembers:Bpe,auth:Upe,youtube:Vpe,tiktok:Wpe,analytics:qpe,billing:Gpe,trialExpired:Hpe,calendar:Ype,ideaDetail:Qpe,ideaModal:Kpe,settings:Jpe,personas:Zpe,contentCreation:Xpe,languageCode:ege,accounts:tge,mediaGallery:rge,postContent:nge,onboarding:age,contentHub:sge,dashboard:ige,platforms:oge,cards:lge,actions:cge,canva:uge,canvaReturn:dge,errors:fge,tooltips:mge,pages:hge,modals:pge,instagramOptionsModal:gge,brandDropdown:yge,integrations:bge,warnings:vge,links:xge,previews:wge,paymentSuccess:jge,paymentCancel:Nge,boostMode:Sge,hints:Cge,linkedin:kge,tabs:Mge,publishModal:Ige,upgradeModal:Ege},Age={network:"La réponse du serveur n’a pas pu être reçue. Actualisez Mes contenus pour vérifier si la publication a été supprimée avant de réessayer.",unknown:"Impossible de supprimer la publication. Veuillez réessayer plus tard.",partial:"Publications supprimées : {{deleted}}. Échecs de suppression : {{failed}}."},Pge={network:"La réponse du serveur n’a pas pu être reçue. Vos modifications sont toujours dans ce formulaire. Vérifiez votre connexion et consultez Mes contenus dans un autre onglet avant de réessayer pour éviter un doublon.",server:"Le serveur est temporairement indisponible. Vos modifications sont toujours dans ce formulaire. Veuillez réessayer plus tard.",unknown:"Impossible d’enregistrer la publication. Vos modifications sont toujours dans ce formulaire."},_ge={dashboard:"Tableau de bord",content:"Contenu",personas:"AI Personas Builder",strategy:"Stratégie de marque",analytics:"Analytique",settings:"Paramètres",logout:"Déconnexion",previous:"Précédent",save:"Enregistrer",cancel:"Annuler",goBack:"Revenir en arrière",purge:"Vider",add:"Ajouter",modify:"Modifier",delete:"Supprimer",hide:"Masquer",openOnPlatform:"Ouvrir sur la plateforme",externalPostReadOnly:"Publié hors Socialness — lecture seule",deleting:"Suppression...",saving:"Enregistrement...",promoteToDraft:"Transformer en brouillon",accept:"Accepter",decline:"Refuser",billing:"Facturation",confirm:"Confirmer",create:"Créer",noBrandsAvailable:"Aucune marque disponible",connectAccountFirst:"Connectez un compte de réseau social pour commencer",createBrandFirst:"Créez votre première marque pour commencer",connectAccount:"Connecter un Compte",createBrand:"Créer une marque",loading:"Chargement en cours...",error:"Erreur",unknownError:"Une erreur inconnue s'est produite",languageSearchPlaceholder:"Tapez pour rechercher une langue ou sélectionnez dans la liste",date:"Date",time:"Heure",back:"Retour",saveDraft:"Enregistrer le brouillon",generating:"Génération en cours...",linking:"Liaison en cours...",checkPostStatus:"Vérifier le statut du post",postStatusModalTitle:"Statut du post",postStatusSuccess:"Votre post a été publié avec succès !",postStatusProcessing:"Votre post est en cours de traitement",timezoneDropdown:{searchPlaceholder:"Rechercher des fuseaux horaires...",noResults:"Aucun fuseau horaire trouvé",group:{usCanada:"États-Unis/Canada",Europe:"Europe",Asia:"Asie",Africa:"Afrique",Australia:"Australie",Pacific:"Pacifique",Standard:"Standard"},timezoneLabel:"Fuseau horaire"},copy:"Copier",copied:"Copié !",trackingLink:"Traçage du lien...",close:"Fermer",duplicate:"Dupliquer"},Lge={notificationMessage:"Merci de rejoindre la bêta. Écrivez-moi sur le Chat si vous trouvez des bugs 👇🏽",trial:{leftPrefix:"Plus que",leftDays:"jours restants dans votre période d'essai.",subscribeNow:"S'abonner maintenant",overPrefix:"Votre période d'essai est terminée."}},Dge={all:"Tous les types de média",allDesc:"Afficher les posts avec tous types de média ou contenu.",image:"Image",imageDesc:"Posts contenant uniquement des images.",video:"Vidéo",videoDesc:"Posts contenant uniquement des vidéos.",carousel:"C
3770arrousel",carouselDesc:"Posts avec plusieurs images ou médias mixtes.",text:"Texte seulement",textDesc:"Posts avec du contenu textuel uniquement, sans média."},Oge={all:"Tous les formats",allDesc:"Afficher les posts dans tous les formats (classique et reel).",regular:"Post classique",regularDesc:"Posts au format horizontal standard pour les fils d'actualité.",reel:"Reel/Short",reelDesc:"Contenu au format vertical pour les reels et les shorts."},Rge={facebook:"Facebook",instagram:"Instagram",linkedin:"LinkedIn",tiktok:"TikTok",twitter:"Twitter",youtube:"YouTube",google:"Google Business"},$ge={title:"Contenu de la publication",contentCreationTooltip:"Créez votre contenu pour cette publication",contentTextPlaceholder:"Que souhaitez-vous partager?",selectBrand:"Sélectionnez ou ajoutez une marque pour continuer",uploadMediaTooltip:"Télécharger des médias",removeMediaTooltip:"Supprimer le média",removeMediaConfirm:"Êtes-vous sûr de vouloir supprimer ce média?",characterLimit:"{{count}}/{{limit}} caractères",formats:"Formats",mediaSizeError:"La taille du fichier est supérieure à 25 Mo",mediaTypeError:"Type de fichier non pris en charge",regularFormat:"Régulier (Horizontal)",reelFormat:"Reel (Vertical)",caption:"Légende",media:"Média",contentPlaceholder:"Rédigez le contenu de votre publication...",aiEnhancedContent:"Contenu Amélioré par l'IA",useBoostPrompt:`Utilisez "Booster avec l'IA" pour améliorer votre contenu`,optimizationDescription:"Notre IA optimisera votre légende pour un meilleur engagement",aiFeedback:"Analyse IA",feedbackWillAppearHere:"L'analyse IA apparaîtra ici",professionalInsights:"Obtenez des conseils professionnels pour améliorer votre contenu",dropMediaHere:"Déposez votre média ici ou cliquez pour télécharger",supportedFormats:"Prend en charge les images et vidéos jusqu'à 10Mo",addMoreImages:"Ajouter d'autres images",boldTooltip:"Gras",italicTooltip:"Italique",underlineTooltip:"Souligné",emojiTooltip:"Emoji",emojiSearch:"Rechercher un emoji...",utmModal:{title:"Lien UTM amélioré généré par l'IA",description:"Ce lien intelligent fonctionne comme l'original, mais vous pouvez maintenant suivre les clics dans Google Analytics, gratuitement.",finalUrl:"Nouveau lien avec UTM :",utmParams:"Paramètres UTM :",keepOld:"Non, garder l'ancien lien",updateLink:"Oui, mettre à jour le lien",createShortLink:"Raccourcir le lien"}},Fge={brandsAndPlatforms:{title:"Canaux de publication"},brands:{title:"Marques",selectPlaceholder:"Sélectionner une marque..."},platforms:{title:"Plateformes",sectionTitle:"Canaux"},mediaPost:{title:"Média",formats:"Formats",regular:"Régulier",horizontal:"(Horizontal)",reel:"Reel",vertical:"(Vertical)"},schedule:{title:"Planification",toggleLabel:"Planifier pour plus tard",toggleDescription:"Choisissez quand publier. La suggestion de l'IA pour votre marque peut vous aider.",pastDateWarning:"Veuillez sélectionner une date et une heure futures. Les publications ne peuvent pas être planifiées dans le passé.",statusTitle:"État de publication",statusScheduled:"Planifié pour le {{date}} (heure {{timezoneName}})",statusImmediate:"Sera publié immédiatement"},preview:{title:"Aperçu",platformPreviewTitle:"Aperçu {{platformName}}",selectPlatformPrompt:"Sélectionnez une plateforme pour voir l'aperçu"},aiContent:{title:"Contenu Amélioré par l'IA",originalScore:"Score Original",enhancedScore:"Score Amélioré",apply:"Appliquer",copyToClipboard:"Copier dans le presse-papiers",detailedScores:"Analyse Détaillée",hookStrength:"Force d'Accroche",brandAlignment:"Alignement de Marque",ctaEffectiveness:"Efficacité CTA",platformOptimization:"Optimisation Plateforme",contentQuality:"Qualité du Contenu"},aiFeedback:{title:"Analyse IA",useBoostPrompt:`Utilisez "Booster avec l'IA" pour améliorer votre contenu`,optimizationDescription:"Notre IA optimisera votre légende pour un meilleur engagement",feedbackWillAppearHere:"L'analyse IA apparaîtra ici",professionalInsights:"Obtenez des conseils professionnels pour améliorer votre contenu"},approval:{title:"Approbation requise",toggleLabel:"Envoyer pour approbation",toggleDescription:"Ce message nécessitera l'approbation du réviseur que vous sélectionnez ci-dessous.",reviewerLabel:"Sélectionner un réviseur",selectPlaceholder:"Sélectionnez un réviseur...",selectReviewerWarning:"Veuillez sélectionner un réviseur pour ce message.",noReviewersError:"Aucun réviseur éligible trouvé pour la marque sélectionnée. Impossible de demander l'approbation.",statusTitle:"Statut d'approbation",statusRequired:"Sera revu par {{reviewerName}}",statusPendingSelection:"En attente de sélection du réviseur",statusNoReviewersAvailable:"Aucun réviseur disponible",statusNotRequired:"Ne sera pas revu"}},zge={platformCapNamed:"{{platform}} autorise jusqu'à {{cap}} images en carrousel"},Bge={publishNow:"Publier maintenant",boostWithAi:"Booster avec l'IA",addFromDesktop:"Ajouter depuis l'ordinateur",addFromCanva:"Ajouter depuis Canva",start:"Commencer",review:"Revoir",locked:"Verrouillé"},Uge={modal:{title:"Créer avec Canva",instructions:"Créez votre design, puis téléchargez-le pour l'importer dans Socialness"},selectDesign:"Sélectionner un design Canva",selectDesignSingular:"Sélectionner un design Canva ({{count}} sélectionné)",selectDesignsPlural:"Sélectionner des designs Canva ({{count}} sélectionnés)",exporting:"Exportation...",addMedia:"Ajouter 1 média",addMedias:"Ajouter {{count}} médias",page:"Page {{current}} sur {{total}}",exportingDesigns:"Exportation des designs...",preparingImages:"Veuillez patienter pendant la préparation de vos images",waitForExport:"Veuillez attendre la fin de l'exportation",refreshDesigns:"Actualiser les designs",noDesigns:"Aucun design trouvé",noDesignsDesc:"Vous n'avez encore aucun design dans votre compte Canva.",createNew:"Créer un nouveau design"},Vge={loading:{title:"Traitement de l'intégration Canva...",processing:"Connexion de votre design..."},error:{title:"Erreur d'intégration Canva",redirecting:"Redirection vers le tableau de bord..."}},Wge={title:"Onboarding",welcome:"Bienvenue, {{firstName}} !",subtitle:"Utilise l'onboarding qui te convient le mieux. Commence par ton site web ou explore pas à pas ci‑dessous.",progress:{title:"Votre Progression 🤩",completed:"Bravo !",allSteps:"Vous avez complété toutes les étapes.",lowCompletion:"Vous venez juste de commencer !",highCompletion:"Presque terminé !"},encouragement:{start:"Commençons !",goodStart:"Bon début, continuez !",halfway:"Excellent travail ! Vous avez fait plus de la moitié du chemin !",almostThere:"Presque là, encore quelques étapes !",done:"Félicitations ! Vous avez terminé l'intégration !"},actions:{start:"Commencer",review:"Revoir",locked:"Verrouillé",redo:"Recommencer",startAnalyze:"Démarrer l'analyse de la marque",startCreatePersona:"Cr
3770éer un persona",startCreateContent:"Créer du contenu",startConnectAccount:"Connecter un compte",startReviewPost:"Soumettre à la relecture",startViewAnalytics:"Voir les analyses",trackYourLink:"Traquer mon lien"},videoCall:{title:"Réservez votre appel vidéo personnalisé",description:"Obtenez une visite guidée de 30 minutes pour garantir une configuration optimale",cta:"Planifier un rendez-vous",demoRequestMessage:"Bonjour, je souhaiterais réserver une démo !"},choosePlan:{title:"Choisissez votre forfait",description:"Sélectionnez le forfait adapté à votre entreprise et débloquez toutes les fonctionnalités premium",cta:"Voir les forfaits"},banner:{title:"Prêt à démarrer ton voyage {{firstName}} ?",description:"On sait que certains veulent aller droit au but, et d'autres préfèrent explorer chaque étape. C'est pourquoi vous avez deux options :",destinationTitle:"La destination",destinationText:"Entrez l'URL de votre site pour générer votre stratégie marketing, vos personas et vos premiers posts en 5 minutes. Ensuite, explorez l'app par vous-même.",journeyTitle:"Le voyage",journeyText:"Parcourez chaque étape ci-dessous pour découvrir toutes les fonctionnalités.",featuresIntro:"Parcours ton propre onboarding pour profiter de nos fonctionnalités uniques :",supportHint:"Une question ? Écris‑nous via le chat en bas à droite.",urlPlaceholder:"Entrez l'URL de votre site web",cta:"C'est parti",analyzing:"Analyse en cours...",urlRequired:"Veuillez saisir une URL de site web"},steps:{brand_analysis:{title:"Analyser sa marque",description:"Utilisez l'IA pour analyser votre site web et obtenir une stratégie de marque complète et personnalisée"},persona_creation:{title:"Créer un persona",description:"Générez des profils détaillés de votre audience idéale avec l'IA pour mieux cibler votre contenu"},content_creation:{title:"Créer du contenu",description:"Créez du contenu pour vos réseaux sociaux adapté à votre marque et personas grâce à l'IA"},social_account_connection:{title:"Connecter un compte réseau social",description:"Connectez vos comptes de réseaux sociaux pour programmer et publier automatiquement"},shorten_link:{title:"Créer un lien intelligent traçable",description:"Utilisez le Constructeur et Raccourcisseur de Liens IA pour générer automatiquement un lien traçable et le raccourcir afin de le partager plus facilement."},post_review:{title:"Demander à l'IA de relire votre post",description:"Pas sûr de votre prochain post ? Demandez à l'IA directement dans l'app de vérifier ce qui peut être amélioré et pourquoi."},ai_analytics:{title:"Voir ses analytics analysés par l'IA",description:"Obtenez des insights intelligents sur la performance de vos publications grâce à l'analyse IA"}}},qge={boostDisabled:{selectBrand:"Sélectionnez une marque pour activer le Boost IA",addContent:"Ajoutez du contenu pour activer le Boost IA",selectPlatform:"Sélectionnez au moins une plateforme pour activer le Boost IA"},publishDisabled:{tiktokDisclosure:"Vous devez indiquer si votre contenu promeut vous-même ou une marque partenaire pour continuer."},locked:"Complétez l'étape précédente pour déverrouiller"},Gge={authRequiredAi:"Vous devez être connecté pour utiliser les fonctionnalités IA.",contentRequiredAi:"Veuillez saisir du contenu avant d'utiliser le Boost IA.",boostFailed:"Échec du Boost IA",authRequired:"Authentification requise",utmBoostNotReady:"Impossible de traquer le lien. Assurez-vous qu'une URL est présente et qu'une plateforme est sélectionnée.",utmBoostFailed:"Échec du traçage du lien",missingBrandOrPersona:"Marque ou persona manquant pour la génération d'image",missingBrand:"Marque manquante pour la génération d'image",imageGenerationFailed:"Échec de la génération d'image",canvaOpenFailed:"Échec de l'ouverture de Canva",captionRequired:"Veuillez ajouter une légende avant de créer une image",platformRequired:"Veuillez sélectionner un canal de publication avant de créer une image",captionAndPlatformRequired:"Veuillez ajouter une légende et sélectionner un canal de publication avant de créer une image"},Hge={createPost:{title:"Créer une Publication",subtitle:"Créer une nouvelle publication pour les réseaux sociaux"},editPost:{title:"Modifier la Publication",subtitle:"Mettre à jour votre publication sur les réseaux sociaux"},status:{draft:"Brouillon",scheduled:"Planifié",waiting_for_approval:"En attente d'approbation",needsYourApproval:"Nécessite votre approbation",published:"Publié",rejected:"Rejeté",error:"Erreur",processing:"En cours de traitement",pending:"En attente"},days:{monday:"Lundi",tuesday:"Mardi",wednesday:"Mercredi",thursday:"Jeudi",friday:"Vendredi",saturday:"Samedi",sunday:"Dimanche"},aiBestTime:{selectPrompt:"Sélectionnez une marque et au moins une plateforme pour voir les recommandations IA.",errorLoading:"Erreur lors du chargement des recommandations :",noData:"Aucune recommandation disponible pour les critères sélectionnés.",noDataForDay:"Veuillez choisir une marque ET une plateforme pour commencer",tooltipHour:"Heure :",tooltipScore:"Score :",tooltipReason:"Raison :",title:"Me
3770illeur moment pour publier selon l'IA",titleForBrandPrefix:"Meilleur moment selon l'IA pour",description:"Score d'engagement horaire basé sur l'analyse IA suite à une analyse approfondie de votre marque et de votre audience.",suggestionPrefix:"Suggestion IA :",suggestionBody:"Le prochain meilleur moment pour publier est",bestDays:"Meilleurs jours",avoidDays:"Jours à éviter",topRecommendationsTitle:"Meilleurs moments recommandés :"}},Yge={categories:{summary:"RÉSUMÉ",content:"CONTENU",aiStudio:"STUDIO IA",management:"GESTION",links:"Liens Intelligents",extra:"EXTRA"},media:"Médiathèque",team:"Équipe",integrations:"Intégrations",links:"Liens Intelligents",aiLinksBuilder:"Constructeur de Liens IA",brands:"Marques & Stratégie",personas:"Personas",smartLinks:"Liens intelligents",connectedAccounts:"Comptes connectés",analytics:"Analytics & Performance",createContent:"Créer du contenu",aiCredits:"{{count}} Crédits IA"},Qge={title:"ADN de marque: le Labo",subtitle:"Gérez vos marques et leur présence sur les réseaux sociaux",values:"Valeurs",keywords:"Mots-clés",accounts:"Comptes",connectedAccounts:"Comptes connectés",connectAccount:"Connecter un compte",noAccounts:"Aucun compte connecté pour cette marque",brandKit:"Kit de Marque",posts:"Posts",marketingStrategy:"Stratégie Marketing",marketScope:"Portée du Marché",distributionType:"Type de Distribution",businessModel:"Modèle d'Affaires",priorityMarkets:"Marchés Prioritaires",colors:{palette:"Couleurs"},typography:"Typographie",addBrand:"Ajouter une marque",search:"Rechercher des marques par nom, description ou mots-clés...",noResults:"Aucune marque trouvée correspondant à vos critères de recherche",noBrands:"Aucune marque créée pour l'instant. Créez votre première marque pour commencer.",createFirst:"Créer votre première Marque",itemsLabel:"marque",itemsLabel_plural:"marques",create:{title:"Créer une marque",subtitle:"Configurez une nouvelle marque et sa stratégie sur les réseaux sociaux",submit:"Sauvegarder la marque"},edit:{title:"Modifier la marque",subtitle:"Mettre à jour les informations et la stratégie de la marque",brandIdentity:{title:"Identité de marque",name:"Nom de la marque",website:"URL du site web",description:"Description de la marque",logo:{change:"Changer le logo",upload:"Télécharger le logo"}},brandTone:{title:"Ton de la marque",contentTone:"Ton du contenu",languages:"Langues",industry:"Industrie"}
3770,brandGuidelines:{title:"Directives de marque",values:"Valeurs de la marque",voiceDescription:"Description de la voix de la marque",recommendedSocialNetworks:"Réseaux sociaux recommandés"},brandStrategy:{title:"Stratégie de marque",usp:"Points de vente uniques",contentFormats:"Formats de contenu"},marketingStrategy:{gtm:{title:"Stratégie Go-To-Market",short:"Description courte",targetSegments:"Segments Cibles",targetSegmentsPlaceholder:"Ajouter un segment cible"},personas:{types:"Types de Personas",typesPlaceholder:"Ajouter un type de persona"},businessModel:"Modèle d'Affaires",marketScope:{title:"Portée du Marché",scope:"Portée du Marché",priorityMarkets:"Marchés Prioritaires",priorityMarketsPlaceholder:"Ajouter un marché prioritaire"},distributionType:"Type de Distribution"},contentStrategy:{themes:{title:"Thèmes de contenu",placeholder:"Ajouter un thème de contenu"},gaps:{title:"Lacunes de contenu",placeholder:"Ajouter une lacune de contenu à combler"},engagement:{title:"Stratégie d'engagement",placeholder:"Ajouter une tactique d'engagement"},growth:{title:"Opportunités de croissance",placeholder:"Ajouter une opportunité de croissance"}},recap:"Aperçu",recapDescription:"Résumé généré par IA de votre site web",keyInsights:"Idées clés",keyInsightsDescription:"Observations importantes concernant votre site web",summary:{title:"Résumé de l'analyse du site web",recap:"Aperçu",recapDescription:"Résumé généré par IA de votre site web",takeaways:"Idées clés",takeawaysDescription:"Observations importantes concernant votre site web",noData:"Aucune donnée d'analyse de site web disponible. Essayez d'analyser votre site web pour obtenir des informations."},brandStyles:{title:"Styles de la marque",colors:{title:"Couleurs de la marque",recommendations:"Recommandations de couleurs",addColor:"Ajouter une couleur",newColor:"Nouvelle couleur"},fonts:{title:"Polices de la marque",recommendations:"Recommandations typographiques",noFonts:"Aucune police définie",addFont:"Ajouter une police",newFont:"Nouvelle police"},visual:{title:"Stratégie Visuelle",colorUsage:"Directives d'Utilisation des Couleurs",typography:"Directives Typographiques",elements:"Éléments Visuels à Mettre en Valeur",consistency:"Conseils de Cohérence Visuelle"}},refresh:{button:"Actualiser l'analyse",refreshing:"Actualisation...",noWebsite:"Aucune URL de site web trouvée à analyser.",error:"Échec de l'analyse du site web",invalidResponse:"Réponse invalide de l'analyse",success:"Données de marque actualisées avec succès !",genericError:"Échec de l'actualisation des données de marque. Veuillez réessayer.",modal:{title:"Actualiser les Données de Marque",description:"Cela va ré-analyser votre site web et mettre à jour toutes les données de marque incluant :",items:{colors:"Couleurs et identité visuelle",fonts:"Typographie et polices",content:"Stratégie de contenu",description:"Description et valeurs de marque"},warning:"Attention : Toutes les données actuelles seront écrasées et ne pourront pas être récupérées.",confirm:"Oui, Actualiser les Données",successTitle:"Données Actualisées !"}},fillWithAI:{button:"Remplir avec l'IA",analyzing:"Analyse en cours...",serviceUnavailable:"Le service d'analyse est temporairement indisponible. Veuillez réessayer dans quelques minutes.",temporaryError:"Service temporairement indisponible ({status}). Veuillez réessayer plus tard.",invalidResponse:"Réponse invalide de l'analyse",genericError:"Échec de l'analyse du site web. Veuillez réessayer.",modal:{title:"Remplir la Marque avec l'IA",description:"Cela va analyser un site web et remplir toutes les données de marque incluant :",items:{colors:"Couleurs et identité visuelle",fonts:"Typographie et polices",content:"Stratégie de contenu",description:"Description et valeurs de marque"},warning:"Attention : Toutes les données actuelles seront écrasées et ne pourront pas être récupérées.",confirm:"Continuer"},urlModal:{title:"Saisir l'URL du Site Web",description:"Veuillez saisir l'URL du site web que vous souhaitez analyser :",placeholder:"https://exemple.com",analyze:"Analyser le Site Web"}}},sections:{branding:"Image de marque",marketingStrategy:"Stratég
3770ie Marketing",contentStrategy:"Stratégie de contenu",brandStyles:"Styles de la marque",recap:"Récap"},validation:{requiredFields:"Les champs suivants sont obligatoires : "},delete:{title:"Supprimer la marque",message:'Êtes-vous sûr de vouloir supprimer la marque "{brandName}" ? Cette action ne peut pas être annulée.',warning:"Toutes les données associées, y compris le contenu, les analyses et les paramètres, seront définitivement supprimées."},websiteFetchModal:{title:"Ajoutez le site web de votre marque",description:"Entrez l'URL de votre site web et nous l'analyserons pour vous aider à démarrer plus rapidement",websiteLabel:"URL du site web",websitePlaceholder:"www.exemple.com",analyze:"Analyser",skipAnalysis:"Passer l'analyse",skipAndStart:"Passer et commencer de zéro",ariaLabel:{close:"Fermer la fenêtre"},loading:{title:"Analyse de votre site web...",step1:"Analyse du contenu du site",step2:"Identification des éléments de marque",step3:"Génération du profil de marque"},error:{fetch:"Échec de l'analyse du site web. Veuillez réessayer ou passer l'analyse."}},generation:{title:"Création de Votre Stratégie de Marque",steps:{analyzing:"Analyse des informations de marque et des marchés cibles...",identifying:"Identification des valeurs de marque et des points de vente uniques...",exploring:"Exploration de vos atouts de marque et de votre style graphique...",creating:"Création de la stratégie de contenu et des recommandations...",optimizing:"Optimisation de la présence sur les réseaux sociaux et recommandations de canaux...",finalizing:"Finalisation du profil de stratégie de marque..."}},recentPosts:"Vos {{count}} derniers posts",personasCount:"{{count}} personas",activeMember:"{{count}} membre actif",activeMembers:"{{count}} membres actifs",pendingMember:"{{count}} membre en attente",pendingMembers:"{{count}} membres en attente"},Kge={createPost:"Créer un post",noPosts:"Aucun post pour cette marque",createWithAI:"Créer avec l'IA",createWithAIDescription:"Laissez l'IA vous aider à créer du contenu engageant",createManually:"Créer manuellement",createManuallyDescription:"Rédigez votre propre contenu de A à Z",createIdea:"Sauvegarder une idée",createIdeaDescription:"Notez une idée de post pour plus tard avec un rappel"},Jge={title:"Membres de l'Équipe",subtitle:"Gérer les membres de l'équipe et leur accès aux marques",addMember:"Ajouter un Membre",searchPlaceholder:"Rechercher des membres par nom ou email",tabs:{all:"Tous",active:"Actifs",pending:"En attente"},table:{member:"Membre",brands:"Marques",orgRole:"Rôle d'organisation",joined:"Rejoint le",actions:"Actions"},actions:{editAriaLabel:"Modifier l'accès pour {email}",deleteAriaLabel:"Supprimer {email} de l'équipe",resendInvitation:"Renvoyer l'invitation",resendInvitationAriaLabel:"Renvoyer l'invitation à {email}"},brandAccess:{title:"Gestion des Accès aux Marques",addAccess:"Ajouter un Accès",role:"Rôle",status:"Statut"},roles:{admin:"Administrateur",writer:"Rédacteur",reviewer:"Validateur",all:"Tous les Rôles",descriptions:{all:"Accès à tous les rôles et leurs fonctionnalités",admin:"Accès complet pour gérer les marques, le contenu et les membres de l'équipe",writer:"Peut créer et modifier du contenu pour les marques assignées",reviewer:"Peut examiner et approuver le contenu avant publication"}},advancedSettings:{title:"Paramètres avancés",orgRoleHint:"Choisissez le rôle à donner à ce nouvel utilisateur. Par défaut, il sera membre"},orgRoles:{owner:"Propriétaire",billing_admin:"Admin Facturation",admin:"Admin",member:"Membre",guest:"Lecteur",descriptions:{owner:"Accès complet à tout, facturation incluse.",billing_admin:"Gestion des paiements et de la facturation uniquement.",admin:"Gestion des membres et des marques, sans facturation.",member:"Accès fonctionnel aux marques attribuées.",guest:"Accès en lecture seule sur tout l'espace."}},removeMember:{title:"Supprimer le membre",description:"Vous pouvez le supprimer uniquement de cette marque, ou complètement de votre organisation.",brand:{title:"Retirer de la marque",desc:"Le membre perdra l'accès à cette marque mais fera toujours partie de votre organisation (place toujours comptée).",cta:"Retirer de la marque"},org:{title:"Retirer de l'organisation",desc:"Le membre perdra l'accès à toutes les marques et ne comptera plus dans vos places.",cta:"Retirer de l'organisation"}},status:{active:"Actif",pending:"En attente",inactive:"Inactif"},deleteConfirmation:{title:"Supprimer le membre",message:"Êtes-vous sûr de vouloir supprimer <strong><em>{{email}}</em></strong> de l'équipe <strong><em>{{brandName}}</em></strong> ? Cette action ne peut pas être annulée.",warning:"Ils perdront l'accès à toutes les marques et contenus associés."},errors:{cannotDeleteAdmin:"Impossible de supprimer un membre administrateur. Veuillez d'abord changer son rôle."}
3770,values:"Valeurs",keywords:"Mots-clés",connectedAccounts:"Comptes connectés",emails:"Adresses Email",emailsPlaceholder:"Entrez les adresses email séparées par des virgules",emailsHint:"Appuyez sur Entrée ou virgule après chaque adresse email",selectBrand:"Sélectionner une Marque",selectRole:"Sélectionner un Rôle",invite:"Inviter le Membre",modifyAccesses:"Modifier l'Accès pour",noResults:"Aucun résultat trouvé",inviteSuccess:"Félicitations ! Vous avez invité les personnes suivantes à rejoindre votre marque {{brandName}} :",noMembers:"Aucun membre d'équipe trouvé. Commencez par inviter quelqu'un dans votre équipe !"},Zge={login:{title:"Connectez-vous à votre compte",emailLabel:"Adresse e-mail",emailPlaceholder:"Adresse e-mail",passwordLabel:"Mot de passe",passwordPlaceholder:"Mot de passe",forgotPassword:"Mot de passe oublié ?",noAccount:"Pas de compte ? Inscrivez-vous",signInButton:"Se connecter",signingIn:"Connexion en cours...",orContinueWith:"Ou continuer avec",google:"Google"},forgotPassword:{title:"Réinitialiser votre mot de passe",subtitle:"Nous vous enverrons un email avec un lien pour réinitialiser votre mot de passe",emailLabel:"Email",emailPlaceholder:"Entrez votre adresse email",resetButton:"Réinitialiser le mot de passe",resetting:"Envoi en cours...",backToLogin:"Retour",success:"Email de réinitialisation envoyé ! Vérifiez votre boîte de réception.",successTitle:"E-mail envoyé !",successMessage:"Vérifiez votre boîte mail, nous venons de vous envoyer un email à",error:"Erreur lors de l'envoi de l'email de réinitialisation. Veuillez réessayer."},signup:{title:"Créez votre compte",nameLabel:"Nom complet",namePlaceholder:"Entrez votre nom complet",firstNameLabel:"Prénom",firstNamePlaceholder:"Entrez votre prénom",lastNameLabel:"Nom",lastNamePlaceholder:"Entrez votre nom",emailLabel:"Adresse e-mail",emailPlaceholder:"Adresse e-mail",passwordLabel:"Mot de passe",passwordPlaceholder:"Mot de passe",confirmPasswordLabel:"Confirmer le mot de passe",confirmPasswordPlaceholder:"Confirmer le mot de passe",referralLabel:"Comment avez-vous entendu parler de nous ?",referralPlaceholder:"Sélectionnez une option",hasAccount:"Déjà un compte ? Connectez-vous",createButton:"Créer un compte",creating:"Création en cours...",orContinueWith:"Ou continuer avec",google:"Google",termsText:"En créant un compte, j'accepte les",termsLink:"conditions d'utilisation",andThe:"et la",privacyLink:"politique de confidentialité",errors:{passwordMatch:"Les mots de passe ne correspondent pas",referralRequired:"Veuillez sélectionner comment vous avez entendu parler de nous",nameRequired:"Veuillez entrer votre nom",emailAlreadyInUse:"Un compte Socialness existe déjà avec cette adresse e-mail. Connecte-toi ou réinitialise ton mot de passe.",passwordRequirements:"Le mot de passe ne respecte pas les exigences de sécurité."},passwordRules:{title:"Le mot de passe doit respecter les exigences suivantes :",minLength:"Au moins 8 caractères",uppercaseLetter:"Contient 1 caractère majuscule",numberOrSymbol:"Contient 1 chiffre ou symbole"}},verification:{title:"Vérifiez Votre Email",subtitle:"Veuillez vérifier votre boîte de réception pour valider votre adresse e-mail",checkInbox:"Nous avons envoyé un lien de vérification à votre adresse e-mail. Veuillez cliquer sur le lien pour vérifier votre compte.",resend:"Renvoyer l'e-mail de vérification",resending:"Envoi en cours...",resendSuccess:"L'e-mail de vérification a été envoyé",resendError:"Échec de l'envoi de l'e-mail de vérification. Veuillez réessayer plus tard.",signOut:"Se déconnecter"}},Xge={settings:{title:"Paramètres YouTube",videoTitle:"Titre de la vidéo",enterVideoTitle:"Entrez un titre descriptif pour votre vidéo",charactersRemaining:"caractères restants",tags:"Tags",tagsPlaceholder:"Ajoutez un tag et appuyez sur Entrée",tagsHelp:"Ajoutez des tags pertinents pour aider les spectateurs à trouver votre vidéo",privacy:"Confidentialité",selectPrivacy:"Sélectionnez le paramètre de confidentialité",removeTag:"Supprimer le tag {{tag}}"}
3770,privacy:{public:{label:"Public",description:"Tout le monde peut regarder votre vidéo"},private:{label:"Privé",description:"Seul vous pouvez regarder votre vidéo"},unlisted:{label:"Non répertorié",description:"Seules les personnes ayant le lien peuvent regarder votre vidéo"}}},e0e={settings:{title:"Paramètres Pinterest",pinTitle:"Titre du Pin",pinTitlePlaceholder:"Entrez le titre du pin (laisser vide pour utiliser le contenu du post)",link:"Lien",linkPlaceholder:"https://votre-site-web.com",linkDescription:"Lien vers lequel les utilisateurs seront redirigés en cliquant sur votre pin",board:"Tableau",selectBoard:"Sélectionnez un tableau",boardRequired:"Veuillez sélectionner un tableau pour votre pin",noBoards:"Aucun tableau disponible",allowComments:"Autoriser les commentaires",allowCommentsDescription:"Permettre aux personnes de commenter votre pin"}},t0e={settings:{title:"Paramètres LinkedIn",companyPage:"Page d'entreprise LinkedIn",publishingAsCompany:"Publication en tant que page d'entreprise",visibility:"Visibilité du post",visibilityPublic:"Public",visibilityConnections:"Connexions uniquement"}},r0e={compliance:{title:"Conformité TikTok",privacyQuestion:"Qui peut voir cette vidéo ?",allowUsersTo:"Autoriser les utilisateurs à",comment:"Commenter",duet:"Faire un duo",stitch:"Collage",discloseTitle:"Divulguer le contenu vidéo",discloseDescription:"Cela nous aide à respecter les réglementations et assure la transparence avec les utilisateurs.",infoBoxText:'Votre vidéo sera étiquetée "Contenu promotionnel". Cela ne peut pas être modifié une fois la vidéo publiée.',brandedContentPrivateWarning:"La visibilité du contenu de marque ne peut pas être privée",yourBrand:"Votre marque",yourBrandDescription:"Contenu faisant la promotion de vos propres biens ou services.",brandedContent:"Contenu de marque",brandedContentDescription:"Contenu faisant la promotion d'une marque, d'un produit ou d'un service tiers.",agreement:{prefix:"En publiant ce contenu, j'accepte",and:"et",suffix:"de TikTok",musicOnly:"En publiant, vous acceptez la <0>Confirmation d'utilisation de la musique</0> de TikTok *",brandedOnly:"En publiant, vous acceptez la <0>Politique de contenu de marque</0> de TikTok *",musicAndBranded:"En publiant, vous acceptez la <0>Politique de contenu de marque</0> et la <1>Confirmation d'utilisation de la musique</1> de TikTok *"},musicUsageConfirmation:"Confirmation d'utilisation de la musique",brandedContentPolicy:"Politique de contenu de marque",termsAgreementWarning:"Vous devez accepter les conditions de TikTok avant de publier.",publishOn:"Ce contenu sera publié sur",disclosureNoOptionsWarning:"Vous devez sélectionner une option de divulgation pour respecter les politiques de TikTok avant de publier."},privacy:{select:"Choisir la confidentialité",selectDescription:"Vous devez sélectionner une option",public_to_everyone:{label:"Tout le monde",description:"Tout le monde peut voir cette vidéo"},mutual_follow_friends:{label:"Amis",description:"Uniquement les abonnés mutuels peuvent voir cette vidéo"},follower_of_creator:{label:"Abonnés",description:"Uniquement vos abonnés peuvent voir cette vidéo"},self_only:{label:"Privé",description:"Uniquement vous pouvez voir cette vidéo"}}},n0e={timeSeries:{title:"Évolution quotidienne",summaryTitle:"Évolution quotidienne par plateforme",daily:"Quotidien",weekly:"Hebdomadaire",current:"Période actuelle",previous:"Période précédente",currentShort:"Actuel",previousShort:"Précédent"},title:"Coach de Performance Analytique",subtitle:"Suivez vos performances sur les réseaux sociaux",summary:"Résumé",dateRange:{thisMonth:"Ce mois-ci",lastMonth:"Mois dernier",last15days:"15 derniers jours",last30days:"30 derniers jours",last90days:"90 derniers jours",last365days:"12 derniers mois",thisYear:"Cette année",custom:"Plage personnalisée",days:"jours",last:"Dernier",startDate:"Date de début",endDate:"Date de fin",apply:"Appliquer",cancel:"Annuler"},platformMetrics:"Métriques de plateforme",followers:"Abonnés",engagement:"Engagement",reach:"Portée",connectAccountForPlatform:"Connectez un compte {{platform}} pour voir les analytiques",metrics:{followers:"Abonnés",views:"Vues",fanAdds:"Nouveaux fans",fanRemoves:"Fans perdus",impressionsPaid:"Impressions payées",impressionsPaidUnique:"Impressions payées uniques",impressionsUnique:"Impressions uniques",impressionsViral:"Impressions virales",impressionsViralUnique:"Impressions virales uniques",postEngagements:"Engagements sur les publications",postImpressions:"Impressions des publications",totalActions:"Actions totales",likes:"Mentions J'aime",organicFollowers:"Abonnés organiques",paidFollowers:"Abonnés payants",posts:"Publications",postsPublished:"Posts publiés",impressions:"Impressions",uniqueImpressions:"Impressions uniques",clicks:"Clics",pageClicks:"Clics sur la page",uniqueViews:"Vues uniques",reactions:"Réactions",comments:"Commentaires",reposts:"Partages",ctr:"CTR",engagementRate:"Taux d'engagement",pageViews:"Vues de page",uniquePageViews:"Vues de page uniques",accountsEngaged:"Comptes ayant engagés",mediaCount:"Nombre de posts",profileViews:"Vues du profil",reach:"Portée",saves:"Enregistrements",shares:"Partages",totalEngagement:"Engagement total",websiteClicks:"Clics sur le site web",followerGrowth:"Croissance des abonnés",connectedPlatforms:"Plateformes connectées",dislikes:"Je n'aime pas",minutesWatched:"Minutes regardées",videosPosted:"Vidéos publiées",followsAndUnfollows:"Abonnements et désabonnements",averageViewDuration:"Durée moyenne de visionnage (sec)",newSubscribers:"Nouveaux abonnés",lostSubscribers:"Abonnés perdus",subscribersGain:"Abonnés gagnés",subscribersGained:"Abonnés gagnés",subscribersLost:"Abonnés perdus",dynamicFollowers:"Abonnés {{platform}}",dynamicSubscribers:"Abonnés {{platform}}"},aiAnalysis:{title:"Analyse IA de votre post",summary:"Résumé",strengths:"Points forts",improvements:"Axes d'amélioration"},ai:{getAnalysisTitleGeneral:"Obtenir une analyse IA",getAnalysisDescriptionNew:"Débloquez des insights IA pour mieux cibler ce qui marche et améliorer votre stratég
3770ie.",analyzeButton:"Analyser maintenant",analyzing:"Analyse en cours...",platformAnalysisTitle:"Analyse {{platform}}",title:"Analyse de Performance IA"},specificPlatformsMetricsTitle:"Métriques spécifique aux plateformes",moreMetricsTitle:"Plus de métriques {{platform}}",youtubeIngestionLag:"Certaines données peuvent prendre jusqu'à 48h pour nous être envoyées par YouTube.",secondaryMetrics:{seeMore:"Voir les {{count}} autres métriques",hide:"Masquer les métriques supplémentaires"},topPosts:{title:"🏆 Vos meilleurs posts des 30 derniers jours",subtitle:"Votre contenu le plus engageant pour la période sélectionnée.",empty:"Aucun post n'a été publié le mois dernier.",none:"Aucun post n'a été publié durant cette période",noText:"Aucun texte",view:"Ouvrir"},thirdMetricsSummaryTitle:"Autres métriques pertinentes"},a0e={title:"Facturation & Abonnement",subtitle:"Gérez votre abonnement et vos moyens de paiement",manageSubscription:"Gérer mon abonnement",manage:"Gérer",getInvoices:"Récupérer mes factures",upgrade:"Mettre à niveau",downgrade:"Rétrograder",saveWithYearly:"Économiser avec l'annuel",noActiveSubscription:"Aucun Abonnement Actif",noActiveSubscriptionMessage:"Vous n'avez actuellement aucun abonnement actif. Choisissez un plan ci-dessous pour commencer avec Socialness.ai.",currentPlan:"Plan Actuel",active:"Actif",paymentMethod:"Moyen de Paiement",noPaymentMethod:"Aucun moyen de paiement enregistré",updatePaymentMethod:"Mettre à jour le moyen de paiement",monthly:"Mensuel",yearly:"Annuel",save20Percent:"Économisez 20%",saveAmount:"Économisez {{amount}}",savingsVsMonthly:"au lieu de {{monthlyTotal}} par an",subscribe:"S'abonner",billingHistory:"Historique de Facturation",noBillingHistory:"Aucun historique de facturation disponible. Abonnez-vous à un plan pour voir vos factures ici.",invoiceNumber:"Numéro de Facture",amount:"Montant",date:"Date",status:"Statut",actions:"Actions",loadingError:"Échec du chargement des informations de facturation. Veuillez réessayer plus tard.",currentPeriodEnds:"La période actuelle se termine le",validUntil:"Votre abonnement actuel est valable jusqu'au",expires:"Expire",perMonth:"/mois",billedAnnually:"Facturé annuellement à",currentPlanBadge:"Plan Actuel",mostPopular:"Le plus populaire",savedAmount:"{{amount}} économisés",intervals:{month:"mois",year:"année"},cardHolder:"Titulaire",edit:"Modifier",features:{brands:"marque",brands_plural:"marques",brands_one:"marque",brands_other:"marques",personas:"persona",personas_plural:"personas",socials:"plateforme sociale",socials_plural:"plateformes sociales",links:"liens / QR codes",ideas:"idées de contenu",posts:"posts par mois",users:"membre d'équipe",users_plural:"membres d'équipe",unlimited:"Illimité",upTo:"Jusqu'à"}},s0e={title:"Votre période d'essai est terminée…",progress:"Jusqu'ici, vous avez analysé <b><i>{{brands}}</i></b> {{brandsWord}}, créé <b><i>{{personas}}</i></b> {{personasWord}}, connecté <b><i>{{accounts}}</i></b> {{accountsWord}} et rédigé <b><i>{{drafts}}</i></b> {{draftsWord}}.",description:"Pour continuer à profiter de votre <1>assistant IA de médias sociaux</1>, vous devez passer à Solo, Team ou Agency Pro",words:{brand_singular:"marque",brand_plural:"marques",persona_singular:"persona",persona_plural:"personas",account_singular:"compte",account_plural:"comptes",draft_singular:"post",draft_plural:"posts"},features:{unlimitedPosts:"Publiez des posts illimités sur toutes les plateformes",unlimitedAiContent:"Générez du contenu IA illimité (posts, légendes, images)",analytics:"Accédez à des analyses avancées et des insights propulsés par l'IA",algorithms:"Débloquez notre suite propriétaire d'algorithmes IA",support:"Support prioritaire & traitement plus rapide",more:"Et bien plus encore !"},upgradeCta:"Mettre à niveau"},i0e={title:"Calendrier de Contenu",subtitle:"Planifiez et programmez votre contenu sur tous les réseaux sociaux",loading:{title:"Chargement de votre calendrier...",fetchingPosts:"Récupération des posts et événements...",refreshing:"Actualisation des posts..."},filter:{columns:"Colonnes"},columns:{brand:"Marque",created:"Créé",updated:"Modifié",published:"Publié"},addIdea:"Ajouter une idée",ideaSaved:"Idée sauvegardée !",ideaError:"Impossible de sauvegarder l'idée.",ideaDeleted:"Idée supprimée.",ideaDeleteError:"Impossible de supprimer l'idée.",promotedToDraft:"Idée transformée en brouillon !",promoteError:"Impossible de transformer l'idée.",externalBadge:"Publié hors Socialness",externalPostTooltip:"
3770Cette publication a été faite directement sur la plateforme, sans passer par Socialness.",hiddenExternal:"Post masqué de votre contenu",hideError:"Impossible de masquer le post."},o0e={title:"Idée de post",ideaTitle:"Titre",description:"Notes",reminder:"Rappel :",promoteToDraft:"Transformer en post",ideaUpdated:"Idée mise à jour !"},l0e={title:"Sauvegarder une idée de post",ideaTitle:"Titre de l'idée",titlePlaceholder:"ex. Reel coulisses de notre processus",description:"Notes",descriptionPlaceholder:"Notes rapides sur cette idée...",brand:"Marque",selectBrand:"Sélectionner une marque",reminderDate:"Me rappeler le",reminderPlaceholder:"Choisir une date (optionnel)",reminderHint:"L'idée apparaîtra sur votre calendrier à cette date.",save:"Sauvegarder l'idée"},c0e={title:"Générateur de Personas IA",subtitle:"Créez et gérez des personas d'audience pour cibler votre stratégie de contenu",create:"Créer un Persona",createFirst:"Créer votre premier Persona",analyzeWithAI:"Analyser avec l'IA",search:"Rechercher des personas par nom, titre de poste ou tags...",noPersonas:"Aucun persona créé pour l'instant. Créez votre premier persona pour commencer.",noPersona:"Aucun persona pour cette marque",noSearchResults:"Aucun persona ne correspond à votre recherche.",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce persona ? Cette action ne peut pas être annulée.",createPersona:"Créer un Persona",createWithAI:"Créer avec l'IA",createWithAIDescription:"Laissez l'IA vous aider à créer un persona réaliste basé sur votre marque",createManually:"Créer Manuellement",createManuallyDescription:"Rédigez votre propre persona à partir de zéro",generation:{title:"Création de Votre Persona IA",steps:{analyzing:"Analyse de l'identité de marque et de l'audience cible...",creating:"Création des données démographiques et de l'historique du persona...",defining:"Définition des objectifs, motivations et défis...",determining:"Détermination des préférences et habitudes sur les réseaux sociaux...",finalizing:"Finalisation des détails du persona et génération de l'avatar..."}},loading:{title:"Chargement et Analyse de vos personas",steps:{analyzing:"Analyse de vos données de personas...",processing:"Traitement des informations démographiques...",generating:"Génération des recommandations IA...",preparing:"Préparation des profils de personas..."}},form:{createTitle:"Créer un nouveau Persona",editTitle:"Modifier le Persona",createSubtitle:"Créer un nouveau persona d'audience cible",editSubtitle:"Modifier les détails de votre persona",create:"Créer un Persona",basicInfo:"Informations de base",name:"Nom",namePlaceholder:"Entrez le nom du persona",jobTitle:"Titre du poste",jobTitlePlaceholder:"Entrez le titre du poste",bio:"Bio",bioPlaceholder:"Rédigez une brève description de ce persona",age:"Âge",ageRange:"Tranche d'âge",location:"Localisation",income:"Revenu",education:"Éducation",relationship:"Situation familiale",languages:"Langues",tags:"Tags",tagsPlaceholder:"Ajouter des tags (ex : tech, marketing)",socialNetworks:"Réseaux sociaux préférés",addNetwork:"Ajouter un réseau social",platform:"Plateforme",frequency:"Fréquence de publication",pertinence:"Pertinence",problems:"Problèmes",problemsPlaceholder:"Quels défis ce persona rencontre-t-il ?",goals:"Objectifs",goalsPlaceholder:"Quels sont les principaux objectifs de ce persona ?",motivations:"Motivations",motivationsPlaceholder:"Qu'est-ce qui motive ce persona ?",challenges:"Défis",challengesPlaceholder:"Quels obstacles ce persona rencontre-t-il ?",contentFormat:"Format de contenu",brandAssociation:"Marque associée",selectBrand:"Sélectionner une marque",savePersona:"Enregistrer le Persona",cancel:"Annuler",tabs:{profile:"Profil",reasons:"Motivations",behavior:"Comportement"},cardTitles:{keyInfo:"Informations Clés",format:"Format",communication:"Communication",story:"Histoire du Persona",problemsChallenges:"Problèmes & Défis",goalsMotivations:"Objectifs & Motivations"},quote:"Citation",quoteDescription:"Une citation représentative du persona.",buyingBehavior:"Comportement d'achat",buyingBehaviorPlaceholder:"Décrivez comment ils prennent leurs décisions d'achat...",buyingBehaviorDescription:"Exemple : Recherche en ligne, compare les prix, consulte les avis.",buyingBehaviorLabel:"Leur manière d'acheter",brandAffinity:"Affinité avec la marque",brandAffinityPlaceholder:"Listez les marques qu'ils aiment ou n'aiment pas...",brandAffinityDescription:"Exemple : Fidèle à Apple, n'aime pas Microsoft.",formatLength:"Longueur du Format",uploadImage:"Télécharger l'image",errors:{invalidImageType:"Veuillez télécharger un fichier image",imageTooLarge:"La taille de l'image doit être inférieure à 5 Mo"},imageStyles:{auto:"Auto",realistic:"Réaliste",design:"Design","3d":"3D",artistic:"Artistique",modern:"Modern"},imageStyleDescriptions:{auto:"L'IA choisit automatiquement le style le plus approprié pour votre contenu",realistic:"Idéal pour des images réalistes et photographiques avec emp
3770hase sur le détail",design:"Parfait pour logos, produits print-on-demand, matériaux promotionnels et design graphique","3d":"Crée des images stylisées en trois dimensions avec profondeur, perspective et effets volumétriques",artistic:"Style polyvalent pour créations artistiques, peintures abstraites, croquis et interprétations créatives",modern:"Pour des visuels contemporains avec une esthétique épurée, minimaliste ou tendance, inspirés du style éditorial ou des magazines"},imageSize:{square:"Carré (1:1)",portrait916:"Portrait (9:16)",portrait45:"Portrait (4:5)"},imageSizeDescriptions:{square:"Parfait pour la plupart des plateformes sociales",portrait916:"Idéal pour les Stories et TikTok",portrait45:"Bon pour Instagram et Pinterest"},tones:{inspirational:"Inspirant",professional:"Professionnel",casual:"Décontracté",educational:"Éducatif",friendly:"Amical",funny:"Drôle"},toneDescriptions:{inspirational:"Contenu stimulant et motivant qui inspire l'action et le changement positif",professional:"Contenu formel et orienté business qui établit l'expertise et l'autorité",casual:"Contenu détendu et amical qui crée une atmosphère confortable et accessible",educational:"Contenu informatif axé sur l'enseignement et le partage de connaissances",friendly:"Contenu chaleureux et accueillant qui établit des connexions personnelles",funny:"Contenu humoristique et divertissant qui fait rire les gens et engage par la comédie"}},analysis:{title:"Analyse IA",summary:"Résumé",strengths:"Points forts",improvements:"Axes d'amélioration",recommendedPersonas:"Nouveaux Personas Recommandés",expertsInsights:"Insights d'Experts",demographicInsights:"Insights Démographiques",brandPersonaAlignment:"Alignement Marque-Persona",gapAnalysis:"Analyse des Lacunes",description:"Obtenez des insights IA sur vos personas actuels et des recommandations pour de nouveaux personas afin de mieux comprendre votre audience cible."},delete:{title:"Supprimer le Persona",message:"Êtes-vous sûr de vouloir supprimer ce persona ? Cette action est irréversible.",warning:"Toutes les données associées seront définitivement supprimées."},errors:{noBrands:"Aucune marque disponible. Veuillez d'abord créer une marque.",noBrandSelected:"Veuillez d'abord sélectionner une marque",generationFailed:"Échec de la génération du persona. Veuillez réessayer.",brandSetupIncomplete:"Les champs suivants sont manquants, veuillez mettre à jour votre marque pour pouvoir générer des personas pertinents",brandSetupIncompleteTitle:"Configuration de marque incomplète",brandSetupIncompleteMessage:"Les champs suivants sont manquants dans votre marque. Veuillez les compléter pour pouvoir générer des personas pertinents :",missingFields:"Champs manquants :",brandSetupInstructions:'Rendez-vous dans la section "Stratégie marketing" pour compléter ces informations.',goToBrandSetup:"Aller à la configuration"},noPersonasForAnalysis:{title:"Analyse des Personas",message:"Il faut d'abord que tu crées un persona pour pouvoir lancer une analyse IA.",createCTA:"Créer un Persona"}},u0e={title:"Création de Contenu",subtitle:"Générez du contenu engageant pour les réseaux sociaux avec l'IA",generation:{title:"Création de Votre Contenu IA",steps:{analyzing:"Analyse de votre voix et style de marque...",creating:"Création de contenu engageant adapté à votre audience...",optimizing:"Optimisation pour les plateformes sélectionnées...",hashtags:"Ajout de hashtags et mots-clés pour la visibilité...",polishing:"Peaufinement et finalisation de votre contenu...",generatingImage:"Génération d'images créatives pour votre contenu...",designingVisuals:"Conception de visuels qui correspondent à l'identité de votre marque..."}},formats:{regularDescription:"Publications standard pour votre fil d'actualité",reelDescription:"Contenu vidéo court format"},form:{brand:"Marque",selectBrand:"Sélectionner une marque",persona:"Persona",selectPersona:"Sélectionner une persona",platforms:"Plateformes",selectPlatforms:"Sélectionner des plateformes",topic:"Sujet",topicPlaceholder:"Entrez un sujet pour votre contenu",description:"Description",descriptionPlaceholder:"Décrivez ce que vous souhaitez créer",keywords:"Mots-clés",keywordsPlaceholder:"Ajouter des mots-clés",voice:"Voix",tone:"Ton",selectTone:"Sélectionner un ton",contentLength:"Longueur du contenu",selectContentLength:"Sélectionner la longueur du contenu",format:"Format du contenu",language:"Langue",selectLanguage:"Sélectionner une langue",sourceUrl:"URL Source (On accepte même les URLs de vidéos YouTube 📺)",sourceUrlPlaceholder:"Entrez une URL de référence (ex. vidéo YouTube)",goal:"Objectif",selectGoal:"Sélectionner un objectif",add:"Ajouter",urlCheckError:"Échec de la vérification de l'URL. Veuillez réessayer.",selectBrandAndPersona:"Veuillez sélectionner une marque et un persona pour générer des idées",clickToGenerate:'Cliquez sur "Générer des idées" pour commencer',generateIdeas:"Générer des idées",goals:{educate:"Éduquer",entertain:"Divertir",inform:"Informer",promote:"Promouvoir"},goalDescriptions:{educate:"Contenu éducatif qui enseigne et partage des connaissances avec votre audience",entertain:"Contenu divertissant qui captive et engage par l'humour, les histoires ou la créativité",inform:"Contenu informatif qui partage des nouvelles, des mises à jour ou des informations importantes",promote:"Contenu promotionnel qui met en avant des produits, services ou campagnes"},generate:"Générer le contenu",generating:"Génération en cours...",regenerate:"Régénérer le contenu",reset:"Réinitialiser",errorSummary:"Veuillez corriger les erreurs suivantes :",contentIdeas:"Idées de contenu",contentCard:"Contenu",generateMoreIdeas:"Générer 5 idées supplémentaires",loadingIdeas:"Chargement des idées...",ideasError:"Échec du chargement des idées de contenu",noIdeas:"Aucune idée de contenu disponible",noPersonas:"Aucune persona disponible pour cette marque",createPersona:"Cr
3770éer une Persona",manuallyEdited:"Vous avez modifié manuellement cette description",postImage:"Image du Post",imageSelection:"Sélection d'image",textOnly:"Texte Uniquement",textOnlyDescription:"Générer du contenu sans image",withImage:"Avec une Image",withImageDescription:"Générer du contenu avec une image associée",useExtractedImage:"Utiliser l'image existante",useExtractedImageDescription:"Utiliser l'image extraite de votre lien",imageStyle:"Style d'Image",imageSize:"Taille d'Image",imageStyleDescription:"Choisissez le style visuel pour votre image générée",imageStyles:{auto:"Auto",realistic:"Réaliste",design:"Design","3d":"3D",artistic:"Artistique",modern:"Modern",ad:"Commercial"},imageStyleDescriptions:{auto:"L'IA choisit automatiquement le style le plus approprié pour votre contenu",realistic:"Idéal pour des images réalistes et photographiques avec emphase sur le détail",design:"Parfait pour logos, produits print-on-demand, matériaux promotionnels et design graphique","3d":"Crée des images stylisées en trois dimensions avec profondeur, perspective et effets volumétriques",artistic:"Style polyvalent pour créations artistiques, peintures abstraites, croquis et interprétations créatives",modern:"Pour des visuels contemporains avec une esthétique épurée, minimaliste ou tendance, inspirés du style éditorial ou des magazines",ad:"Parfait pour créer des visuels publicitaires accrocheurs, des bannières promotionnelles et du contenu marketing commercial"},tones:{inspirational:"Inspirant",professional:"Professionnel",casual:"Décontracté",educational:"Éducatif",friendly:"Amical",funny:"Drôle"},toneDescriptions:{inspirational:"Contenu stimulant et motivant qui inspire l'action et le changement positif",professional:"Contenu formel et orienté business qui établit l'expertise et l'autorité",casual:"Contenu détendu et amical qui crée une atmosphère confortable et accessible",educational:"Contenu informatif axé sur l'enseignement et le partage de connaissances",friendly:"Contenu chaleureux et accueillant qui établit des connexions personnelles",funny:"Contenu humoristique et divertissant qui fait rire les gens et engage par la comédie"},languageSetFromBrand:"Nous avons sélectionné cette langue par défaut basée sur la langue que vous avez mise dans votre analyse de marque",imageStyleSetFromBrand:"Nous avons sélectionné ce style d'image par défaut basé sur le style d'image que vous avez mis dans votre analyse de marque"},imageSize:{square:"Carré (1:1)",portrait916:"Portrait (9:16)",portrait45:"Portrait (4:5)"},imageSizeDescriptions:{square:"Parfait pour la plupart des plateformes sociales",portrait916:"Idéal pour les Stories et TikTok",portrait45:"Bon pour Instagram et Pinterest"},contentLength:{short:"Court",medium:"Moyen",long:"Long",shortDescription:"Contenu bref, idéal pour un engagement rapide",mediumDescription:"Longueur équilibrée pour la plupart des plateformes",longDescription:"Contenu approfondi avec des informations détaillées"},results:{title:"Contenu Généré",copyAll:"Tout copier",copyToClipboard:"Copier dans le Presse-papiers",copied:"Copié !",createPost:"Créer un Post",regenerate:"Régénérer",regenerateImage:"Régénérer l'image",regenerateText:"Régénérer le texte",regenerateBoth:"Régénérer les deux",generatedImage:"Image Générée",generatedImageAlt:"Image générée par IA pour le contenu",noContent:"Aucun contenu généré pour l'instant. Remplissez le formulaire et cliquez sur 'Générer du Contenu' pour commencer."},errors:{brandRequired:"Veuillez sélectionner une marque",platformsRequired:"Veuillez sélectionner au moins une plateforme",topicRequired:"Veuillez entrer un sujet",descriptionRequired:"Veuillez fournir une description",descriptionOrSourceRequired:"Veuillez fournir soit une description, soit une URL source",toneRequired:"Veuillez sélectionner un ton",contentLengthRequired:"Veuillez sélectionner une longueur de contenu",languageRequired:"Veuillez sélectionner une langue",generationFailed:"Échec de la génération de contenu. Veuillez réessayer."},modals:{aiPostDraft:{title:"Gérer les autres posts générés",message:"Vous êtes sur le point de modifier 1 post sur {{totalPosts}}. Que souhaitez-vous faire avec le(s) {{count}} post(s) restant(s) ?",discard:"Ignorer les autres & Continuer",saveAndEdit:"Sauvegarder les autres & Continuer"},savingDrafts:{title:"Sauvegarde des brouillons",message:"Veuillez patienter pendant que nous sauvegardons les autres posts générés en tant que brouillons..."},regenerateImage:{title:"Régénérer l'Image",description:"Choisissez votre style et taille d'image préférés pour générer une nouvelle image pour votre contenu.",generate:"Générer une Nouvelle Image",generating:"Génération en cours...",regenerate:"Générer une Autre",validate:"Utiliser 
3770cette Image",preview:"Aperçu de l'Image Générée",previewAlt:"Aperçu de l'image générée",hoverForFullSize:"Survolez pour voir en zoom x2",fullSizePreview:"Aperçu zoom x2",fullSizeHint:"Zoom x2"}}},d0e="fr",f0e={title:"Social Media Hub",subtitle:"Gérez vos comptes de réseaux sociaux connectés",connect:"Connecter un Compte",connectFirst:"Connectez Votre Premier Compte",followers:"abonnés",viewProfile:"Voir le Profil",linkToBrand:"Lier à une Marque",unlinkBrand:"Délier de la Marque",reconnect:"Reconnecter",reconnecting:"Reconnexion...",disconnect:"Déconnecter",follow:"Suivre",errors:{linkFailed:"Échec de la liaison du compte à la marque. Veuillez réessayer.",unlinkFailed:"Échec de la dissociation du compte de la marque. Veuillez réessayer."},linkedin:{organizationSelectionTitle:"Sélectionner les organisations LinkedIn",selectAtLeastOne:"Veuillez sélectionner au moins une organisation à connecter",connectionFailed:"Échec de la connexion des pages LinkedIn",loadingOrganizations:"Chargement de vos organisations LinkedIn...",loadFailed:"Échec du chargement des organisations LinkedIn",noOrganizationsFound:"Aucune organisation LinkedIn trouvée",noOrganizationsFoundSubtext:"Assurez-vous d'avoir accès aux pages d'entreprise LinkedIn",selectionDescription:"Choisissez quelles organisations LinkedIn vous souhaitez connecter à votre compte. Vous pourrez publier du contenu sur ces pages une fois connectées.",selectAll:"Tout sélectionner",deselectAll:"Tout désélectionner",organizationsSelected:"{{count}} organisation sur {{total}} sélectionnée",organizationsSelected_plural:"{{count}} organisations sur {{total}} sélectionnées",companyPage:"Page d'entreprise",organizationsExpire:"Les organisations expirent le : {{date}}",connectButton:"Connecter {{count}} organisation",connectButton_plural:"Connecter {{count}} organisations",connecting:"Connexion...",linkedInPageFallback:"Page LinkedIn {{id}}",organizationType:{educational:"Établissement éducatif",publicCompany:"Société cotée en bourse",privatelyHeld:"Entreprise privée",selfEmployed:"Indépendant",selfOwned:"Entreprise individuelle",partnership:"Société de personnes",nonProfit:"Organisation à but non lucratif",governmentAgency:"Organisme gouvernemental",unknown:"Organisation"}}},m0e={title:"Galerie Média",subtitle:"Gérez vos ressources média pour toutes vos marques",upload:"Télécharger un média",search:"Rechercher des médias par nom, type ou tags...",selectMultiple:"Sélection Multiple",exitSelection:"Quitter la Sélection",selectedCount:"{{count}} éléments sélectionnés",clearSelection:"Effacer la Sélection",loading:"Chargement des fichiers média...",error:"Erreur lors du chargement des fichiers média",uploading:"Téléchargement en cours...",pleaseWait:"Veuillez patienter pendant le téléchargement de votre fichier",uploadError:"Échec du téléchargement",tryAgain:"Réessayer",uploadSuccess:"Téléchargement réussi",fileUploaded:"Votre fichier a été téléchargé avec succès et apparaîtra dans la galerie sous peu.",closeUploadModal:"Fermer",filters:{all:"Tous les médias",images:"Images",videos:"Vidéos",documents:"Documents",brand:"Filtrer par marque",allBrands:"Toutes les marques",date:"Filtrer par date",type:"Type de média"},totalMedia:"Total de médias : {{count}}",sort:{label:"Trier par",newest:"Plus récent",oldest:"Plus ancien",nameAZ:"Nom A-Z",nameZA:"Nom Z-A",size:"Taille",title:"Trier par"},view:{grid:"Vue en grille",list:"Vue en liste"},item:{name:"Nom",size:"Taille",dimensions:"Dimensions",uploadedBy:"Téléchargé par",uploadedAt:"Téléchargé le",brand:"Marque",tags:"Tags",edit:"Modifier",delete:"Supprimer",download:"Télécharger",copyUrl:"Copier l'URL",urlCopied:"URL copiée dans le presse-papiers",preview:"Aperçu",profilePictureBadge:"Photo de profil actuelle",close:"Fermer",rename:"Renommer",renameDisabled:"Fonction de renommage à venir"},deleteConfirm:{title:"Supprimer un média",message:"Êtes-vous sûr de vouloir supprimer ce média? Cette action ne peut pas être annulée.",cancel:"Annuler",confirm:"Supprimer"},bulkDeleteConfirm:{title:"Suppression en masse",message:"Êtes-vous sûr de vouloir supprimer {{count}} éléments média? Cette action ne peut pas être annulée.",cancel:"Annuler",confirm:"Supprimer"},bulkDelete:"Supprimer {{count}} éléments",bulkDeleteProgress:{title:"Suppression des fichiers média...",message:"Veuillez patienter pendant la suppression de vos fichiers"},bulkDeleteSuccess:"Fichiers supprimés avec succès","bulkDeleteSuccess.message":"Vos fichiers ont été supprimés avec succès de la galer
3770ie média",noResults:"Aucun média trouvé correspondant à vos critères de recherche",dropzone:{title:"Glisser-déposer des fichiers",subtitle:"ou cliquer pour parcourir",maxSize:"Taille max. de fichier: 10Mo"},rename:{title:"Renommer le fichier",fileNameLabel:"Nom du fichier",cancel:"Annuler",confirm:"Renommer"}},h0e={title:"Paramètres",manageAccount:"Gérez vos paramètres de compte et préférences",profile:"Profil",uploadProfilePicture:"Téléchargez une nouvelle photo de profil. L'image doit faire au moins 400x400 pixels.","profile.firstName":"Prénom","profile.lastName":"Nom","profile.updateButton":"Enregistrer les modifications","profile.success":"Profil mis à jour avec succès","profile.error.noAuth":"Erreur d'authentification. Veuillez vous reconnecter.","profile.error.generic":"Échec de la mise à jour du profil. Veuillez réessayer.",avatarUploadFailed:"Échec du téléchargement de l'avatar. Veuillez réessayer.",email:{title:"Adresse Email",current:"Email Actuel",new:"Nouvel Email",placeholder:"Entrez votre nouvel email",update:"Mettre à jour l'Email",success:"Email mis à jour avec succès"},security:{title:"Sécurité",currentPassword:"Mot de passe actuel",currentPasswordPlaceholder:"Entrez votre mot de passe actuel",newPassword:"Nouveau mot de passe",newPasswordPlaceholder:"Entrez votre nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",confirmPasswordPlaceholder:"Confirmez votre nouveau mot de passe",update:"Mettre à jour le mot de passe",success:"Mot de passe mis à jour avec succès"}},p0e={title:"Mon Contenu",subtitle:"Gérez tous vos posts et idées en un seul endroit",loading:{title:"Chargement de votre contenu...",fetchingPosts:"Récupération de vos posts depuis le serveur...",refreshing:"Actualisation des posts..."},view:{list:"Liste",grid:"Grille",board:"Tableau"},table:{content:"Contenu",platforms:"Plateformes",brand:"Marque",status:"Statut",stats:"Statistiques",date:"Date",actions:"Actions"},filter:{columns:"Colonnes"},columns:{brand:"Marque",created:"Créé",updated:"Modifié",published:"Publié"},noStatsYet:"Pas encore de statistiques"},g0e={title:"Bonjour {{firstName}}, Voici votre aperçu des médias sociaux",subtitle:"Ceci est votre centre de commande de contenu. Suivez, planifiez et optimisez votre contenu avec l'aide des informations et recommandations de l'IA.",pageTitle:"Tableau de bord",seeAnalytics:"Voir mes analyses",metrics:{youtubeSubscribers:"Abonnés YouTube",facebookFollowers:"Abonnés Facebook",instagramFollowers:"Abonnés Instagram",linkedinFollowers:"Abonnés LinkedIn",tiktokFollowers:"Abonnés TikTok"}},y0e={all:"Tous les statuts",allDesc:"Voir les publications dans tous leurs états actuels.",idea:"Idée",ideaDesc:"Une idée de post sauvegardée pour plus tard avec une date de rappel optionnelle.",draft:"Brouillon",draftDesc:"La publication est en cours de rédaction, pas encore soumise pour révision ou planification.",scheduled:"Planifié",scheduledDesc:"La publication est approuvée et programmée pour une publication automatique à une date ultérieure.",ready_to_publish:"Prêt à publier",ready_to_publishDesc:"La publication est complète, approuvée et en attente de sa date programmée ou d'une publication manuelle.",waiting_for_approval:"En attente d'approbation",waiting_for_approvalDesc:"La publication a été soumise et attend la révision d'un validateur.",published:"Publié",publishedDesc:"La publication a été partagée avec succès sur les plateformes sélectionnées.",rejected:"Rejeté",rejectedDesc:"La publication a été révisée mais n'a pas été approuvée pour publication par un validateur.",error:"Erreur",errorDesc:"Une erreur s'est produite lors de la tentative de publication ou de traitement de la publication.",processing:"Traitement en cours",processingDesc:"La publication est en cours de traitement par le système (ex : téléchargement de média, soumission API).",pending:"En attente",pendingDesc:"La publication attend une action du système ou une confirmation externe avant de continuer."},b0e={noBrands:"Aucune marque disponible",allBrands:"Toutes les marques"},v0e={saveDraftInstead:{title:"Connexion de compte manquante",message:"La marque sélectionnée '{{brandName}}' n'a pas de compte connecté pour la/les plateforme(s) suivante(s) : {{platformList}}. Vous pouvez enregistrer ce post comme brouillon et connecter les comptes plus tard.",question:"Souhaitez-vous enregistrer ce post comme brouillon à la place ?"}},x0e={reviewSubmitError:"Échec de la soumission de l'avis",postLoadError:"Échec du chargement du post",postNotFound:"Post introuvable. Il a peut-être été supprimé.",draftSavedDueToMissingAccounts:"Post enregistré comme brouillon en raison de connexions de compte manquantes.",sc
3770heduleSuccess:"Post programmé avec succès !",draftSaveSuccess:"Brouillon enregistré avec succès !"},w0e={title:"Choisir le type de connexion Instagram",option1:{titleLine1:"Profil Personnel",titleLine2:"(Instagram perso)",description:"Utilisation professionnelle ? Passez à un compte pro pour accéder à tous les outils nécessaires.",tag:"Non disponible"},option2:{titleLine1:"Profil Professionnel + Facebook",titleLine2:"",description:"Connectez vos comptes Facebook et Instagram en une seule étape.",tag:"Recommandé",cta:"Connecter via Facebook"},option3:{titleLine1:"Compte Professionnel",titleLine2:"(Instagram Seul)",description:"Connectez directement votre compte professionnel ou créateur Instagram.",cta:"Connecter via Instagram"}},j0e={title:"Intégrations",subtitle:"Connectez vos outils et services préférés",searchPlaceholder:"Rechercher des intégrations...",allStatuses:"Tous les statuts",allCategories:"Toutes les catégories",resultsCount:"Affichage de {{count}} sur {{total}} intégrations",noResults:"Aucune intégration trouvée",noResultsFiltered:"Essayez d'ajuster vos critères de recherche ou de filtre",noIntegrations:"Aucune intégration n'est disponible pour le moment",categories:{link_shortener:"Raccourcisseur de liens",social_media:"Réseaux sociaux",analytics:"Analytique",email_marketing:"Email marketing",crm:"CRM",payment:"Paiement",productivity:"Productivité",design:"Design",communication:"Communication",automation:"Automatisation"},statuses:{connected:"Connecté",disconnected:"Déconnecté",active:"Actif",inactive:"Inactif",pending:"En attente",available:"Disponible",coming_soon:"Bientôt disponible",maintenance:"Maintenance"},authTypes:{oauth:"OAuth",oauth2:"OAuth 2.0",api_key:"Clé API","api-key":"Clé API",basic:"Auth basique",token:"Token",webhook:"Webhook",none:"Aucune auth requise"},statusDescriptions:{all:"Voir les intégrations dans tous les statuts",connected:"Filtrer par intégrations actuellement connectées et actives",disconnected:"Filtrer par intégrations qui ne sont pas connectées",active:"Filtrer par intégrations actuellement actives",inactive:"Filtrer par intégrations actuellement inactives",pending:"Filtrer par intégrations avec un statut de connexion en attente",available:"Filtrer par intégrations disponibles pour la connexion",coming_soon:"Filtrer par intégrations bientôt disponibles",maintenance:"Filtrer par intégrations en maintenance"},categoryDescriptions:{all:"Voir toutes les catégories d'intégrations",link_shortener:"Filtrer par outils de raccourcissement de liens et de gestion d'URL",social_media:"Filtrer par plateformes et outils de réseaux sociaux",analytics:"Filtrer par plateformes d'analyse et de suivi",email_marketing:"Filtrer par outils d'email marketing et d'automatisation",crm:"Filtrer par systèmes de gestion de la relation client",payment:"Filtrer par outils de traitement des paiements et de e-commerce",productivity:"Filtrer par outils de productivité et de flux de travail",design:"Filtrer par outils de design et créatifs",communication:"Filtrer par plateformes de communication et de messagerie",automation:"Filtrer par outils d'automatisation et de flux de travail"}},N0e={noAccountConnectedForBrand:"{{brandName}} n'a pas de compte connecté pour {{platform}}.",noAccountConnectedForBrandMultiple:"{{brandName}} n'a pas de comptes connectés pour : {{platformList}}.",saveAsDraftOnly:"Vous pouvez sauvegarder en brouillon mais pas encore publier.",saveAsDraftOnlyNote:"Vous pouvez sauvegarder en brouillon mais pas encore publier."},S0e={title:"Constructeur de Liens IA",subtitle:"Gérez et suivez vos liens raccourcis",createSmartLink:"Créer un lien intelligent",searchPlaceholder:"Rechercher des liens par URL...",resultsCount:"Affichage de {{count}} sur {{total}} liens",originalUrl:"URL Originale",shortUrl:"URL Raccourcie",copyUrl:"Copier l'URL",openUrl:"Ouvrir l'URL",clicks:"clics",created:"Créé",createdBy:"Créé par",lastClicked:"Dernier clic",source:"Source",errorLoading:"Échec du chargement des liens",noResults:"Aucun lien trouvé",noResultsFiltered:"Essayez d'ajuster vos critères de recherche",noLinks:"Vous n'avez pas encore créé de liens intelligents",createFirstLink:"Créer votre premier lien intelligent",createSuccess:"Lien raccourci créé avec succès !",createError:"Échec de la création du lien raccourci. Veuillez réessayer.",statuses:{active:"Actif",inactive:"Inactif",pending:"En attente",expired:"Expiré"},analytics:{totalClicks:"Total des Clics",uniqueUsers:"Utilisateurs Uniques",totalLinks:"Total des Liens",clicks:"Clics",clicksOverTime:"Évolution des Clics",last30Days:"Performance des 30 derniers jours"}},C0e={followers:"abonnés",follow:"Suivre",comments:"commentaires",reposts:"partages",viewAllComments:"Voir les {{count}} commentaires",originalAudio:"Audio original",time:{hoursAgo:"il y a {{count}} HEURES",hourAgo:"il y a {{count}} HEURE"},actions:{like:"J'aime",comment:"Commenter",repost:"Partager",send:"Envoyer",share:"Partager"}},k0e={title:"Paiement Réussi - Socialness.ai",loading:"Chargement des détails du paiement...",successTitle:"Paiement Réussi ! 🎉",successMessage:"Votre paiement a été effectué avec succès.",subscriptionMessage:"Vous venez de vous abonner sur une base {{billingInterval}} au forfait {{planName}}
3770.",subscriptionDetails:"Détails de l'Abonnement",plan:"Forfait :",price:"Prix :",billing:"Facturation :",yearly:"Annuelle",monthly:"Mensuelle",nextBilling:"Prochaine facturation :",redirectMessage:"Vous serez redirigé vers votre page de facturation dans <1>{{countdown}}</1> secondes.",goToBilling:"Aller à la Facturation",welcomeMessage:"Bienvenue sur Socialness.ai ! Commencez à gérer vos réseaux sociaux comme un pro."},M0e={title:"Paiement Annulé - Socialness.ai",cancelTitle:"Paiement Annulé ou Erreur Survenue. Veuillez réessayer depuis la page facturation. ❌",supportMessage:"Si l'erreur persiste, veuillez nous contacter directement via le chat en direct en bas à droite.",redirectMessage:"Vous serez redirigé vers votre page de facturation dans <1>{{countdown}}</1> secondes.",goToBilling:"Aller à la Facturation"},I0e={title:"Mode Boost",subtitle:"Générez des idées de contenu et créez plusieurs posts à la fois avec l'IA",selectBrand:"Sélectionner une Marque",selectPersona:"Sélectionner un Persona",contentIdeas:"Idées de Contenu",generateMore:"Générer 5 de plus",createManually:"Créer Manuellement",createPosts:"Créer les posts",topicsGenerated:"sujets générés",noPersonas:"Aucun persona disponible pour cette marque",createPersona:"Créer un Persona",ideasError:"Échec du chargement des idées de contenu",noIdeas:"Aucune idée de contenu disponible pour l'instant. Générez quelques idées pour commencer !",welcomeTitle:"Bienvenue dans le Mode Boost !",welcomeDescription:"Boostez votre productivité ! Sélectionnez une marque et un persona pour générer des idées de contenu et créer plusieurs posts complets à la fois, optimisés pour votre audience.",step1:"Choisissez votre marque et votre persona cible",step2:"Parcourez les idées de contenu et générez des posts complets",step3:"Sélectionnez plusieurs idées pour créer des posts en lot",saveAll:"Tout sauvegarder",personasPage:"Page {{current}} sur {{total}} ({{count}} personas au total)",performanceTip:"Conseil : Sélectionnez 1-3 idées pour une génération plus rapide",generatedContent:"Contenu Généré",selectAll:"Tout sélectionner",saveSelected:"Sauvegarder sélectionnés",quota:{free:"{{remaining}}/{{total}} boosts d'essai restants aujourd'hui",paid:"{{remaining}}/{{total}} boosts restants aujourd'hui"},cooldown:{wait:"Veuillez patienter {{seconds}} secondes"},rateLimiting:{dailyLimitReached:"Limite quotidienne atteinte",dailyLimitReachedMessage:"Vous avez utilisé tous vos boosts pour aujourd'hui. Revenez demain ou passez à un plan supérieur.",upgradeFromFree:"Passer à un plan payant pour plus de boosts"},quotaCard:{title:"Quota Boost",used:"Utilisé",total:"Total",lastBoostToday:"Dernier boost disponible aujourd'hui",remainingBoosts:"Plus que {{count}} boosts aujourd'hui"},toasts:{functionCalled:"🔄 Fonction appelée avec succès !",noIdeasSelected:"⚠️ Aucune idée sélectionnée",noBrandSelected:"⚠️ Aucune marque sélectionnée",noPersonaSelected:"⚠️ Aucun persona sélectionné",generatingPosts:"🚀 Génération des posts en cours...",brandDataUnavailable:"❌ Données de la marque non disponibles",postsGeneratedSuccess:"🎉 {{count}} posts générés avec succès !",noContentGenerated:"⚠️ Aucun contenu généré",generationFailed:"❌ Échec de génération: {{message}}",noContentToSave:"⚠️ Aucun contenu à sauvegarder",draftsAllSavedSuccess:"✅ {{count}} brouillons sauvegardés avec succès",draftsPartialSuccess:"⚠️ {{successCount}} brouillons sauvegardés, {{errorCount}} erreurs",draftsSaveFailed:"❌ Erreur lors de la sauvegarde de tous les brouillons",saveAllError:"❌ Erreur générale lors de la sauvegarde",noPostsSelected:"⚠️ Aucun post sélectionné",selectedPostsSavedSuccess:"✅ {{successCount}} posts sélectionnés sauvegardés avec succès",selectedPostsPartialSuccess:"⚠️ {{successCount}} posts sauvegardés, {{errorCount}} erreurs",selectedPostsSaveFailed:"❌ Erreur lors de la sauvegarde des posts sélectionnés",saveSelectedError:"❌ Erreur générale lors de la sauvegarde des posts sélectionnés",draftSaveError:"❌ Erreur lors de la sauvegarde des brouillons",timeoutError:"⏱️ Génération trop lente... Essayez avec moins d'idées (1-3) ou réessayez plus tard.",rateLimitReached:"❌ Limite de boost atteinte",cooldownActive:"⏳ Cooldown actif, veuillez patienter"}},E0e={preview:"Aperçu",aiTimeSuggestions:"Recommandations IA",planning:"Planification"},T0e={title:"Confirmer la publication",successTitle:"Succès !",successMessage:"Votre publication a été publiée avec succès.",brandPublishingAs:"Publication au nom de la marque",schedule:{title:"Publication planifiée",willPublishOn:"Sera publiée le {{datetime}}"},content:{title:"Contenu"},media:{unavailable:"Aperçu du média indisponible",noMedia:"Aucun média",type:{image:"image",video:"vidéo"},format:{reel:"reel",attachment:"pièce jointe"}},badge:{reel:"Format Reel"},list:{title:"Sera publié sur"},warning:{scheduled:"Cette publication sera publiée à l'heure prévue.",publishAll:"Cette action publiera votre post sur toutes les plateformes sélectionnées. Cette action est irréversible."},errors:{title:"Erreurs de publication",generic:"Échec de la publication"},buttons:{cancel:"Annuler",publishing:"Publication en cours...",schedulePost:"Programmer",publishNow:"Publier maintenant"}}
3770,A0e={title:"Bravo, vous avez atteint votre limite 🥳",description:"Vous voulez aller plus loin ? Supprimez une {{singular}} ou passez à l'abonnement supérieur pour avoir plus de {{plural}}.",cta:"Mettre à niveau maintenant"},P0e={postDeleteErrors:Age,postSaveErrors:Pge,common:_ge,beta:Lge,mediaFormatDropdown:Dge,postFormatDropdown:Oge,platforms:Rge,postContent:$ge,cards:Fge,hints:zge,actions:Bge,canva:Uge,canvaReturn:Vge,onboarding:Wge,tooltips:qge,errors:Gge,pages:Hge,sidebar:Yge,brands:Qge,posts:Kge,teamMembers:Jge,auth:Zge,youtube:Xge,pinterest:e0e,linkedin:t0e,tiktok:r0e,analytics:n0e,billing:a0e,trialExpired:s0e,calendar:i0e,ideaDetail:o0e,ideaModal:l0e,personas:c0e,contentCreation:u0e,languageCode:d0e,accounts:f0e,mediaGallery:m0e,settings:h0e,contentHub:p0e,dashboard:g0e,statusDropdown:y0e,brandDropdown:b0e,modals:v0e,toasts:x0e,instagramOptionsModal:w0e,integrations:j0e,warnings:N0e,links:S0e,previews:C0e,paymentSuccess:k0e,paymentCancel:M0e,boostMode:I0e,tabs:E0e,publishModal:T0e,upgradeModal:A0e},_0e={notificationMessage:"Gracias por unirte a la beta. Escríbeme en el chat si ves algún bug 👇🏽",trial:{leftPrefix:"Solo",leftDays:"días restantes de tu periodo de prueba.",subscribeNow:"Suscríbete ahora",overPrefix:"Tu periodo de prueba ha terminado."}},L0e={title:"Tu periodo de prueba ha expirado…",progress:"Hasta ahora has analizado <b><i>{{brands}}</i></b> {{brandsWord}}, creado <b><i>{{personas}}</i></b> {{personasWord}}, conectado <b><i>{{accounts}}</i></b> {{accountsWord}} y redactado <b><i>{{drafts}}</i></b> {{draftsWord}}.",description:"Para seguir disfrutando de tu <1>asistente de redes sociales con IA</1>, tendrás que actualizar a Solo, Team o Agency Pro",words:{brand_singular:"marca",brand_plural:"marcas",persona_singular:"persona",persona_plural:"personas",account_singular:"cuenta",account_plural:"cuentas",draft_singular:"borrador",draft_plural:"borradores"},features:{unlimitedPosts:"Publica publicaciones ilimitadas en todas las plataformas",unlimitedAiContent:"Genera contenido con IA ilimitado (posts, textos, imágenes)",analytics:"Accede a analytics avanzados e insights impulsados por IA",algorithms:"Desbloquea nuestra suite propietaria de algoritmos de IA",support:"Soporte prioritario y procesamiento más rápido",more:"¡Y mucho más!"},upgradeCta:"Actualizar"},D0e={title:"Onboarding",tooltips:{locked:"Completa el paso anterior para desbloquear"},banner:{title:"Elige tu propio onboarding",description:"Sabemos que algunos quieren ir directo a la meta y otros prefieren explorar cada paso. Por eso tienes dos opciones:",journeyTitle:"El recorrido",journeyText:"Sigue cada paso a continuación para aprender cómo funciona cada función y cómo puedes aprovecharla.",destinationTitle:"El destino",destinationText:"Ingresa la URL de tu sitio web para generar tu estrategia de marketing, personas y primeros posts en 5 minutos. Luego explora la app por tu cuenta.",urlPlaceholder:"Introduce la URL de tu sitio web",cta:"Vamos",analyzing:"Analizando...",urlRequired:"Por favor, introduce una URL de sitio web"},actions:{start:"Comenzar",review:"Revisar",locked:"Bloqueado",startAnalyze:"Iniciar análisis de marca",startCreatePersona:"Crear persona",startCreateContent:"Crear contenido",startConnectAccount:"Conectar cuenta",startReviewPost:"Enviar a revisión",startViewAnalytics:"Ver analytics",trackYourLink:"Rastrear mi enlace"},welcome:"Bienvenido {{firstName}}",subtitle:"Elige tu camino y completa lo esencial para obtener valor rápido. Empieza con tu sitio web o explora paso a paso abajo.",gettingStarted:"Para empezar",completed:"completado",steps:{brand_analysis:{title:"Analizar tu marca",description:"Analiza tu marca para entender tu posicionamiento y tu audiencia"},social_account_connection:{title:"Conectar una cuenta de red social",description:"Conecta una cuenta para publicar automáticamente"},persona_creation:{title:"Crear un perfil de cliente ideal",description:"Crea un perfil que represente a tu público objetivo"},content_creation:{title:"Crear contenido",description:"Crea contenido para publicar en tus redes sociales"},shorten_link:{title:"Crea un enlace inteligente rastreable",description:"Usa el Constructor y Acortador de Enlaces IA para generar automáticamente un enlace rastreable y acortarlo para que sea más fácil de compartir."},post_review:{title:"Pide a la IA que revise tu publicación",description:"¿No estás seguro sobre tu próxima publicación? Pídele a la IA directamente en la app que verifique qué se puede mejorar y por qué."},ai_analytics:{title:"Ver analytics analizados por IA",description:"Consulta análisis de rendimiento de tus publicaciones"}},videoCall:{title:"Reserva tu videollamada personalizada",description:"Obtén un recorrido del producto de 30 minutos para asegurar una configuración óptima",cta:"Programar una cita",learnMore:"Saber más",demoRequestMessage:"¡Hola, quiero reservar una demostración!"},choosePlan:{title:"Elige tu plan",description:"Selecciona el plan adecuado para tu negocio y desbloquea todas las funciones premium",cta:"Ver planes",learnMore:"Comparar planes"},pageBuilder:{title:"Nuevo constructor de páginas",description:"Descubre nuevas posibilidades de diseño y experimenta la evolución de la creación de contenido",cta:"Pruébalo ahora",learnMore:"Saber más"},encouragement:{start:"¡Empecemos!",goodStart:"¡Buen comienzo, sigue así!",halfway:"¡Excelente trabajo! ¡Has superado la mitad!",almostThere:"¡Casi terminado, solo unos pasos más!",done:"¡Felicidades! ¡Has completado el proceso de iniciación!"},progress:{title:"Tu Progreso 🤩",completed:"¡Bien hecho!",allSteps:"Has completado todos los pasos.",lowCompletion:"¡Acabas de empezar!",highCompletion:"¡Casi terminado!"}},O0e={signup:{firstNameLabel:"Nombre",firstNamePlaceholder:"Introduce tu nombre",lastNameLabel:"Apellidos",lastNamePlaceholder:"Introduce tus apellidos"}},R0e={title:"Hola {{firstName}}, aquí está tu resumen de Redes Sociales",subtitle:"Este es tu centro de comando de contenido. Monitorea, planea y optimiza tu contenido con la ayuda de insights y recomendaciones de IA.",pageTitle:"Dashboard",pageSubtitle:"Ten una visión general rápida de tus redes sociales"},$0e={categories:{summary:"RESUMEN",content:"CONTENIDO",aiStudio:"ESTUDIO IA",management:"GESTIÓN",admin:"ADMIN",extra:"EXTRA"}
3770,media:"Biblioteca de Medios",team:"Equipo",integrations:"Integraciones",links:"Enlaces Inteligentes",aiLinksBuilder:"Constructor y Acortador de Enlaces IA",brands:"Marcas & Estrategia",personas:"Personas",smartLinks:"Enlaces inteligentes",connectedAccounts:"Cuentas conectadas",analytics:"Analytics & Rendimiento",createContent:"Crear Contenido",aiCredits:"{{count}} Créditos IA"},F0e={compliance:{disclosureNoOptionsWarning:"Debe seleccionar una opción de divulgación para cumplir con las políticas de TikTok antes de publicar."}},z0e={item:{profilePictureBadge:"Foto de perfil actual"}},B0e={connectFirst:"Conecta Tu Primera Cuenta",linkedin:{organizationSelectionTitle:"Seleccionar organizaciones de LinkedIn",selectAtLeastOne:"Por favor selecciona al menos una organización para conectar",connectionFailed:"Error al conectar páginas de LinkedIn",loadingOrganizations:"Cargando tus organizaciones de LinkedIn...",loadFailed:"Error al cargar organizaciones de LinkedIn",noOrganizationsFound:"No se encontraron organizaciones de LinkedIn",noOrganizationsFoundSubtext:"Asegúrate de tener acceso a páginas de empresa de LinkedIn",selectionDescription:"Elige qué organizaciones de LinkedIn te gustaría conectar a tu cuenta. Podrás publicar contenido en estas páginas una vez conectadas.",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo",organizationsSelected:"{{count}} de {{total}} organizaciones seleccionadas",companyPage:"Página de empresa",organizationsExpire:"Las organizaciones expiran: {{date}}",connectButton:"Conectar {{count}} organización",connectButton_plural:"Conectar {{count}} organizaciones",connecting:"Conectando...",linkedInPageFallback:"Página de LinkedIn {{id}}",organizationType:{educational:"Educativo",publicCompany:"Empresa pública",privatelyHeld:"Empresa privada",selfEmployed:"Autónomo",selfOwned:"Empresa propia",partnership:"Sociedad",nonProfit:"Sin fines de lucro",governmentAgency:"Agencia gubernamental",unknown:"Organización"}}},U0e={title:"Elegir tipo de conexión de Instagram",option1:{titleLine1:"Perfil Personal",titleLine2:"",description:"¿Lo usas para negocios? Cambia a una cuenta profesional y accede a todas las herramientas que necesitas.",tag:"No disponible"},option2:{title:"Perfil Profesional + Facebook",description:"Conecta tus cuentas de Facebook e Instagram en un solo paso.",tag:"Recomendado",cta:"Conectar vía Facebook"},option3:{title:"Cuenta Profesional (Solo Instagram)",description:"Conecta directamente tu cuenta de empresa o creador de Instagram.",cta:"Conectar vía Instagram"}},V0e={allBrands:"Todas las Marcas"},W0e={title:"Contenido del Post",contentCreationTooltip:"Crea tu contenido para esta publicación",contentTextPlaceholder:"¿Qué te gustaría compartir?",selectBrand:"Selecciona o añade una marca para continuar",uploadMediaTooltip:"Subir medios",removeMediaTooltip:"Eliminar medios",removeMediaConfirm:"¿Estás seguro de que quieres eliminar estos medios?",characterLimit:"{{count}}/{{limit}} caracteres",formats:"Formatos",mediaSizeError:"El tamaño del archivo es mayor que 25MB",mediaTypeError:"Tipo de archivo no soportado",regularFormat:"Clásico (Horizontal)",reelFormat:"Reel (Vertical)",addMoreImages:"Añadir más imágenes",caption:"Leyenda",placeholder:"Escribe el contenido de tu publicación aquí...",urlDetected:"URL detectada"},q0e={copy:"Copiar",copied:"¡Copiado!",trackingLink:"Enlace de seguimiento...",cancel:"Cancelar",goBack:"Volver atrás",purge:"Limpiar",createBrand:"Crear una marca",createBrandFirst:"Crea tu primera marca para comenzar",noBrandsAvailable:"No hay marcas disponibles",connectAccountFirst:"Conecta una cuenta de redes sociales para comenzar",connectAccount:"Conectar cuenta"},G0e={title:"Laboratorio de Estrategia de Marca",subtitle:"Gestiona tus marcas y su presencia en redes sociales",values:"Valores",keywords:"Palabras clave",accounts:"Cuentas",connectedAccounts:"Cuentas conectadas",connectAccount:"Conectar una cuenta",noAccounts:"No hay cuentas conectadas para esta marca",posts:"Posts",marketingStrategy:"Estrategia de Marketing",addBrand:"Agregar Marca",search:"Buscar marcas por nombre, descripción o palabras clave...",noResults:"No se encontraron marcas que coincidan con tus criterios de búsqueda",noBrands:"Aún no has creado marcas. Crea tu primera marca para comenzar.",createFirst:"Crear tu primera Marca",brandKit:"Kit de Marca",colors:{palette:"Colores"},typography:"Tipografía",generation:{title:"Creando tu Estrategia de Marc
3770a",steps:{analyzing:"Analizando información de marca y mercados objetivo...",identifying:"Identificando valores de marca y puntos de venta únicos...",exploring:"Explorando tus activos de marca y tu estilo visual...",creating:"Creando estrategia de contenido y recomendaciones...",optimizing:"Optimizando presencia en redes sociales y recomendaciones de canales...",finalizing:"Finalizando perfil de estrategia de marca..."}}},H0e={loading:{title:"Cargando tu contenido...",fetchingPosts:"Obteniendo tus publicaciones del servidor...",refreshing:"Actualizando publicaciones..."},table:{content:"Contenido",platforms:"Plataformas",brand:"Marca",status:"Estado",stats:"Estadísticas",date:"Fecha",actions:"Acciones"},noStatsYet:"Aún no hay estadísticas"},Y0e={all:"Todos",allDesc:"Ver posts en todos sus estados actuales.",draft:"Borradores",draftDesc:"Post está en progreso, aún no enviado para revisión o programación.",scheduled:"Programado",scheduledDesc:"Post está aprobado y configurado para publicación automática en un momento futuro.",ready_to_publish:"Listo para publicar",ready_to_publishDesc:"Post está completo, aprobado y esperando su horario programado o publicación manual.",waiting_for_approval:"Esperando aprobación",waiting_for_approvalDesc:"Post ha sido enviado y está esperando revisión por un aprobador.",published:"Publicado",publishedDesc:"Post ha sido compartido exitosamente en las plataformas seleccionadas.",rejected:"Rechazado",rejectedDesc:"Post fue revisado pero no aprobado para publicación por un aprobador.",error:"Error",errorDesc:"Ocurrió un error al intentar publicar o procesar el post.",processing:"Procesando",processingDesc:"Post está siendo procesado por el sistema (ej.: subida de medios, envío de API).",pending:"Pendiente",pendingDesc:"Post está esperando acción del sistema o confirmación externa antes de proceder."},Q0e={image:"Imagen",document:"Documento",video:"Vídeo",multi:"Múltiples imágenes",text:"Texto",regular:"Normal",reel:"Reel"},K0e=!1,J0e={videosPosted:"Videos publicados"},Z0e={uniqueViews:"Vistas únicas",clicks:"Clics"},X0e={timeSeries:{title:"Evolución diaria",summaryTitle:"Evolución diaria por plataforma",daily:"Diario",weekly:"Semanal",current:"Período actual",previous:"Período anterior",currentShort:"Actual",previousShort:"Anterior"},dateRange:{thisMonth:"Este mes",lastMonth:"Mes pasado",last15days:"Últimos 15 días",last30days:"Últimos 30 días",last90days:"Últimos 90 días",last365days:"Últimos 12 meses",custom:"Rango personalizado",days:"días",last:"Últimos",startDate:"Fecha de inicio",endDate:"Fecha de fin",apply:"Aplicar",cancel:"Cancelar"},moreMetricsTitle:"Más métricas de {{platform}}",youtubeIngestionLag:"Algunos datos pueden tardar hasta 48 h en llegarnos desde YouTube.",topPosts:{title:"🏆 Tus top posts de los últimos 30 días",subtitle:"Tu contenido más atractivo para el período seleccionado.",empty:"No se han publicado posts el mes pasado.",none:"No se han publicado posts durante este período",noText:"Sin texto",view:"Abrir"},secondaryMetrics:{seeMore:"Ver las otras {{count}} métricas",hide:"Ocultar métricas adicionales"},metrics:{videosPosted:"Videos publicados",followsAndUnfollows:"Follows y unfollows",postsPublished:"Publicaciones realizadas",clicks:"Clics",pageClicks:"Clics en la página",uniqueViews:"Vistas únicas"}},eye={loading:{title:"Cargando tu calendario...",fetchingPosts:"Obteniendo publicaciones y eventos...",refreshing:"Actualizando publicaciones..."}},tye={createSuccess:"¡Enlace corto creado exitosamente!",createError:"Error al crear enlace corto. Por favor, inténtalo de nuevo."},rye={title:"Generador de Personas IA",subtitle:"Crea y gestiona personas de audiencia para dirigir tu estrategia de contenido",create:"Crear Persona",createFirst:"Crear tu primer Persona",noPersonas:"No se han creado personas aún. Crea tu primer persona para empezar.",noPersona:"No hay personas para esta marca",createPersona:"Crear un Persona",analyzeWithAI:"Analizar con IA",analysis:{title:"Análisis IA",summary:"Resumen",strengths:"Fortalezas",improvements:"Áreas de Mejora",recommendedPersonas:"Nuevos Personas Recomendados",expertsInsights:"Insights de Expertos",demographicInsights:"Insights Demográficos",brandPersonaAlignment:"Alineación Marca-Persona",gapAnalysis:"Análisis de Brechas",description:"Obtén insights de IA sobre tus personas actuales y recomendaciones para nuevos personas para entender mejor tu audiencia objetivo."},noPersonasForAnalysis:{title:"Análisis de Personas",message:"Necesitas crear un persona primero antes de poder ejecutar un análisis con IA.",createCTA:"Crear un Persona"}},nye={createPost:"Crear Post",noPosts:"No hay posts para esta marca"},aye={auto:"Auto",realistic:"Realista",design:"Diseño","3d":"3D",artistic:"Artístico",modern:"Moderno",ad:"Comercial"},sye={auto:"Auto permite que la IA decida qué estilo aplicar a la imagen generada",realistic:"Ideal para imágenes realistas y fotográficas con énfasis en el realismo y detalle",design:"Perfecto para crear logos, productos de impresión bajo demanda, materiales promocionales y diseño gráfico","3d":"Crea imágenes estilizadas en tres dimensiones con profundidad, perspectiva y efectos volumétricos",artistic:"Estilo versátil para obras artísticas como pinturas abstractas, bocetos e interpretaciones creativas",modern:"Para visuales contemporáneos con estética limpia, minimalista o tendencia, inspirados en estilos editoriales o de revistas",ad:"Perfecto para crear visuales publicitarios llamativos, banners promocionales y contenido de marketing comercial"},iye={title:"Pago Exitoso - Socialness.ai",loading:"Cargando detalles del pago...",successTitle:"¡Pago Exitoso! 🎉",successMessage:"Su pago se ha realizado con éxito.",subscriptionMessage:"Te acabas de suscribir de forma {{billingInterval}} al plan {{planName}}
3770.",subscriptionDetails:"Detalles de la Suscripción",plan:"Plan:",price:"Precio:",billing:"Facturación:",yearly:"Anual",monthly:"Mensual",nextBilling:"Próxima facturación:",redirectMessage:"Serás redirigido a tu página de facturación en <1>{{countdown}}</1> segundos.",goToBilling:"Ir a Facturación",welcomeMessage:"¡Bienvenido a Socialness.ai! Comienza a gestionar tus redes sociales como un profesional."},oye={title:"Pago Cancelado - Socialness.ai",cancelTitle:"Pago Cancelado o Error Ocurrido. Por favor, inténtalo de nuevo desde la página de facturación. ❌",supportMessage:"Si el error persiste, por favor contáctanos directamente a través del chat en vivo en la parte inferior derecha.",redirectMessage:"Serás redirigido a tu página de facturación en <1>{{countdown}}</1> segundos.",goToBilling:"Ir a Facturación"},lye={title:"Facturación y Suscripción",subtitle:"Gestiona tu suscripción y métodos de pago",manageSubscription:"Gestionar mi suscripción",upgrade:"Actualizar",downgrade:"Reducir plan",saveWithYearly:"Ahorrar con anual",noActiveSubscription:"Sin Suscripción Activa",noActiveSubscriptionMessage:"Actualmente no tienes una suscripción activa. Elige un plan a continuación para comenzar con Socialness.ai.",currentPlan:"Plan Actual",active:"Activo",paymentMethod:"Método de Pago",noPaymentMethod:"Sin método de pago registrado",updatePaymentMethod:"Actualizar método de pago",monthly:"Mensual",yearly:"Anual",save20Percent:"Ahorra 20%",savedAmount:"{{amount}} ahorrados",subscribe:"Suscribirse",billingHistory:"Historial de Facturación",noBillingHistory:"No hay historial de facturación disponible. Suscríbete a un plan para ver tus facturas aquí.",invoiceNumber:"Número de Factura",amount:"Monto",date:"Fecha",status:"Estado",actions:"Acciones",loadingError:"Error al cargar la información de facturación. Por favor, inténtalo más tarde.",currentPeriodEnds:"El período actual termina el",expires:"Expira",perMonth:"/mes",billedAnnually:"Facturado anualmente a",currentPlanBadge:"Plan Actual",intervals:{month:"mes",year:"año"},cardHolder:"Titular",edit:"Editar",features:{brands:"marca",brands_plural:"marcas",brands_one:"marca",brands_other:"marcas",personas:"persona",personas_plural:"personas",socials:"plataforma social",socials_plural:"plataformas sociales",links:"enlaces / códigos QR",ideas:"ideas de contenido",posts:"posts por mes",users:"miembro del equipo",users_plural:"miembros del equipo",unlimited:"Ilimitado",upTo:"Hasta"}},cye={title:"Social Media Hub",subtitle:"Gestiona tus cuentas de redes sociales conectadas",connect:"Conectar Cuenta",connectFirst:"Conecta Tu Primera Cuenta",followers:"seguidores",viewProfile:"Ver Perfil",linkToBrand:"Vincular a Marca",unlinkBrand:"Desvincular de Marca",reconnect:"Reconectar",reconnecting:"Reconectando...",disconnect:"Desconectar",follow:"Seguir",errors:{linkFailed:"Error al vincular la cuenta a la marca. Por favor, inténtalo de nuevo.",unlinkFailed:"Error al desvincular la cuenta de la marca. Por favor, inténtalo de nuevo."}},uye={removeMember:{title:"Eliminar miembro",description:"Puedes eliminar a este miembro solo de la marca actual o completamente de tu organización.",brand:{title:"Eliminar de la marca",desc:"El miembro perderá acceso a esta marca pero seguirá perteneciendo a tu organización (la plaza sigue contando).",cta:"Eliminar de la marca"},org:{title:"Eliminar de la organización",desc:"El miembro perderá acceso a todas las marcas y ya no contará para tus plazas.",cta:"Eliminar de la organización"}}},dye={title:"Configuración",manageAccount:"Gestiona la configuración de tu cuenta y preferencias",profile:"Perfil",uploadProfilePicture:"Sube una nueva imagen de perfil. La imagen debe tener al menos 400x400 píxeles.","profile.firstName":"Nombre","profile.lastName":"Apellido","profile.updateButton":"Guardar Cambios","profile.success":"Perfil actualizado exitosamente","profile.error.noAuth":"Error de autenticación. Por favor, inicia sesión de nuevo.","profile.error.generic":"Error al actualizar el perfil. Por favor, inténtalo de nuevo.",avatarUploadFailed:"Error al subir la imagen del avatar. Por favor, inténtalo de nuevo.",email:{title:"Dirección de Correo",current:"Correo Actual",new:"Nuevo Correo",placeholder:"Ingresa tu nuevo correo",update:"Actualizar Correo",success:"Correo actualizado exitosamente"},security:{title:"Seguridad",currentPassword:"Contraseña Actual",currentPasswordPlaceholder:"Ingresa tu contraseña actual",newPassword:"Nueva Contraseña",newPasswordPlaceholder:"Ingresa tu nueva contraseña",confirmPassword:"Confirmar Nueva Contraseña",confirmPasswordPlaceholder:"Confirma tu nueva contraseña",update:"Actualizar Contraseña",success:"Contraseña actualizada exitosamente"},language:{title:"Preferencia de Idioma"}},fye="es",mye={platformCapNamed:"{{platform}} permite carruseles de hasta {{cap}} imágenes"},hye={settings:{title:"Configuración de LinkedIn",companyPage:"Página de empresa de LinkedIn",publishingAsCompany:"Publicando como página de empresa",visibility:"Visibilidad del post",visibilityPublic:"Público",visibilityConnections:"Solo conexiones"}},pye={followers:"seguidores",follow:"Seguir",comments:"comentarios",reposts:"reposts",actions:{like:"Me gusta",comment:"Comentar",repost:"Repostear",send:"Enviar"}},gye={preview:"Vista previa",aiTimeSuggestions:"Sugerencias de IA",planning:"Planificación"},yye={boostWithAi:"Mejorar con IA",trackYourLink:"Rastrear enlace",generateImage:"Generar imagen",remove:"Eliminar"},bye={authRequiredAi:"Debes estar conectado para usar funciones de IA.",contentRequiredAi:"Por favor, ingresa contenido antes de usar el Boost de IA.",boostFailed:"Boost de IA falló",authRequired:"Autenticación requerida",missingBrandOrPersona:"Marca o persona faltante para generación de imagen",missingBrand:"Marca faltante para generación de imagen",imageGenerationFailed:"Falló la generación de imagen",utmBoostNotReady:"El enlace no se puede mejorar. Asegúrate de que una URL esté presente y una plataforma esté seleccionad
3770a.",utmBoostFailed:"Mejora de enlace falló",captionRequired:"Por favor, agrega una descripción antes de crear una imagen",platformRequired:"Por favor, selecciona un canal de publicación antes de crear una imagen",captionAndPlatformRequired:"Por favor, agrega una descripción y selecciona un canal de publicación antes de crear una imagen"},vye={boostDisabled:{selectBrand:"Selecciona una marca para activar el Boost de IA",addContent:"Añade contenido para activar el Boost de IA",selectPlatform:"Selecciona al menos una plataforma para activar el Boost de IA"}},xye={draft:"Borrador",scheduled:"Programado",ready_to_publish:"Listo para publicar",waiting_for_approval:"Esperando aprobación",published:"Publicado",rejected:"Rechazado",error:"Error",pending:"Pendiente",waiting:"Esperando"},wye={brandsAndPlatforms:{title:"Canales de publicación"},brands:{title:"Marca"},platforms:{sectionTitle:"Canales"},mediaPost:{title:"Medios",formats:"Formatos",regular:"Normal",horizontal:"(Horizontal)",reel:"Reel",vertical:"(Vertical)"},preview:{title:"Vista previa",platformPreviewTitle:"Vista previa {{platformName}}",selectPlatformPrompt:"Selecciona una plataforma para ver la vista previa"}},jye={instagram:"Instagram",facebook:"Facebook",twitter:"Twitter",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest"},Nye={imageAlt:"Imagen {{index}}",previewAlt:"Vista previa",dropOrClick:"Arrastra tus medios aquí o haz clic para cargar",supportedTypes:"Soporta imágenes y videos de hasta 10MB"},Sye={title:"Confirmar publicación",successTitle:"¡Éxito!",successMessage:"Tu publicación se ha publicado correctamente.",brandPublishingAs:"Publicando como marca",schedule:{title:"Publicación programada",willPublishOn:"Se publicará el {{datetime}}"},content:{title:"Contenido"},media:{unavailable:"Vista previa no disponible",noMedia:"Sin medios",type:{image:"imagen",video:"video"},format:{reel:"reel",attachment:"adjunto"}},badge:{reel:"Formato Reel"},list:{title:"Se publicará en"},warning:{scheduled:"Esta publicación se publicará a la hora programada.",publishAll:"Esta acción publicará tu post en todas las plataformas seleccionadas. No se puede deshacer."},errors:{title:"Errores de publicación",generic:"Error al publicar"},buttons:{cancel:"Cancelar",publishing:"Publicando...",schedulePost:"Programar",publishNow:"Publicar ahora"}},Cye={beta:_0e,trialExpired:L0e,onboarding:D0e,auth:O0e,dashboard:R0e,sidebar:$0e,tiktok:F0e,mediaGallery:z0e,accounts_es_duplicate_remove_me:B0e,instagramOptionsModal:U0e,brandDropdown:V0e,postContent:W0e,common:q0e,brands:G0e,contentHub:H0e,statusDropdown:Y0e,tags:Q0e,common_metrics_patch:K0e,analytics_metrics_patch:J0e,analytics_metrics_additional:Z0e,analytics:X0e,calendar:eye,links:tye,personas:rye,posts:nye,imageStyles:aye,imageStyleDescriptions:sye,paymentSuccess:iye,paymentCancel:oye,billing:lye,accounts:cye,teamMembers:uye,settings:dye,languageCode:fye,hints:mye,linkedin:hye,previews:pye,tabs:gye,actions:yye,errors:bye,tooltips:vye,status:xye,cards:wye,platforms:jye,mediaCard:Nye,publishModal:Sye},kye={removeMember:{title:"Mitglied entfernen",description:"Du kannst dieses Mitglied nur aus der aktuellen Marke entfernen oder vollständig aus deiner Organisation.",brand:{title:"Aus Marke entfernen",desc:"Das Mitglied verliert den Zugriff auf diese Marke, gehört aber weiterhin zu deiner Organisation (Sitz bleibt belegt).",cta:"Aus Marke entfernen"},org:{title:"Aus Organisation entfernen",desc:"Das Mitglied verliert den Zugriff auf alle Marken und zählt nicht mehr zu euren Sitzen.",cta:"Aus Organisation entfernen"}}},Mye={dashboard:"Dashboard",content:"Inhalte",personas:"KI-Personas Builder",strategy:"Markenstrategie",analytics:"Analytics",settings:"Einstellungen",logout:"Abmelden",previous:"Zurück",save:"Speichern",cancel:"Abbrechen",goBack:"Zurück",purge:"Löschen",add:"Hinzufügen",modify:"Ändern",delete:"Löschen",accept:"Akzeptieren",decline:"Ablehnen",billing:"Abrechnung",confirm:"Bestätigen",create:"Erstellen",noBrandsAvailable:"Keine Marken verfügbar",connectAccountFirst:"Verbinden Sie ein Social-Media-Konto, um zu beginnen",connectAccount:"Konto verbinden",createBrand:"Marke erstellen",createBrandFirst:"Erstellen Sie Ihre erste Marke, um zu beginnen",loading:"Lädt...",error:"Fehler",unknownError:"Ein unbekannter Fehler ist aufgetreten",languageSearchPlaceholder:"Tippen Sie, um nach einer Sprache zu suchen oder aus Liste wählen",generating:"Generiere...",boosting:"Booste...",saving:"Speichere...",savingInProgress:"Speichere...",sending:"Sende...",retry:"Wiederholen",close:"Schließen",continue:"Fortfahren",submit:"Übermitteln",next:"Weiter",search:"Suchen",filter:"Filter",back:"Zurück",saveDraft:"Entwurf speichern",success:"Erfolg",warning:"Warnung",info:"Information",linking:"Verknüpfe...",selectDate:"Datum auswählen",selectTime:"Zeit auswählen",today:"Heute",now:"Jetzt",checkPostStatus:"Beitragsstatus prüfen",postStatusModalTitle:"Beitragsstatus",postStatusSuccess:"Ihr Beitrag wurde erfolgreich veröffentlicht!",postStatusProcessing:"Ihr Beitrag wird derzeit verarbeitet.",reviewSubmitError:"Bewertung konnte nicht übermittelt werden",postLoadError:"Beitrag konnte nicht geladen werden",postNotFound:"Beitrag nicht gefunden. Er wurde möglicherweise gelöscht.",draftSavedDueToMissingAccounts:"Beitrag als Entwurf gespeichert aufgrund fehlender Kontoverknüpfungen.",sc
3770heduleSuccess:"Beitrag erfolgreich geplant!",draftSaveSuccess:"Entwurf erfolgreich gespeichert!",subtitle:"Verfolgen Sie Ihre Social-Media-Performance auf allen Plattformen",summary:"Zusammenfassung",dateRange:{thisMonth:"Diesen Monat",lastMonth:"Letzten Monat",last15days:"Letzte 15 Tage",last30days:"Letzte 30 Tage",last90days:"Letzte 90 Tage",last365days:"Letzte 12 Monate",thisYear:"Dieses Jahr",custom:"Benutzerdefinierter Bereich",days:"Tage",last:"Letzte",startDate:"Startdatum",endDate:"Enddatum",apply:"Anwenden",cancel:"Abbrechen"},platformMetrics:"Plattform-Metriken",followers:"Follower",engagement:"Engagement",reach:"Reichweite",connectAccountForPlatform:"Verbinden Sie ein {{platform}}-Konto, um Analytics zu sehen",metrics:{videosPosted:"Veröffentlichte Videos"},aiAnalysis:{title:"KI-Beitragsanalyse",summary:"Zusammenfassung",strengths:"Stärken",improvements:"Verbesserungsbereich"},ai:{getAnalysisTitleGeneral:"KI-Analyse erhalten",getAnalysisDescriptionNew:"Schalten Sie KI-gestützte Einblicke in Ihre Social-Media-Aktivitäten frei, um sich besser auf das zu konzentrieren, was funktioniert, und Ihre Social-Media-Strategie zu verbessern.",analyzeButton:"Jetzt analysieren",analyzing:"Analysiere...",platformAnalysisTitle:"{{platform}} Analyse",title:"KI-Performance-Analyse"},specificPlatformsMetricsTitle:"Spezifische Plattform-Metriken",moreMetricsTitle:"Weitere {{platform}}-Metriken",youtubeIngestionLag:"Einige Daten können bis zu 48 Stunden brauchen, bis YouTube sie an uns übermittelt.",secondaryMetrics:{seeMore:"Weitere {{count}} Metriken anzeigen",hide:"Zusätzliche Metriken ausblenden"},topPosts:{title:"🏆 Deine top Beiträge der letzten 30 Tage",subtitle:"Dein am meisten engagierender Content für den ausgewählten Zeitraum.",empty:"Im vergangenen Monat wurden keine Beiträge veröffentlicht.",none:"In diesem Zeitraum wurden keine Beiträge veröffentlicht",noText:"Kein Text",view:"Öffnen"},thirdMetricsSummaryTitle:"Weitere relevante Metriken",timezoneDropdown:{searchPlaceholder:"Zeitzonen suchen...",noResults:"Keine Zeitzonen gefunden",group:{usCanada:"USA/Kanada",Europe:"Europa",Asia:"Asien",Africa:"Afrika",Australia:"Australien",Pacific:"Pazifik",Standard:"Standard"},timezoneLabel:"Zeitzone"},copy:"Kopieren",copied:"Kopiert!",trackingLink:"Tracking-Link...",recentPosts:"Ihre {{count}} letzten Beiträge",activeMember:"{{count}} aktives Mitglied",activeMembers:"{{count}} aktive Mitglieder",pendingMember:"{{count}} ausstehendes Mitglied",pendingMembers:"{{count}} ausstehende Mitglieder",duplicate:"Duplizieren",all:"Alle",drafts:"Entwürfe",scheduled:"Geplant",published:"Veröffentlicht",ready:"Bereit",period:"Zeitraum",status:"Status",brands:"Marken",platforms:"Plattformen",allBrands:"Alle Marken",filters:"Filter",createContent:"Content erstellen"},Iye={title:"Onboarding",banner:{title:"Wähle dein eigenes Onboarding",description:"Wir wissen, dass manche direkt ins Ziel wollen und andere jeden Schritt erkunden. Deshalb hast du zwei Optionen:",journeyTitle:"Die Reise",journeyText:"Gehe die Schritte unten durch, um zu lernen, wie jede Funktion funktioniert und wie du sie nutzen kannst.",destinationTitle:"Das Ziel",destinationText:"Gib deine Website-URL ein, um in 5 Minuten deine Marketingstrategie, Personas und ersten Beiträge zu erstellen. Danach kannst du die App selbst erkunden.",urlPlaceholder:"Website-URL eingeben",cta:"Los geht's",analyzing:"Analysiere...",urlRequired:"Bitte gib eine Website-URL ein"},tooltips:{locked:"Vorherigen Schritt abschließen, um zu entsperren"},actions:{start:"Start",review:"Überprüfen",locked:"Gesperrt",startAnalyze:"Markenanalyse starten",startCreatePersona:"Persona erstellen",startCreateContent:"Inhalt erstellen",startConnectAccount:"Konto verbinden",startReviewPost:"Beitrag prüfen lassen",startViewAnalytics:"Analytics ansehen",trackYourLink:"Rastrear mi enlace"},steps:{brand_analysis:{title:"Marke analysieren",description:"Nutze KI zur Analyse deiner Website und erhalte eine vollständige, personalisierte Markenstrategie"},persona_creation:{title:"Persona erstellen",description:"Erzeuge mit KI detaillierte Profile deiner Zielgruppe für besseres Content‑Targeting"},content_creation:{title:"Inhalt erstellen",description:"Erstelle Inhalte für soziale Netzwerke, abgestimmt auf Marke und Personas mit KI"},social_account_connection:{title:"Social‑Media‑Konto verbinden",description:"Verbinde Konten, um automatisch zu planen und zu veröffentlichen"},shorten_link:{title:"Erstelle einen smarten trackbaren Link",description:"Nutze den Smart Link Builder & Shortener, um automatisch einen trackbaren Link zu erzeugen und ihn zum einfachen Teilen zu kürzen."},post_review:{title:"KI um Beitragsprüfung bitten",description:"Unsicher beim nächsten Post? Bitte die KI in der App zu prüfen, was verbessert werden kann und warum."}
3770,ai_analytics:{title:"Analytics von KI analysiert",description:"Erhalte intelligente Einblicke in die Performance deiner Beiträge dank KI‑Analyse"}},subtitle:"Wähle deinen Weg und erledige das Wichtigste, um schnell Mehrwert zu schaffen. Starte mit deiner Website oder erkunde Schritt für Schritt unten.",encouragement:{start:"Los geht's!",goodStart:"Guter Start, weiter so!",halfway:"Tolle Arbeit! Mehr als die Hälfte geschafft!",almostThere:"Fast da, nur noch wenige Schritte!",done:"Glückwunsch! Onboarding abgeschlossen!"},progress:{title:"Dein Fortschritt 🤩",completed:"Gut gemacht!",allSteps:"Alle Schritte abgeschlossen.",lowCompletion:"Du beginnst gerade erst!",highCompletion:"Fast geschafft!"},videoCall:{title:"Buche deinen persönlichen Video‑Call",description:"30‑minütige Produktführung für einen optimalen Start",cta:"Termin vereinbaren",demoRequestMessage:"Hey, ich möchte eine Demo buchen!"},choosePlan:{title:"Wähle deinen Plan",description:"Wähle den passenden Plan und schalte Premium‑Funktionen frei",cta:"Pläne anzeigen"}},Eye={title:"Mein Content Hub",subtitle:"Verwalten Sie all Ihre Inhalte an einem Ort",loading:{title:"Ihre Inhalte werden geladen...",fetchingPosts:"Beiträge werden vom Server abgerufen...",refreshing:"Beiträge werden aktualisiert..."},view:{list:"Liste",grid:"Raster",board:"Board"},table:{content:"Inhalt",platforms:"Plattformen",brand:"Marke",status:"Status",stats:"Statistiken",created:"ERSTELLT",updated:"AKTUALISIERT",publishedOn:"VERÖFFENTLICHT",date:"Datum",actions:"Aktionen"},filter:{dateRange:"Zeitraum",status:"Status",brands:"Marken",platforms:"Plattformen"},filters:"Filter",statusDescriptions:{draft:"Beitrag ist in Bearbeitung, noch nicht zur Überprüfung oder Terminierung eingereicht.",scheduled:"Beitrag ist genehmigt und für die automatische Veröffentlichung zu einem zukünftigen Zeitpunkt festgelegt.",ready_to_publish:"Beitrag ist vollständig, genehmigt und wartet auf seinen geplanten Zeitpunkt oder die manuelle Veröffentlichung.",waiting_for_approval:"Beitrag wurde eingereicht und wartet auf Überprüfung durch einen Genehmiger.",published:"Beitrag wurde erfolgreich auf den ausgewählten Plattformen geteilt.",rejected:"Beitrag wurde überprüft, aber nicht von einem Genehmiger für die Veröffentlichung freigegeben.",error:"Beim Versuch, den Beitrag zu veröffentlichen oder zu verarbeiten, ist ein Fehler aufgetreten.",processing:"Beitrag wird derzeit vom System verarbeitet (z. B. Medien-Upload, API-Übermittlung).",pending:"Beitrag wartet auf Systemaktion oder externe Bestätigung, bevor er fortfahren kann."},noStatsYet:"Noch keine Statistiken"},Tye={all:"Alle",allDesc:"Beiträge über alle aktuellen Zustände hinweg anzeigen.",draft:"Entwürfe",draftDesc:"Beitrag ist in Bearbeitung, noch nicht zur Überprüfung oder Terminierung eingereicht.",scheduled:"Geplant",scheduledDesc:"Beitrag ist genehmigt und für die automatische Veröffentlichung zu einem zukünftigen Zeitpunkt festgelegt.",ready_to_publish:"Bereit zur Veröffentlichung",ready_to_publishDesc:"Beitrag ist vollständig, genehmigt und wartet auf seinen geplanten Zeitpunkt oder die manuelle Veröffentlichung.",waiting_for_approval:"Wartet auf Genehmigung",waiting_for_approvalDesc:"Beitrag wurde eingereicht und wartet auf Überprüfung durch einen Genehmiger.",published:"Veröffentlicht",publishedDesc:"Beitrag wurde erfolgreich auf den ausgewählten Plattformen geteilt.",rejected:"Abgelehnt",rejectedDesc:"Beitrag wurde überprüft, aber nicht von einem Genehmiger für die Veröffentlichung freigegeben.",error:"Fehler",errorDesc:"Beim Versuch, den Beitrag zu veröffentlichen oder zu verarbeiten, ist ein Fehler aufgetreten.",processing:"Wird verarbeitet",processingDesc:"Beitrag wird derzeit vom System verarbeitet (z. B. Medien-Upload, API-Übermittlung).",pending:"Ausstehend",pendingDesc:"Beitrag wartet auf Systemaktion oder externe Bestätigung, bevor er fortfahren kann."},Aye={allBrands:"Alle Marken"},Pye={image:"Bild",document:"Dokument",video:"Video",multi:"Mehrere Bilder",text:"Text",regular:"Normal",reel:"Reel"},_ye={title:"Content-Erstellung",subtitle:"Erstellen Sie ansprechende Social-Media-Inhalte mit KI",audience:"Zielgruppe",brand:"Marke",generatedContent:"Generierte Inhalte",noContent:"Noch kein Content generiert. Füllen Sie das Formular aus und klicken Sie auf 'Content generieren', um zu beginnen."},Lye={title:"Boost-Modus",subtitle:"Generieren Sie Content-Ideen und erstellen Sie mehrere Posts auf einmal mit KI",welcomeTitle:"Willkommen beim Boost-Modus!",welcomeDescription:"Steigern Sie Ihre Produktivität! Wählen Sie eine Marke und Persona aus, um Content-Ideen zu generieren und mehrere vollständige Posts auf einmal zu erstellen, perfekt auf Ihre Zielgruppe zugeschnitten.",chooseBrandAndPersona:"Wählen Sie Ihre Marke und Ziel-Per
3770sona",step1:"Wählen Sie Ihre Marke und Ziel-Persona",step2:"Durchsuchen Sie Content-Ideen und generieren Sie vollständige Posts",step3:"Wählen Sie mehrere Ideen aus, um Posts in Massen zu erstellen"},Dye={createSuccess:"Kurzlink erfolgreich erstellt!",createError:"Kurzlink konnte nicht erstellt werden. Bitte versuchen Sie es erneut."},Oye={title:"Content-Kalender",subtitle:"Planen und terminieren Sie Ihre Inhalte über soziale Netzwerke",loading:{title:"Ihr Kalender wird geladen...",fetchingPosts:"Beiträge und Ereignisse werden abgerufen...",refreshing:"Beiträge werden aktualisiert..."}},Rye={notificationMessage:"Danke, dass Sie an der Beta teilnehmen. Schreiben Sie mir im Chat bei Fehlern 👇🏽",trial:{leftPrefix:"Nur",leftDays:"Tage verbleiben in Ihrem Testzeitraum.",subscribeNow:"Jetzt abonnieren",overPrefix:"Ihre Testphase ist abgelaufen."}},$ye={title:"Ihre Testphase ist abgelaufen…",progress:"Bisher haben Sie <b><i>{{brands}}</i></b> {{brandsWord}} analysiert, <b><i>{{personas}}</i></b> {{personasWord}} erstellt, <b><i>{{accounts}}</i></b> {{accountsWord}} verbunden und <b><i>{{drafts}}</i></b> {{draftsWord}} erstellt.",description:"Um weiterhin Ihren <1>eigenen KI‑Social‑Media‑Assistenten</1> zu nutzen, wechseln Sie zu Solo, Team oder Agency Pro",words:{brand_singular:"Marke",brand_plural:"Marken",persona_singular:"Persona",persona_plural:"Personas",account_singular:"Konto",account_plural:"Konten",draft_singular:"Entwurf",draft_plural:"Entwürfe"},features:{unlimitedPosts:"Veröffentlichen Sie unbegrenzt Beiträge auf allen Plattformen",unlimitedAiContent:"Generieren Sie unbegrenzt KI‑Inhalte (Beiträge, Captions, Bilder)",analytics:"Erhalten Sie erweiterte Analytics und KI‑gestützte Insights",algorithms:"Schalten Sie unsere proprietäre KI‑Algorithmus‑Suite frei",support:"Priorisierter Support & schnellere Verarbeitung",more:"Und vieles mehr!"},upgradeCta:"Upgrade"},Fye={createPost:"Beitrag erstellen",noPosts:"Keine Beiträge für diese Marke",createWithAI:"Mit KI erstellen",createWithAIDescription:"Lassen Sie KI Ihnen helfen, ansprechende Inhalte zu erstellen",createManually:"Manuell erstellen",createManuallyDescription:"Schreiben Sie Ihre eigenen Inhalte von Grund auf"},zye={title:"Beitragsinhalt",contentCreationTooltip:"Erstellen Sie Ihren Inhalt für diesen Beitrag",contentTextPlaceholder:"Was möchten Sie teilen?",selectBrand:"Marke auswählen oder hinzufügen, um fortzufahren",uploadMediaTooltip:"Medien hochladen",removeMediaTooltip:"Medien entfernen",removeMediaConfirm:"Sind Sie sicher, dass Sie diese Medien entfernen möchten?",characterLimit:"{{count}}/{{limit}} Zeichen",formats:"Formate",mediaSizeError:"Dateigröße ist größer als 25MB",mediaTypeError:"Nicht unterstützter Dateityp",regularFormat:"Klassisch (Horizontal)",reelFormat:"Reel (Vertikal)",addMoreImages:"Weitere Bilder hinzufügen",caption:"Beschriftung",placeholder:"Schreiben Sie Ihren Beitragsinhalt hier...",urlDetected:"URL erkannt"},Bye={boostWithAi:"Mit KI verbessern",trackYourLink:"Link verfolgen",generateImage:"Bild generieren",remove:"Entfernen"},Uye={authRequiredAi:"Sie müssen angemeldet sein, um KI-Funktionen zu verwenden.",contentRequiredAi:"Bitte geben Sie Inhalt ein, bevor Sie KI-Boost verwenden.",boostFailed:"KI-Boost fehlgeschlagen",authRequired:"Authentifizierung erforderlich",missingBrandOrPersona:"Fehlende Marke oder Persona für Bildgenerierung",missingBrand:"Fehlende Marke für Bildgenerierung",imageGenerationFailed:"Bildgenerierung fehlgeschlagen",utmBoostNotReady:"Link kann nicht verbessert werden. Stellen Sie sicher, dass eine URL vorhanden ist und eine Plattform ausgewählt ist.",utmBoostFailed:"Link-Verbesserung fehlgeschlagen",captionRequired:"Bitte fügen Sie eine Bildunterschrift hinzu, bevor Sie ein Bild erstellen",platformRequired:"Bitte wählen Sie einen Veröffentlichungskanal aus, bevor Sie ein Bild erstellen",captionAndPlatformRequired:"Bitte fügen Sie eine Bildunterschrift hinzu und wählen Sie einen Veröffentlichungskanal aus, bevor Sie ein Bild erstellen"},Vye={boostDisabled:{selectBrand:"Wählen Sie eine Marke aus, um KI-Boost zu aktivieren",addContent:"Fügen Sie Inhalt hinzu, um KI-Boost zu aktivieren",selectPlatform:"Wählen Sie mindestens eine Plattform au
3770s, um KI-Boost zu aktivieren"}},Wye={draft:"Entwurf",scheduled:"Geplant",ready_to_publish:"Bereit zur Veröffentlichung",waiting_for_approval:"Wartet auf Genehmigung",published:"Veröffentlicht",rejected:"Abgelehnt",error:"Fehler",pending:"Ausstehend",waiting:"Wartend"},qye={brandsAndPlatforms:{title:"Veröffentlichungskanäle"},brands:{title:"Marke"},platforms:{sectionTitle:"Kanäle"},mediaPost:{title:"Medien",formats:"Formate",regular:"Normal",horizontal:"(Horizontal)",reel:"Reel",vertical:"(Vertikal)"},preview:{title:"Vorschau",platformPreviewTitle:"{{platformName}} Vorschau",selectPlatformPrompt:"Wählen Sie eine Plattform aus, um die Vorschau zu sehen"}},Gye={instagram:"Instagram",facebook:"Facebook",twitter:"Twitter",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest"},Hye={imageAlt:"Bild {{index}}",previewAlt:"Vorschau",dropOrClick:"Ziehen Sie Ihre Medien hierher oder klicken Sie zum Hochladen",supportedTypes:"Unterstützt Bilder und Videos bis zu 10MB"},Yye={categories:{summary:"ZUSAMMENFASSUNG",content:"CONTENT",aiStudio:"KI STUDIO",management:"VERWALTUNG",admin:"ADMIN",extra:"EXTRA"},media:"Medienbibliothek",team:"Team",integrations:"Integrationen",links:"Smart Links",aiLinksBuilder:"KI Link Builder & Shortener",brands:"Marken & Strategie",personas:"Personas",smartLinks:"Smart Links",connectedAccounts:"Verbundene Konten",analytics:"Analytics & Performance",createContent:"Content erstellen",aiCredits:"{{count}} KI-Credits"},Qye={title:"Markenstrategie-Labor",subtitle:"Verwalten Sie Ihre Marken und ihre Social-Media-Präsenz",values:"Werte",keywords:"Schlüsselwörter",accounts:"Konten",connectedAccounts:"Verbundene Konten",connectAccount:"Konto verbinden",noAccounts:"Keine Konten für diese Marke verbunden",brandKit:"Marken-Kit",posts:"Beiträge",marketingStrategy:"Marketing-Strategie",marketScope:"Marktbereich",distributionType:"Vertriebsart",businessModel:"Geschäftsmodell",priorityMarkets:"Prioritätsmärkte",colors:{palette:"Farben"},typography:"Typografie",addBrand:"Marke hinzufügen",search:"Marken nach Name, Beschreibung oder Schlüsselwörtern suchen...",noResults:"Keine Marken gefunden, die Ihren Suchkriterien entsprechen",noBrands:"Noch keine Marken erstellt. Erstellen Sie Ihre erste Marke, um zu beginnen.",createFirst:"Ihre erste Marke erstellen",create:{title:"Marke erstellen",subtitle:"Richten Sie eine neue Marke und ihre Social-Media-Strategie ein",submit:"Marke speichern"}},Kye={login:{title:"In Ihr Konto einloggen",emailLabel:"E-Mail-Adresse",emailPlaceholder:"E-Mail-Adresse",passwordLabel:"Passwort",passwordPlaceholder:"Passwort",forgotPassword:"Passwort vergessen?",noAccount:"Haben Sie kein Konto? Registrieren",signInButton:"Anmelden",signingIn:"Anmelden...",orContinueWith:"Oder fortfahren mit",google:"Google"},signup:{title:"Ihr Konto erstellen",nameLabel:"Vollständiger Name",namePlaceholder:"Geben Sie Ihren vollständigen Namen ein",firstNameLabel:"Vorname",firstNamePlaceholder:"Geben Sie Ihren Vornamen ein",lastNameLabel:"Nachname",lastNamePlaceholder:"Geben Sie Ihren Nachnamen ein",emailLabel:"E-Mail-Adresse",emailPlaceholder:"E-Mail-Adresse",passwordLabel:"Passwort",passwordPlaceholder:"Passwort",confirmPasswordLabel:"Passwort bestätigen",confirmPasswordPlaceholder:"Passwort bestätigen",hasAccount:"Haben Sie bereits ein Konto? Anmelden",createButton:"Konto erstellen",creating:"Konto wird erstellt...",orContinueWith:"Oder fortfahren mit",google:"Google"}},Jye={title:"KI-Personas Builder",subtitle:"Erstellen und verwalten Sie Zielgruppen-Personas für Ihre Content-Strategie",create:"Persona erstellen",createFirst:"Erste Persona erstellen",analyzeWithAI:"Mit KI analysieren",search:"Personas nach Name, Berufsbezeichnung oder Tags suchen...",noPersonas:"Noch keine Personas erstellt. Erstellen Sie Ihre erste Persona, um zu beginnen.",noPersona:"Keine Personas für diese Marke",noSearchResults:"Keine Personas gefunden, die Ihren Suchkriterien entsprechen",confirmDelete:"Sind Sie sicher, dass Sie diese Persona löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",createPersona:"Persona erstellen",createWithAI:"Mit KI erstellen",createWithAIDescription:"Lassen Sie KI Ihnen helfen, eine realistische Persona basierend auf Ihrer Marke zu erstellen",createManually:"Manuell erstellen",createManuallyDescription:"Schreiben Sie Ihre eigene Persona von Grund auf"},Zye={timeSeries:{title:"Tägliche Entwicklung",summaryTitle:"Tägliche Entwicklung nach Plattform",daily:"Täglich",weekly:"Wöchentlich",current:"Aktueller Zeitraum",previous:"Vorheriger Zeitraum",currentShort:"Aktuell",previousShort:"Vorher"},title:"Performance Coach Analytics",subtitle:"Verfolgen Sie Ihre Social-Media-Performance auf allen Plattformen"},Xye={title:"Hallo {{firstName}}
3770, hier ist Ihre Social-Media-Übersicht",subtitle:"Das ist Ihr Content-Kommandozentrum. Verfolgen, planen und optimieren Sie Ihren Content mit Hilfe von KI-Insights und Empfehlungen.",pageTitle:"Dashboard",pageSubtitle:"Haben Sie einen schnellen Überblick über Ihre Social-Media-Aktivitäten",seeAnalytics:"Meine Analytics ansehen",metrics:{youtubeSubscribers:"YouTube Abonnenten",facebookFollowers:"Facebook Follower",instagramFollowers:"Instagram Follower",linkedinFollowers:"LinkedIn Follower",tiktokFollowers:"TikTok Follower"}},ebe={followers:"Follower",follow:"Folgen",comments:"Kommentare",reposts:"Reposts",viewAllComments:"Alle {{count}} Kommentare ansehen",originalAudio:"Originalaudio",time:{hoursAgo:"vor {{count}} STUNDEN",hourAgo:"vor {{count}} STUNDE"},actions:{like:"Gefällt mir",comment:"Kommentieren",repost:"Reposten",send:"Senden",share:"Teilen"}},tbe="Wähle deinen Weg und erledige das Wichtigste, um schnell Mehrwert zu schaffen. Starte mit deiner Website oder erkunde Schritt für Schritt unten.",rbe={title:"Einstellungen",manageAccount:"Verwalten Sie Ihre Kontoeinstellungen und Präferenzen",profile:"Profil",uploadProfilePicture:"Neues Profilbild hochladen. Das Bild sollte mindestens 400x400 Pixel groß sein.","profile.firstName":"Vorname","profile.lastName":"Nachname","profile.updateButton":"Änderungen speichern","profile.success":"Profil erfolgreich aktualisiert","profile.error.noAuth":"Authentifizierungsfehler. Bitte melden Sie sich erneut an.","profile.error.generic":"Profil konnte nicht aktualisiert werden. Bitte versuchen Sie es erneut.",avatarUploadFailed:"Profilbild konnte nicht hochgeladen werden. Bitte versuchen Sie es erneut.",email:{title:"E-Mail-Adresse",current:"Aktuelle E-Mail",new:"Neue E-Mail",placeholder:"Geben Sie Ihre neue E-Mail ein",update:"E-Mail aktualisieren",success:"E-Mail erfolgreich aktualisiert"},security:{title:"Sicherheit",currentPassword:"Aktuelles Passwort",currentPasswordPlaceholder:"Geben Sie Ihr aktuelles Passwort ein",newPassword:"Neues Passwort",newPasswordPlaceholder:"Geben Sie Ihr neues Passwort ein",confirmPassword:"Neues Passwort bestätigen",confirmPasswordPlaceholder:"Bestätigen Sie Ihr neues Passwort",update:"Passwort aktualisieren",success:"Passwort erfolgreich aktualisiert"},language:{title:"Sprachpräferenz"}},nbe="de",abe={createPost:{title:"Beitrag erstellen",subtitle:"Erstellen Sie einen neuen Social-Media-Beitrag"},editPost:{title:"Beitrag bearbeiten",subtitle:"Aktualisieren Sie Ihren Social-Media-Beitrag"},status:{draft:"Entwurf",scheduled:"Geplant",waiting_for_approval:"Wartet auf Genehmigung",needsYourApproval:"Benötigt Ihre Überprüfung",published:"Veröffentlicht",rejected:"Abgelehnt",error:"Fehler",processing:"Wird verarbeitet",pending:"Ausstehend",ready_to_publish:"Bereit zur Veröffentlichung"},days:{monday:"Montag",tuesday:"Dienstag",wednesday:"Mittwoch",thursday:"Donnerstag",friday:"Freitag",saturday:"Samstag",sunday:"Sonntag"},aiBestTime:{selectPrompt:"Wählen Sie eine Marke und mindestens eine Plattform aus, um KI-Empfehlungen zu sehen.",errorLoading:"Fehler beim Laden der Empfehlungen:",noData:"Keine Empfehlungen für die ausgewählten Kriterien verfügbar.",noDataForDay:"Bitte wählen Sie eine Marke UND eine Plattform aus, um zu beginnen",tooltipHour:"Stunde:",tooltipScore:"Bewertung:",tooltipReason:"Grund:",title:"KI-Beste Zeit zum Posten",titleForBrandPrefix:"KI-Beste Zeit zum Posten für",description:"Stündliche Engagement-Bewertung basierend auf KI-Analyse, nach einer gründlichen Überprüfung Ihrer Marke und Zielgruppe",suggestionPrefix:"KI-Vorschlag:",suggestionBody:"Die nächste beste Zeit zum Posten ist",bestDays:"Beste Tage",avoidDays:"Zu vermeidende Tage",topRecommendationsTitle:"Top empfohlene Zeiten:"}},sbe={platformCapNamed:"{{platform}} erlaubt Karussells mit bis zu {{cap}} Bildern"},ibe={settings:{title:"LinkedIn‑Einstellungen",companyPage:"LinkedIn‑Unternehmensseite",publishingAsCompany:"Veröffentlichung als Unternehmensseite",visibility:"Sichtbarkeit des Beitrags",visibilityPublic:"Öffentlich",visibilityConnections:"Nur Verbindungen"}},obe={preview:"Vorschau",aiTimeSuggestions:"KI‑Zeitvorschläge",planning:"Planung"},lbe={title:"Veröffentlichung bestätigen",successTitle:"Erfolg!",successMessage:"Ihr Beitrag wurde erfolgreich veröffentlicht.",brandPublishingAs:"Veröffentlichung als Marke",schedule:{title:"Geplante Veröffentlichung",willPublishOn:"Wird veröffentlicht am {{datetime}}"},content:{title:"Inhalt"},media:{unavailable:"Medienvorschau nicht verfügbar",noMedia:"Kein Medium",type:{image:"Bild",video:"Video"},format:{reel:"Reel",attachment:"Anhang"}},badge:{reel:"Reel‑Format"},list:{title:"Wird veröffentlicht auf"},warning:{scheduled:"Dieser Beitrag wird zum geplanten Zeitpunkt veröffentlicht.",publishAll:"Diese Aktion veröffentlicht Ihren Beitrag auf allen ausgewählten Plattformen. Dies kann nicht rückgängig gemacht werden."},errors:{title:"Veröffentlichungsfehler",generic:"Beitrag konnte nicht veröffentlicht werden"},buttons:{cancel:"Abbrechen",publishing:"Veröffentliche...",schedulePost:"Planen",publishNow:"Jetzt veröffentlichen"}},cbe={features:{brands:"Marke",brands_plural:"Marken",brands_one:"Marke",brands_other:"Marken"}},ube={teamMembers:kye,common:Mye,onboarding:Iye,contentHub:Eye,statusDropdown:Tye,brandDropdown:Aye,tags:Pye,contentCreation:_ye,boostMode:Lye,links:Dye,calendar:Oye,beta:Rye,trialExpired:$ye,posts:Fye,postContent:zye,actions:Bye,errors:Uye,tooltips:Vye,status:Wye,cards:qye,platforms:Gye,mediaCard:Hye,sidebar:Yye,brands:Qye,auth:Kye,personas:Jye,analytics:Zye,dashboard:Xye,previews:ebe,onboardingSubtitleOverride:tbe,settings:rbe,languageCode:nbe,pages:abe,hints:sbe,linkedin:ibe,tabs:obe,publishModal:lbe,billing:cbe},dbe={removeMember:{title:"Rimuovi membro",description:"Puoi rimuovere questo membro solo dal brand corrente oppure completamente dalla tua organizzazione.",brand:{title:"Rimuovi dal brand",desc:"Il membro perderà l'accesso a questo brand ma farà ancora parte della tua organizzazione (posto ancora contato).",cta:"Rimuovi dal brand"},org:{title:"Rimuovi dall'organizzazione",desc:"Il membro perderà l'accesso a tutti i brand e non verrà più conteggiato nei posti.",cta:"Rimuovi dall'organizzazione"}}},fbe={dashboard:"Dashboard",content:"Contenuti",personas:"AI Personas Builder",strategy:"Strategia del Brand",analytics:"Analytics",settings:"Impostazioni",logout:"Esci",previous:"Precedente",save:"Salva",cancel:"Annulla",goBack:"Torna indietro",purge:"Elimina",add:"Aggiungi",modify:"Modifica",delete:"Elimina",accept:"Accetta",decline:"Rifiuta",billing:"Fatturazione",confirm:"Conferma",create:"Crea",noBrandsAvailable:"Nessun Brand Disponibile",connectAccountFirst:"Connetti un account social media per iniziare",connectAccount:"Connetti Account",createBrand:"Crea un brand",createBrandFirst:"Crea il tuo primo brand per iniziare",loading:"Caricamento...",error:"Errore",unknownError:"Si è verificato un errore sconosciuto",languageSearchPlaceholder:"Digita per 
3770cercare una lingua o seleziona dalla lista",generating:"Generando...",boosting:"Potenziando...",saving:"Salvando...",savingInProgress:"Salvando...",sending:"Inviando...",retry:"Riprova",close:"Chiudi",continue:"Continua",submit:"Invia",next:"Avanti",search:"Cerca",filter:"Filtro",back:"Indietro",saveDraft:"Salva Bozza",success:"Successo",warning:"Attenzione",info:"Informazioni",linking:"Collegando...",selectDate:"Seleziona data",selectTime:"Seleziona ora",today:"Oggi",now:"Ora",checkPostStatus:"Verifica Stato Post",postStatusModalTitle:"Stato del Post",postStatusSuccess:"Il tuo post è stato pubblicato con successo!",postStatusProcessing:"Il tuo post è attualmente in elaborazione.",reviewSubmitError:"Impossibile inviare la recensione",postLoadError:"Impossibile caricare il post",postNotFound:"Post non trovato. Potrebbe essere stato eliminato.",draftSavedDueToMissingAccounts:"Post salvato come bozza a causa di connessioni account mancanti.",scheduleSuccess:"Post programmato con successo!",draftSaveSuccess:"Bozza salvata con successo!",subtitle:"Monitora le tue prestazioni sui social media su tutte le piattaforme",summary:"Riepilogo",dateRange:{thisMonth:"Questo Mese",lastMonth:"Mese Scorso",last15days:"Ultimi 15 Giorni",last30days:"Ultimi 30 Giorni",last90days:"Ultimi 90 Giorni",last365days:"Ultimi 12 Mesi",thisYear:"Quest'anno",custom:"Intervallo Personalizzato",days:"giorni",last:"Ultimi",startDate:"Data di Inizio",endDate:"Data di Fine",apply:"Applica",cancel:"Annulla"},platformMetrics:"Metriche della Piattaforma",followers:"Follower",engagement:"Engagement",reach:"Portata",connectAccountForPlatform:"Connetti un account {{platform}} per visualizzare le analytics",metrics:{videosPosted:"Video pubblicati"},aiAnalysis:{title:"Analisi AI del Post",summary:"Riepilogo",strengths:"Punti di Forza",improvements:"Aree di Miglioramento"},ai:{getAnalysisTitleGeneral:"Ottieni Analisi AI",getAnalysisDescriptionNew:"Sblocca insight alimentati dall'AI sulle tue azioni sui social media per concentrarti meglio su ciò che funziona e migliorare la tua strategia sui social media.",analyzeButton:"Analizza Ora",analyzing:"Analizzando...",platformAnalysisTitle:"Analisi {{platform}}",title:"Analisi delle Prestazioni AI"},specificPlatformsMetricsTitle:"Metriche delle Piattaforme Specifiche",moreMetricsTitle:"Altre metriche {{platform}}",youtubeIngestionLag:"Alcuni dati possono impiegare fino a 48 ore prima di esserci inviati da YouTube.",secondaryMetrics:{seeMore:"Vedi le altre {{count}} metriche",hide:"Nascondi metriche aggiuntive"},topPosts:{title:"🏆 I tuoi top post degli ultimi 30 giorni",subtitle:"Il tuo contenuto più coinvolgente per il periodo selezionato.",empty:"Nessun post è stato pubblicato il mese scorso.",none:"Nessun post è stato pubblicato in questo periodo",noText:"Nessun testo",view:"Apri"},thirdMetricsSummaryTitle:"Altre metriche rilevanti",timezoneDropdown:{searchPlaceholder:"Cerca fusi orari...",noResults:"Nessun fuso orario trovato",group:{usCanada:"USA/Canada",Europe:"Europa",Asia:"Asia",Africa:"Africa",Australia:"Australia",Pacific:"Pacifico",Standard:"Standard"},timezoneLabel:"Fuso Orario"},copy:"Copia",copied:"Copiato!",trackingLink:"Link di Tracciamento...",recentPosts:"I tuoi {{count}} post recenti",activeMember:"{{count}} membro attivo",activeMembers:"{{count}} membri attivi",pendingMember:"{{count}} membro in attesa",pendingMembers:"{{count}} membri in attesa",duplicate:"Duplica"},mbe={title:"Onboarding",banner:{title:"Scegli il tuo onboarding",description:"Sappiamo che alcuni vogliono arrivare subito al traguardo e altri preferiscono esplorare ogni passo. Per questo hai due opzioni:",journeyTitle:"Il percorso",journeyText:"Segui i passaggi qui sotto per capire come funziona ogni funzionalità e come sfruttarla al meglio.",destinationTitle:"La destinazione",destinationText:"Inserisci l'URL del tuo sito per generare la tua strategia di marketing, le personas e i primi post in 5 minuti. Poi esplora l'app in autonomia.",urlPlaceholder:"Inserisci l'URL del tuo sito web",cta:"Andiamo",analyzing:"Analisi in corso...",urlRequired:"Per favore inserisci un URL del sito"},tooltips:{locked:"Completa il passo precedente per sbloccare"},actions:{start:"Inizia",review:"Rivedi",locked:"Bloccato",startAnalyze:"Avvia analisi brand",startCreatePersona:"Crea persona",startCreateContent:"Crea contenuto",startConnectAccount:"Connetti account",startReviewPost:"Invia a revisione",startViewAnalytics:"Vedi analytics",trackYourLink:"Traccia il tuo link"},steps:{brand_analysis:{title:"Analizza il tuo brand",description:"Usa l'AI per analizzare il tuo sito e ottenere una strategia di brand completa e personalizzata"},persona_creation:{title:"Crea una persona",description:"Genera con l'AI profili dettagliati del tuo pubblico ideale per indirizzare meglio i contenuti"},content_creation:{title:"Crea contenuti",description:"Crea contenuti per i social adatti al tuo brand e alle tue personas grazie all'AI"},social_account_connection:{title:"Connetti un account social",description:"Connetti gli account per programmare e pubblicare automaticamente"},shorten_link:{title:"Crea un link intelligente tracciabile",description:"Usa il Builder & Shortener di Link IA per generare automaticamente un link tracciabile e accorciarlo per condividerlo con facilità."},post_review:{title:"Chiedi all'AI di rivedere il tuo post",description:"Non sei sicuro del prossimo post? Chiedi all'AI nell'app cosa migliorare e perché."},ai_analytics:{title:"Vedi analytics analizzate dall'AI",description:"Ottieni insight intelligenti sulle performance dei tuoi post grazie all'analisi AI"}},subtitle:"Scegli il tuo percorso e completa l'essenziale per ottenere valore rapidamente. Inizia dal tuo sito web o esplora passo dopo passo qui sotto.",encouragement:{start:"Iniziamo!",goodStart:"Buon inizio, continua così!",halfway:"Ottimo lavoro! Sei oltre metà strada!",almostThere:"Quasi fatto, ancora pochi passi!",done:"Congratulazioni! Hai completato l'onboarding!"},progress:{title:"Il tuo Progresso 🤩",completed:"Ben fatto!",allSteps:"Hai completato tutti i passaggi.",lowCompletion:"Hai appena iniziato!",highCompletion:"Quasi fatto!"},videoCall:{title:"Prenota la tua videochiamata personalizzata",description:"Tour del prodotto di 30 minuti per un setup ottimale",cta:"Programma",demoRequestMessage:"Ciao, vorrei prenotare una demo!"},choosePlan:{title:"Scegli il tuo piano",description:"Seleziona il piano giusto per la tua azienda e sblocca tutte le funzioni premium",cta:"Vedi piani"}},hbe={notificationMessage:"Grazie per aver partecipato alla beta. Scrivimi nella chat se ci sono bug 👇🏽",trial:{leftPrefix:"Solo",leftDays:"giorni rimasti nel periodo di prova.",subscribeNow:"Abbonati ora",overPrefix:"Il tuo periodo di prova è terminato."}},pbe={title:"Il tuo periodo di prova è terminato…",progress:"Finora hai analizzato <b><i>{{brands}}</i></b> {{brandsWord}}, creato <b><i>{{personas}}</i></b> {{personasWord}}, collegato <b><i>{{accounts}}</i></b> {{accountsWord}} e redatto <b><i>{{drafts}}</i></b> {{draftsWord}}.",description:"Per continuare a goderti il tuo <1>assistente AI per i social media</1>, passa a Solo, Team o Agency Pro",words:{brand_singular:"brand",brand_plural:"brand",persona_singular:"persona",persona_plural:"personas",account_singular:"account",account_plural:"account",draft_singular:"bozza",draft_plural:"bozze"},features:{unlimitedPosts:"Pubblica post illimitati su tutte le piattaforme",unlimitedAiContent:"Genera contenuti AI 
3770illimitati (post, didascalie, immagini)",analytics:"Accedi ad analytics avanzati e insight potenziati dall'AI",algorithms:"Sblocca la nostra suite proprietaria di algoritmi AI",support:"Supporto prioritario e elaborazione più veloce",more:"E molto altro!"},upgradeCta:"Aggiorna"},gbe={createPost:"Crea Post",noPosts:"Nessun post per questo brand",createWithAI:"Crea con AI",createWithAIDescription:"Lascia che l'AI ti aiuti a creare contenuti coinvolgenti",createManually:"Crea Manualmente",createManuallyDescription:"Scrivi i tuoi contenuti da zero"},ybe={title:"Contenuto del Post",contentCreationTooltip:"Crea il tuo contenuto per questo post",contentTextPlaceholder:"Cosa ti piacerebbe condividere?",selectBrand:"Seleziona o aggiungi un brand per continuare",uploadMediaTooltip:"Carica media",removeMediaTooltip:"Rimuovi media",removeMediaConfirm:"Sei sicuro di voler rimuovere questi media?",characterLimit:"{{count}}/{{limit}} caratteri",formats:"Formati",mediaSizeError:"La dimensione del file è maggiore di 25MB",mediaTypeError:"Tipo di file non supportato",regularFormat:"Classico (Orizzontale)",reelFormat:"Reel (Verticale)",addMoreImages:"Aggiungi più immagini",caption:"Didascalia",placeholder:"Scrivi il contenuto del tuo post qui...",urlDetected:"URL rilevata"},bbe={categories:{summary:"RIEPILOGO",content:"CONTENUTO",aiStudio:"STUDIO IA",management:"GESTIONE",admin:"ADMIN",extra:"EXTRA"},media:"Libreria Media",team:"Team",integrations:"Integrazioni",links:"Link Intelligenti",aiLinksBuilder:"Costruttore e Accorciatore Link IA",brands:"Brand & Strategia",personas:"Personas",smartLinks:"Link intelligenti",connectedAccounts:"Account collegati",analytics:"Analytics & Performance",createContent:"Crea Contenuto",aiCredits:"{{count}} Crediti IA"},vbe={title:"Laboratorio Strategia del Brand",subtitle:"Gestisci i tuoi brand e la loro presenza sui social media",values:"Valori",keywords:"Parole Chiave",accounts:"Account",connectedAccounts:"Account Connessi",connectAccount:"Connetti un account",noAccounts:"Nessun account connesso per questo brand",brandKit:"Brand Kit",posts:"Post",marketingStrategy:"Strategia di Marketing",marketScope:"Ambito di Mercato",distributionType:"Tipo di Distribuzione",businessModel:"Modello di Business",priorityMarkets:"Mercati Prioritari",colors:{palette:"Colori"},typography:"Tipografia",addBrand:"Aggiungi Brand",search:"Cerca brand per nome, descrizione o parole chiave...",noResults:"Nessun brand trovato che corrisponda ai tuoi criteri di ricerca",noBrands:"Nessun brand creato ancora. Crea il tuo primo brand per iniziare.",createFirst:"Crea il tuo primo Brand",create:{title:"Crea Brand",subtitle:"Configura un nuovo brand e la sua strategia sui social media",submit:"Salva Brand"}},xbe={title:"Il Mio Hub Contenuti",subtitle:"Gestisci tutti i tuoi contenuti in un unico posto",loading:{title:"Caricamento dei tuoi contenuti...",fetchingPosts:"Recupero dei post dal server...",refreshing:"Aggiornamento dei post..."},view:{list:"Lista",grid:"Griglia",board:"Bacheca"},table:{content:"Contenuto",platforms:"Piattaforme",brand:"Brand",status:"Stato",stats:"Statistiche",created:"CREATO",updated:"AGGIORNATO",publishedOn:"PUBBLICATO",date:"Data",actions:"Azioni"},filter:{dateRange:"Periodo",status:"Stato",brands:"Brand",platforms:"Piattaforme"},filters:"Filtri",noStatsYet:"Nessuna statistica ancora"},wbe={all:"Tutti",allDesc:"Visualizza post in tutti i loro stati attuali.",draft:"Bozze",draftDesc:"Post è in corso, non ancora inviato per revisione o programmazione.",scheduled:"Programmato",scheduledDesc:"Post è approvato e impostato per pubblicazione automatica in un momento futuro.",ready_to_publish:"Pronto per pubblicare",ready_to_publishDesc:"Post è completo, approvato e in attesa del suo orario programmato o pubblicazione manuale.",waiting_for_approval:"In attesa di approvazione",waiting_for_approvalDesc:"Post è stato inviato e sta aspettando revisione da un approvatore.",published:"Pubblicato",publishedDesc:"Post è stato condiviso con successo sulle piattaforme selezionate.",rejected:"Rifiutato",rejectedDesc:"Post è stato revisionato ma non approvato per pubblicazione da un approvatore.",error:"Errore",errorDesc:"Si è verificato un errore tentando di pubblicare o elaborare il post.",processing:"Elaborazione",processingDesc:"Post sta sendo elaborato dal sistema (es.: caricamento media, invio API).",pending:"In sospeso",pendingDesc:"Post sta aspettando azione del sistema o conferma esterna prima di procedere."},jbe={allBrands:"Tutti i Brand"},Nbe={image:"Immagine",document:"Documento",video:"Video",multi:"Immagini multiple",text:"Testo",regular:"Normale",reel:"Reel"},Sbe={loading:{title:"Caricamento del tuo calendario...",fetchingPosts:"Recupero di post ed eventi...",refreshing:"Aggiornamento dei post..."}},Cbe={login:{title:"Accedi al tuo account",emailLabel:"Indirizzo email",emailPlaceholder:"Indirizzo email",passwordLabel:"Password",passwordPlaceholder:"Password",forgotPassword:"Hai dimenticato la password?",noAccount:"Non hai un account? Registrati",signInButton:"Accedi",signingIn:"Accesso in corso...",orContinueWith:"O continua con",google:"Google"},signup:{title:"Crea il tuo account",nameLabel:"Nome completo",namePlaceholder:"Inserisci il tuo nome completo",firstNameLabel:"Nome",firstNamePlaceholder:"Inserisci il tuo nome",lastNameLabel:"Cognome",lastNamePlaceholder:"Inserisci il tuo cognome",emailLabel:"Indirizzo email",emailPlaceholder:"Indirizzo email",passwordLabel:"Password",passwordPlaceholder:"Password",confirmPasswordLabel:"Conferma Password",confirmPasswordPlaceholder:"Conferma Password",hasAccount:"Hai già un account? Accedi",createButton:"Crea account",creating:"Creazione account...",orContinueWith:"O continua con",google:"Google"}},kbe={title:"AI Personas Builder",subtitle:"Crea e gestisci le personas del pubblico per indirizzare la tua strategia di contenuti",create:"Crea Persona",createFirst:"Crea Prima Persona",analyzeWithAI:"Analizza con AI",search:"
3770Cerca personas per nome, titolo di lavoro o tag...",noPersonas:"Nessuna persona creata ancora. Crea la tua prima persona per iniziare.",noPersona:"Nessuna persona per questo brand",noSearchResults:"Nessuna persona trovata che corrisponda ai tuoi criteri di ricerca",confirmDelete:"Sei sicuro di voler eliminare questa persona? Questa azione non può essere annullata.",createPersona:"Crea Persona",createWithAI:"Crea con AI",createWithAIDescription:"Lascia che l'AI ti aiuti a creare una persona realistica basata sul tuo brand",createManually:"Crea Manualmente",createManuallyDescription:"Scrivi la tua persona da zero"},Mbe={timeSeries:{title:"Evoluzione quotidiana",summaryTitle:"Evoluzione quotidiana per piattaforma",daily:"Giornaliero",weekly:"Settimanale",current:"Periodo corrente",previous:"Periodo precedente",currentShort:"Corrente",previousShort:"Precedente"},title:"Analytics Performance Coach",subtitle:"Monitora le tue prestazioni sui social media su tutte le piattaforme"},Ibe="Scegli il tuo percorso e completa l'essenziale per ottenere valore rapidamente. Inizia dal tuo sito web o esplora passo dopo passo qui sotto.",Ebe={title:"Ciao {{firstName}}, ecco la tua panoramica dei Social Media",subtitle:"Questo è il tuo centro di comando dei contenuti. Monitora, pianifica e ottimizza i tuoi contenuti con l'aiuto di insights e raccomandazioni AI.",pageTitle:"Dashboard",pageSubtitle:"Abbi una panoramica rapida dei tuoi social media"},Tbe={followers:"follower",follow:"Segui",comments:"commenti",reposts:"repost",viewAllComments:"Vedi tutti i {{count}} commenti",originalAudio:"Audio originale",time:{hoursAgo:"{{count}} ORE FA",hourAgo:"{{count}} ORA FA"},actions:{like:"Mi piace",comment:"Commenta",repost:"Reposta",send:"Invia",share:"Condividi"}},Abe={title:"Impostazioni",manageAccount:"Gestisci le impostazioni del tuo account e le preferenze",profile:"Profilo",uploadProfilePicture:"Carica una nuova immagine del profilo. L'immagine dovrebbe essere di almeno 400x400 pixel.","profile.firstName":"Nome","profile.lastName":"Cognome","profile.updateButton":"Salva Modifiche","profile.success":"Profilo aggiornato con successo","profile.error.noAuth":"Errore di autenticazione. Effettua nuovamente l'accesso.","profile.error.generic":"Impossibile aggiornare il profilo. Riprova.",avatarUploadFailed:"Impossibile caricare l'immagine dell'avatar. Riprova.",email:{title:"Indirizzo Email",current:"Email Attuale",new:"Nuova Email",placeholder:"Inserisci la tua nuova email",update:"Aggiorna Email",success:"Email aggiornata con successo"},security:{title:"Sicurezza",currentPassword:"Password Attuale",currentPasswordPlaceholder:"Inserisci la tua password attuale",newPassword:"Nuova Password",newPasswordPlaceholder:"Inserisci la tua nuova password",confirmPassword:"Conferma Nuova Password",confirmPasswordPlaceholder:"Conferma la tua nuova password",update:"Aggiorna Password",success:"Password aggiornata con successo"},language:{title:"Preferenza Lingua"}},Pbe="it",_be={platformCapNamed:"{{platform}} consente carrousel fino a {{cap}} immagini"},Lbe={settings:{title:"Impostazioni LinkedIn",companyPage:"Pagina aziendale LinkedIn",publishingAsCompany:"Pubblicazione come pagina aziendale",visibility:"Visibilità del post",visibilityPublic:"Pubblico",visibilityConnections:"Solo connessioni"}},Dbe={preview:"Anteprima",aiTimeSuggestions:"Suggerimenti IA",planning:"Pianificazione"},Obe={title:"Conferma pubblicazione",successTitle:"Successo!",successMessage:"Il tuo post è stato pubblicato con successo.",brandPublishingAs:"Pubblicazione come brand",schedule:{title:"Pubblicazione programmata",willPublishOn:"Sarà pubblicato il {{datetime}}"},content:{title:"Contenuto"},media:{unavailable:"Anteprima media non disponibile",noMedia:"Nessun media",type:{image:"immagine",video:"video"},format:{reel:"reel",attachment:"allegato"}},badge:{reel:"Formato Reel"},list:{title:"Sarà pubblicato su"},warning:{scheduled:"Questo post verrà pubblicato all'orario programmato.",publishAll:"Questa azione pubblicherà il tuo post su tutte le piattaforme selezionate. Non può essere annullata."},errors:{title:"Errori di pubblicazione",generic:"Impossibile pubblicare"},buttons:{cancel:"Annulla",publishing:"Pubblicazione...",schedulePost:"Programma",publishNow:"Pubblica ora"}},Rbe={features:{brands:"brand",brands_plural:"brand",brands_one:"brand",brands_other:"brand"}},$be={boostWithAi:"Migliora con IA",trackYourLink:"Traccia link",generateImage:"Genera immagine",remove:"Rimuovi"},Fbe={authRequiredAi:"Devi essere connesso per utilizzare le funzioni IA.",contentRequiredAi:"Per favore, inserisci contenuto prima di utilizzare il Boost IA.",boostFailed:"Boost IA fallito",authRequired:"Autenticazione richiesta",missingBrandOrPersona:"Brand o persona mancante per generazione immagine",missingBrand:"Brand mancante per generazione immagine",imageGenerationFailed:"Generazione immagine fallita",utmBoostNotReady:"Il link non può essere migliorato. Assicurati che sia presente un URL e sia selezionata una piattaforma.",utmBoostFailed:"Miglioramento link fallito",captionRequired:"Per favore, aggiungi una didascali
3770a prima di creare un'immagine",platformRequired:"Per favore, seleziona un canale di pubblicazione prima di creare un'immagine",captionAndPlatformRequired:"Per favore, aggiungi una didascalia e seleziona un canale di pubblicazione prima di creare un'immagine"},zbe={boostDisabled:{selectBrand:"Seleziona un brand per attivare il Boost IA",addContent:"Aggiungi contenuto per attivare il Boost IA",selectPlatform:"Seleziona almeno una piattaforma per attivare il Boost IA"}},Bbe={createSuccess:"Link corto creato con successo!",createError:"Errore nella creazione del link corto. Riprova."},Ube={draft:"Bozza",scheduled:"Programmato",ready_to_publish:"Pronto per pubblicare",waiting_for_approval:"In attesa di approvazione",published:"Pubblicato",rejected:"Rifiutato",error:"Errore",pending:"In sospeso",waiting:"In attesa"},Vbe={brandsAndPlatforms:{title:"Canali di pubblicazione"},brands:{title:"Brand"},platforms:{sectionTitle:"Canali"},mediaPost:{title:"Media",formats:"Formati",regular:"Normale",horizontal:"(Orizzontale)",reel:"Reel",vertical:"(Verticale)"},preview:{title:"Anteprima",platformPreviewTitle:"Anteprima {{platformName}}",selectPlatformPrompt:"Seleziona una piattaforma per vedere l'anteprima"}},Wbe={instagram:"Instagram",facebook:"Facebook",twitter:"Twitter",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest"},qbe={imageAlt:"Immagine {{index}}",previewAlt:"Anteprima",dropOrClick:"Trascina i tuoi media qui o clicca per caricare",supportedTypes:"Supporta immagini e video fino a 10MB"},Gbe={teamMembers:dbe,common:fbe,onboarding:mbe,beta:hbe,trialExpired:pbe,posts:gbe,postContent:ybe,sidebar:bbe,brands:vbe,contentHub:xbe,statusDropdown:wbe,brandDropdown:jbe,tags:Nbe,calendar:Sbe,auth:Cbe,personas:kbe,analytics:Mbe,onboardingSubtitleOverride:Ibe,dashboard:Ebe,previews:Tbe,settings:Abe,languageCode:Pbe,hints:_be,linkedin:Lbe,tabs:Dbe,publishModal:Obe,billing:Rbe,actions:$be,errors:Fbe,tooltips:zbe,links:Bbe,status:Ube,cards:Vbe,platforms:Wbe,mediaCard:qbe},Hbe={removeMember:{title:"Remover membro",description:"Você pode remover este membro apenas da marca atual ou removê-lo completamente da sua organização.",brand:{title:"Remover da marca",desc:"O membro perderá acesso a esta marca mas continuará pertencendo à sua organização (assento ainda contado).",cta:"Remover da marca"},org:{title:"Remover da organização",desc:"O membro perderá acesso a todas as marcas e não contará mais nos seus assentos.",cta:"Remover da organização"}}},Ybe={dashboard:"Dashboard",content:"Conteúdo",personas:"AI Personas Builder",strategy:"Estratégia da Marca",analytics:"Analytics",settings:"Configurações",logout:"Sair",previous:"Anterior",save:"Salvar",cancel:"Cancelar",goBack:"Voltar",purge:"Limpar",add:"Adicionar",modify:"Modificar",delete:"Excluir",accept:"Aceitar",decline:"Recusar",billing:"Faturamento",confirm:"Confirmar",create:"Criar",noBrandsAvailable:"Nenhuma Marca Disponível",connectAccountFirst:"Conecte uma conta de mídia social para começar",connectAccount:"Conectar Conta",createBrand:"Criar uma marca",createBrandFirst:"Crie sua primeira marca para começar",loading:"Carregando...",error:"Erro",unknownError:"Ocorreu um erro desconhecido",languageSearchPlaceholder:"Digite para procurar um idioma ou selecione da lista",generating:"Gerando...",boosting:"Impulsionando...",saving:"Salvando...",savingInProgress:"Salvando...",sending:"Enviando...",retry:"Tentar novamente",close:"Fechar",continue:"Continuar",submit:"Enviar",next:"Próximo",search:"Pesquisar",filter:"Filtro",back:"Voltar",saveDraft:"Salvar Rascunho",success:"Sucesso",warning:"Aviso",info:"Informação",linking:"Conectando...",selectDate:"Selecionar data",selectTime:"Selecionar hora",today:"Hoje",now:"Agora",checkPostStatus:"Verificar Status do Post",postStatusModalTitle:"Status do Post",postStatusSuccess:"Seu post foi publicado com sucesso!",postStatusProcessing:"Seu post está sendo processado no momento.",reviewSubmitError:"Falha ao enviar avaliação",postLoadError:"Falha ao carregar post",postNotFound:"Post não encontrado. Pode ter sido excluído.",draftSavedDueToMissingAccounts:"Post salvo como rascunho devido a conexões de conta ausentes.",sc
3770heduleSuccess:"Post agendado com sucesso!",draftSaveSuccess:"Rascunho salvo com sucesso!",subtitle:"Acompanhe seu desempenho nas mídias sociais em todas as plataformas",summary:"Resumo",dateRange:{thisMonth:"Este Mês",lastMonth:"Mês Passado",last15days:"Últimos 15 Dias",last30days:"Últimos 30 Dias",last90days:"Últimos 90 Dias",last365days:"Últimos 12 Meses",thisYear:"Este ano",custom:"Período Personalizado",days:"dias",last:"Últimos",startDate:"Data de Início",endDate:"Data de Fim",apply:"Aplicar",cancel:"Cancelar"},platformMetrics:"Métricas da Plataforma",followers:"Seguidores",engagement:"Engajamento",reach:"Alcance",connectAccountForPlatform:"Conecte uma conta {{platform}} para visualizar analytics",metrics:{videosPosted:"Vídeos publicados",postsPublished:"Posts publicados"},aiAnalysis:{title:"Análise IA do Post",summary:"Resumo",strengths:"Pontos Fortes",improvements:"Áreas de Melhoria"},ai:{getAnalysisTitleGeneral:"Obter Análise IA",getAnalysisDescriptionNew:"Desbloqueie insights alimentados por IA sobre suas ações nas mídias sociais para focar melhor no que funciona e melhorar sua estratég
3770ia de mídias sociais.",analyzeButton:"Analisar Agora",analyzing:"Analisando...",platformAnalysisTitle:"Análise {{platform}}",title:"Análise de Performance IA"},specificPlatformsMetricsTitle:"Métricas de Plataformas Específicas",moreMetricsTitle:"Mais métricas de {{platform}}",youtubeIngestionLag:"Alguns dados podem levar até 48h para chegar até nós pelo YouTube.",secondaryMetrics:{seeMore:"Ver as outras {{count}} métricas",hide:"Ocultar métricas adicionais"},topPosts:{title:"🏆 Seus top posts dos últimos 30 dias",subtitle:"Seu conteúdo mais envolvente para o período selecionado.",empty:"Nenhum post foi publicado no mês passado.",none:"Nenhum post foi publicado durante este período",noText:"Sem texto",view:"Abrir"},thirdMetricsSummaryTitle:"Outras métricas relevantes",timezoneDropdown:{searchPlaceholder:"Pesquisar fusos horários...",noResults:"Nenhum fuso horário encontrado",group:{usCanada:"EUA/Canadá",Europe:"Europa",Asia:"Ásia",Africa:"África",Australia:"Austrália",Pacific:"Pacífico",Standard:"Padrão"},timezoneLabel:"Fuso Horário"},copy:"Copiar",copied:"Copiado!",trackingLink:"Link de Rastreamento...",recentPosts:"Seus {{count}} posts recentes",activeMember:"{{count}} membro ativo",activeMembers:"{{count}} membros ativos",pendingMember:"{{count}} membro pendente",pendingMembers:"{{count}} membros pendentes",duplicate:"Duplicar"},Qbe={title:"Onboarding",banner:{title:"Escolha seu próprio onboarding",description:"Sabemos que alguns querem ir direto à linha de chegada e outros preferem explorar cada etapa. Por isso você tem duas opções:",journeyTitle:"A jornada",journeyText:"Siga cada etapa abaixo para aprender como cada recurso funciona e como aproveitá-lo.",destinationTitle:"O destino",destinationText:"Insira a URL do seu site para gerar sua estratég
3770ia de marketing, personas e primeiros posts em 5 minutos. Depois explore o app por conta própria.",urlPlaceholder:"Insira a URL do seu site",cta:"Vamos lá",analyzing:"Analisando...",urlRequired:"Por favor, insira uma URL de site"},actions:{start:"Começar",review:"Revisar",locked:"Bloqueado",startAnalyze:"Iniciar análise de marca",startCreatePersona:"Criar persona",startCreateContent:"Criar conteúdo",startConnectAccount:"Conectar conta",startReviewPost:"Enviar para revisão",startViewAnalytics:"Ver analytics",trackYourLink:"Rastrear meu link"},steps:{shorten_link:{title:"Crie um link inteligente rastreável",description:"Use o Construtor e Encurtador de Links com IA para gerar automaticamente um link rastreável e encurtá-lo para facilitar o compartilhamento."}},subtitle:"Escolha seu caminho e complete o essencial para obter valor rapidamente. Comece pelo seu site ou explore passo a passo abaixo."},Kbe={notificationMessage:"Obrigado por participar da beta. Escreva no chat se houver bugs 👇🏽",trial:{leftPrefix:"Apenas",leftDays:"dias restantes no seu período de teste.",subscribeNow:"Assine agora",overPrefix:"Seu período de teste terminou."}},Jbe={title:"Seu período de teste expirou…",progress:"Até agora você analisou <b><i>{{brands}}</i></b> {{brandsWord}}, criou <b><i>{{personas}}</i></b> {{personasWord}}, conectou <b><i>{{accounts}}</i></b> {{accountsWord}} e redigiu <b><i>{{drafts}}</i></b> {{draftsWord}}.",description:"Para continuar aproveitando seu <1>assistente de mídia social com IA</1>, atualize para Solo, Team ou Agency Pro",words:{brand_singular:"marca",brand_plural:"marcas",persona_singular:"persona",persona_plural:"personas",account_singular:"conta",account_plural:"contas",draft_singular:"rascunho",draft_plural:"rascunhos"},features:{unlimitedPosts:"Publique posts ilimitados em todas as plataformas",unlimitedAiContent:"Gere conteúdo com IA ilimitado (posts, legendas, imagens)",analytics:"Acesse analytics avançados e insights com IA",algorithms:"Desbloqueie nossa suíte proprietária de algoritmos de IA",support:"Suporte prioritário e processamento mais rápido",more:"E muito mais!"},upgradeCta:"Atualizar"},Zbe={createPost:"Criar Post",noPosts:"Nenhum post para esta marca",createWithAI:"Criar com IA",createWithAIDescription:"Deixe a IA ajudá-lo a criar conteúdo envolvente",createManually:"Criar Manualmente",createManuallyDescription:"Escreva seu próprio conteúdo do zero"},Xbe={title:"Conteúdo do Post",contentCreationTooltip:"Crie seu conteúdo para este post",contentTextPlaceholder:"O que você gostaria de compartilhar?",selectBrand:"Selecione ou adicione uma marca para continuar",uploadMediaTooltip:"Carregar mídia",removeMediaTooltip:"Remover mídia",removeMediaConfirm:"Tem certeza de que deseja remover esta mídia?",characterLimit:"{{count}}/{{limit}} caracteres",formats:"Formatos",mediaSizeError:"O tamanho do arquivo é maior que 25MB",mediaTypeError:"Tipo de arquivo não suportado",regularFormat:"Clássico (Horizontal)",reelFormat:"Reel (Vertical)",addMoreImages:"Adicionar mais imagens",caption:"Legenda",placeholder:"Escreva o conteúdo do seu post aqui...",urlDetected:"URL detectada"},eve={categories:{summary:"RESUMO",content:"CONTEÚDO",aiStudio:"ESTÚDIO IA",management:"GERENCIAMENTO",admin:"ADMIN",extra:"EXTRA"},media:"Biblioteca de Mídia",team:"Equipe",integrations:"Integrações",links:"Links Inteligentes",aiLinksBuilder:"Construtor e Encurtador de Links IA",brands:"Marcas & Estratégia",personas:"Personas",smartLinks:"Links inteligentes",connectedAccounts:"Contas conectadas",analytics:"Analytics & Performance",createContent:"Criar Conteúdo",aiCredits:"{{count}} Créditos IA"},tve={title:"Laboratório de Estratégia de Marca",subtitle:"Gerencie suas marcas e sua presença nas mídias sociais",values:"Valores",keywords:"Palavras-chave",accounts:"Contas",connectedAccounts:"Contas Conectadas",connectAccount:"Conectar uma conta",noAccounts:"Nenhuma conta conectada para esta marca",brandKit:"Kit da Marca",posts:"Posts",marketingStrategy:"Estratégia de Marketing",marketScope:"Escopo do Mercado",distributionType:"Tipo de Distribuição",businessModel:"Modelo de Negócio",priorityMarkets:"Mercados Prioritários",colors:{palette:"Cores"},typography:"Tipografia",addBrand:"Adicionar Marca",search:"Buscar marcas por nome, descrição ou palavras-chave...",noResults:"Nenhuma marca encontrada que corresponda aos seus critérios de pesquisa",noBrands:"Nenhuma marca criada ainda. Crie sua primeira marca para começar.",createFirst:"Criar sua primeira Marca",create:{title:"Criar Marca",subtitle:"Configure uma nova marca e sua estratég
3770ia de mídia social",submit:"Salvar Marca"}},rve={title:"Meu Hub de Conteúdo",subtitle:"Gerencie todos os seus conteúdos em um só lugar",loading:{title:"Carregando seus conteúdos...",fetchingPosts:"Buscando seus posts no servidor...",refreshing:"Atualizando posts..."},view:{list:"Lista",grid:"Grade",board:"Quadro"},table:{content:"Conteúdo",platforms:"Plataformas",brand:"Marca",status:"Status",stats:"Estatísticas",created:"CRIADO",updated:"ATUALIZADO",publishedOn:"PUBLICADO",date:"Data",actions:"Ações"},filter:{dateRange:"Período",status:"Status",brands:"Marcas",platforms:"Plataformas"},filters:"Filtros",noStatsYet:"Ainda não há estatísticas"},nve={all:"Todos",allDesc:"Ver posts em todos os estados atuais.",draft:"Rascunhos",draftDesc:"Post está em andamento, ainda não enviado para revisão ou agendamento.",scheduled:"Agendado",scheduledDesc:"Post está aprovado e definido para publicação automática em um momento futuro.",ready_to_publish:"Pronto para publicar",ready_to_publishDesc:"Post está completo, aprovado e aguardando seu horário programado ou publicação manual.",waiting_for_approval:"Aguardando aprovação",waiting_for_approvalDesc:"Post foi enviado e está aguardando revisão por um aprovador.",published:"Publicado",publishedDesc:"Post foi compartilhado com sucesso nas plataformas selecionadas.",rejected:"Rejeitado",rejectedDesc:"Post foi revisado, mas não aprovado para publicação por um aprovador.",error:"Erro",errorDesc:"Ocorreu um erro ao tentar publicar ou processar o post.",processing:"Processando",processingDesc:"Post está sendo processado pelo sistema (ex.: upload de mídia, envio de API).",pending:"Pendente",pendingDesc:"Post está aguardando ação do sistema ou confirmação externa antes de prosseguir."},ave={allBrands:"Todas as Marcas"},sve={image:"Imagem",document:"Documento",video:"Vídeo",multi:"Múltiplas imagens",text:"Texto",regular:"Normal",reel:"Reel"},ive={login:{title:"Entrar na sua conta",emailLabel:"Endereço de email",emailPlaceholder:"Endereço de email",passwordLabel:"Senha",passwordPlaceholder:"Senha",forgotPassword:"Esqueceu sua senha?",noAccount:"Não tem uma conta? Cadastre-se",signInButton:"Entrar",signingIn:"Entrando...",orContinueWith:"Ou continue com",google:"Google"},signup:{title:"Criar sua conta",nameLabel:"Nome completo",namePlaceholder:"Digite seu nome completo",firstNameLabel:"Nome",firstNamePlaceholder:"Digite seu nome",lastNameLabel:"Sobrenome",lastNamePlaceholder:"Digite seu sobrenome",emailLabel:"Endereço de email",emailPlaceholder:"Endereço de email",passwordLabel:"Senha",passwordPlaceholder:"Senha",confirmPasswordLabel:"Confirmar Senha",confirmPasswordPlaceholder:"Confirmar Senha",hasAccount:"Já tem uma conta? Entrar",createButton:"Criar conta",creating:"Criando conta...",orContinueWith:"Ou continue com",google:"Google"}},ove={title:"AI Personas Builder",subtitle:"Crie e gerencie personas de público para direcionar sua estratég
3770ia de conteúdo",create:"Criar Persona",createFirst:"Criar Primeira Persona",analyzeWithAI:"Analisar com IA",search:"Buscar personas por nome, cargo ou tags...",noPersonas:"Nenhuma persona criada ainda. Crie sua primeira persona para começar.",noPersona:"Nenhuma persona para esta marca",noSearchResults:"Nenhuma persona encontrada que corresponda aos seus critérios de pesquisa",confirmDelete:"Tem certeza de que deseja excluir esta persona? Esta ação não pode ser desfeita.",createPersona:"Criar Persona",createWithAI:"Criar com IA",createWithAIDescription:"Deixe a IA ajudá-lo a criar uma persona realista baseada na sua marca",createManually:"Criar Manualmente",createManuallyDescription:"Escreva sua própria persona do zero"},lve={timeSeries:{title:"Evolução diária",summaryTitle:"Evolução diária por plataforma",daily:"Diário",weekly:"Semanal",current:"Período atual",previous:"Período anterior",currentShort:"Atual",previousShort:"Anterior"},title:"Analytics Performance Coach",subtitle:"Acompanhe seu desempenho nas mídias sociais em todas as plataformas"},cve={title:"Olá {{firstName}}, aqui está sua visão geral das Mídias Sociais",subtitle:"Este é seu centro de comando de conteúdo. Monitore, planeje e otimize seu conteúdo com a ajuda de insights e recomendações de IA.",pageTitle:"Dashboard",pageSubtitle:"Tenha uma visão geral rápida das suas mídias sociais"},uve={followers:"seguidores",follow:"Seguir",comments:"comentários",reposts:"reposts",viewAllComments:"Ver todos os {{count}} comentários",originalAudio:"Áudio original",time:{hoursAgo:"HÁ {{count}} HORAS",hourAgo:"HÁ {{count}} HORA"},actions:{like:"Curtir",comment:"Comentar",repost:"Repostar",send:"Enviar",share:"Compartilhar"}},dve={title:"Configurações",manageAccount:"Gerencie as configurações da sua conta e preferências",profile:"Perfil",uploadProfilePicture:"Carregar uma nova foto de perfil. A imagem deve ter pelo menos 400x400 pixels.","profile.firstName":"Nome","profile.lastName":"Sobrenome","profile.updateButton":"Salvar Alterações","profile.success":"Perfil atualizado com sucesso","profile.error.noAuth":"Erro de autenticação. Faça login novamente.","profile.error.generic":"Falha ao atualizar perfil. Tente novamente.",avatarUploadFailed:"Falha ao carregar imagem do avatar. Tente novamente.",email:{title:"Endereço de Email",current:"Email Atual",new:"Novo Email",placeholder:"Digite seu novo email",update:"Atualizar Email",success:"Email atualizado com sucesso"},security:{title:"Segurança",currentPassword:"Senha Atual",currentPasswordPlaceholder:"Digite sua senha atual",newPassword:"Nova Senha",newPasswordPlaceholder:"Digite sua nova senha",confirmPassword:"Confirmar Nova Senha",confirmPasswordPlaceholder:"Confirme sua nova senha",update:"Atualizar Senha",success:"Senha atualizada com sucesso"},language:{title:"Preferência de Idioma"}},fve="pt-BR",mve={platformCapNamed:"{{platform}} permite carrosséis com até {{cap}} imagens"},hve={settings:{title:"Configurações do LinkedIn",companyPage:"Página da empresa no LinkedIn",publishingAsCompany:"Publicando como página da empresa",visibility:"Visibilidade do post",visibilityPublic:"Público",visibilityConnections:"Somente conexões"}},pve={preview:"Pré-visualização",aiTimeSuggestions:"Sugestões de IA",planning:"Planejamento"},gve={title:"Confirmar publicação",successTitle:"Sucesso!",successMessage:"Seu post foi publicado com sucesso.",brandPublishingAs:"Publicando como marca",schedule:{title:"Publicação programada",willPublishOn:"Será publicado em {{datetime}}"},content:{title:"Conteúdo"},media:{unavailable:"Prévia de mídia indisponível",noMedia:"Sem mídia",type:{image:"imagem",video:"vídeo"},format:{reel:"reel",attachment:"anexo"}},badge:{reel:"Formato Reel"},list:{title:"Será publicado em"},warning:{scheduled:"Esta publicação será publicada no horário programado.",publishAll:"Esta ação publicará seu post em todas as plataformas selecionadas. Não pode ser desfeita."},errors:{title:"Erros de publicação",generic:"Falha ao publicar"},buttons:{cancel:"Cancelar",publishing:"Publicando...",schedulePost:"Programar",publishNow:"Publicar agora"}},yve={boostWithAi:"Melhorar com IA",trackYourLink:"Rastrear link",generateImage:"Gerar imagem",remove:"Remover"},bve={authRequiredAi:"Você deve estar logado para usar funções de IA.",contentRequiredAi:"Por favor, insira conteúdo antes de usar o Boost de IA.",boostFailed:"Boost de IA falhou",authRequired:"Autenticação necessária",missingBrandOrPersona:"Marca ou persona ausente para geração de imagem",missingBrand:"Marca ausente para geração de imagem",imageGenerationFailed:"Falha na geração de imagem",utmBoostNotReady:"Link não pode ser melhorado. Certifique-se de que uma URL está presente e uma plataforma está selecionada.",utmBoostFailed:"Melhoria de link falhou",captionRequired:"Por favor, adicione uma legenda antes de criar uma imagem",platformRequired:"Por favor, selecione um canal de publicação antes de criar uma imagem",captionAndPlatformRequired:"Por favor, adicione uma legenda e selecione um canal de publicação antes de criar uma imagem"},vve={boostDisabled:{selectBrand:"Selecione uma marca para ativar o Boost de IA",addContent:"Adicione conteúdo para ativar o Boost de IA",selectPlatform:"Selecione pelo menos uma plataforma para ativar o Boost de IA"}},xve={createSuccess:"Link curto criado com sucesso!",createError:"Falha ao criar link curto. Tente novamente."},wve={draft:"Rascunho",scheduled:"Agendado",ready_to_publish:"Pronto para publicar",w
3770aiting_for_approval:"Aguardando aprovação",published:"Publicado",rejected:"Rejeitado",error:"Erro",pending:"Pendente",waiting:"Aguardando"},jve={brandsAndPlatforms:{title:"Canais de publicação"},brands:{title:"Marca"},platforms:{sectionTitle:"Canais"},mediaPost:{title:"Mídia",formats:"Formatos",regular:"Normal",horizontal:"(Horizontal)",reel:"Reel",vertical:"(Vertical)"},preview:{title:"Pré-visualização",platformPreviewTitle:"Pré-visualização {{platformName}}",selectPlatformPrompt:"Selecione uma plataforma para ver a pré-visualização"}},Nve={instagram:"Instagram",facebook:"Facebook",twitter:"Twitter",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest"},Sve={imageAlt:"Imagem {{index}}",previewAlt:"Pré-visualização",dropOrClick:"Arraste sua mídia aqui ou clique para carregar",supportedTypes:"Suporta imagens e vídeos de até 10MB"},Cve={features:{brands:"marca",brands_plural:"marcas",brands_one:"marca",brands_other:"marcas"},savedAmount:"{{amount}} economizados"},kve={teamMembers:Hbe,common:Ybe,onboarding:Qbe,beta:Kbe,trialExpired:Jbe,posts:Zbe,postContent:Xbe,sidebar:eve,brands:tve,contentHub:rve,statusDropdown:nve,brandDropdown:ave,tags:sve,auth:ive,personas:ove,analytics:lve,dashboard:cve,previews:uve,settings:dve,languageCode:fve,hints:mve,linkedin:hve,tabs:pve,publishModal:gve,actions:yve,errors:bve,tooltips:vve,links:xve,status:wve,cards:jve,platforms:Nve,mediaCard:Sve,billing:Cve};ns.use(r8).use(Fhe).init({resources:{en:{translation:Tge},fr:{translation:P0e},es:{translation:Cye},de:{translation:ube},it:{translation:Gbe},"pt-BR":{translation:kve}},fallbackLng:"en",interpolation:{escapeValue:!1}});const Mve=e=>GB(e),np=({isOpen:e,onClose:t,onCreateWithAI:r,onCreateManually:n,onCreateIdea:a})=>{const{t:i}=Te();if(!e)return null;const o=()=>{r()};return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl max-w-lg w-full p-6 border border-black",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:i("posts.createPost","Create Content")}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("button",{onClick:o,className:"flex flex-col items-center justify-center p-4 rounded-lg border border-primary-600 bg-primary-50 hover:bg-primary-100 hover:border-primary-700 transition-all duration-200 h-full",children:[s.jsx(Hn,{className:"w-8 h-8 text-primary-600 mb-3"}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-primary-900",children:i("posts.createWithAI","Create with AI")}),s.jsx("div",{className:"text-sm text-primary-600",children:i("posts.createWithAIDescription","Let AI help you create engaging content")})]})]}),s.jsxs("button",{onClick:n,className:"flex flex-col items-center justify-center p-4 rounded-lg border border-black hover:border-gray-700 hover:bg-gray-50 transition-all duration-200 h-full",children:[s.jsx(da,{className:"w-8 h-8 text-gray-600 mb-3"}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-gray-900",children:i("posts.createManually","Create Manually")}),s.jsx("div",{className:"text-sm text-gray-600",children:i("posts.createManuallyDescription","Write your own content from scratch")})]})]}),a&&s.jsxs("button",{onClick:a,className:"flex flex-col items-center justify-center p-4 rounded-lg border border-amber-400 bg-amber-50 hover:bg-amber-100 hover:border-amber-500 transition-all duration-200 h-full",children:[s.jsx(Fs,{className:"w-8 h-8 text-amber-500 mb-3"}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-amber-900",children:i("posts.createIdea","Save an Idea")}),s.jsx("div",{className:"text-sm text-amber-600",children:i("posts.createIdeaDescription","Capture a post idea for later with a reminder")})]})]})]})]})]})})};function n8(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n8(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Jt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n8(e))&&(n&&(n+=" "),n+=t);return n}const a8=6048e5,Ive=864e5,P2=6e4,_2=36e5,Eve=1e3,RL=Symbol.for("constructDateFrom");function wn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&RL in e?e[RL](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ot(e,t){return wn(t||e,e)}function go(e,t,r){const n=Ot(e,r==null?void 0:r.in);return isNaN(t)?wn((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function xo(e,t,r){const n=Ot(e,r==null?void 0:r.in);if(isNaN(t))return wn(e,NaN);if(!t)return n;const a=n.getDate(),i=wn(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),a),n)}function s8(e,t,r){return wn(e,+Ot(e)+t)}function Tve(e,t,r){return s8(e,t*_2)}let Ave={};function Nf(){return Ave}function cc(e,t){var l,c,u,d;const r=Nf(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=Ot(e,t==null?void 0:t.in),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function dh(e,t){return cc(e,{...t,weekStartsOn:1}
vendor: 4,445 bytes, line 3770
3770)}function i8(e,t){const r=Ot(e,t==null?void 0:t.in),n=r.getFullYear(),a=wn(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=dh(a),o=wn(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=dh(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function r1(e){const t=Ot(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function vc(e,...t){const r=wn.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function af(e,t){const r=Ot(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function fh(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t),i=af(n),o=af(a),l=+i-r1(i),c=+o-r1(o);return Math.round((l-c)/Ive)}function Pve(e,t){const r=i8(e,t),n=wn(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),dh(n)}function Tk(e,t,r){const n=Ot(e,r==null?void 0:r.in);return n.setTime(n.getTime()+t*P2),n}function IE(e,t,r){return xo(e,t*3,r)}function _ve(e,t,r){return s8(e,t*1e3)}function n1(e,t,r){return go(e,t*7,r)}function Gl(e,t,r){return xo(e,t*12,r)}function $L(e,t){let r,n=t==null?void 0:t.in;return e.forEach(a=>{!n&&typeof a=="object"&&(n=wn.bind(null,a));const i=Ot(a,n);(!r||r<i||isNaN(+i))&&(r=i)}),wn(n,r||NaN)}function FL(e,t){let r,n=t==null?void 0:t.in;return e.forEach(a=>{!n&&typeof a=="object"&&(n=wn.bind(null,a));const i=Ot(a,n);(!r||r>i||isNaN(+i))&&(r=i)}),wn(n,r||NaN)}function Lve(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t);return+af(n)==+af(a)}function Hl(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function a1(e){return!(!Hl(e)&&typeof e!="number"||isNaN(+Ot(e)))}function s1(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t),i=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return i*12+o}function Od(e,t){const r=Ot(e,t==null?void 0:t.in);return Math.trunc(r.getMonth()/3)+1}function i1(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t),i=n.getFullYear()-a.getFullYear(),o=Od(n)-Od(a);return i*4+o}function o1(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t);return n.getFullYear()-a.getFullYear()}function Dve(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t),i=zL(n,a),o=Math.abs(fh(n,a));n.setDate(n.getDate()-i*o);const l=+(zL(n,a)===-i),c=i*(o-l);return c===0?0:c}function zL(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function o8(e,t){const r=Ot(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function l8(e,t){const r=Ot(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function Ak(e,t){const r=Ot(e,t==null?void 0:t.in),n=r.getMonth(),a=n-n%3;return r.setMonth(a,1),r.setHours(0,0,0,0),r}function c8(e,t){const r=Ot(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function u8(e,t){const r=Ot(e,t==null?void 0:t.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function L2(e,t){const r=Ot(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Ove(e,t){var l,c;const r=Nf(),n=r.weekStartsOn??((c=(l=r.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,a=Ot(e,t==null?void 0:t.in),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}const Rve={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$ve=(e,t,r)=>{let n;const a=Rve[e];
vendor: 17,511 bytes, line 3770
3770return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function QN(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Fve={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zve={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bve={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uve={date:QN({formats:Fve,defaultWidth:"full"}),time:QN({formats:zve,defaultWidth:"full"}),dateTime:QN({formats:Bve,defaultWidth:"full"})},Vve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wve=(e,t,r,n)=>Vve[e];function Zp(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const qve={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gve={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hve={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yve={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Jve=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Zve={ordinalNumber:Jve,era:Zp({values:qve,defaultWidth:"wide"}),quarter:Zp({values:Gve,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zp({values:Hve,defaultWidth:"wide"}),day:Zp({values:Yve,defaultWidth:"wide"}),dayPeriod:Zp({values:Qve,defaultWidth:"wide",formattingValues:Kve,defaultFormattingWidth:"wide"})};function Xp(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?exe(l,f=>f.test(o)):Xve(l,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function Xve(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function exe(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function txe(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const rxe=/^(\d+)(th|st|nd|rd)?/i,nxe=/\d+/i,axe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sxe={any:[/^b/i,/^(a|c)/i]},ixe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},oxe={any:[/1/i,/2/i,/3/i,/4/i]},lxe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},cxe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},uxe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dxe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fxe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mxe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hxe={ordinalNumber:txe({matchPattern:rxe,parsePattern:nxe,valueCallback:e=>parseInt(e,10)}),era:Xp({matchPatterns:axe,defaultMatchWidth:"wide",parsePatterns:sxe,defaultParseWidth:"any"}),quarter:Xp({matchPatterns:ixe,defaultMatchWidth:"wide",parsePatterns:oxe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xp({matchPatterns:lxe,defaultMatchWidth:"wide",parsePatterns:cxe,defaultParseWidth:"any"}),day:Xp({matchPatterns:uxe,defaultMatchWidth:"wide",parsePatterns:dxe,defaultParseWidth:"any"}),dayPeriod:Xp({matchPatterns:fxe,defaultMatchWidth:"any",parsePatterns:mxe,defaultParseWidth:"any"})},d8={code:"en-US",formatDistance:$ve,formatLong:Uve,formatRelative:Wve,localize:Zve,match:hxe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pxe(e,t){const r=Ot(e,t==null?void 0:t.in);return fh(r,L2(r))+1}function EE(e,t){const r=Ot(e,t==null?void 0:t.in),n=+dh(r)-+Pve(r);return Math.round(n/a8)+1}function TE(e,t){var d,f,m,h;const r=Ot(e,t==null?void 0:t.in),n=r.getFullYear(),a=Nf(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(m=a.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=wn((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=cc(o,t),c=wn((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=cc(c,t);return+r>=+l?n+1:+r>=+u?n:n-1}function gxe(e,t){var l,c,u,d;const r=Nf(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=TE(e,t),i=wn((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),cc(i,t)}function f8(e,t){const r=Ot(e,t==null?void 0:t.in),n=+cc(r,t)-+gxe(r,t);return Math.round(n/a8)+1}function bn(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Ac={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return bn(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):bn(r+1,2)},d(e,t){return bn(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return bn(e.getHours()%12||12,t.length)},H(e,t){return bn(e.getHours(),t.length)},m(e,t){return bn(e.getMinutes(),t.length)},s(e,t){return bn(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return bn(a,t.length)}},Wf={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},BL={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return Ac.y(e,t)},Y:function(e,t,r,n){const a=TE(e,n),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return bn(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):bn(i,t.length)},R:function(e,t){const r=i8(e);return bn(r,t.length)},u:function(e,t){const r=e.getFullYear();return bn(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return bn(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return bn(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Ac.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return bn(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=f8(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):bn(a,t.length)},I:function(e,t,r){const n=EE(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):bn(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ac.d(e,t)},D:function(e,t,r){const n=pxe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):bn(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return bn(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return bn(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return bn(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=Wf.noon:n===0?a=Wf.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=Wf.evening:n>=12?a=Wf.afternoon:n>=4?a=Wf.morning:a=Wf.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ac.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ac.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):bn(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):bn(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ac.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ac.s(e,t)},S:function(e,t){return Ac.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return VL(n);case"XXXX":case"XX":return ad(n);case"XXXXX":case"XXX":default:return ad(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return VL(n);case"xxxx":case"xx":return ad(n);case"xxxxx":case"xxx":default:return ad(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UL(n,":");case"OOOO":default:return"GMT"+ad(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UL(n,":");case"zzzz":default:return"GMT"+ad(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return bn(n,t.length)},T:function(e,t,r){return bn(+e,t.length)}};function UL(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+bn(i,2)}function VL(e,t){return e%60===0?(e>0?"-":"+")+bn(Math.abs(e)/60,2):ad(e,t)}function ad(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=bn(Math.trunc(n/60),2),i=bn(n%60,2);return r+a+t+i}const WL=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},m8=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},yxe=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return WL(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",WL(n,t)).replace("{{time}}",m8(a,t))},Pk={p:m8,P:yxe},bxe=/^D+$/,vxe=/^Y+$/,xxe=["D","DD","YY","YYYY"];function wxe(e){return bxe.test(e)}function jxe(e){return vxe.test(e)}function Nxe(e,t,r){const n=Sxe(e,t,r);if(console.warn(n),xxe.includes(e))throw new RangeError(n)}function Sxe(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Cxe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kxe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mxe=/^'([^]*?)'?$/,Ixe=/''/g,Exe=/[a-zA-Z]/;function qL(e,t,r){var d,f,m,h,p,g,y,v;const n=Nf(),a=(r==null?void 0:r.locale)??n.locale??d8,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(m=n.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(p=r==null?void 0:r.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((v=(y=n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,l=Ot(e,r==null?void 0:r.in);if(!a1(l))throw new RangeError("Invalid time value");let c=t.match(kxe).map(x=>{const j=x[0];if(j==="p"||j==="P"){const C=Pk[j];return C(x,a.formatLong)}return x}).join("").match(Cxe).map(x=>
vendor: 46,755 bytes, line 3770
3770{if(x==="''")return{isToken:!1,value:"'"};const j=x[0];if(j==="'")return{isToken:!1,value:Txe(x)};if(BL[j])return{isToken:!0,value:x};if(j.match(Exe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:x}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(x=>{if(!x.isToken)return x.value;const j=x.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&jxe(j)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&wxe(j))&&Nxe(j,t,String(e));const C=BL[j[0]];return C(l,j,a.localize,u)}).join("")}function Txe(e){const t=e.match(Mxe);return t?t[1].replace(Ixe,"'"):e}function GL(e,t){return Ot(e,t==null?void 0:t.in).getDate()}function Axe(e,t){return Ot(e,t==null?void 0:t.in).getDay()}function Pxe(e,t){const r=Ot(e,t==null?void 0:t.in),n=r.getFullYear(),a=r.getMonth(),i=wn(r,0);return i.setFullYear(n,a+1,0),i.setHours(0,0,0,0),i.getDate()}function _xe(){return Object.assign({},Nf())}function Yl(e,t){return Ot(e,t==null?void 0:t.in).getHours()}function Lxe(e,t){const r=Ot(e,t==null?void 0:t.in).getDay();return r===0?7:r}function Ql(e,t){return Ot(e,t==null?void 0:t.in).getMinutes()}function hs(e,t){return Ot(e,t==null?void 0:t.in).getMonth()}function gu(e){return Ot(e).getSeconds()}function _k(e){return+Ot(e)}function jr(e,t){return Ot(e,t==null?void 0:t.in).getFullYear()}function Tu(e,t){return+Ot(e)>+Ot(t)}function Wo(e,t){return+Ot(e)<+Ot(t)}function Dxe(e,t){return+Ot(e)==+Ot(t)}function Oxe(e,t){const r=Rxe(t)?new t(0):wn(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}function Rxe(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const $xe=10;class h8{constructor(){vt(this,"subPriority",0)}validate(t,r){return!0}}class Fxe extends h8{constructor(t,r,n,a,i){super(),this.value=t,this.validateValue=r,this.setValue=n,this.priority=a,i&&(this.subPriority=i)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,n){return this.setValue(t,r,this.value,n)}}class zxe extends h8{constructor(r,n){super();vt(this,"priority",$xe);vt(this,"subPriority",-1);this.context=r||(a=>wn(n,a))}set(r,n){return n.timestampIsSet?r:wn(r,Oxe(r,this.context))}}class rn{run(t,r,n,a){const i=this.parse(t,r,n,a);return i?{setter:new Fxe(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,r,n){return!0}}class Bxe extends rn{constructor(){super(...arguments);vt(this,"priority",140);vt(this,"incompatibleTokens",["R","u","t","T"])}parse(r,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"})||a.era(r,{width:"narrow"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})||a.era(r,{width:"abbreviated"})||a.era(r,{width:"narrow"})}}set(r,n,a){return n.era=a,r.setFullYear(a,0,1),r.setHours(0,0,0,0),r}}const ha={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},zo={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function pa(e,t){return e&&{value:t(e.value),rest:e.rest}}function Jn(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function Bo(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const n=r[1]==="+"?1:-1,a=r[2]?parseInt(r[2],10):0,i=r[3]?parseInt(r[3],10):0,o=r[5]?parseInt(r[5],10):0;return{value:n*(a*_2+i*P2+o*Eve),rest:t.slice(r[0].length)}}function p8(e){return Jn(ha.anyDigitsSigned,e)}function ia(e,t){switch(e){case 1:return Jn(ha.singleDigit,t);case 2:return Jn(ha.twoDigits,t);case 3:return Jn(ha.threeDigits,t);case 4:return Jn(ha.fourDigits,t);default:return Jn(new RegExp("^\\d{1,"+e+"}"),t)}}function l1(e,t){switch(e){case 1:return Jn(ha.singleDigitSigned,t);case 2:return Jn(ha.twoDigitsSigned,t);case 3:return Jn(ha.threeDigitsSigned,t);case 4:return Jn(ha.fourDigitsSigned,t);default:return Jn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function AE(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function g8(e,t){const r=t>0,n=r?t:1-t;let a;if(n<=50)a=e||100;else{const i=n+50,o=Math.trunc(i/100)*100,l=e>=i%100;a=e+o-(l?100:0)}return r?a:1-a}function y8(e){return e%400===0||e%4===0&&e%100!==0}class Uxe extends rn{constructor(){super(...arguments);vt(this,"priority",130);vt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(r,n,a){const i=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return pa(ia(4,r),i);case"yo":return pa(a.ordinalNumber(r,{unit:"year"}),i);default:return pa(ia(n.length,r),i)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,a){const i=r.getFullYear();if(a.isTwoDigitYear){const l=g8(a.year,i);return r.setFullYear(l,0,1),r.setHours(0,0,0,0),r}const o=!("era"in n)||n.era===1?a.year:1-a.year;return r.setFullYear(o,0,1),r.setHours(0,0,0,0),r}}class Vxe extends rn{constructor(){super(...arguments);vt(this,"priority",130);vt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(r,n,a){const i=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return pa(ia(4,r),i);case"Yo":return pa(a.ordinalNumber(r,{unit:"year"}),i);default:return pa(ia(n.length,r),i)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,a,i){const o=TE(r,i);if(a.isTwoDigitYear){const c=g8(a.year,o);return r.setFullYear(c,0,i.firstWeekContainsDate),r.setHours(0,0,0,0),cc(r,i)}const l=!("era"in n)||n.era===1?a.year:1-a.year;return r.setFullYear(l,0,i.firstWeekContainsDate),r.setHours(0,0,0,0),cc(r,i)}}class Wxe extends rn{constructor(){super(...arguments);vt(this,"priority",130);vt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(r,n){return l1(n==="R"?4:n.length,r)}set(r,n,a){const i=wn(r,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),dh(i)}}class qxe extends rn{constructor(){super(...arguments);vt(this,"priority",130);vt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(r,n){return l1(n==="u"?4:n.length,r)}set(r,n,a){return r.setFullYear(a,0,1),r.setHours(0,0,0,0),r}}class Gxe extends rn{constructor(){super(...arguments);vt(this,"priority",120);vt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,a){switch(n){case"Q":case"QQ":return ia(n.length,r);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"})||a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})||a.quarter(r,{width:"abbreviated",context:"formatting"})||a.quarter(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=1&&n<=4}set(r,n,a){return r.setMonth((a-1)*3,1),r.setHours(0,0,0,0),r}}class Hxe extends rn{constructor(){super(...arguments);vt(this,"priority",120);vt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,a){switch(n){case"q":case"qq":return ia(n.length,r);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"})||a.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})||a.quarter(r,{width:"abbreviated",context:"standalone"})||a.quarter(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=1&&n<=4}set(r,n,a){return r.setMonth((a-1)*3,1),r.setHours(0,0,0,0),r}}class Yxe extends rn{constructor(){super(...arguments);vt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);vt(this,"priority",110)}parse(r,n,a){const i=o=>o-1;switch(n){case"M":return pa(Jn(ha.month,r),i);case"MM":return pa(ia(2,r),i);case"Mo":return pa(a.ordinalNumber(r,{unit:"month"}),i);case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"})||a.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})||a.month(r,{width:"abbreviated",context:"formatting"})||a.month(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=11}set(r,n,a){return r.setMonth(a,1),r.setHours(0,0,0,0),r}}class Qxe extends rn{constructor(){super(...arguments);vt(this,"priority",110);vt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(r,n,a){const i=o=>o-1;switch(n){case"L":return pa(Jn(ha.month,r),i);case"LL":return pa(ia(2,r),i);case"Lo":return pa(a.ordinalNumber(r,{unit:"month"}),i);case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"})||a.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})||a.month(r,{width:"abbreviated",context:"standalone"})||a.month(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=11}set(r,n,a){return r.setMonth(a,1),r.setHours(0,0,0,0),r}}function Kxe(e,t,r){const n=Ot(e,r==null?void 0:r.in),a=f8(n,r)-t;return n.setDate(n.getDate()-a*7),Ot(n,r==null?void 0:r.in)}class Jxe extends rn{constructor(){super(...arguments);vt(this,"priority",100);vt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(r,n,a){switch(n){case"w":return Jn(ha.week,r);case"wo":return a.ordinalNumber(r,{unit:"week"});default:return ia(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,a,i){return cc(Kxe(r,a,i),i)}}function Zxe(e,t,r){const n=Ot(e,r==null?void 0:r.in),a=EE(n,r)-t;return n.setDate(n.getDate()-a*7),n}class Xxe extends rn{constructor(){super(...arguments);vt(this,"priority",100);vt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(r,n,a){switch(n){case"I":return Jn(ha.week,r);case"Io":return a.ordinalNumber(r,{unit:"week"});default:return ia(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,a){return dh(Zxe(r,a))}}const e1e=[31,28,31,30,31,30,31,31,30,31,30,31],t1e=[31,29,31,30,31,30,31,31,30,31,30,31];class r1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"subPriority",1);vt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(r,n,a){switch(n){case"d":return Jn(ha.date,r);case"do":return a.ordinalNumber(r,{unit:"date"});default:return ia(n.length,r)}}validate(r,n){const a=r.getFullYear(),i=y8(a),o=r.getMonth();return i?n>=1&&n<=t1e[o]:n>=1&&n<=e1e[o]}set(r,n,a){return r.setDate(a),r.setHours(0,0,0,0),r}}class n1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"subpriority",1);vt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(r,n,a){switch(n){case"D":case"DD":return Jn(ha.dayOfYear,r);case"Do":return a.ordinalNumber(r,{unit:"date"});default:return ia(n.length,r)}}validate(r,n){const a=r.getFullYear();return y8(a)?n>=1&&n<=366:n>=1&&n<=365}set(r,n,a){return r.setMonth(0,a),r.setHours(0,0,0,0),r}}function PE(e,t,r){var f,m,h,p;const n=Nf(),a=(r==null?void 0:r.weekStartsOn)??((m=(f=r==null?void 0:r.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,i=Ot(e,r==null?void 0:r.in),o=i.getDay(),c=(t%7+7)%7,u=7-a,d=t<0||t>6?t-(o+u)%7:(c+u)%7-(o+u)%7;return go(i,d,r)}class a1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(r,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})||a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,a,i){return r=PE(r,a,i),r.setHours(0,0,0,0),r}}class s1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(r,n,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return pa(ia(n.length,r),o);case"eo":return pa(a.ordinalNumber(r,{unit:"day"}),o);case"eee":return a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})||a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,a,i){return r=PE(r,a,i),r.setHours(0,0,0,0),r}}class i1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(r,n,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return pa(ia(n.length,r),o);case"co":return pa(a.ordinalNumber(r,{unit:"day"}),o);case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"})||a.day(r,{width:"short",context:"standalone"})||a.day(r,{width:"narrow",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"})||a.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})||a.day(r,{width:"abbreviated",context:"standalone"})||a.day(r,{width:"short",context:"standalone"})||a.day(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=6}set(r,n,a,i){return r=PE(r,a,i),r.setHours(0,0,0,0),r}}function o1e(e,t,r){const n=Ot(e,r==null?void 0:r.in),a=Lxe(n,r),i=t-a;return go(n,i,r)}class l1e extends rn{constructor(){super(...arguments);vt(this,"priority",90);vt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(r,n,a){const i=o=>o===0?7:o;switch(n){case"i":case"ii":return ia(n.length,r);case"io":return a.ordinalNumber(r,{unit:"day"});case"iii":return pa(a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"}),i);case"iiiii":return pa(a.day(r,{width:"narrow",context:"formatting"}),i);case"iiiiii":return pa(a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"}),i);case"iiii":default:return pa(a.day(r,{width:"wide",context:"formatting"})||a.day(r,{width:"abbreviated",context:"formatting"})||a.day(r,{width:"short",context:"formatting"})||a.day(r,{width:"narrow",context:"formatting"}),i)}}validate(r,n){return n>=1&&n<=7}set(r,n,a){return r=o1e(r,a),r.setHours(0,0,0,0),r}}class c1e extends rn{constructor(){super(...arguments);vt(this,"priority",80);vt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(r,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})||a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,a){return r.setHours(AE(a),0,0,0),r}}class u1e extends rn{constructor(){super(...arguments);vt(this,"priority",80);vt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(r,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})||a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,a){return r.setHours(AE(a),0,0,0),r}}class d1e extends rn{constructor(){super(...arguments);vt(this,"priority",80);vt(this,"incompatibleTokens",["a","b","t","T"])}parse(r,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})||a.dayPeriod(r,{width:"abbreviated",context:"formatting"})||a.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,a){return r.setHours(AE(a),0,0,0),r}}class f1e extends rn{constructor(){super(...arguments);vt(this,"priority",70);vt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(r,n,a){switch(n){case"h":return Jn(ha.hour12h,r);case"ho":return a.ordinalNumber(r,{unit:"hour"});default:return ia(n.length,r)}}validate(r,n){return n>=1&&n<=12}set(r,n,a){const i=r.getHours()>=12;return i&&a<12?r.setHours(a+12,0,0,0):!i&&a===12?r.setHours(0,0,0,0):r.setHours(a,0,0,0),r}}class m1e extends rn{constructor(){super(...arguments);vt(this,"priority",70);vt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(r,n,a){switch(n){case"H":return Jn(ha.hour23h,r);case"Ho":return a.ordinalNumber(r,{unit:"hour"});default:return ia(n.length,r)}}validate(r,n){return n>=0&&n<=23}set(r,n,a){return r.setHours(a,0,0,0),r}}class h1e extends rn{constructor(){super(...arguments);vt(this,"priority",70);vt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(r,n,a){switch(n){case"K":return Jn(ha.hour11h,r);case"Ko":return a.ordinalNumber(r,{unit:"hour"});default:return ia(n.length,r)}}validate(r,n){return n>=0&&n<=11}set(r,n,a){return r.getHours()>=12&&a<12?r.setHours(a+12,0,0,0):r.setHours(a,0,0,0),r}}class p1e extends rn{constructor(){super(...arguments);vt(this,"priority",70);vt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(r,n,a){switch(n){case"k":return Jn(ha.hour24h,r);case"ko":return a.ordinalNumber(r,{unit:"hour"});default:return ia(n.length,r)}}validate(r,n){return n>=1&&n<=24}set(r,n,a){const i=a<=24?a%24:a;return r.setHours(i,0,0,0),r}}class g1e extends rn{constructor(){super(...arguments);vt(this,"priority",60);vt(this,"incompatibleTokens",["t","T"])}parse(r,n,a){switch(n){case"m":return Jn(ha.minute,r);case"mo":return a.ordinalNumber(r,{unit:"minute"});default:return ia(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,a){return r.setMinutes(a,0,0),r}}class y1e extends rn{constructor(){super(...arguments);vt(this,"priority",50);vt(this,"incompatibleTokens",["t","T"])}parse(r,n,a){switch(n){case"s":return Jn(ha.second,r);case"so":return a.ordinalNumber(r,{unit:"second"});default:return ia(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,a){return r.setSeconds(a,0),r}}class b1e extends rn{constructor(){super(...arguments);vt(this,"priority",30);vt(this,"incompatibleTokens",["t","T"])}parse(r,n){const a=i=>Math.trunc(i*Math.pow(10,-n.length+3));return pa(ia(n.length,r),a)}set(r,n,a){return r.setMilliseconds(a),r}}class v1e extends rn{constructor(){super(...arguments);vt(this,"priority",10);vt(this,"incompatibleTokens",["t","T","x"])}parse(r,n){switch(n){case"X":return Bo(zo.basicOptionalMinutes,r);case"XX":return Bo(zo.basic,r);case"XXXX":return Bo(zo.basicOptionalSeconds,r);case"XXXXX":return Bo(zo.extendedOptionalSeconds,r);case"XXX":default:return Bo(zo.extended,r)}}set(r,n,a){return n.timestampIsSet?r:wn(r,r.getTime()-r1(r)-a)}}class x1e extends rn{constructor(){super(...arguments);vt(this,"priority",10);vt(this,"incompatibleTokens",["t","T","X"])}parse(r,n){switch(n){case"x":return Bo(zo.basicOptionalMinutes,r);case"xx":return Bo(zo.basic,r);case"xxxx":return Bo(zo.basicOptionalSeconds,r);case"xxxxx":return Bo(zo.extendedOptionalSeconds,r);case"xxx":default:return Bo(zo.extended,r)}}set(r,n,a){return n.timestampIsSet?r:wn(r,r.getTime()-r1(r)-a)}}class w1e extends rn{constructor(){super(...arguments);vt(this,"priority",40);vt(this,"incompatibleTokens","*")}parse(r){return p8(r)}set(r,n,a){return[wn(r,a*1e3),{timestampIsSet:!0}]}}class j1e extends rn{constructor(){super(...arguments);vt(this,"priority",20);vt(this,"incompatibleTokens","*")}parse(r){return p8(r)}set(r,n,a){return[wn(r,a),{timestampIsSet:!0}]}}const N1e={G:new Bxe,y:new Uxe,Y:new Vxe,R:new Wxe,u:new qxe,Q:new Gxe,q:new Hxe,M:new Yxe,L:new Qxe,w:new Jxe,I:new Xxe,d:new r1e,D:new n1e,E:new a1e,e:new s1e,c:new i1e,i:new l1e,a:new c1e,b:new u1e,B:new d1e,h:new f1e,H:new m1e,K:new h1e,k:new p1e,m:new g1e,s:new y1e,S:new b1e,X:new v1e,x:new x1e,t:new w1e,T:new j1e},S1e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C1e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,k1e=/^'([^]*?)'?$/,M1e=/''/g,I1e=/\S/,E1e=/[a-zA-Z]/;function T1e(e,t,r,n){var y,v,x,j,C,N,S,M;const a=()=>wn((n==null?void 0:n.in)||r,NaN),i=_xe(),o=(n==null?void 0:n.locale)??i.locale??d8,l=(n==null?void 0:n.firstWeekContainsDate)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.firstWeekContainsDate)??i.firstWeekContainsDate??((j=(x=i.locale)==null?void 0:x.options)==null?void 0:j.firstWeekContainsDate)??1,c=(n==null?void 0:n.weekStartsOn)??((N=(C=n==null?void 0:n.locale)==null?void 0:C.options)==null?void 0:N.weekStartsOn)??i.weekStartsOn??((M=(S=i.locale)==null?void 0:S.options)==null?void 0:M.weekStartsOn)??0;if(!t)return e?a():Ot(r,n==null?void 0:n.in);const u={firstWeekContainsDate:l,weekStartsOn:c,locale:o},d=[new zxe(n==null?void 0:n.in,r)],f=t.match(C1e).map(k=>{const I=k[0];if(I in Pk){const T=Pk[I];return T(k,o.formatLong)}return k}).join("").match(S1e),m=[];for(let k of f){const I=k[0],T=N1e[I];if(T){const{incompatibleTokens:L}=T;if(Array.isArray(L)){const _=m.find(B=>L.includes(B.token)||B.token===I);if(_)throw new RangeError(`The format string mustn't contain \`${_.fullToken}\` and \`${k}\` at the same time`)}else if(T.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${k}\` and any other token at the same time`);m.push({token:I,fullToken:k});const R=T.run(e,k,o.match,u);if(!R)return a();d.push(R.setter),e=R.rest}else{if(I.match(E1e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");if(k==="''"?k="'":I==="'"&&(k=A1e(k)),e.indexOf(k)===0)e=e.slice(k.length);else return a()}}if(e.length>0&&I1e.test(e))return a();const h=d.map(k=>k.priority).sort((k,I)=>I-k).filter((k,I,T)=>T.indexOf(k)===I).map(k=>d.filter(I=>I.priority===k).sort((I,T)=>T.subPriority-I.subPriority)).map(k=>k[0]);let p=Ot(r,n==null?void 0:n.in);if(isNaN(+p))return a();const g={};for(const k of h){if(!k.validate(p,u))return a();const I=k.set(p,g,u);Array.isArray(I)?(p=I[0],Object.assign(g,I[1])):p=I}return p}function A1e(e){return e.match(k1e)[1].replace(M1e,"'")}function P1e(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function _1e(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t);return+Ak(n)==+Ak(a)}function L1e(e,t,r){const[n,a]=vc(r==null?void 0:r.in,e,t);return n.getFullYear()===a.getFullYear()}function E0(e,t,r){const n=+Ot(e,r==null?void 0:r.in),[a,i]=[+Ot(t.start,r==null?void 0:r.in),+Ot(t.end,r==null?void 0:r.in)].sort((o,l)=>o-l);return n>=a&&n<=i}function D1e(e,t,r){return go(e,-1,r)}function O1e(e,t){const r=()=>wn(t==null?void 0:t.in,NaN),a=z1e(e);let i;if(a.date){const u=B1e(a.date,2);i=U1e(u.restDateString,u.year)}if(!i||isNaN(+i))return r();const o=+i;let l=0,c;if(a.time&&(l=V1e(a.time),isNaN(l)))return r();if(a.timezone){if(c=W1e(a.timezone),isNaN(c))return r()}else{const u=new Date(o+l),d=Ot(0,t==null?void 0:t.in);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return Ot(o+l+c,t==null?void 0:t.in)}const Jb={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},R1e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,$1e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,F1e=/^([+-])(\d{2})(?::?(\d{2}))?$/;function z1e(e){const t={},r=e.split(Jb.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Jb.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Jb.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const a=Jb.timezone.exec(n);a?(t.time=n.replace(a[1],""),t.timezone=a[1]):t.time=n}return t}function B1e(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((n[1]||n[2]).length)}}function U1e(e,t){if(t===null)return new Date(NaN);const r=e.match(R1e);if(!r)return new Date(NaN);const n=!!r[4],a=eg(r[1]),i=eg(r[2])-1,o=eg(r[3]),l=eg(r[4]),c=eg(r[5])-1;if(n)return Q1e(t,l,c)?q1e(t,l,c):new Date(NaN);{const u=new Date(0);return!H1e(t,i,o)||!Y1e(t,a)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(a,o)),u)}}function eg(e){return e?parseInt(e):1}function V1e(e){const t=e.match($1e);if(!t)return NaN;const r=KN(t[1]),n=KN(t[2]),a=KN(t[3]);return K1e(r,n,a)?r*_2+n*P2+a*1e3:NaN}function KN(e){return e&&parseFloat(e.replace(",","."))||0}function W1e(e){if(e==="Z")return 0;const t=e.match(F1e);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return J1e(n,a)?r*(n*_2+a*P2):NaN}function q1e(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const a=n.getUTCDay()||7,i=(t-1)*7+r+1-a;return n.setUTCDate(n.getUTCDate()+i),n}const G1e=[31,null,31,30,31,30,31,31,30,31,30,31];function b8(e){return e%400===0||e%4===0&&e%100!==0}function H1e(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(G1e[t]||(b8(e)?29:28))}function Y1e(e,t){return t>=1&&t<=(b8(e)?366:365)}function Q1e(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function K1e(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function J1e(e,t){return t>=0&&t<=59}function Si(e,t,r){const n=Ot(e,r==null?void 0:r.in),a=n.getFullYear(),i=n.getDate(),o=wn(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=Pxe(o);return n.setMonth(t,Math.min(i,l)),n}function Yv(e,t,r){const n=Ot(e,r==null?void 0:r.in);return n.setHours(t),n}function Qv(e,t,r){const n=Ot(e,r==null?void 0:r.in);return n.setMinutes(t),n}function am(e,t,r){const n=Ot(e,r==null?void 0:r.in),a=Math.trunc(n.getMonth()/3)+1,i=t-a;return Si(n,n.getMonth()+i*3)}function Kv(e,t,r){const n=Ot(e,r==null?void 0:r.in);return n.setSeconds(t),n}function To(e,t,r){const n=Ot(e,r==null?void 0:r.in);return isNaN(+n)?wn(e,NaN):(n.setFullYear(t),n)}function Rd(e,t,r){return xo(e,-t,r)}function v8(e,t,r){return IE(e,-1,r)}function HL(e,t,r){return n1(e,-1,r)}function mh(e,t,r){return Gl(e,-t,r)}function D2(){return typeof window<"u"}function ap(e){return x8(e)?(e.nodeName||"").toLowerCase():"#document"}function si(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ml(e){var t;return(t=(x8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function x8(e){return D2()?e instanceof Node||e instanceof si(e).Node:!1}function Ts(e){return D2()?e instanceof Element||e instanceof si(e).Element:!1}function ol(e){return D2()?e instanceof HTMLElement||e instanceof si(e).HTMLElement:!1}function YL(e){return!D2()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof si(e).ShadowRoot}const Z1e=new Set(["inline","contents"]);function Xy(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=zi(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Z1e.has(a)}const X1e=new Set(["table","td","th"]);function ewe(e){return X1e.has(ap(e))}const twe=[":popover-open",":modal"];function O2(e){return twe.some(t=>{try{return e.matches(t)}catch{return!1}})}const rwe=["transform","translate","scale","rotate","perspective"],nwe=["transform","translate","scale","rotate","perspective","filter"],awe=["paint","layout","strict","content"];function _E(e){const t=LE(),r=Ts(e)?zi(e):e;return rwe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||nwe.some(n=>(r.willChange||"").includes(n))||awe.some(n=>(r.contain||"").includes(n))}function swe(e){let t=Au(e);for(;ol(t)&&!hh(t);){if(_E(t))return t;if(O2(t))return null;t=Au(t)}return null}function LE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const iwe=new Set(["html","body","#document"]);function hh(e){return iwe.has(ap(e))}function zi(e){return si(e).getComputedStyle(e)}function R2(e){return Ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Au(e){if(ap(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YL(e)&&e.host||ml(e);return YL(t)?t.host:t}function w8(e){const t=Au(e);return hh(t)?e.ownerDocument?e.ownerDocument.body:e.body:ol(t)&&Xy(t)?t:w8(t)}function T0(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=w8(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=si(a);if(i){const l=Lk(o);return t.concat(o,o.visualViewport||[],Xy(a)?a:[],l&&r?T0(l):[])}return t.concat(a,T0(a,[],r))}function Lk(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ph=Math.min,$d=Math.max,c1=Math.round,Zb=Math.floor,Zo=e=>({x:e,y:e}),owe={left:"right",right:"left",bottom:"top",top:"bottom"},lwe={start:"end",end:"start"};function cwe(e,t,r){return $d(e,ph(t,r))}function $2(e,t){return typeof e=="function"?e(t):e}function gh(e){return e.split("-")[0]}function eb(e){return e.split("-")[1]}function uwe(e){return e==="x"?"y":"x"}function DE(e){return e==="y"?"height":"width"}const dwe=new Set(["top","bottom"]);function bd(e){return dwe.has(gh(e))?"y":"x"}function OE(e){return uwe(bd(e))}function fwe(e,t,r){r===void 0&&(r=!1);const n=eb(e),a=OE(e),i=DE(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=u1(o)),[o,u1(o)]}function mwe(e){const t=u1(e);return[Dk(e),t,Dk(t)]}function Dk(e){return e.replace(/start|end/g,t=>lwe[t])}const QL=["left","right"],KL=["right","left"],hwe=["top","bottom"],pwe=["bottom","top"];function gwe(e,t,r){switch(e){case"top":case"bottom":return r?t?KL:QL:t?QL:KL;case"left":case"right":return t?hwe:pwe;default:return[]}}function ywe(e,t,r,n){const a=eb(e);let i=gwe(gh(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Dk)))),i}function u1(e){return e.replace(/left|right|bottom|top/g,t=>owe[t])}function bwe(e){return{top:0,right:0,bottom:0,left:0,...e}}function j8(e){return typeof e!="number"?bwe(e):{top:e,right:e,bottom:e,left:e}}function d1(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}var vwe=typeof document<"u",xwe=function(){},f1=vwe?b.useLayoutEffect:xwe;const wwe={...Wd},jwe=wwe.useInsertionEffect,Nwe=jwe||(e=>e());function Swe(e){const t=b.useRef(()=>{});return Nwe(()=>{t.current=e}),b.useCallback(function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.current==null?void 0:t.current(...n)},[])}function JL(e,t,r){let{reference:n,floating:a}=e;const i=bd(t),o=OE(t),l=DE(o),c=gh(t),u=i==="y",d=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,m=n[l]/2-a[l]/2;let h;switch(c){case"top":h={x:d,y:n.y-a.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-a.width,y:f};break;default:h={x:n.x,y:n.y}}switch(eb(t)){case"start":h[o]-=m*(r&&u?-1:1);break;case"end":h[o]+=m*(r&&u?-1:1);break}return h}const Cwe=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=JL(u,n,c),m=n,h={},p=0;for(let g=0;g<l.length;g++){const{name:y,fn:v}=l[g],{x,y:j,data:C,reset:N}=await v({x:d,y:f,initialPlacement:n,placement:m,strategy:a,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});d=x??d,f=j??f,h={...h,[y]:{...h[y],...C}},N&&p<=50&&(p++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:d,y:f}=JL(u,m,c)),g=-1)}return{x:d,y:f,placement:m,strategy:a,middlewareData:h}};async function kwe(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:h=0}=$2(t,e),p=j8(h),y=l[m?f==="floating"?"reference":"floating":f],v=d1(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),C=await(i.isElement==null?void 0:i.isElement(j))?await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1}:{x:1,y:1},N=d1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:j,strategy:c}):x);return{top:(v.top-N.top+p.top)/C.y,bottom:(N.bottom-v.bottom+p.bottom)/C.y,left:(v.left-N.left+p.left)/C.x,right:(N.right-v.right+p.right)/C.x}}const Mwe=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=$2(e,t)||{};if(u==null)return{};const f=j8(d),m={x:r,y:n},h=OE(a),p=DE(h),g=await o.getDimensions(u),y=h==="y",v=y?"top":"left",x=y?"bottom":"right",j=y?"clientHeight":"clientWidth",C=i.reference[p]+i.reference[h]-m[h]-i.floating[p],N=m[h]-i.reference[h],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let M=S?S[j]:0;(!M||!await(o.isElement==null?void 0:o.isElement(S)))&&(M=l.floating[j]||i.floating[p]);const k=C/2-N/2,I=M/2-g[p]/2-1,T=ph(f[v],I),L=ph(f[x],I),R=T,_=M-g[p]-L,B=M/2-g[p]/2+k,z=cwe(R,B,_),D=!c.arrow&&eb(a)!=null&&B!==z&&i.reference[p]/2-(B<R?T:L)-g[p]/2<0,A=D?B<R?B-R:B-_:0;return{[h]:m[h]+A,data:{[h]:z,centerOffset:B-z-A,...D&&{alignmentOffset:A}},reset:D}}}),Iwe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...y}=$2(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=gh(a),x=bd(l),j=gh(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=m||(j||!g?[u1(l)]:mwe(l)),S=p!=="none";!m&&S&&N.push(...ywe(l,g,p,C));const M=[l,...N],k=await kwe(t,y),I=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&I.push(k[v]),f){const B=fwe(a,o,C);I.push(k[B[0]],k[B[1]])}if(T=[...T,{placement:a,overflows:I}],!I.every(B=>B<=0)){var L,R;const B=(((L=i.flip)==null?void 0:L.index)||0)+1,z=M[B];if(z&&(!(f==="alignment"?x!==bd(z):!1)||T.every(P=>bd(P.placement)===x?P.overflows[0]>0:!0)))return{data:{index:B,overflows:T},reset:{placement:z}};let D=(R=T.filter(A=>A.overflows[0]<=0).sort((A,P)=>A.overflows[1]-P.overflows[1])[0])==null?void 0:R.placement;if(!D)switch(h){case"bestFit":{var _;const A=(_=T.filter(P=>{if(S){const E=bd(P.placement);return E===x||E==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(E=>E>0).reduce((E,F)=>E+F,0)]).sort((P,E)=>P[1]-E[1])[0])==null?void 0:_[0];A&&(D=A);break}case"initialPlacement":D=l;break}if(a!==D)return{reset:{placement:D}}}return{}}}},Ewe=new Set(["left","top"]);async function Twe(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=gh(r),l=eb(r),c=bd(r)==="y",u=Ewe.has(o)?-1:1,d=i&&c?-1:1,f=$2(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),c?{x:h*d,y:m*u}:{x:m*u,y:h*d}}const Awe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await Twe(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}};function N8(e){const t=zi(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ol(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=c1(r)!==i||c1(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function RE(e){return Ts(e)?e:e.contextElement}function Sm(e){const t=RE(e);if(!ol(t))return Zo(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=N8(t);let o=(i?c1(r.width):r.width)/n,l=(i?c1(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Pwe=Zo(0);function S8(e){const t=si(e);return!LE()||!t.visualViewport?Pwe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _we(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==si(e)?!1:t}function sf(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=RE(e);let o=Zo(1);t&&(n?Ts(n)&&(o=Sm(n)):o=Sm(e));const l=_we(i,r,n)?S8(i):Zo(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,f=a.height/o.y;if(i){const m=si(i),h=n&&Ts(n)?si(n):n;let p=m,g=Lk(p);for(;g&&n&&h!==p;){const y=Sm(g),v=g.getBoundingClientRect(),x=zi(g),j=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,C=v.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=j,u+=C,p=si(g),g=Lk(p)}}return d1({width:d,height:f,x:c,y:u})}function F2(e,t){const r=R2(e).scrollLeft;return t?t.left+r:sf(ml(e)).left+r}function C8(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-F2(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function Lwe(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=ml(n),l=t?O2(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Zo(1);const d=Zo(0),f=ol(n);if((f||!f&&!i)&&((ap(n)!=="body"||Xy(o))&&(c=R2(n)),ol(n))){const h=sf(n);u=Sm(n),d.x=h.x+n.clientLeft,d.y=h.y+n.clientTop}const m=o&&!f&&!i?C8(o,c):Zo(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:r.y*u.y-c.scrollTop*u.y+d.y+m.y}}function Dwe(e){return Array.from(e.getClientRects())}function Owe(e){const t=ml(e),r=R2(e),n=e.ownerDocument.body,a=$d(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=$d(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+F2(e);const l=-r.scrollTop;return zi(n).direction==="rtl"&&(o+=$d(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}const ZL=25;function Rwe(e,t){const r=si(e),n=ml(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=LE();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const u=F2(n);if(u<=0){const d=n.ownerDocument,f=d.body,m=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(n.clientWidth-f.clientWidth-h);p<=ZL&&(i-=p)}else u<=ZL&&(i+=u);return{width:i,height:o,x:l,y:c}}const $we=new Set(["absolute","fixed"]);function Fwe(e,t){const r=sf(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=ol(e)?Sm(e):Zo(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function XL(e,t,r){let n;if(t==="viewport")n=Rwe(e,r);else if(t==="document")n=Owe(ml(e));else if(Ts(t))n=Fwe(t,r);else{const a=S8(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return d1(n)}function k8(e,t){const r=Au(e);return r===t||!Ts(r)||hh(r)?!1:zi(r).position==="fixed"||k8(r,t)}function zwe(e,t){const r=t.get(e);if(r)return r;let n=T0(e,[],!1).filter(l=>Ts(l)&&ap(l)!=="body"),a=null;const i=zi(e).position==="fixed";let o=i?Au(e):e;for(;Ts(o)&&!hh(o);){const l=zi(o),c=_E(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&$we.has(a.position)||Xy(o)&&!c&&k8(e,o))?n=n.filter(d=>d!==o):a=l,o=Au(o)}return t.set(e,n),n}function Bwe(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?O2(t)?[]:zwe(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const f=XL(t,d,a);return u.top=$d(f.top,u.top),u.right=ph(f.right,u.right),u.bottom=ph(f.bottom,u.bottom),u.left=$d(f.left,u.left),u},XL(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uwe(e){const{width:t,height:r}=N8(e);return{width:t,height:r}}function Vwe(e,t,r){const n=ol(t),a=ml(t),i=r==="fixed",o=sf(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Zo(0);function u(){c.x=F2(a)}if(n||!n&&!i)if((ap(t)!=="body"||Xy(a))&&(l=R2(t)),n){const h=sf(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else a&&u();i&&!n&&a&&u();const d=a&&!n&&!i?C8(a,l):Zo(0),f=o.left+l.scrollLeft-c.x-d.x,m=o.top+l.scrollTop-c.y-d.y;return{x:f,y:m,width:o.width,height:o.height}}function JN(e){return zi(e).position==="static"}function eD(e,t){if(!ol(e)||zi(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ml(e)===r&&(r=r.ownerDocument.body),r}function M8(e,t){const r=si(e);if(O2(e))return r;if(!ol(e)){let a=Au(e);for(;a&&!hh(a);){if(Ts(a)&&!JN(a))return a;a=Au(a)}return r}let n=eD(e,t);for(;n&&ewe(n)&&JN(n);)n=eD(n,t);return n&&hh(n)&&JN(n)&&!_E(n)?r:n||swe(e)||r}const Wwe=async function(e){const t=this.getOffsetParent||M8,r=this.getDimensions,n=await r(e.floating);return{reference:Vwe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qwe(e){return zi(e).direction==="rtl"}const Gwe={convertOffsetParentRelativeRectToViewportRelativeRect:Lwe,getDocumentElement:ml,getClippingRect:Bwe,getOffsetParent:M8,getElementRects:Wwe,getClientRects:Dwe,getDimensions:Uwe,getScale:Sm,isElement:Ts,isRTL:qwe};function I8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hwe(e,t){let r=null,n;const a=ml(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:m,height:h}=u;if(l||t(),!m||!h)return;const p=Zb(f),g=Zb(a.clientWidth-(d+m)),y=Zb(a.clientHeight-(f+h)),v=Zb(d),j={rootMargin:-p+"px "+-g+"px "+-y+"px "+-v+"px",threshold:$d(0,ph(1,c))||1};let C=!0;function N(S){const M=S[0].intersectionRatio;if(M!==c){if(!C)return o();M?o(!1,M):n=setTimeout(()=>{o(!1,1e-7)},1e3)}M===1&&!I8(u,e.getBoundingClientRect())&&o(),C=!1}try{r=new IntersectionObserver(N,{...j,root:a.ownerDocument})}catch{r=new IntersectionObserver(N,j)}r.observe(e)}return o(!0),i}function Ywe(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=RE(e),d=a||i?[...u?T0(u):[],...T0(t)]:[];d.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const f=u&&l?Hwe(u,r):null;let m=-1,h=null;o&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var j;(j=h)==null||j.observe(t)})),r()}),u&&!c&&h.observe(u),h.observe(t));let p,g=c?sf(e):null;c&&y();function y(){const v=sf(e);g&&!I8(g,v)&&r(),g=v,p=requestAnimationFrame(y)}return r(),()=>{var v;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),f==null||f(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Qwe=Awe,Kwe=Iwe,tD=Mwe,Jwe=(e,t,r)=>{const n=new Map,a={platform:Gwe,...r},i={...a.platform,_c:n};return Cwe(e,t,{...a,platform:i})};var Zwe=typeof document<"u",Xwe=function(){},Jv=Zwe?b.useLayoutEffect:Xwe;function m1(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!m1(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!m1(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function E8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rD(e,t){const r=E8(e);return Math.round(t*r)/r}function ZN(e){const t=b.useRef(e);return Jv(()=>{t.current=e}),t}function e2e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=b.useState(n);m1(m,n)||h(n);const[p,g]=b.useState(null),[y,v]=b.useState(null),x=b.useCallback(P=>{P!==S.current&&(S.current=P,g(P))},[]),j=b.useCallback(P=>{P!==M.current&&(M.current=P,v(P))},[]),C=i||p,N=o||y,S=b.useRef(null),M=b.useRef(null),k=b.useRef(d),I=c!=null,T=ZN(c),L=ZN(a),R=ZN(u),_=b.useCallback(()=>
3770{if(!S.current||!M.current)return;const P={placement:t,strategy:r,middleware:m};L.current&&(P.platform=L.current),Jwe(S.current,M.current,P).then(E=>{const F={...E,isPositioned:R.current!==!1};B.current&&!m1(k.current,F)&&(k.current=F,Ly.flushSync(()=>{f(F)}))})},[m,t,r,L,R]);Jv(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[u]);const B=b.useRef(!1);Jv(()=>(B.current=!0,()=>{B.current=!1}),[]),Jv(()=>{if(C&&(S.current=C),N&&(M.current=N),C&&N){if(T.current)return T.current(C,N,_);_()}},[C,N,_,T,I]);const z=b.useMemo(()=>({reference:S,floating:M,setReference:x,setFloating:j}),[x,j]),D=b.useMemo(()=>({reference:C,floating:N}),[C,N]),A=b.useMemo(()=>{const P={position:r,left:0,top:0};if(!D.floating)return P;const E=rD(D.floating,d.x),F=rD(D.floating,d.y);return l?{...P,transform:"translate("+E+"px, "+F+"px)",...E8(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:F}},[r,l,D.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:_,refs:z,elements:D,floatingStyles:A}),[d,_,z,D,A])}const t2e=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?tD({element:n.current,padding:a}).fn(r):{}:n?tD({element:n,padding:a}).fn(r):{}}}},r2e=(e,t)=>({...Qwe(e),options:[e,t]}),n2e=(e,t)=>({...Kwe(e),options:[e,t]}),a2e=(e,t)=>({...t2e(e),options:[e,t]}),s2e={...Wd};let nD=!1,i2e=0;const aD=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+i2e++;function o2e(){const[e,t]=b.useState(()=>nD?aD():void 0);return f1(()=>{e==null&&t(aD())},[]),b.useEffect(()=>{nD=!0},[]),e}const l2e=s2e.useId,T8=l2e||o2e,c2e=b.forwardRef(function(t,r){const{context:{placement:n,elements:{floating:a},middlewareData:{arrow:i,shift:o}},width:l=14,height:c=7,tipRadius:u=0,strokeWidth:d=0,staticOffset:f,stroke:m,d:h,style:{transform:p,...g}={},...y}=t,v=T8(),[x,j]=b.useState(!1);if(f1(()=>{if(!a)return;zi(a).direction==="rtl"&&j(!0)},[a]),!a)return null;const[C,N]=n.split("-"),S=C==="top"||C==="bottom";let M=f;(S&&o!=null&&o.x||!S&&o!=null&&o.y)&&(M=null);const k=d*2,I=k/2,T=l/2*(u/-8+1),L=c/2*u/4,R=!!h,_=M&&N==="end"?"bottom":"top";let B=M&&N==="end"?"right":"left";M&&x&&(B=N==="end"?"left":"right");const z=(i==null?void 0:i.x)!=null?M||i.x:"",D=(i==null?void 0:i.y)!=null?M||i.y:"",A=h||"M0,0"+(" H"+l)+(" L"+(l-T)+","+(c-L))+(" Q"+l/2+","+c+" "+T+","+(c-L))+" Z",P={top:R?"rotate(180deg)":"",left:R?"rotate(90deg)":"rotate(-90deg)",bottom:R?"":"rotate(180deg)",right:R?"rotate(-90deg)":"rotate(90deg)"}[C];return s.jsxs("svg",{...y,"aria-hidden":!0,ref:r,width:R?l:l+k,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[B]:z,[_]:D,[C]:S||R?"100%":"calc(100% - "+k/2+"px)",transform:[P,p].filter(E=>!!E).join(" "),...g},children:[k>0&&s.jsx("path",{clipPath:"url(#"+v+")",fill:"none",stroke:m,strokeWidth:k+(h?0:1),d:A}),s.jsx("path",{stroke:k&&!h?y.fill:"none",d:A}),s.jsx("clipPath",{id:v,children:s.jsx("rect",{x:-I,y:I*(R?-1:1),width:l+k,height:l})})]})});function u2e(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(a=>a(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var n;(n=e.get(t))==null||n.delete(r)}}}const d2e=b.createContext(null),f2e=b.createContext(null),m2e=()=>{var e;return((e=b.useContext(d2e))==null?void 0:e.id)||null},h2e=()=>b.useContext(f2e);function p2e(e){const{open:t=!1,onOpenChange:r,elements:n}=e,a=T8(),i=b.useRef({}),[o]=b.useState(()=>u2e()),l=m2e()!=null,[c,u]=b.useState(n.reference),d=Swe((h,p,g)=>{i.current.openEvent=h?p:void 0,o.emit("openchange",{open:h,event:p,reason:g,nested:l}),r==null||r(h,p,g)}),f=b.useMemo(()=>({setPositionReference:u}),[]),m=b.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return b.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:o,floatingId:a,refs:f}),[t,d,m,o,a,f])}function g2e(e){e===void 0&&(e={});const{nodeId:t}=e,r=p2e({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,a=n.elements,[i,o]=b.useState(null),[l,c]=b.useState(null),d=(a==null?void 0:a.domReference)||i,f=b.useRef(null),m=h2e();f1(()=>{d&&(f.current=d)},[d]);const h=e2e({...e,elements:{...a,...l&&{reference:l}}}),p=b.useCallback(j=>{const C=Ts(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;c(C),h.refs.setReference(C)},[h.refs]),g=b.useCallback(j=>{(Ts(j)||j===null)&&(f.current=j,o(j)),(Ts(h.refs.reference.current)||h.refs.reference.current===null||j!==null&&!Ts(j))&&h.refs.setReference(j)},[h.refs]),y=b.useMemo(()=>({...h.refs,setReference:g,setPositionReference:p,domReference:f}),[h.refs,g,p]),v=b.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),x=b.useMemo(()=>({...h,...n,refs:y,elements:v,nodeId:t}),[h,y,v,t,n]);return f1(()=>{n.dataRef.current.floatingContext=x;const j=m==null?void 0:m.nodesRef.current.find(C=>C.id===t);j&&(j.context=x)}),b.useMemo(()=>({...h,context:x,refs:y,elements:v}),[h,y,v,x])}/*!
3771  react-datepicker v8.7.0
3772  https://github.com/Hacker0x01/react-datepicker
3773  Released under the MIT License.
3774*/var Ok=function(t,r){return Ok=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},Ok(t,r)};function as(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ok(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ar=function(){return Ar=Object.assign||function(r){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},Ar.apply(this,arguments)};function qo(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var y2e=function(e){var t=e.showTimeSelectOnly,r=t===void 0?!1:t,n=e.showTime,a=n===void 0?!1:n,i=e.className,o=e.children,l=r?"Choose Time":"Choose Date".concat(a?" and Time":"");return U.createElement("div",{className:i,role:"dialog","aria-label":l,"aria-modal":"true"},o)},b2e=function(e,t){var r=b.useRef(null),n=b.useRef(e);n.current=e;var a=b.useCallback(function(i){var o,l=i.composed&&i.composedPath&&i.composedPath().find(function(c){return c instanceof Node})||i.target;r.current&&!r.current.contains(l)&&(t&&l instanceof HTMLElement&&l.classList.contains(t)||(o=n.current)===null||o===void 0||o.call(n,i))},[t]);return b.useEffect(function(){return document.addEventListener("mousedown",a),function(){document.removeEventListener("mousedown",a)}},[a]),r},z2=function(e){var t=e.children,r=e.onClickOutside,n=e.className,a=e.containerRef,i=e.style,o=e.ignoreClass,l=b2e(r,o);return U.createElement("div",{className:n,style:i,ref:function(c){l.current=c,a&&(a.current=c)}},t)},Ct;(function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"})(Ct||(Ct={}));function $E(){var e=typeof window<"u"?window:globalThis;return e}var tb=12;function cn(e){if(e==null)return new Date;var t=typeof e=="string"?O1e(e):Ot(e);return B2(t)?t:new Date}function XN(e,t,r,n,a){a===void 0&&(a=cn());for(var i=yh(r)||yh(FE()),o=Array.isArray(t)?t:[t],l=0,c=o;l<c.length;l++){var u=c[l],d=T1e(e,u,a,{locale:i});if(B2(d)&&(!n||e===Bn(d,u,r)))return d}return null}function B2(e,t){return a1(e)&&!Wo(e,new Date("1/1/1800"))}function Bn(e,t,r){if(r==="en")return qL(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var n=r?yh(r):void 0;return r&&!n&&console.warn('A locale object was not found for the provided string ["'.concat(r,'"].')),n=n||yh(FE()),qL(e,t,{locale:n,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function ji(e,t){var r=t.dateFormat,n=t.locale,a=Array.isArray(r)&&r.length>0?r[0]:r;return e&&Bn(e,a,n)||""}var A8=" - ";function v2e(e,t,r){if(!e&&!t)return"";var n=e?ji(e,r):"",a=t?ji(t,r):"",i=r.rangeSeparator||A8;return"".concat(n).concat(i).concat(a)}function x2e(e,t){if(!(e!=null&&e.length))return"";var r=e[0]?ji(e[0],t):"";if(e.length===1)return r;if(e.length===2&&e[1]){var n=ji(e[1],t);return"".concat(r,", ").concat(n)}var a=e.length-1;return"".concat(r," (+").concat(a,")")}function eS(e,t){var r=t.hour,n=r===void 0?0:r,a=t.minute,i=a===void 0?0:a,o=t.second,l=o===void 0?0:o;return Yv(Qv(Kv(e,l),i),n)}function w2e(e){return EE(e)}function j2e(e,t){return Bn(e,"ddd",t)}function Zv(e){return af(e)}function yu(e,t,r){var n=yh(t||FE());return cc(e,{locale:n,weekStartsOn:r})}function Kl(e){return c8(e)}function Ag(e){return L2(e)}function sD(e){return Ak(e)}function iD(){return af(cn())}function oD(e){return o8(e)}function N2e(e){return Ove(e)}function S2e(e){return l8(e)}function Ro(e,t){return e&&t?L1e(e,t):!e&&!t}function ks(e,t){return e&&t?P1e(e,t):!e&&!t}function h1(e,t){return e&&t?_1e(e,t):!e&&!t}function Tr(e,t){return e&&t?Lve(e,t):!e&&!t}function vd(e,t){return e&&t?Dxe(e,t):!e&&!t}function sd(e,t,r){var n,a=af(t),i=o8(r);try{n=E0(e,{start:a,end:i})}catch{n=!1}return n}function P8(e,t){var r=$E();r.__localeData__||(r.__localeData__={}),r.__localeData__[e]=t}function FE(){var e=$E();return e.__localeId__}function yh(e){if(typeof e=="string"){var t=$E();return t.__localeData__?t.__localeData__[e]:void 0}else return e}function C2e(e,t,r){return t(Bn(e,"EEEE",r))}function k2e(e,t){return Bn(e,"EEEEEE",t)}function M2e(e,t){return Bn(e,"EEE",t)}function zE(e,t){return Bn(Si(cn(),e),"LLLL",t)}function _8(e,t){return Bn(Si(cn(),e),"LLL",t)}function I2e(e,t){return Bn(am(cn(),e),"QQQ",t)}function Ci(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.maxDate,i=r.excludeDates,o=r.excludeDateIntervals,l=r.includeDates,c=r.includeDateIntervals,u=r.filterDate;return rb(e,{minDate:n,maxDate:a})||i&&i.some(function(d){return d instanceof Date?Tr(e,d):Tr(e,d.date)})||o&&o.some(function(d){var f=d.start,m=d.end;return E0(e,{start:f,end:m})})||l&&!l.some(function(d){return Tr(e,d)})||c&&!c.some(function(d){var f=d.start,m=d.end;return E0(e,{start:f,end:m})})||u&&!u(cn(e))||!1}function BE(e,t){var r=t===void 0?{}:t,n=r.excludeDates,a=r.excludeDateIntervals;return a&&a.length>0?a.some(function(i){var o=i.start,l=i.end;return E0(e,{start:o,end:l})}):n&&n.some(function(i){var o;return i instanceof Date?Tr(e,i):Tr(e,(o=i.date)!==null&&o!==void 0?o:new Date)})||!1}function L8(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.maxDate,i=r.excludeDates,o=r.includeDates,l=r.filterDate;return rb(e,{minDate:n?c8(n):void 0,maxDate:a?l8(a):void 0})||(i==null?void 0:i.some(function(c){return ks(e,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return ks(e,c)})||l&&!l(cn(e))||!1}
3774function Xb(e,t,r,n){var a=jr(e),i=hs(e),o=jr(t),l=hs(t),c=jr(n);return a===o&&a===c?i<=r&&r<=l:a<o?c===a&&i<=r||c===o&&l>=r||c<o&&c>a:!1}function E2e(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.maxDate,i=r.excludeDates,o=r.includeDates;return rb(e,{minDate:n,maxDate:a})||i&&i.some(function(l){return ks(l instanceof Date?l:l.date,e)})||o&&!o.some(function(l){return ks(l,e)})||!1}function ev(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.maxDate,i=r.excludeDates,o=r.includeDates,l=r.filterDate;return rb(e,{minDate:n,maxDate:a})||(i==null?void 0:i.some(function(c){return h1(e,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return h1(e,c)})||l&&!l(cn(e))||!1}function tv(e,t,r){if(!t||!r||!a1(t)||!a1(r))return!1;var n=jr(t),a=jr(r);return n<=e&&a>=e}function Xv(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.maxDate,i=r.excludeDates,o=r.includeDates,l=r.filterDate,c=new Date(e,0,1);return rb(c,{minDate:n?L2(n):void 0,maxDate:a?u8(a):void 0})||(i==null?void 0:i.some(function(u){return Ro(c,u instanceof Date?u:u.date)}))||o&&!o.some(function(u){return Ro(c,u)})||l&&!l(cn(c))||!1}function rv(e,t,r,n){var a=jr(e),i=Od(e),o=jr(t),l=Od(t),c=jr(n);return a===o&&a===c?i<=r&&r<=l:a<o?c===a&&i<=r||c===o&&l>=r||c<o&&c>a:!1}function rb(e,t){var r,n=t===void 0?{}:t,a=n.minDate,i=n.maxDate;return(r=a&&fh(e,a)<0||i&&fh(e,i)>0)!==null&&r!==void 0?r:!1}function lD(e,t){return t.some(function(r){return Yl(r)===Yl(e)&&Ql(r)===Ql(e)&&gu(r)===gu(e)})}function cD(e,t){var r=t===void 0?{}:t,n=r.excludeTimes,a=r.includeTimes,i=r.filterTime;return n&&lD(e,n)||a&&!lD(e,a)||i&&!i(e)||!1}function uD(e,t){var r=t.minTime,n=t.maxTime;if(!r||!n)throw new Error("Both minTime and maxTime props required");var a=cn();a=Yv(a,Yl(e)),a=Qv(a,Ql(e)),a=Kv(a,gu(e));var i=cn();i=Yv(i,Yl(r)),i=Qv(i,Ql(r)),i=Kv(i,gu(r));var o=cn();o=Yv(o,Yl(n)),o=Qv(o,Ql(n)),o=Kv(o,gu(n));var l;try{l=!E0(a,{start:i,end:o})}catch{l=!1}return l}function dD(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.includeDates,i=Rd(e,1);return n&&s1(n,i)>0||a&&a.every(function(o){return s1(o,i)>0})||!1}function fD(e,t){var r=t===void 0?{}:t,n=r.maxDate,a=r.includeDates,i=xo(e,1);return n&&s1(i,n)>0||a&&a.every(function(o){return s1(i,o)>0})||!1}function T2e(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.includeDates,i=L2(e),o=v8(i);return n&&i1(n,o)>0||a&&a.every(function(l){return i1(l,o)>0})||!1}function A2e(e,t){var r=t===void 0?{}:t,n=r.maxDate,a=r.includeDates,i=u8(e),o=IE(i,1);return n&&i1(o,n)>0||a&&a.every(function(l){return i1(o,l)>0})||!1}function mD(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.includeDates,i=mh(e,1);return n&&o1(n,i)>0||a&&a.every(function(o){return o1(o,i)>0})||!1}function P2e(e,t){var r=t===void 0?{}:t,n=r.minDate,a=r.yearItemNumber,i=a===void 0?tb:a,o=Ag(mh(e,i)),l=Ol(o,i).endPeriod,c=n&&jr(n);return c&&c>l||!1}function hD(e,t){var r=t===void 0?{}:t,n=r.maxDate,a=r.includeDates,i=Gl(e,1);return n&&o1(i,n)>0||a&&a.every(function(o){return o1(i,o)>0})||!1}function _2e(e,t){var r=t===void 0?{}:t,n=r.maxDate,a=r.yearItemNumber,i=a===void 0?tb:a,o=Gl(e,i),l=Ol(o,i).startPeriod,c=n&&jr(n);return c&&c<l||!1}function D8(e){var t=e.minDate,r=e.includeDates;if(r&&t){var n=r.filter(function(a){return fh(a,t)>=0});return FL(n)}else return r?FL(r):t}function O8(e){var t=e.maxDate,r=e.includeDates;if(r&&t){var n=r.filter(function(a){return fh(a,t)<=0});return $L(n)}else return r?$L(r):t}function pD(e,t){var r;e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--highlighted");for(var n=new Map,a=0,i=e.length;a<i;a++){var o=e[a];if(Hl(o)){var l=Bn(o,"MM.dd.yyyy"),c=n.get(l)||[];c.includes(t)||(c.push(t),n.set(l,c))}else if(typeof o=="object"){var u=Object.keys(o),d=(r=u[0])!==null&&r!==void 0?r:"",f=o[d];if(typeof d=="string"&&Array.isArray(f))for(var m=0,h=f.length;m<h;m++){var p=f[m];if(p){var l=Bn(p,"MM.dd.yyyy"),c=n.get(l)||[];c.includes(d)||(c.push(d),n.set(l,c))}}}}return n}function L2e(e,t){return e.length!==t.length?!1:e.every(function(r,n){return r===t[n]})}function D2e(e,t){e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--holidays");var r=new Map;return e.forEach(function(n){var a=n.date,i=n.holidayName;if(Hl(a)){var o=Bn(a,"MM.dd.yyyy"),l=r.get(o)||{className:"",holidayNames:[]};if(!("className"in l&&l.className===t&&L2e(l.holidayNames,[i]))){l.className=t;var c=l.holidayNames;l.holidayNames=c?qo(qo([],c,!0),[i],!1):[i],r.set(o,l)}}}),r}function O2e(e,t,r,n,a){for(var i=a.length,o=[],l=0;l<i;l++){var c=e,u=a[l];u&&(c=Tve(c,Yl(u)),c=Tk(c,Ql(u)),c=_ve(c,gu(u)));var d=Tk(e,(r+1)*n);Tu(c,t)&&Wo(c,d)&&u!=null&&o.push(u)}return o}function gD(e){return e<10?"0".concat(e):"".concat(e)}function Ol(e,t){t===void 0&&(t=tb);var r=Math.ceil(jr(e)/t)*t,n=r-(t-1);return{startPeriod:n,endPeriod:r}}function R2e(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+r-+t)/36e5)}function yD(e){var t=e.getSeconds(),r=e.getMilliseconds();return Ot(e.getTime()-t*1e3-r)}function $2e(e,t){return yD(e).getTime()===yD(t).getTime()}function bD(e){if(!Hl(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function tS(e,t){if(!Hl(e)||!Hl(t))throw new Error("Invalid date received");var r=bD(e),n=bD(t);return Wo(r,n)}function R8(e){return e.key===Ct.Space}var F2e=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.inputRef=U.createRef(),n.onTimeChange=function(a){var i,o;n.setState({time:a});var l=n.props.date,c=l instanceof Date&&!isNaN(+l),u=c?l:new Date;if(a!=null&&a.includes(":")){var d=a.split(":"),f=d[0],m=d[1];u.setHours(Number(f)),u.setMinutes(Number(m))}(o=(i=n.props).onChange)===null||o===void 0||o.call(i,u)},n.renderTimeInput=function(){var a=n.state.time,i=n.props,o=i.date,l=i.timeString,c=i.customTimeInput;return c?b.cloneElement(c,{date:o,value:a,onChange:n.onTimeChange}):U.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:n.inputRef,onClick:function(){var u;(u=n.inputRef.current)===null||u===void 0||u.focus()},required:!0,value:a,onChange:function(u){n.onTimeChange(u.target.value||l)}})}
3774,n.state={time:n.props.timeString},n}return t.getDerivedStateFromProps=function(r,n){return r.timeString!==n.time?{time:r.timeString}:null},t.prototype.render=function(){return U.createElement("div",{className:"react-datepicker__input-time-container"},U.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),U.createElement("div",{className:"react-datepicker-time__input-container"},U.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},t}(b.Component),z2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.dayEl=b.createRef(),r.handleClick=function(n){!r.isDisabled()&&r.props.onClick&&r.props.onClick(n)},r.handleMouseEnter=function(n){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(n)},r.handleOnKeyDown=function(n){var a,i,o=n.key;o===Ct.Space&&(n.preventDefault(),n.key=Ct.Enter),(i=(a=r.props).handleOnKeyDown)===null||i===void 0||i.call(a,n)},r.isSameDay=function(n){return Tr(r.props.day,n)},r.isKeyboardSelected=function(){var n;if(r.props.disabledKeyboardNavigation)return!1;var a=r.props.selectsMultiple?(n=r.props.selectedDates)===null||n===void 0?void 0:n.some(function(o){return r.isSameDayOrWeek(o)}):r.isSameDayOrWeek(r.props.selected),i=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!a&&r.isSameDayOrWeek(r.props.preSelection)&&!i},r.isDisabled=function(n){return n===void 0&&(n=r.props.day),Ci(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(){return BE(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return Tr(r.props.day,yu(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(n){return r.props.showWeekPicker&&Tr(n,yu(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(n){return r.isSameDay(n)||r.isSameWeek(n)},r.getHighLightedClass=function(){var n=r.props,a=n.day,i=n.highlightDates;if(!i)return!1;var o=Bn(a,"MM.dd.yyyy");return i.get(o)},r.getHolidaysClass=function(){var n,a=r.props,i=a.day,o=a.holidays;if(!o)return[void 0];var l=Bn(i,"MM.dd.yyyy");return o.has(l)?[(n=o.get(l))===null||n===void 0?void 0:n.className]:[void 0]},r.isInRange=function(){var n=r.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:sd(a,i,o)},r.isInSelectingRange=function(){var n,a=r.props,i=a.day,o=a.selectsStart,l=a.selectsEnd,c=a.selectsRange,u=a.selectsDisabledDaysInRange,d=a.startDate,f=a.swapRange,m=a.endDate,h=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;if(!(o||l||c)||!h||!u&&r.isDisabled())return!1;if(o&&m&&(Wo(h,m)||vd(h,m)))return sd(i,h,m);if(l&&d&&(Tu(h,d)||vd(h,d)))return sd(i,d,h);if(c&&d&&!m){if(vd(h,d)||Tu(h,d))return sd(i,d,h);if(f&&Wo(h,d))return sd(i,h,d)}return!1},r.isSelectingRangeStart=function(){var n;if(!r.isInSelectingRange())return!1;var a=r.props,i=a.day,o=a.startDate,l=a.selectsStart,c=a.swapRange,u=a.selectsRange,d=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;return l?Tr(i,d):u&&c&&o&&d?Tr(i,Wo(d,o)?d:o):Tr(i,o)},r.isSelectingRangeEnd=function(){var n;if(!r.isInSelectingRange())return!1;var a=r.props,i=a.day,o=a.endDate,l=a.selectsEnd,c=a.selectsRange,u=a.swapRange,d=a.startDate,f=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;return l?Tr(i,f):c&&u&&d&&f?Tr(i,Wo(f,d)?d:f):c?Tr(i,f):Tr(i,o)},r.isRangeStart=function(){var n=r.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:Tr(i,a)},r.isRangeEnd=function(){var n=r.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:Tr(o,a)},r.isWeekend=function(){var n=Axe(r.props.day);return n===0||n===6},r.isAfterMonth=function(){return r.props.month!==void 0&&(r.props.month+1)%12===hs(r.props.day)},r.isBeforeMonth=function(){return r.props.month!==void 0&&(hs(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(cn())},r.isSelected=function(){var n;return r.props.selectsMultiple?(n=r.props.selectedDates)===null||n===void 0?void 0:n.some(function(a){return r.isSameDayOrWeek(a)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(n){var a=r.props.dayClassName?r.props.dayClassName(n):void 0;return Jt("react-datepicker__day",a,"react-datepicker__day--"+j2e(r.props.day),{"react-datepicker__day--disabled":r.
3774isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var n=r.props,a=n.day,i=n.ariaLabelPrefixWhenEnabled,o=i===void 0?"Choose":i,l=n.ariaLabelPrefixWhenDisabled,c=l===void 0?"Not available":l,u=r.isDisabled()||r.isExcluded()?c:o;return"".concat(u," ").concat(Bn(a,"PPPP",r.props.locale))},r.getTitle=function(){var n=r.props,a=n.day,i=n.holidays,o=i===void 0?new Map:i,l=n.excludeDates,c=Bn(a,"MM.dd.yyyy"),u=[];return o.has(c)&&u.push.apply(u,o.get(c).holidayNames),r.isExcluded()&&u.push(l==null?void 0:l.filter(function(d){return d instanceof Date?Tr(d,a):Tr(d==null?void 0:d.date,a)}).map(function(d){if(!(d instanceof Date))return d==null?void 0:d.message})),u.join(", ")},r.getTabIndex=function(){var n=r.props.selected,a=r.props.preSelection,i=!(r.props.showWeekPicker&&(r.props.showWeekNumber||!r.isStartOfWeek()))&&(r.isKeyboardSelected()||r.isSameDay(n)&&Tr(a,n))?0:-1;return i},r.handleFocusDay=function(){var n;r.shouldFocusDay()&&((n=r.dayEl.current)===null||n===void 0||n.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(GL(r.props.day),r.props.day):GL(r.props.day)},r.render=function(){return U.createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"gridcell",title:r.getTitle(),"aria-disabled":r.
3774isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),r.getTitle()!==""&&U.createElement("span",{className:"overlay"},r.getTitle()))},r}return t.prototype.componentDidMount=function(){this.handleFocusDay()},t.prototype.componentDidUpdate=function(){this.handleFocusDay()},t.prototype.shouldFocusDay=function(){var r=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(r=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(r=!1),this.isDayActiveElement()&&(r=!0),this.isDuplicateDay()&&(r=!1)),r},t.prototype.isDayActiveElement=function(){var r,n,a;return((n=(r=this.props.containerRef)===null||r===void 0?void 0:r.current)===null||n===void 0?void 0:n.contains(document.activeElement))&&((a=document.activeElement)===null||a===void 0?void 0:a.classList.contains("react-datepicker__day"))},t.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},t}(b.Component),B2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.weekNumberEl=b.createRef(),r.handleClick=function(n){r.props.onClick&&r.props.onClick(n)},r.handleOnKeyDown=function(n){var a,i,o=n.key;o===Ct.Space&&(n.preventDefault(),n.key=Ct.Enter),(i=(a=r.props).handleOnKeyDown)===null||i===void 0||i.call(a,n)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!Tr(r.props.date,r.props.selected)&&Tr(r.props.date,r.props.preSelection)},r.getTabIndex=function(){return r.props.showWeekPicker&&r.props.showWeekNumber&&(r.isKeyboardSelected()||Tr(r.props.date,r.props.selected)&&Tr(r.props.preSelection,r.props.selected))?0:-1},r.handleFocusWeekNumber=function(n){var a=!1;r.getTabIndex()===0&&!(n!=null&&n.isInputFocused)&&Tr(r.props.date,r.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(a=!0),r.props.inline&&!r.props.shouldFocusDayInline&&(a=!1),r.props.containerRef&&r.props.containerRef.current&&r.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(a=!0)),a&&r.weekNumberEl.current&&r.weekNumberEl.current.focus({preventScroll:!0})},r}return Object.defineProperty(t,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},t.prototype.componentDidUpdate=function(r){this.handleFocusWeekNumber(r)},t.prototype.render=function(){var r=this.props,n=r.weekNumber,a=r.isWeekDisabled,i=r.ariaLabelPrefix,o=i===void 0?t.defaultProps.ariaLabelPrefix:i,l=r.onClick,c={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!l&&!a,"react-datepicker__week-number--selected":!!l&&Tr(this.props.date,this.props.selected)};return U.createElement("div",{ref:this.weekNumberEl,className:Jt(c),"aria-label":"".concat(o," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},n)},t}(b.Component),U2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.isDisabled=function(n){return Ci(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(n,a){r.props.onDayClick&&r.props.onDayClick(n,a)},r.handleDayMouseEnter=function(n){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(n)},r.handleWeekClick=function(n,a,i){for(var o,l,c,u=new Date(n),d=0;d<7;d++){var f=new Date(n);f.setDate(f.getDate()+d);var m=!r.isDisabled(f);if(m){u=f;break}}typeof r.props.onWeekSelect=="function"&&r.props.onWeekSelect(u,a,i),r.props.showWeekPicker&&r.handleDayClick(u,i),((o=r.props.shouldCloseOnSelect)!==null&&o!==void 0?o:t.defaultProps.shouldCloseOnSelect)&&((c=(l=r.props).setOpen)===null||c===void 0||c.c
3774all(l,!1))},r.formatWeekNumber=function(n){return r.props.formatWeekNumber?r.props.formatWeekNumber(n):w2e(n)},r.isWeekDisabled=function(){for(var n=r.startOfWeek(),a=go(n,6),i=new Date(n);i<=a;){if(!r.isDisabled(i))return!1;i=go(i,1)}return!0},r.renderDays=function(){var n=r.startOfWeek(),a=[],i=r.formatWeekNumber(n);if(r.props.showWeekNumber){var o=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,n,i):void 0;a.push(U.createElement(B2e,Ar({key:"W"},t.defaultProps,r.props,{weekNumber:i,isWeekDisabled:r.isWeekDisabled(),date:n,onClick:o})))}return a.concat([0,1,2,3,4,5,6].map(function(l){var c=go(n,l);return U.createElement(z2e,Ar({},t.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:c.valueOf(),day:c,onClick:r.handleDayClick.bind(r,c),onMouseEnter:r.handleDayMouseEnter.bind(r,c)}))}))},r.startOfWeek=function(){return yu(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!Tr(r.startOfWeek(),r.props.selected)&&Tr(r.startOfWeek(),r.props.preSelection)},r}return Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var r={"react-datepicker__week":!0,"react-datepicker__week--selected":Tr(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},n=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return U.createElement("div",{className:Jt(r,n),role:"row"},this.renderDays())},t}(b.Component),tg,V2e=6,Cm={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},rS=(tg={},tg[Cm.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},tg[Cm.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},tg[Cm.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},tg),nv=1;function vD(e,t){return e?Cm.FOUR_COLUMNS:t?Cm.TWO_COLUMNS:Cm.THREE_COLUMNS}var W2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.MONTH_REFS=qo([],Array(12),!0).map(function(){return b.createRef()}),r.QUARTER_REFS=qo([],Array(4),!0).map(function(){return b.createRef()}),r.isDisabled=function(n){return Ci(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(n){return BE(n,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(n,a){var i,o;
3774(o=(i=r.props).onDayClick)===null||o===void 0||o.call(i,n,a,r.props.orderInDisplay)},r.handleDayMouseEnter=function(n){var a,i;(i=(a=r.props).onDayMouseEnter)===null||i===void 0||i.call(a,n)},r.handleMouseLeave=function(){var n,a;(a=(n=r.props).onMouseLeave)===null||a===void 0||a.call(n)},r.isRangeStartMonth=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:ks(Si(i,n),o)},r.isRangeStartQuarter=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:h1(am(i,n),o)},r.isRangeEndMonth=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:ks(Si(i,n),l)},r.isRangeEndQuarter=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:h1(am(i,n),l)},r.isInSelectingRangeMonth=function(n){var a,i=r.props,o=i.day,l=i.selectsStart,c=i.selectsEnd,u=i.selectsRange,d=i.startDate,f=i.endDate,m=(a=r.props.selectingDate)!==null&&a!==void 0?a:r.props.preSelection;return!(l||c||u)||!m?!1:l&&f?Xb(m,f,n,o):c&&d||u&&d&&!f?Xb(d,m,n,o):!1},r.isSelectingMonthRangeStart=function(n){var a;if(!r.isInSelectingRangeMonth(n))return!1;var i=r.props,o=i.day,l=i.startDate,c=i.selectsStart,u=Si(o,n),d=(a=r.props.selectingDate)!==null&&a!==void 0?a:r.props.preSelection;return c?ks(u,d):ks(u,l)},r.isSelectingMonthRangeEnd=function(n){var a;if(!r.isInSelectingRangeMonth(n))return!1;var i=r.props,o=i.day,l=i.endDate,c=i.selectsEnd,u=i.selectsRange,d=Si(o,n),f=(a=r.props.selectingDate)!==null&&a!==void 0?a:r.props.preSelection;return c||u?ks(d,f):ks(d,l)},r.isInSelectingRangeQuarter=function(n){var a,i=r.props,o=i.day,l=i.selectsStart,c=i.selectsEnd,u=i.selectsRange,d=i.startDate,f=i.endDate,m=(a=r.props.selectingDate)!==null&&a!==void 0?a:r.props.preSelection;return!(l||c||u)||!m?!1:l&&f?rv(m,f,n,o):c&&d||u&&d&&!f?rv(d,m,n,o):!1},r.isWeekInMonth=function(n){var a=r.props.day,i=go(n,6);return ks(n,a)||ks(i,a)},r.isCurrentMonth=function(n,a){return jr(n)===jr(cn())&&a===hs(cn())},r.isCurrentQuarter=function(n,a){return jr(n)===jr(cn())&&a===Od(cn())},r.isSelectedMonth=function(n,a,i){return hs(i)===a&&jr(n)===jr(i)},r.isSelectMonthInList=function(n,a,i){return i.some(function(o){return r.isSelectedMonth(n,a,o)})},r.isSelectedQuarter=function(n,a,i){return Od(n)===a&&jr(n)===jr(i)},r.isMonthSelected=function(){var n=r.props,a=n.day,i=n.selected,o=n.selectedDates,l=n.selectsMultiple,c=hs(a);return l?o==null?void 0:o.some(function(u){return r.isSelectedMonth(a,c,u)}):!!i&&r.isSelectedMonth(a,c,i)},r.renderWeeks=function(){for(var n=[],a=r.props.fixedHeight,i=0,o=!1,l=yu(Kl(r.props.day),r.props.locale,r.props.calendarStartDay),c=function(p){return r.props.showWeekPicker?yu(p,r.props.locale,r.props.calendarStartDay):r.props.preSelection},u=function(p){return r.props.showWeekPicker?yu(p,r.props.locale,r.props.calendarStartDay):r.props.selected},d=r.props.selected?u(r.props.selected):void 0,f=r.props.preSelection?c(r.props.preSelection):void 0;n.push(U.createElement(U2e,Ar({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:i,day:l,month:hs(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:d,preSelection:f,showWeekNumber:r.props.showWeekNumbers}))),!o;){i++,l=n1(l,1);var m=a&&i>=V2e,h=!a&&!r.isWeekInMonth(l);if(m||h)if(r.props.peekNextMonth)o=!0;else break}return n},r.onMonthClick=function(n,a){var i=r.isMonthDisabledForLabelDate(a),o=i.isDisabled,l=i.labelDate;o||r.handleDayClick(Kl(l),n)},r.onMonthMouseEnter=function(n){var a=r.isMonthDisabledForLabelDate(n),i=a.isDisabled,o=a.labelDate;i||r.handleDayMouseEnter(Kl(o))},r.handleMonthNavigation=function(n,a){var i,o,l,c;(o=(i=r.props).setPreSelection)===null||o===void 0||o.call(i,a),(c=(l=r.MONTH_REFS[n])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus()},r.handleKeyboardNavigation=function(n,a,i){var o,l=r.props,c=l.selected,u=l.preSelection,d=l.setPreSelection,f=l.minDate,m=l.maxDate,h=l.showFourColumnMonthYearPicker,p=l.showTwoColumnMonthYearPicker;if(u){var g=vD(h,p),y=r.getVerticalOffset(g),v=(o=rS[g])===null||o===void 0?void 0:o.grid,x=function(M,k,I){var T,L,R=k,_=I;switch(M){case Ct.ArrowRight:R=xo(k,nv),_=I===11?0:I+nv;break;
3774case Ct.ArrowLeft:R=Rd(k,nv),_=I===0?11:I-nv;break;case Ct.ArrowUp:R=Rd(k,y),_=!((T=v==null?void 0:v[0])===null||T===void 0)&&T.includes(I)?I+12-y:I-y;break;case Ct.ArrowDown:R=xo(k,y),_=!((L=v==null?void 0:v[v.length-1])===null||L===void 0)&&L.includes(I)?I-12+y:I+y;break}return{newCalculatedDate:R,newCalculatedMonth:_}},j=function(M,k,I){for(var T=40,L=M,R=!1,_=0,B=x(L,k,I),z=B.newCalculatedDate,D=B.newCalculatedMonth;!R;){if(_>=T){z=k,D=I;break}if(f&&z<f){L=Ct.ArrowRight;var A=x(L,z,D);z=A.newCalculatedDate,D=A.newCalculatedMonth}if(m&&z>m){L=Ct.ArrowLeft;var A=x(L,z,D);z=A.newCalculatedDate,D=A.newCalculatedMonth}if(E2e(z,r.props)){var A=x(L,z,D);z=A.newCalculatedDate,D=A.newCalculatedMonth}else R=!0;_++}return{newCalculatedDate:z,newCalculatedMonth:D}};if(a===Ct.Enter){r.isMonthDisabled(i)||(r.onMonthClick(n,i),d==null||d(c));return}var C=j(a,u,i),N=C.newCalculatedDate,S=C.newCalculatedMonth;switch(a){case Ct.ArrowRight:case Ct.ArrowLeft:case Ct.ArrowUp:case Ct.ArrowDown:r.handleMonthNavigation(S,N);break}}},r.getVerticalOffset=function(n){var a,i;return(i=(a=rS[n])===null||a===void 0?void 0:a.verticalNavigationOffset)!==null&&i!==void 0?i:0},r.onMonthKeyDown=function(n,a){var i=r.props,o=i.disabledKeyboardNavigation,l=i.handleOnMonthKeyDown,c=n.key;c!==Ct.Tab&&n.preventDefault(),o||r.handleKeyboardNavigation(n,c,a),l&&l(n)},r.onQuarterClick=function(n,a){var i=am(r.props.day,a);ev(i,r.props)||r.handleDayClick(sD(i),n)},r.onQuarterMouseEnter=function(n){var a=am(r.props.day,n);ev(a,r.props)||r.handleDayMouseEnter(sD(a))},r.handleQuarterNavigation=function(n,a){var i,o,l,c;r.isDisabled(a)||r.isExcluded(a)||((o=(i=r.props).setPreSelection)===null||o===void 0||o.call(i,a),(c=(l=r.QUARTER_REFS[n-1])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus())},r.onQuarterKeyDown=function(n,a){var i,o,l=n.key;if(!r.props.disabledKeyboardNavigation)switch(l){case Ct.Enter:r.onQuarterClick(n,a),(o=(i=r.props).setPreSelection)===null||o===void 0||o.call(i,r.props.selected);break;case Ct.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(a===4?1:a+1,IE(r.props.preSelection,1));break;case Ct.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(a===1?4:a-1,v8(r.props.preSelection));break}},r.isMonthDisabledForLabelDate=function(n){var a,i=r.props,o=i.day,l=i.minDate,c=i.maxDate,u=i.excludeDates,d=i.includeDates,f=Si(o,n);return{isDisabled:(a=(l||c||u||d)&&L8(f,r.props))!==null&&a!==void 0?a:!1,labelDate:f}},r.isMonthDisabled=function(n){var a=r.isMonthDisabledForLabelDate(n).isDisabled;return a},r.getMonthClassNames=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate,c=a.preSelection,u=a.monthClassName,d=u?u(Si(i,n)):void 0,f=r.getSelection();return Jt("react-datepicker__month-text","react-datepicker__month-".concat(n),d,{"react-datepicker__month-text--disabled":r.
3774isMonthDisabled(n),"react-datepicker__month-text--selected":f?r.isSelectMonthInList(i,n,f):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&c&&r.isSelectedMonth(i,n,c)&&!r.isMonthSelected()&&!r.isMonthDisabled(n),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(n),"react-datepicker__month-text--in-range":o&&l?Xb(o,l,n,i):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(n),"react-datepicker__month-text--range-end":r.isRangeEndMonth(n),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(n),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(n),"react-datepicker__month-text--today":r.isCurrentMonth(i,n)})},r.getTabIndex=function(n){if(r.props.preSelection==null)return"-1";var a=hs(r.props.preSelection),i=r.isMonthDisabledForLabelDate(a).isDisabled,o=n===a&&!(i||r.props.disabledKeyboardNavigation)?"0":"-1";return o},r.getQuarterTabIndex=function(n){if(r.props.preSelection==null)return"-1";var a=Od(r.props.preSelection),i=ev(r.props.day,r.props),o=n===a&&!(i||r.props.disabledKeyboardNavigation)?"0":"-1";return o},r.getAriaLabel=function(n){var a=r.props,i=a.chooseDayAriaLabelPrefix,o=i===void 0?"Choose":i,l=a.disabledDayAriaLabelPrefix,c=l===void 0?"Not available":l,u=a.day,d=a.locale,f=Si(u,n),m=r.isDisabled(f)||r.isExcluded(f)?c:o;return"".concat(m," ").concat(Bn(f,"MMMM yyyy",d))},r.getQuarterClassNames=function(n){var a=r.props,i=a.day,o=a.startDate,l=a.endDate,c=a.selected,u=a.minDate,d=a.maxDate,f=a.excludeDates,m=a.includeDates,h=a.filterDate,p=a.preSelection,g=a.disabledKeyboardNavigation,y=(u||d||f||m||h)&&ev(am(i,n),r.props);return Jt("react-datepicker__quarter-text","react-datepicker__quarter-".concat(n),{"react-datepicker__quarter-text--disabled":y,"react-datepicker__quarter-text--selected":c?r.isSelectedQuarter(i,n,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!g&&p&&r.isSelectedQuarter(i,n,p)&&!y,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(n),"react-datepicker__quarter-text--in-range":o&&l?rv(o,l,n,i):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(n),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(n),"react-datepicker__quarter-text--today":r.
3774isCurrentQuarter(i,n)})},r.getMonthContent=function(n){var a=r.props,i=a.showFullMonthYearPicker,o=a.renderMonthContent,l=a.locale,c=a.day,u=_8(n,l),d=zE(n,l);return o?o(n,u,d,c):i?d:u},r.getQuarterContent=function(n){var a,i=r.props,o=i.renderQuarterContent,l=i.locale,c=I2e(n,l);return(a=o==null?void 0:o(n,c))!==null&&a!==void 0?a:c},r.renderMonths=function(){var n,a=r.props,i=a.showTwoColumnMonthYearPicker,o=a.showFourColumnMonthYearPicker,l=a.day,c=a.selected,u=(n=rS[vD(o,i)])===null||n===void 0?void 0:n.grid;return u==null?void 0:u.map(function(d,f){return U.createElement("div",{className:"react-datepicker__month-wrapper",key:f},d.map(function(m,h){return U.createElement("div",{ref:r.MONTH_REFS[m],key:h,onClick:function(p){r.onMonthClick(p,m)},onKeyDown:function(p){R8(p)&&(p.preventDefault(),p.key=Ct.Enter),r.onMonthKeyDown(p,m)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(m)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(m)}:void 0,tabIndex:Number(r.getTabIndex(m)),className:r.getMonthClassNames(m),"aria-disabled":r.
vendor: 11,418 bytes, line 3774
3774isMonthDisabled(m),role:"option","aria-label":r.getAriaLabel(m),"aria-current":r.isCurrentMonth(l,m)?"date":void 0,"aria-selected":c?r.isSelectedMonth(l,m,c):void 0},r.getMonthContent(m))}))})},r.renderQuarters=function(){var n=r.props,a=n.day,i=n.selected,o=[1,2,3,4];return U.createElement("div",{className:"react-datepicker__quarter-wrapper"},o.map(function(l,c){return U.createElement("div",{key:c,ref:r.QUARTER_REFS[c],role:"option",onClick:function(u){r.onQuarterClick(u,l)},onKeyDown:function(u){r.onQuarterKeyDown(u,l)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(l)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(l)}:void 0,className:r.getQuarterClassNames(l),"aria-selected":i?r.isSelectedQuarter(a,l,i):void 0,tabIndex:Number(r.getQuarterTabIndex(l)),"aria-current":r.isCurrentQuarter(a,l)?"date":void 0},r.getQuarterContent(l))}))},r.getClassNames=function(){var n=r.props,a=n.selectingDate,i=n.selectsStart,o=n.selectsEnd,l=n.showMonthYearPicker,c=n.showQuarterYearPicker,u=n.showWeekPicker;return Jt("react-datepicker__month",{"react-datepicker__month--selecting-range":a&&(i||o)},{"react-datepicker__monthPicker":l},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":u})},r}return t.prototype.getSelection=function(){var r=this.props,n=r.selected,a=r.selectedDates,i=r.selectsMultiple;if(i)return a;if(n)return[n]},t.prototype.render=function(){var r=this.props,n=r.showMonthYearPicker,a=r.showQuarterYearPicker,i=r.day,o=r.ariaLabelPrefix,l=o===void 0?"Month ":o,c=l?l.trim()+" ":"",u=n||a;return u?U.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(Bn(i,"MMMM, yyyy",this.props.locale)),role:"listbox"},n?this.renderMonths():this.renderQuarters()):U.createElement("div",{role:"table"},this.props.dayNamesHeader&&U.createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),U.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(Bn(i,"MMMM, yyyy",this.props.locale)),role:"rowgroup"},this.renderWeeks()))},t}(b.Component),q2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.monthOptionButtonsRef={},r.isSelectedMonth=function(n){return r.props.month===n},r.handleOptionKeyDown=function(n,a){var i;switch(a.key){case"Enter":a.preventDefault(),r.onChange(n);break;case"Escape":a.preventDefault(),r.props.onCancel();break;case"ArrowUp":case"ArrowDown":{a.preventDefault();var o=(n+(a.key==="ArrowUp"?-1:1)+r.props.monthNames.length)%r.props.monthNames.length;(i=r.monthOptionButtonsRef[o])===null||i===void 0||i.focus();break}}},r.renderOptions=function(){return r.monthOptionButtonsRef={},r.props.monthNames.map(function(n,a){return U.createElement("div",{ref:function(i){r.monthOptionButtonsRef[a]=i,r.isSelectedMonth(a)&&(i==null||i.focus())},role:"button",tabIndex:0,className:r.isSelectedMonth(a)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:n,onClick:r.onChange.bind(r,a),onKeyDown:r.handleOptionKeyDown.bind(r,a),"aria-selected":r.isSelectedMonth(a)?"true":void 0},r.isSelectedMonth(a)?U.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",n)})},r.onChange=function(n){return r.props.onChange(n)},r.handleClickOutside=function(){return r.props.onCancel()},r}return t.prototype.render=function(){return U.createElement(z2,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t}(b.Component),G2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(n){return n.map(function(a,i){return U.createElement("option",{key:a,value:i},a)})},r.renderSelectMode=function(n){return U.createElement("select",{value:r.props.month,className:"react-datepicker__month-select",onChange:function(a){return r.onChange(parseInt(a.target.value))}},r.renderSelectOptions(n))},r.renderReadView=function(n,a){return U.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:r.toggleDropdown},U.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),U.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},a[r.props.month]))},r.renderDropdown=function(n){return U.createElement(q2e,Ar({key:"dropdown"},r.props,{monthNames:n,onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(n){var a=r.state.dropdownVisible,i=[r.renderReadView(!a,n)];return a&&i.unshift(r.renderDropdown(n)),i},r.onChange=function(n){r.toggleDropdown(),n!==r.props.month&&r.props.onChange(n)},r.toggleDropdown=function(){return r.setState({dropdownVisible:!r.state.dropdownVisible})},r}return t.prototype.render=function(){var r=this,n=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(i){return _8(i,r.props.locale)}:function(i){return zE(i,r.props.locale)}),a;switch(this.props.dropdownMode){case"scroll":a=this.renderScrollMode(n);break;case"select":a=this.renderSelectMode(n);break}return U.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},a)},t}(b.Component);function H2e(e,t){for(var r=[],n=Kl(e),a=Kl(t);!Tu(n,a);)r.push(cn(n)),n=xo(n,1);return r}var Y2e=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.renderOptions=function(){return n.state.monthYearsList.map(function(a){var i=_k(a),o=Ro(n.props.date,a)&&ks(n.props.date,a);return U.createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:i,onClick:n.onChange.bind(n,i),"aria-selected":o?"true":void 0},o?U.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",Bn(a,n.props.dateFormat,n.props.locale))})},n.onChange=function(a){return n.props.onChange(a)},n.handleClickOutside=function(){n.props.onCancel()},n.state={monthYearsList:H2e(n.props.minDate,n.props.maxDate)},n}return t.prototype.render=function(){var r=Jt({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return U.createElement(z2,{className:r,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(b.Component),Q2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(){for(var n=Kl(r.props.minDate),a=Kl(r.props.maxDate),i=[];!Tu(n,a);){var o=_k(n);i.push(U.createElement("option",{key:o,value:o},Bn(n,r.props.dateFormat,r.props.locale))),n=xo(n,1)}return i},r.onSelectChange=function(n){r.onChange(parseInt(n.target.value))},r.renderSelectMode=function(){return U.createElement("select",{value:_k(Kl(r.props.date)),className:"react-datepicker__month-year-select",onChange:r.onSelectChange},r.renderSelectOptions())},r.renderReadView=function(n){var a=Bn(r.props.date,r.props.dateFormat,r.props.locale);return U.createElement("div",{key:"read",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:r.toggleDropdown},U.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),U.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},a))},r.renderDropdown=function(){return U.createElement(Y2e,Ar({key:"dropdown"},r.props,{onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(){var n=r.state.dropdownVisible,a=[r.renderReadView(!n)];return n&&a.unshift(r.renderDropdown()),a},r.onChange=function(n){r.toggleDropdown();var a=cn(n);Ro(r.props.date,a)&&ks(r.props.date,a)||r.props.onChange(a)},r.toggleDropdown=function(){return r.setState({dropdownVisible:!r.state.dropdownVisible})},r}return t.prototype.render=function(){var r;switch(this.props.dropdownMode){case"scroll":r=this.renderScrollMode();break;case"select":r=this.renderSelectMode();break}return U.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},r)},t}(b.Component),K2e=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var n,a,i;r.list&&(r.list.scrollTop=(i=r.centerLi&&t.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-((a=(n=r.header)===null||n===void 0?void 0:n.clientHeight)!==null&&a!==void 0?a:0):r.list.clientHeight,r.centerLi))!==null&&i!==void 0?i:0)})},r.handleClick=function(n){var a,i;(r.props.minTime||r.props.maxTime)&&uD(n,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&cD(n,r.props)||(i=(a=r.props).onChange)===null||i===void 0||i.call(a,n)},r.isSelectedTime=function(n){return r.props.selected&&$2e(r.props.selected,n)},r.isDisabledTime=function(n){return(r.props.minTime||r.props.maxTime)&&uD(n,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&cD(n,r.props)},r.liClasses=function(n){var a,i=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(n):void 0];return r.isSelectedTime(n)&&i.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(n)&&i.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(Yl(n)*3600+Ql(n)*60+gu(n))%(((a=r.props.intervals)!==null&&a!==void 0?a:t.defaultProps.intervals)*60)!==0&&i.push("react-datepicker__time-list-item--injected"),i.join(" ")},r.handleOnKeyDown=function(n,a){var i,o;n.key===Ct.Space&&(n.preventDefault(),n.key=Ct.Enter),(n.key===Ct.ArrowUp||n.key===Ct.ArrowLeft)&&n.target instanceof HTMLElement&&n.target.previousSibling&&(n.preventDefault(),n.target.previousSibling instanceof HTMLElement&&n.target.previousSibling.focus()),(n.key===Ct.ArrowDown||n.key===Ct.ArrowRight)&&n.target instanceof HTMLElement&&n.target.nextSibling&&(n.preventDefault(),n.target.nextSibling instanceof HTMLElement&&n.target.nextSibling.focus()),n.key===Ct.Enter&&r.handleClick(a),(o=(i=r.props).handleOnKeyDown)===null||o===void 0||o.call(i,n)},r.renderTimes=function(){for(var n,a=[],i=typeof r.props.format=="string"?r.props.format:"p",o=(n=r.props.intervals)!==null&&n!==void 0?n:t.defaultProps.intervals,l=r.props.selected||r.props.openToDate||cn(),c=Zv(l),u=r.props.injectTimes&&r.props.injectTimes.sort(function(y,v){return y.getTime()-v.getTime()}),d=60*R2e(l),f=d/o,m=0;m<f;m++){var h=Tk(c,m*o);if(a.push(h),u){var p=O2e(c,h,m,o,u);a=a.concat(p)}}var g=a.reduce(function(y,v){return v.getTime()<=l.getTime()?v:y},a[0]);return a.map(function(y){return U.createElement("li",{key:y.valueOf(),onClick:r.handleClick.bind(r,y),className:r.liClasses(y),ref:function(v){y===g&&(r.centerLi=v)},onKeyDown:function(v){r.handleOnKeyDown(v,y)},tabIndex:y===g?0:-1,role:"option","aria-selected":r.isSelectedTime(y)?"true":void 0,"aria-disabled":r.
3774isDisabledTime(y)?"true":void 0},Bn(y,i,r.props.locale))})},r.renderTimeCaption=function(){return r.props.showTimeCaption===!1?U.createElement(U.Fragment,null):U.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(n){r.header=n}},U.createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var r;(r=this.resizeObserver)===null||r===void 0||r.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var r=this,n=this.props.monthRef;this.updateContainerHeight(),n&&(this.resizeObserver=new ResizeObserver(function(){r.updateContainerHeight()}),this.resizeObserver.observe(n))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var r=this,n,a=this.state.height;return U.createElement("div",{className:"react-datepicker__time-container ".concat(((n=this.props.todayButton)!==null&&n!==void 0?n:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),U.createElement("div",{className:"react-datepicker__time"},U.createElement("div",{className:"react-datepicker__time-box"},U.createElement("ul",{className:"react-datepicker__time-list",ref:function(i){r.list=i},style:a?{height:a}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(r,n){return n.offsetTop-(r/2-n.clientHeight/2)},t}(b.Component),xD=3,J2e=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.YEAR_REFS=qo([],Array(n.props.yearItemNumber),!0).map(function(){return b.createRef()}),n.isDisabled=function(a){return Ci(a,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.isExcluded=function(a){return BE(a,{excludeDates:n.props.excludeDates})},n.selectingDate=function(){var a;return(a=n.props.selectingDate)!==null&&a!==void 0?a:n.props.preSelection},n.updateFocusOnPaginate=function(a){var i=function(){var o,l;(l=(o=n.YEAR_REFS[a])===null||o===void 0?void 0:o.current)===null||l===void 0||l.focus()};window.requestAnimationFrame(i)},n.handleYearClick=function(a,i){n.props.onDayClick&&n.props.onDayClick(a,i)},n.handleYearNavigation=function(a,i){var o,l,c,u,d=n.props,f=d.date,m=d.yearItemNumber;if(!(f===void 0||m===void 0)){var h=Ol(f,m).startPeriod;n.isDisabled(i)||n.isExcluded(i)||((l=(o=n.props).setPreSelection)===null||l===void 0||l.call(o,i),a-h<0?n.updateFocusOnPaginate(m-(h-a)):a-h>=m?n.updateFocusOnPaginate(Math.abs(m-(a-h))):(u=(c=n.YEAR_REFS[a-h])===null||c===void 0?void 0:c.current)===null||u===void 0||u.focus())}},n.isSameDay=function(a,i){return Tr(a,i)},n.isCurrentYear=function(a){return a===jr(cn())},n.isRangeStart=function(a){return n.props.startDate&&n.props.endDate&&Ro(To(cn(),a),n.props.startDate)},n.isRangeEnd=function(a){return n.props.startDate&&n.props.endDate&&Ro(To(cn(),a),n.props.endDate)},n.isInRange=function(a){return tv(a,n.props.startDate,n.props.endDate)},n.isInSelectingRange=function(a){var i=n.props,o=i.selectsStart,l=i.selectsEnd,c=i.selectsRange,u=i.startDate,d=i.endDate;return!(o||l||c)||!n.selectingDate()?!1:o&&d?tv(a,n.selectingDate(),d):l&&u||c&&u&&!d?tv(a,u,n.selectingDate()):!1},n.isSelectingRangeStart=function(a){var i;if(!n.isInSelectingRange(a))return!1;var o=n.props,l=o.startDate,c=o.selectsStart,u=To(cn(),a);return c?Ro(u,(i=n.selectingDate())!==null&&i!==void 0?i:null):Ro(u,l??null)},n.isSelectingRangeEnd=function(a){var i;if(!n.isInSelectingRange(a))return!1;var o=n.props,l=o.endDate,c=o.selectsEnd,u=o.selectsRange,d=To(cn(),a);return c||u?Ro(d,(i=n.selectingDate())!==null&&i!==void 0?i:null):Ro(d,l??null)}
3774,n.isKeyboardSelected=function(a){if(!(n.props.disabledKeyboardNavigation||n.props.date===void 0||n.props.preSelection==null)){var i=n.props,o=i.minDate,l=i.maxDate,c=i.excludeDates,u=i.includeDates,d=i.filterDate,f=i.selected,m=Ag(To(n.props.date,a)),h=(o||l||c||u||d)&&Xv(a,n.props),p=!!f&&Tr(m,Ag(f)),g=Tr(m,Ag(n.props.preSelection));return!n.props.inline&&!p&&g&&!h}},n.isSelectedYear=function(a){var i=n.props,o=i.selectsMultiple,l=i.selected,c=i.selectedDates;return o?c==null?void 0:c.some(function(u){return a===jr(u)}):!!l&&a===jr(l)},n.onYearClick=function(a,i){var o=n.props.date;o!==void 0&&n.handleYearClick(Ag(To(o,i)),a)},n.onYearKeyDown=function(a,i){var o,l,c=a.key,u=n.props,d=u.date,f=u.yearItemNumber,m=u.handleOnKeyDown;if(c!==Ct.Tab&&a.preventDefault(),!n.props.disabledKeyboardNavigation)switch(c){case Ct.Enter:if(n.props.selected==null)break;n.onYearClick(a,i),(l=(o=n.props).setPreSelection)===null||l===void 0||l.call(o,n.props.selected);break;case Ct.ArrowRight:if(n.props.preSelection==null)break;n.handleYearNavigation(i+1,Gl(n.props.preSelection,1));break;case Ct.ArrowLeft:if(n.props.preSelection==null)break;n.handleYearNavigation(i-1,mh(n.props.preSelection,1));break;case Ct.ArrowUp:{if(d===void 0||f===void 0||n.props.preSelection==null)break;var h=Ol(d,f).startPeriod,p=xD,g=i-p;if(g<h){var y=f%p;i>=h&&i<h+y?p=y:p+=y,g=i-p}n.handleYearNavigation(g,mh(n.props.preSelection,p));break}case Ct.ArrowDown:{if(d===void 0||f===void 0||n.props.preSelection==null)break;var v=Ol(d,f).endPeriod,p=xD,g=i+p;if(g>v){var y=f%p;i<=v&&i>v-y?p=y:p+=y,g=i+p}n.handleYearNavigation(g,Gl(n.props.preSelection,p));break}}m&&m(a)},n.getYearClassNames=function(a){var i=n.props,o=i.date,l=i.minDate,c=i.maxDate,u=i.excludeDates,d=i.includeDates,f=i.filterDate,m=i.yearClassName;return Jt("react-datepicker__year-text","react-datepicker__year-".concat(a),o?m==null?void 0:m(To(o,a)):void 0,{"react-datepicker__year-text--selected":n.isSelectedYear(a),"react-datepicker__year-text--disabled":(l||c||u||d||f)&&Xv(a,n.props),"react-datepicker__year-text--keyboard-selected":n.isKeyboardSelected(a),"react-datepicker__year-text--range-start":n.isRangeStart(a),"react-datepicker__year-text--range-end":n.isRangeEnd(a),"react-datepicker__year-text--in-range":n.isInRange(a),"react-datepicker__year-text--in-selecting-range":n.isInSelectingRange(a),"react-datepicker__year-text--selecting-range-start":n.isSelectingRangeStart(a),"react-datepicker__year-text--selecting-range-end":n.isSelectingRangeEnd(a),"react-datepicker__year-text--today":n.isCurrentYear(a)})},n.getYearTabIndex=function(a){if(n.props.disabledKeyboardNavigation||n.props.preSelection==null)return"-1";var i=jr(n.props.preSelection),o=Xv(a,n.props);return a===i&&!o?"0":"-1"},n.getYearContent=function(a){return n.props.renderYearContent?n.props.renderYearContent(a):a},n}return t.prototype.render=function(){var r=this,n=[],a=this.props,i=a.date,o=a.yearItemNumber,l=a.onYearMouseEnter,c=a.onYearMouseLeave;if(i===void 0)return null;for(var u=Ol(i,o),d=u.startPeriod,f=u.endPeriod,m=function(g){n.push(U.createElement("div",{ref:h.YEAR_REFS[g-d],onClick:function(y){r.onYearClick(y,g)},onKeyDown:function(y){R8(y)&&(y.preventDefault(),y.key=Ct.Enter),r.onYearKeyDown(y,g)},tabIndex:Number(h.getYearTabIndex(g)),className:h.getYearClassNames(g),onMouseEnter:h.props.usePointerEvent?void 0:function(y){return l(y,g)},onPointerEnter:h.props.usePointerEvent?function(y){return l(y,g)}:void 0,onMouseLeave:h.props.usePointerEvent?void 0:function(y){return c(y,g)},onPointerLeave:h.props.usePointerEvent?function(y){return c(y,g)}:void 0,key:g,"aria-current":h.isCurrentYear(g)?"date":void 0},h.getYearContent(g)))},h=this,p=d;p<=f;p++)m(p);return U.createElement("div",{className:"react-datepicker__year"},U.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},n))},t}(b.Component);function Z2e(e,t,r,n){for(var a=[],i=0;i<2*t+1;i++){var o=e+t-i,l=!0;r&&(l=jr(r)<=o),n&&l&&(l=jr(n)>=o),l&&a.push(o)}return a}var X2e=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;n.yearOptionButtonsRef={},n.handleOptionKeyDown=function(l,c){var u;switch(c.key){case"Enter":c.preventDefault(),n.onChange(l);break;case"Escape":c.preventDefault(),n.props.onCancel();break;case"ArrowUp":case"ArrowDown":{c.preventDefault();var d=l+(c.key==="ArrowUp"?1:-1);n.yearOptionButtonsRef[d]&&((u=n.yearOptionButtonsRef[d])===null||u===void 0||u.focus());break}}},n.renderOptions=function(){n.yearOptionButtonsRef={};var l=n.props.year,c=n.state.yearsList.map(function(f){return U.createElement("div",{ref:function(m){n.yearOptionButtonsRef[f]=m,f===l&&(m==null||m.focus())},role:"button",tabIndex:0,className:l===f?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:f,onClick:n.onChange.bind(n,f),onKeyDown:n.handleOptionKeyDown.bind(n,f),"aria-selected":l===f?"true":void 0},l===f?U.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",f)}),u=n.props.minDate?jr(n.props.minDate):null,d=n.props.maxDate?jr(n.props.maxDate):null;return(!d||!n.state.yearsList.find(function(f){return f===d}))&&c.unshift(U.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:n.incrementYears},U.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!u||!n.state.yearsList.find(function(f){return f===u}))&&c.push(U.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:n.decrementYears},U.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},n.onChange=function(l){n.props.onChange(l)},n.handleClickOutside=function(){n.props.onCancel()},n.shiftYears=function(l){var c=n.state.yearsList.map(function(u){return u+l});n.setState({yearsList:c})},n.incrementYears=function(){return n.shiftYears(1)},n.decrementYears=function(){return n.shiftYears(-1)};var a=r.yearDropdownItemNumber,i=r.scrollableYearDropdown,o=a||(i?10:5);return n.state={yearsList:Z2e(n.props.year,o,n.props.minDate,n.props.maxDate)},n.dropdownRef=b.createRef(),n}return t.prototype.componentDidMount=function(){var r=this.dropdownRef.current;if(r){var n=r.children?Array.from(r.children):null,a=n?n.find(function(i){return i.ariaSelected}):null;r.scrollTop=a&&a instanceof HTMLElement?a.offsetTop+(a.clientHeight-r.clientHeight)/2:(r.scrollHeight-r.clientHeight)/2}},t.prototype.render=function(){var r=Jt({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return U.createElement(z2,{className:r,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(b.Component),eje=function(e){as(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(){for(var n=r.props.minDate?jr(r.props.minDate):1900,a=r.props.maxDate?jr(r.props.maxDate):2100,i=[],o=n;o<=a;o++)i.push(U.createElement("option",{key:o,value:o},o));return i},r.onSelectChange=function(n){r.onChange(parseInt(n.target.value))},r.renderSelectMode=function(){return U.createElement("select",{value:r.props.year,className:"react-datepicker__year-select",onChange:r.onSelectChange},r.renderSelectOptions())},r.renderReadView=function(n){return U.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:r.toggleDropdown},U.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),U.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},r.props.year))},r.renderDropdown=function(){return U.createElement(X2e,Ar({key:"dropdown"},r.props,{onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(){var n=r.state.dropdownVisible,a=[r.renderReadView(!n)];return n&&a.unshift(r.renderDropdown()),a},r.onChange=function(n){r.toggleDropdown(),n!==r.props.year&&r.props.onChange(n)},r.toggleDropdown=function(n){r.setState({dropdownVisible:!r.state.dropdownVisible},function(){r.props.adjustDateOnChange&&r.handleYearChange(r.props.date,n)})},r.handleYearChange=function(n,a){var i;(i=r.onSelect)===null||i===void 0||i.call(r,n,a),r.setOpen()},r.onSelect=function(n,a){var i,o;(o=(i=r.props).onSelect)===null||o===void 0||o.call(i,n,a)},r.setOpen=function(){var n,a;(a=(n=r.props).setOpen)===null||a===void 0||a.call(n,!0)},r}return t.prototype.render=function(){var r;switch(this.props.dropdownMode){case"scroll":r=this.renderScrollMode();break;case"select":r=this.renderSelectMode();break}return U.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},r)},t}(b.Component),tje=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],$8="react-datepicker-ignore-onclickoutside",rje=function(e){var t=(e.className||"").split(/\s+/);return tje.some(function(r){return t.indexOf(r)>=0})},nje=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.monthContainer=void 0,n.handleClickOutside=function(a){n.props.onClickOutside(a)},n.setClickOutsideRef=function(){return n.containerRef.current},n.handleDropdownFocus=function(a){var i,o;rje(a.target)&&((o=(i=n.props).onDropdownFocus)===null||o===void 0||o.call(i,a))},n.getDateInView=function(){var a=n.props,i=a.preSelection,o=a.selected,l=a.openToDate,c=D8(n.props),u=O8(n.props),d=cn(),f=l||o||i;return f||(c&&Wo(d,c)?c:u&&Tu(d,u)?u:d)},n.increaseMonth=function(){n.setState(function(a){var i=a.date;return{date:xo(i,1)}},function(){return n.handleMonthChange(n.state.date)})},n.decreaseMonth=function(){n.setState(function(a){var i=a.date;return{date:Rd(i,1)}},function(){return n.handleMonthChange(n.state.date)})},n.handleDayClick=function(a,i,o){n.props.onSelect(a,i,o),n.props.setPreSelection&&n.props.setPreSelection(a)},n.handleDayMouseEnter=function(a){n.setState({selectingDate:a}),n.props.onDayMouseEnter&&n.props.onDayMouseEnter(a)},n.handleMonthMouseLeave=function(){n.setState({selectingDate:void 0}),n.props.onMonthMouseLeave&&n.props.onMonthMouseLeave()},n.handleYearMouseEnter=function(a,i){n.setState({selectingDate:To(cn(),i)}),n.props.onYearMouseEnter&&n.props.onYearMouseEnter(a,i)},n.handleYearMouseLeave=function(a,i){n.props.onYearMouseLeave&&n.props.onYearMouseLeave(a,i)},n.handleYearChange=function(a){var i,o,l,c;(o=(i=n.props).onYearChange)===null||o===void 0||o.call(i,a),n.setState({isRenderAriaLiveMessage:!0}),n.props.adjustDateOnChange&&(n.props.onSelect(a),(c=(l=n.props).setOpen)===null||c===void 0||c.c
3774all(l,!0)),n.props.setPreSelection&&n.props.setPreSelection(a)},n.getEnabledPreSelectionDateForMonth=function(a){if(!Ci(a,n.props))return a;for(var i=Kl(a),o=S2e(a),l=Dve(o,i),c=null,u=0;u<=l;u++){var d=go(i,u);if(!Ci(d,n.props)){c=d;break}}return c},n.handleMonthChange=function(a){var i,o,l,c=(i=n.getEnabledPreSelectionDateForMonth(a))!==null&&i!==void 0?i:a;n.handleCustomMonthChange(c),n.props.adjustDateOnChange&&(n.props.onSelect(c),(l=(o=n.props).setOpen)===null||l===void 0||l.call(o,!0)),n.props.setPreSelection&&n.props.setPreSelection(c)},n.handleCustomMonthChange=function(a){var i,o;(o=(i=n.props).onMonthChange)===null||o===void 0||o.call(i,a),n.setState({isRenderAriaLiveMessage:!0})},n.handleMonthYearChange=function(a){n.handleYearChange(a),n.handleMonthChange(a)},n.changeYear=function(a){n.setState(function(i){var o=i.date;return{date:To(o,Number(a))}},function(){return n.handleYearChange(n.state.date)})},n.changeMonth=function(a){n.setState(function(i){var o=i.date;return{date:Si(o,Number(a))}},function(){return n.handleMonthChange(n.state.date)})},n.changeMonthYear=function(a){n.setState(function(i){var o=i.date;return{date:To(Si(o,hs(a)),jr(a))}},function(){return n.handleMonthYearChange(n.state.date)})},n.header=function(a){a===void 0&&(a=n.state.date);var i=yu(a,n.props.locale,n.props.calendarStartDay),o=[];return n.props.showWeekNumbers&&o.push(U.createElement("div",{key:"W",className:"react-datepicker__day-name",role:"columnheader"},U.createElement("span",{className:"react-datepicker__sr-only"},"Week number"),U.createElement("span",{"aria-hidden":"true"},n.props.weekLabel||"#"))),o.concat([0,1,2,3,4,5,6].map(function(l){var c=go(i,l),u=n.formatWeekday(c,n.props.locale),d=n.props.weekDayClassName?n.props.weekDayClassName(c):void 0;return U.createElement("div",{key:l,role:"columnheader",className:Jt("react-datepicker__day-name",d)},U.createElement("span",{className:"react-datepicker__sr-only"},Bn(c,"EEEE",n.props.locale)),U.createElement("span",{"aria-hidden":"true"},u))}))},n.formatWeekday=function(a,i){return n.props.formatWeekDay?C2e(a,n.props.formatWeekDay,i):n.props.useWeekdaysShort?M2e(a,i):k2e(a,i)},n.decreaseYear=function(){n.setState(function(a){var i,o=a.date;return{date:mh(o,n.props.showYearPicker?(i=n.props.yearItemNumber)!==null&&i!==void 0?i:t.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.clearSelectingDate=function(){n.setState({selectingDate:void 0})},n.renderPreviousButton=function(){var a,i,o;if(!n.props.renderCustomHeader){var l=(a=n.props.monthsShown)!==null&&a!==void 0?a:t.defaultProps.monthsShown,c=n.props.showPreviousMonths?l-1:0,u=(i=n.props.monthSelectedIn)!==null&&i!==void 0?i:c,d=Rd(n.state.date,u),f;switch(!0){case n.props.showMonthYearPicker:f=mD(n.state.date,n.props);break;case n.props.showYearPicker:f=P2e(n.state.date,n.props);break;case n.props.showQuarterYearPicker:f=T2e(n.state.date,n.props);break;default:f=dD(d,n.props);break}if(!(!((o=n.props.forceShowMonthNavigation)!==null&&o!==void 0?o:t.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&f||n.props.showTimeSelectOnly)){var m=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],h=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=n.decreaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(p=n.decreaseYear),f&&n.props.showDisabledMonthNavigation&&(h.push("react-datepicker__navigation--previous--disabled"),p=void 0);var g=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,y=n.props,v=y.previousMonthButtonLabel,x=v===void 0?t.defaultProps.previousMonthButtonLabel:v,j=y.previousYearButtonLabel,C=j===void 0?t.defaultProps.previousYearButtonLabel:j,N=n.props,S=N.previousMonthAriaLabel,M=S===void 0?typeof x=="string"?x:"Previous Month":S,k=N.previousYearAriaLabel,I=k===void 0?typeof C=="string"?C:"Previous Year":k;return U.createElement("button",{type:"button",className:h.join(" "),onClick:p,onKeyDown:n.props.handleOnKeyDown,"aria-label":g?I:M},U.createElement("span",{className:m.join(" ")},g?C:x))}}},n.increaseYear=function(){n.setState(function(a){var i,o=a.date;return{date:Gl(o,n.props.showYearPicker?(i=n.props.yearItemNumber)!==null&&i!==void 0?i:t.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.renderNextButton=function(){var a;if(!n.props.renderCustomHeader){var i;switch(!0){case n.props.showMonthYearPicker:i=hD(n.state.date,n.props);break;case n.props.showYearPicker:i=_2e(n.state.date,n.props);break;case n.props.showQuarterYearPicker:i=A2e(n.state.date,n.props);break;default:i=fD(n.state.date,n.props);break}if(!(!((a=n.props.forceShowMonthNavigation)!==null&&a!==void 0?a:t.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&i||n.props.showTimeSelectOnly)){var o=["react-datepicker__navigation","react-datepicker__navigation--next"],l=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];n.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),n.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var c=n.increaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(c=n.increaseYear),i&&n.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),c=void 0);var u=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,d=n.props,f=d.nextMonthButtonLabel,m=f===void 0?t.defaultProps.nextMonthButtonLabel:f,h=d.nextYearButtonLabel,p=h===void 0?t.defaultProps.nextYearButtonLabel:h,g=n.props,y=g.nextMonthAriaLabel,v=y===void 0?typeof m=="string"?m:"Next Month":y,x=g.nextYearAriaLabel,j=x===void 0?typeof p=="string"?p:"Next Year":x;return U.createElement("button",{type:"button",className:o.join(" "),onClick:c,onKeyDown:n.props.handleOnKeyDown,"aria-label":u?j:v},U.createElement("span",{className:l.join(" ")},u?p:m))}}},n.renderCurrentMonth=function(a){a===void 0&&(a=n.state.date);var i=["react-datepicker__current-month"];return n.props.showYearDropdown&&i.push("react-datepicker__current-month--hasYearDropdown"),n.props.showMonthDropdown&&i.push("react-datepicker__current-month--hasMonthDropdown"),n.props.showMonthYearDropdown&&i.push("react-datepicker__current-month--hasMonthYearDropdown"),U.createElement("h2",{className:i.join(" ")},Bn(a,n.props.dateFormat,n.props.locale))}
3774,n.renderYearDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showYearDropdown||a))return U.createElement(eje,Ar({},t.defaultProps,n.props,{date:n.state.date,onChange:n.changeYear,year:jr(n.state.date)}))},n.renderMonthDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showMonthDropdown||a))return U.createElement(G2e,Ar({},t.defaultProps,n.props,{month:hs(n.state.date),onChange:n.changeMonth}))},n.renderMonthYearDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showMonthYearDropdown||a))return U.createElement(Q2e,Ar({},t.defaultProps,n.props,{date:n.state.date,onChange:n.changeMonthYear}))},n.handleTodayButtonClick=function(a){n.props.onSelect(iD(),a),n.props.setPreSelection&&n.props.setPreSelection(iD())},n.renderTodayButton=function(){if(!(!n.props.todayButton||n.props.showTimeSelectOnly))return U.createElement("div",{className:"react-datepicker__today-button",onClick:n.handleTodayButtonClick},n.props.todayButton)},n.renderDayNamesHeader=function(a){return U.createElement("div",{className:"react-datepicker__day-names",role:"row"},n.header(a))},n.renderDefaultHeader=function(a){var i=a.monthDate,o=a.i;return U.createElement("div",{className:"react-datepicker__header ".concat(n.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},n.renderCurrentMonth(i),U.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(n.props.dropdownMode),onFocus:n.handleDropdownFocus},n.renderMonthDropdown(o!==0),n.renderMonthYearDropdown(o!==0),n.renderYearDropdown(o!==0)))},n.renderCustomHeader=function(a){var i,o,l=a.monthDate,c=a.i;if(n.props.showTimeSelect&&!n.state.monthContainer||n.props.showTimeSelectOnly)return null;var u=n.props,d=u.showYearPicker,f=u.yearItemNumber,m;if(d){var h=Ol(l,f),p=h.startPeriod,g=h.endPeriod;m={startYear:p,endYear:g}}var y=dD(n.state.date,n.props),v=fD(n.state.date,n.props),x=mD(n.state.date,n.props),j=hD(n.state.date,n.props);return U.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:n.props.onDropdownFocus},(o=(i=n.props).renderCustomHeader)===null||o===void 0?void 0:o.call(i,Ar(Ar(Ar({},n.state),d&&{visibleYearsRange:m}),{customHeaderCount:c,monthDate:l,changeMonth:n.changeMonth,changeYear:n.changeYear,decreaseMonth:n.decreaseMonth,increaseMonth:n.increaseMonth,decreaseYear:n.decreaseYear,increaseYear:n.increaseYear,prevMonthButtonDisabled:y,nextMonthButtonDisabled:v,prevYearButtonDisabled:x,nextYearButtonDisabled:j})))},n.renderYearHeader=function(a){var i=a.monthDate,o=n.props,l=o.showYearPicker,c=o.yearItemNumber,u=c===void 0?t.defaultProps.yearItemNumber:c,d=Ol(i,u),f=d.startPeriod,m=d.endPeriod;return U.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},l?"".concat(f," - ").concat(m):jr(i))},n.renderHeader=function(a){var i=a.monthDate,o=a.i,l=o===void 0?0:o,c={monthDate:i,i:l};switch(!0){case n.props.renderCustomHeader!==void 0:return n.renderCustomHeader(c);case(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker):return n.renderYearHeader(c);default:return n.renderDefaultHeader(c)}},n.renderMonths=function(){var a,i;if(!(n.props.showTimeSelectOnly||n.props.showYearPicker)){for(var o=[],l=(a=n.props.monthsShown)!==null&&a!==void 0?a:t.defaultProps.monthsShown,c=n.props.showPreviousMonths?l-1:0,u=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?Gl(n.state.date,c):Rd(n.state.date,c),d=(i=n.props.monthSelectedIn)!==null&&i!==void 0?i:c,f=0;f<l;++f){var m=f-d+c,h=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?Gl(u,m):xo(u,m),p="month-".concat(f),g=f<l-1,y=f>0;o.push(U.createElement("div",{key:p,ref:function(v){n.monthContainer=v??void 0},className:"react-datepicker__month-container"},n.renderHeader({monthDate:h,i:f}),U.createElement(W2e,Ar({},t.defaultProps,n.props,{containerRef:n.containerRef,ariaLabelPrefix:n.props.monthAriaLabelPrefix,day:h,onDayClick:n.handleDayClick,handleOnKeyDown:n.props.handleOnDayKeyDown,handleOnMonthKeyDown:n.props.handleOnKeyDown,onDayMouseEnter:n.handleDayMouseEnter,onMouseLeave:n.handleMonthMouseLeave,orderInDisplay:f,selectingDate:n.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:y,dayNamesHeader:n.renderDayNamesHeader(h)}))))}return o}},n.renderYears=function(){if(!n.props.showTimeSelectOnly&&n.props.showYearPicker)return U.createElement("div",{className:"react-datepicker__year--container"},n.renderHeader({monthDate:n.state.date}),U.createElement(J2e,Ar({},t.defaultProps,n.props,{selectingDate:n.state.selectingDate,date:n.state.date,onDayClick:n.handleDayClick,clearSelectingDate:n.clearSelectingDate,onYearMouseEnter:n.handleYearMouseEnter,onYearMouseLeave:n.handleYearMouseLeave})))},n.renderTimeSection=function(){if(n.props.showTimeSelect&&(n.state.monthContainer||n.props.showTimeSelectOnly))return U.createElement(K2e,Ar({},t.defaultProps,n.props,{onChange:n.props.onTimeChange,format:n.props.timeFormat,intervals:n.props.timeIntervals,monthRef:n.state.monthContainer}))},n.renderInputTimeSection=function(){var a=n.props.selected?new Date(n.props.selected):void 0,i=a&&B2(a)&&!!n.props.selected,o=i?"".concat(gD(a.getHours()),":").concat(gD(a.getMinutes())):"";if(n.props.showTimeInput)return U.createElement(F2e,Ar({},t.defaultProps,n.props,{date:a,timeString:o,onChange:n.props.onTimeChange}))},n.renderAriaLiveRegion=function(){var a,i=Ol(n.state.date,(a=n.props.yearItemNumber)!==null&&a!==void 0?a:t.defaultProps.yearItemNumber),o=i.startPeriod,l=i.endPeriod,c;return n.props.showYearPicker?c="".concat(o," - ").concat(l):n.props.showMonthYearPicker||n.props.showQuarterYearPicker?c=jr
3774(n.state.date):c="".concat(zE(hs(n.state.date),n.props.locale)," ").concat(jr(n.state.date)),U.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},n.state.isRenderAriaLiveMessage&&c)},n.renderChildren=function(){if(n.props.children)return U.createElement("div",{className:"react-datepicker__children-container"},n.props.children)},n.containerRef=b.createRef(),n.state={date:n.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:$8,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:tb}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var r=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){r.setState({monthContainer:r.monthContainer})}())},t.prototype.componentDidUpdate=function(r){var n=this;if(this.props.preSelection&&(!Tr(this.props.preSelection,r.preSelection)||this.props.monthSelectedIn!==r.monthSelectedIn)){var a=!ks(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return a&&n.handleCustomMonthChange(n.state.date)})}else this.props.openToDate&&!Tr(this.props.openToDate,r.openToDate)&&this.setState({date:this.props.openToDate})},t.prototype.render=function(){var r=this.props.container||y2e;return U.createElement(z2,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},U.createElement("div",{style:{display:"contents"},ref:this.containerRef},U.createElement(r,{className:Jt("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},t}(b.Component),aje=function(e){var t=e.icon,r=e.className,n=r===void 0?"":r,a=e.onClick,i="react-datepicker__calendar-icon";if(typeof t=="string")return U.createElement("i",{className:"".concat(i," ").concat(t," ").concat(n),"aria-hidden":"true",onClick:a});if(U.isValidElement(t)){var o=t;return U.cloneElement(o,{className:"".concat(o.props.className||""," ").concat(i," ").concat(n),onClick:function(l){typeof o.props.onClick=="function"&&o.props.onClick(l),typeof a=="function"&&a(l)}})}return U.createElement("svg",{className:"".concat(i," ").concat(n),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:a},U.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},F8=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return tF.createPortal(this.props.children,this.el)},t}(b.Component),sje="[tabindex], a, button, input, select, textarea",ije=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&e.tabIndex!==-1},z8=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.getTabChildren=function(){var a;return Array.prototype.slice.call((a=n.tabLoopRef.current)===null||a===void 0?void 0:a.querySelectorAll(sje),1,-1).filter(ije)},n.handleFocusStart=function(){var a=n.getTabChildren();a&&a.length>1&&a[a.length-1].focus()},n.handleFocusEnd=function(){var a=n.getTabChildren();a&&a.length>1&&a[0].focus()},n.tabLoopRef=b.createRef(),n}return t.prototype.render=function(){var r;return((r=this.props.enableTabLoop)!==null&&r!==void 0?r:t.defaultProps.enableTabLoop)?U.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},U.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,U.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},t.defaultProps={enableTabLoop:!0},t}(b.Component);function oje(e){function t(r){var n,a=typeof r.hidePopper=="boolean"?r.hidePopper:!0,i=b.useRef(null),o=g2e(Ar({open:!a,whileElementsMounted:Ywe,placement:r.popperPlacement,middleware:qo([n2e({padding:15}),r2e(10),a2e({element:i})],(n=r.popperModifiers)!==null&&n!==void 0?n:[],!0)},r.popperProps)),l=Ar(Ar({},r),{hidePopper:a,popperProps:Ar(Ar({},o),{arrowRef:i})});return U.createElement(e,Ar({},l))}return t.displayName="withFloating(".concat(e.displayName||e.name||"Component",")"),t}var lje=function(e){var t=e.className,r=e.wrapperClassName,n=e.hidePopper,a=n===void 0?!0:n,i=e.popperComponent,o=e.targetComponent,l=e.enableTabLoop,c=e.popperOnKeyDown,u=e.portalId,d=e.portalHost,f=e.popperProps,m=e.showArrow,h=void 0;if(!a){var p=Jt("react-datepicker-popper",t);h=U.createElement(z8,{enableTabLoop:l},U.createElement("div",{ref:f.refs.setFloating,style:f.floatingStyles,className:p,"data-placement":f.placement,onKeyDown:c},i,m&&U.createElement(c2e,{ref:f.arrowRef,context:f.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}e.popperContainer&&(h=b.createElement(e.popperContainer,{},h)),u&&!a&&(h=U.createElement(F8,{portalId:u,portalHost:d},h));var g=Jt("react-datepicker-wrapper",r);return U.createElement(U.Fragment,null,U.createElement("div",{ref:f.refs.setReference,className:g},o),h)},cje=oje(lje);function uje(e,t){return e&&t?hs(e)!==hs(t)||jr(e)!==jr(t):e!==t}var nS="Date input not valid.",bh=function(e){as(t,e);function t(r){var n=e.call(this,r)||this;return n.calendar=null,n.input=null,n.getPreSelection=function(){return n.props.openToDate?n.props.openToDate:n.props.selectsEnd&&n.props.startDate?n.props.startDate:n.props.selectsStart&&n.props.endDate?n.props.endDate:cn()},n.modifyHolidays=function(){var a;return(a=n.props.holidays)===null||a===void 0?void 0:a.reduce(function(i,o){var l=new Date(o.date);return B2(l)?qo(qo([],i,!0),[Ar(Ar({},o),{date:l})],!1):i},[])},n.calcInitialState=function(){var a,i=n.getPreSelection(),o=D8(n.props),l=O8(n.props),c=o&&Wo(i,Zv(o))?o:l&&Tu(i,oD(l))?l:i;return{open:n.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(a=n.props.selectsRange?n.props.startDate:n.props.selected)!==null&&a!==void 0?a:c,highlightDates:pD(n.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},n.getInputValue=function(){var a,i=n.props,o=i.locale,l=i.startDate,c=i.endDate,u=i.rangeSeparator,d=i.selected,f=i.selectedDates,m=i.selectsMultiple,h=i.selectsRange,p=i.value,g=(a=n.props.dateFormat)!==null&&a!==void 0?a:t.defaultProps.dateFormat,y=n.state.inputValue;return typeof p=="string"?p:typeof y=="string"?y:h?v2e(l,c,{dateFormat:g,locale:o,rangeSeparator:u}):m?x2e(f??[],{dateFormat:g,locale:o}):ji(d,{dateFormat:g,locale:o})},n.resetHiddenStatus=function(){n.setState(Ar(Ar({},n.state),{wasHidden:!1}))},n.setHiddenStatus=function(){n.setState(Ar(Ar({},n.state),{wasHidden:!0}))},n.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&n.setHiddenStatus()},n.clearPreventFocusTimeout=function(){n.preventFocusTimeout&&clearTimeout(n.preventFocusTimeout)},n.setFocus=function(){var a,i;(i=(a=n.input)===null||a===void 0?void 0:a.focus)===null||i===void 0||i.call(a,{preventScroll:!0})},n.setBlur=function(){var a,i;(i=(a=n.input)===null||a===void 0?void 0:a.blur)===null||i===void 0||i.call(a),n.cancelFocusInput()},n.deferBlur=function(){requestAnimationFrame(function(){n.setBlur()})},n.setOpen=function(a,i){i===void 0&&(i=!1),n.setState({open:a,preSelection:a&&n.state.open?n.state.preSelection:n.calcInitialState().preSelection,lastPreSelectChange:aS},function(){a||n.setState(function(o){return{focused:i?o.focused:!1}},function(){!i&&n.deferBlur(),n.setState({inputValue:null})})})},n.inputOk=function(){return Hl(n.state.preSelection)},n.isCalendarOpen=function(){return n.props.open===void 0?n.state.open&&!n.props.disabled&&!n.props.readOnly:n.props.open},n.handleFocus=function(a){var i,o,l=n.state.wasHidden,c=l?n.state.open:!0;l&&n.resetHiddenStatus(),n.state.preventFocus||((o=(i=n.props).onFocus)===null||o===void 0||o.call(i,a),c&&!n.props.preventOpenOnFocus&&!n.props.readOnly&&n.setOpen(!0)),n.setState({focused:!0})},n.sendFocusBackToInput=function(){n.preventFocusTimeout&&n.clearPreventFocusTimeout(),n.setState({preventFocus:!0},function(){n.preventFocusTimeout=setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})})}
3774,n.cancelFocusInput=function(){clearTimeout(n.inputFocusTimeout),n.inputFocusTimeout=void 0},n.deferFocusInput=function(){n.cancelFocusInput(),n.inputFocusTimeout=setTimeout(function(){return n.setFocus()},1)},n.handleDropdownFocus=function(){n.cancelFocusInput()},n.resetInputValue=function(){n.setState(Ar(Ar({},n.state),{inputValue:null}))},n.handleBlur=function(a){var i,o;(!n.state.open||n.props.withPortal||n.props.showTimeInput)&&((o=(i=n.props).onBlur)===null||o===void 0||o.call(i,a)),n.resetInputValue(),n.state.open&&n.props.open===!1&&n.setOpen(!1),n.setState({focused:!1})},n.handleCalendarClickOutside=function(a){var i,o;n.props.inline||n.setOpen(!1),(o=(i=n.props).onClickOutside)===null||o===void 0||o.call(i,a),n.props.withPortal&&a.preventDefault()},n.handleChange=function(){for(var a,i,o,l,c,u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];var f=u[0];if(!(n.props.onChangeRaw&&(n.props.onChangeRaw.apply(n,u),!f||typeof f.isDefaultPrevented!="function"||f.isDefaultPrevented()))){n.setState({inputValue:(f==null?void 0:f.target)instanceof HTMLInputElement?f.target.value:null,lastPreSelectChange:dje});var m=n.props,h=m.selectsRange,p=m.startDate,g=m.endDate,y=(a=n.props.dateFormat)!==null&&a!==void 0?a:t.defaultProps.dateFormat,v=(i=n.props.strictParsing)!==null&&i!==void 0?i:t.defaultProps.strictParsing,x=(f==null?void 0:f.target)instanceof HTMLInputElement?f.target.value:"";if(h){var j=n.props.rangeSeparator,C=j.trim(),N=x.split(y.includes(C)?j:C,2).map(function(_){return _.trim()}),S=N[0],M=N[1],k=XN(S??"",y,n.props.locale,v),I=k?XN(M??"",y,n.props.locale,v):null,T=(p==null?void 0:p.getTime())!==(k==null?void 0:k.getTime()),L=(g==null?void 0:g.getTime())!==(I==null?void 0:I.getTime());if(!T&&!L||k&&Ci(k,n.props)||I&&Ci(I,n.props))return;(l=(o=n.props).onChange)===null||l===void 0||l.call(o,[k,I],f)}else{var R=XN(x,y,n.props.locale,v,(c=n.props.selected)!==null&&c!==void 0?c:void 0);(R||!x)&&n.setSelected(R,f,!0)}}},n.handleSelect=function(a,i,o){if(!n.props.readOnly){var l=n.props,c=l.selectsRange,u=l.startDate,d=l.endDate,f=l.swapRange,m=!c||u&&!d&&(f||!tS(a,u));n.props.shouldCloseOnSelect&&!n.props.showTimeSelect&&m&&n.sendFocusBackToInput(),n.props.onChangeRaw&&n.props.onChangeRaw(i),n.setSelected(a,i,!1,o),n.props.showDateSelect&&n.setState({isRenderAriaLiveMessage:!0}),!n.props.shouldCloseOnSelect||n.props.showTimeSelect?n.setPreSelection(a):m&&n.setOpen(!1)}},n.setSelected=function(a,i,o,l){var c,u,d=a;if(n.props.showYearPicker){if(d!==null&&Xv(jr(d),n.props))return}else if(n.props.showMonthYearPicker){if(d!==null&&L8(d,n.props))return}else if(d!==null&&Ci(d,n.props))return;var f=n.props,m=f.onChange,h=f.selectsRange,p=f.startDate,g=f.endDate,y=f.selectsMultiple,v=f.selectedDates,x=f.minTime,j=f.swapRange;if(!vd(n.props.selected,d)||n.props.allowSameDay||h||y)if(d!==null&&(n.props.selected&&(!o||!n.props.showTimeSelect&&!n.props.showTimeSelectOnly&&!n.props.showTimeInput)&&(d=eS(d,{hour:Yl(n.props.selected),minute:Ql(n.props.selected),second:gu(n.props.selected)})),!o&&(n.props.showTimeSelect||n.props.showTimeSelectOnly)&&x&&(d=eS(d,{hour:x.getHours(),minute:x.getMinutes(),second:x.getSeconds()})),n.props.inline||n.setState({preSelection:d}),n.props.focusSelectedMonth||n.setState({monthSelectedIn:l})),h){var C=!p&&!g,N=p&&!g,S=!p&&!!g,M=p&&g;C?m==null||m([d,null],i):N?d===null?m==null||m([null,null],i):tS(d,p)?j?m==null||m([d,p],i):m==null||m([d,null],i):m==null||m([p,d],i):S&&(d&&tS(d,g)?m==null||m([d,g],i):m==null||m([d,null],i)),M&&(m==null||m([d,null],i))}else if(y){if(d!==null)if(!(v!=null&&v.length))m==null||m([d],i);else{var k=v.some(function(T){return Tr(T,d)});if(k){var I=v.filter(function(T){return!Tr(T,d)});m==null||m(I,i)}else m==null||m(qo(qo([],v,!0),[d],!1),i)}}else m==null||m(d,i);o||((u=(c=n.props).onSelect)===null||u===void 0||u.call(c,d,i),n.setState({inputValue:null}))},n.setPreSelection=function(a){if(!n.props.readOnly){var i=Hl(n.props.minDate),o=Hl(n.props.maxDate),l=!0;if(a){var c=Zv(a);if(i&&o)l=sd(a,n.props.minDate,n.props.maxDate);else if(i){var u=Zv(n.props.minDate);l=Tu(a,u)||vd(c,u)}else if(o){var d=oD(n.props.maxDate);l=Wo(a,d)||vd(c,d)}}l&&n.setState({preSelection:a})}},n.toggleCalendar=function(){n.setOpen(!n.state.open)},n.handleTimeChange=function(a){var i,o;if(!(n.props.selectsRange||n.props.selectsMultiple)){var l=n.props.selected?n.props.selected:n.getPreSelection(),c=n.props.selected?a:eS(l,{hour:Yl(a),minute:Ql(a)});n.setState({preSelection:c}),(o=(i=n.props).onChange)===null||o===void 0||o.call(i,c),n.props.shouldCloseOnSelect&&!n.props.showTimeInput&&(n.sendFocusBackToInput(),n.setOpen(!1)),n.props.showTimeInput&&n.setOpen(!0),(n.props.showTimeSelectOnly||n.props.showTimeSelect)&&n.setState({isRenderAriaLiveMessage:!0}),n.setState({inputValue:null})}},n.onInputClick=function(){var a,i;!n.props.disabled&&!n.props.readOnly&&n.setOpen(!0),(i=(a=n.props).onInputClick)===null||i===void 0||i.call(a)},n.onInputKeyDown=function(a){var i,o,l,c,u,d;(o=(i=n.props).onKeyDown)===null||o===void 0||o.call(i,a);var f=a.key;if(!n.state.open&&!n.props.inline&&!n.props.preventOpenOnFocus){(f===Ct.ArrowDown||f===Ct.ArrowUp||f===Ct.Enter)&&((l=n.onInputClick)===null||l===void 0||l.call(n));return}if(n.state.open){if(f===Ct.ArrowDown||f===Ct.ArrowUp){a.preventDefault();var m=n.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":n.props.showWeekPicker&&n.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':n.props.showFullMonthYearPicker||n.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',h=((c=n.calendar)===null||c===void 0?void 0:c.containerRef.current)instanceof Element&&n.calendar.containerRef.current.querySelector(m);h instanceof HTMLElement&&h.focus({preventScroll:!0});return}var p=cn(n.state.preSelection);f===Ct.Enter?(a.preventDefault(),a.target.blur(),n.inputOk()&&n.state.lastPreSelectChange===aS?(n.handleSelect(p,a),!n.props.shouldCloseOnSelect&&n.setPreSelection(p)):n.setOpen(!1)):f===Ct.Escape?(a.preventDefault(),a.target.blur(),n.sendFocusBackToInput(),n.setOpen(!1)):f===Ct.Tab&&n.setOpen(!1),n.inputOk()||(d=(u=n.props).onInputError)===null||d===void 0||d.call(u,{code:1,msg:nS})}}
3774,n.onPortalKeyDown=function(a){var i=a.key;i===Ct.Escape&&(a.preventDefault(),n.setState({preventFocus:!0},function(){n.setOpen(!1),setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})}))},n.onDayKeyDown=function(a){var i,o,l,c,u,d,f=n.props,m=f.minDate,h=f.maxDate,p=f.disabledKeyboardNavigation,g=f.showWeekPicker,y=f.shouldCloseOnSelect,v=f.locale,x=f.calendarStartDay,j=f.adjustDateOnChange,C=f.inline;if((o=(i=n.props).onKeyDown)===null||o===void 0||o.call(i,a),!p){var N=a.key,S=a.shiftKey,M=cn(n.state.preSelection),k=function(z,D){var A=D;switch(z){case Ct.ArrowRight:A=g?n1(D,1):go(D,1);break;case Ct.ArrowLeft:A=g?HL(D):D1e(D);break;case Ct.ArrowUp:A=HL(D);break;case Ct.ArrowDown:A=n1(D,1);break;case Ct.PageUp:A=S?mh(D,1):Rd(D,1);break;case Ct.PageDown:A=S?Gl(D,1):xo(D,1);break;case Ct.Home:A=yu(D,v,x);break;case Ct.End:A=N2e(D);break}return A},I=function(z,D){for(var A=40,P=z,E=!1,F=0,$=k(z,D);!E;){if(F>=A){$=D;break}m&&$<m&&(P=Ct.ArrowRight,$=Ci(m,n.props)?k(P,$):m),h&&$>h&&(P=Ct.ArrowLeft,$=Ci(h,n.props)?k(P,$):h),Ci($,n.props)?((P===Ct.PageUp||P===Ct.Home)&&(P=Ct.ArrowRight),(P===Ct.PageDown||P===Ct.End)&&(P=Ct.ArrowLeft),$=k(P,$)):E=!0,F++}return $};if(N===Ct.Enter){a.preventDefault(),n.handleSelect(M,a),!y&&n.setPreSelection(M);return}else if(N===Ct.Escape){a.preventDefault(),n.setOpen(!1),n.inputOk()||(c=(l=n.props).onInputError)===null||c===void 0||c.call(l,{code:1,msg:nS});return}var T=null;switch(N){case Ct.ArrowLeft:case Ct.ArrowRight:case Ct.ArrowUp:case Ct.ArrowDown:case Ct.PageUp:case Ct.PageDown:case Ct.Home:case Ct.End:T=I(N,M);break}if(!T){(d=(u=n.props).onInputError)===null||d===void 0||d.call(u,{code:1,msg:nS});return}if(a.preventDefault(),n.setState({lastPreSelectChange:aS}),j&&n.setSelected(T),n.setPreSelection(T),C){var L=hs(M),R=hs(T),_=jr(M),B=jr(T);L!==R||_!==B?n.setState({shouldFocusDayInline:!0}):n.setState({shouldFocusDayInline:!1})}}},n.onPopperKeyDown=function(a){var i=a.key;i===Ct.Escape&&(a.preventDefault(),n.sendFocusBackToInput(),n.setOpen(!1))},n.onClearClick=function(a){a&&a.preventDefault&&a.preventDefault(),n.sendFocusBackToInput();var i=n.props,o=i.selectsRange,l=i.onChange;o?l==null||l([null,null],a):l==null||l(null,a),n.setState({inputValue:null})},n.clear=function(){n.onClearClick()},n.onScroll=function(a){typeof n.props.closeOnScroll=="boolean"&&n.props.closeOnScroll?(a.target===document||a.target===document.documentElement||a.target===document.body)&&n.setOpen(!1):typeof n.props.closeOnScroll=="function"&&n.props.closeOnScroll(a)&&n.setOpen(!1)},n.renderCalendar=function(){var a,i;return!n.props.inline&&!n.isCalendarOpen()?null:U.createElement(nje,Ar({showMonthYearDropdown:void 0,ref:function(o){n.calendar=o}},n.props,n.state,{setOpen:n.setOpen,dateFormat:(a=n.props.dateFormatCalendar)!==null&&a!==void 0?a:t.defaultProps.dateFormatCalendar,onSelect:n.handleSelect,onClickOutside:n.handleCalendarClickOutside,holidays:D2e(n.modifyHolidays()),outsideClickIgnoreClass:n.props.outsideClickIgnoreClass,onDropdownFocus:n.handleDropdownFocus,onTimeChange:n.handleTimeChange,className:n.props.calendarClassName,container:n.props.calendarContainer,handleOnKeyDown:n.props.onKeyDown,handleOnDayKeyDown:n.onDayKeyDown,setPreSelection:n.setPreSelection,dropdownMode:(i=n.props.dropdownMode)!==null&&i!==void 0?i:t.defaultProps.dropdownMode}),n.props.children)},n.renderAriaLiveRegion=function(){var a,i=n.props.locale,o=(a=n.props.dateFormat)!==null&&a!==void 0?a:t.defaultProps.dateFormat,l=n.props.showTimeInput||n.props.showTimeSelect,c=l?"PPPPp":"PPPP",u;return n.props.selectsRange?u="Selected start date: ".concat(ji(n.props.startDate,{dateFormat:c,locale:i}),". ").concat(n.props.endDate?"End date: "+ji(n.props.endDate,{dateFormat:c,locale:i}):""):n.props.showTimeSelectOnly?u="Selected time: ".concat(ji(n.props.selected,{dateFormat:o,locale:i})):n.props.showYearPicker?u="Selected year: ".concat(ji(n.props.selected,{dateFormat:"yyyy",locale:i})):n.props.showMonthYearPicker?u="Selected month: ".concat(ji(n.props.selected,{dateFormat:"MMMM yyyy",locale:i})):n.props.showQuarterYearPicker?u="Selected quarter: ".concat(ji(n.props.selected,{dateFormat:"yyyy, QQQ",locale:i})):u="Selected date: ".concat(ji(n.props.selected,{dateFormat:c,locale:i})),U.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-l
3774ive"},u)},n.renderDateInput=function(){var a,i,o=Jt(n.props.className,(a={},a[n.props.outsideClickIgnoreClass||t.defaultProps.outsideClickIgnoreClass]=n.state.open,a)),l=n.props.customInput||U.createElement("input",{type:"text"}),c=n.props.customInputRef||"ref";return b.cloneElement(l,(i={},i[c]=function(u){n.input=u},i.value=n.getInputValue(),i.onBlur=n.handleBlur,i.onChange=n.handleChange,i.onClick=n.onInputClick,i.onFocus=n.handleFocus,i.onKeyDown=n.onInputKeyDown,i.id=n.props.id,i.name=n.props.name,i.form=n.props.form,i.autoFocus=n.props.autoFocus,i.placeholder=n.props.placeholderText,i.disabled=n.props.disabled,i.autoComplete=n.props.autoComplete,i.className=Jt(l.props.className,o),i.title=n.props.title,i.readOnly=n.props.readOnly,i.required=n.props.required,i.tabIndex=n.props.tabIndex,i["aria-describedby"]=n.props.ariaDescribedBy,i["aria-invalid"]=n.props.ariaInvalid,i["aria-labelledby"]=n.props.ariaLabelledBy,i["aria-required"]=n.props.ariaRequired,i))},n.renderClearButton=function(){var a=n.props,i=a.isClearable,o=a.disabled,l=a.selected,c=a.startDate,u=a.endDate,d=a.clearButtonTitle,f=a.clearButtonClassName,m=f===void 0?"":f,h=a.ariaLabelClose,p=h===void 0?"Close":h,g=a.selectedDates,y=a.readOnly;return i&&!y&&(l!=null||c!=null||u!=null||g!=null&&g.length)?U.createElement("button",{type:"button",className:Jt("react-datepicker__close-icon",m,{"react-datepicker__close-icon--disabled":o}),disabled:o,"aria-label":p,onClick:n.onClearClick,title:d,tabIndex:-1}):null},n.state=n.calcInitialState(),n.preventFocusTimeout=void 0,n}return Object.defineProperty(t,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:$8,readOnly:!1,rangeSeparator:A8,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:tb,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.componentDidUpdate=function(r,n){var a,i,o,l;r.inline&&uje(r.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&r.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),r.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:pD(this.props.highlightDates)}),!n.focused&&!vd(r.selected,this.props.selected)&&this.setState({inputValue:null}),n.open!==this.state.open&&(n.open===!1&&this.state.open===!0&&((i=(a=this.props).onCalendarOpen)===null||i===void 0||i.call(a)),n.open===!0&&this.state.open===!1&&((l=(o=this.props).onCalendarClose)===null||l===void 0||l.call(o)))},t.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.renderInputContainer=function(){var r=this.props,n=r.showIcon,a=r.icon,i=r.calendarIconClassname,o=r.calendarIconClassName,l=r.toggleCalendarOnIconClick,c=this.state.open;return i&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),U.createElement("div",{className:"react-datepicker__input-container".concat(n?" react-datepicker__view-calendar-icon":"")},n&&U.createElement(aje,Ar({icon:a,className:Jt(o,!o&&i,c&&"react-datepicker-ignore-onclickoutside")},l?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())}
3774,t.prototype.render=function(){var r=this.renderCalendar();if(this.props.inline)return r;if(this.props.withPortal){var n=this.state.open?U.createElement(z8,{enableTabLoop:this.props.enableTabLoop},U.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},r)):null;return this.state.open&&this.props.portalId&&(n=U.createElement(F8,Ar({portalId:this.props.portalId},this.props),n)),U.createElement("div",null,this.renderInputContainer(),n)}return U.createElement(cje,Ar({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:r,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},t}(b.Component),dje="input",aS="navigate";const UE=({isOpen:e,onClose:t,onSave:r,initialTitle:n="",initialDescription:a="",initialBrandId:i="",initialDate:o,isLoading:l=!1})=>{var C;const{t:c}=Te(),{data:u}=oa(),d=(u==null?void 0:u.brands)||[],[f,m]=b.useState(n),[h,p]=b.useState(a),[g,y]=b.useState(i||(d.length===1?(C=d[0])==null?void 0:C.id:"")),[v,x]=b.useState(o||null);U.useEffect(()=>{var N;e&&(m(n),p(a),y(i||(d.length===1?(N=d[0])==null?void 0:N.id:"")),x(o||null))},[e,n,a,i,o,d]);const j=()=>{!f.trim()||!g||r({title:f.trim(),description:h.trim(),brandId:g,reminderAt:v?v.toISOString():null})};return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl max-w-md w-full p-6 border border-black",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Fs,{className:"h-5 w-5 text-amber-500"}),s.jsx("h2",{className:"text-xl font-semibold",children:c("ideaModal.title","Save a Post Idea")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"idea-title",className:"block text-sm font-medium text-gray-700 mb-1",children:[c("ideaModal.ideaTitle","Idea title")," *"]}),s.jsx("input",{id:"idea-title",type:"text",value:f,onChange:N=>m(N.target.value),placeholder:c("ideaModal.titlePlaceholder","e.g. Behind-the-scenes reel of our process"),className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm",autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"idea-description",className:"block text-sm font-medium text-gray-700 mb-1",children:c("ideaModal.description","Notes")}),s.jsx("textarea",{id:"idea-description",value:h,onChange:N=>p(N.target.value),placeholder:c("ideaModal.descriptionPlaceholder","Quick notes about this idea..."),rows:3,className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm"})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"idea-brand",className:"block text-sm font-medium text-gray-700 mb-1",children:[c("ideaModal.brand","Brand")," *"]}),s.jsxs("select",{id:"idea-brand",value:g,onChange:N=>y(N.target.value),className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm",children:[s.jsx("option",{value:"",children:c("ideaModal.selectBrand","Select a brand")}),d.map(N=>s.jsx("option",{value:N.id,children:N.name},N.id))]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("ideaModal.reminderDate","Remind me on")}),s.jsx(bh,{selected:v,onChange:N=>x(N),dateFormat:"PPP",minDate:new Date,placeholderText:c("ideaModal.reminderPlaceholder","Pick a date (optional)"),className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm",isClearable:!0,inline:!0}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("ideaModal.reminderHint","The idea will appear on your calendar on this date.")})]})]}),s.jsxs("div",{className:"mt-6 flex flex-row-reverse gap-3",children:[s.jsx("button",{type:"button",onClick:j,disabled:!f.trim()||!g||l,className:"inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-amber-500 text-base font-medium text-white hover:bg-amber-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-amber-500 sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:l?c("common.saving","Saving..."):c("ideaModal.save","Save Idea")}),s.jsx("button",{type:"button",onClick:t,className:"inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:text-sm",children:c("common.cancel","Cancel")})]})]})]})}):null},fje={enabledLevels:["error","warn"],enabledInProduction:!1};class mje{constructor(t=fje){vt(this,"config");vt(this,"isProduction");this.config=t,this.isProduction=!0}
3774shouldLog(t){return this.isProduction&&!this.config.enabledInProduction?!1:this.config.enabledLevels.includes(t)}formatMessage(t,r,n){const i=`[${new Date().toISOString()}] [${t}] ${r}`;return n?`${i}
3775Data: ${JSON.stringify(n,null,2)}`:i}debug(t,r,n){this.shouldLog("debug")&&console.debug(this.formatMessage(t,r,n))}info(t,r,n){this.shouldLog("info")&&console.info(this.formatMessage(t,r,n))}warn(t,r,n){this.shouldLog("warn")&&console.warn(this.formatMessage(t,r,n))}error(t,r,n){if(this.shouldLog("error")){const a=n instanceof Error?`${r}: ${n.message}
3776Stack: ${n.stack}`:this.formatMessage(t,r,n);console.error(`[${new Date().toISOString()}] [${t}] ${a}`)}}}const Ie=new mje,hje=()=>{{const e={log:console.log,debug:console.debug,info:console.info,warn:console.warn,error:console.error};console.log=()=>{},console.debug=()=>{},console.info=()=>{},console.warn=(...t)=>{e.warn(...t)},console.error=(...t)=>{e.error(...t)},window.__restoreConsole=()=>{Object.assign(console,e),console.log("🔧 Console logging restored for debugging")},window.__logError=(t,r)=>{window.Sentry&&window.Sentry.captureException(t,{tags:{context:r||"unknown"}}),window.__productionErrors||(window.__productionErrors=[]),window.__productionErrors.push({error:(t==null?void 0:t.message)||t,context:r,timestamp:new Date().toISOString(),url:window.location.href})},e.log("🔒 Console logging disabled in production. Use __restoreConsole() to enable for debugging.")}};class km extends Error{constructor(t,r,n){super(t),this.status=r,this.code=n,this.name="PostRequestError"}}async function VE(e,t){var n,a;const r=await e.json().catch(()=>null);if(r&&typeof r=="object"){const i=r,o=typeof i.error=="string"?i.error:((n=i.error)==null?void 0:n.message)??i.message,l=typeof i.error=="object"?((a=i.error)==null?void 0:a.code)??i.code:i.code,c=typeof l=="string"?l:void 0;return typeof o=="string"&&o.trim()&&!/<(?:!doctype|html|body)\b/i.test(o)?new km(o,e.status,c):new km(`${t} (HTTP ${e.status})`,e.status,c)}return new km(`${t} (HTTP ${e.status})`,e.status)}function wD(e,t){const r=e instanceof Error?e.message:"";return/failed to fetch|fetch failed|network ?error|network request failed|load failed/i.test(r)?t("postDeleteErrors.network","The server response could not be received. Refresh My Content to check whether the post was deleted before trying again."):r||t("postDeleteErrors.unknown","Unable to delete the post. Please try again later.")}function pje(e,t){const r=e instanceof Error?e.message:"";return/failed to fetch|fetch failed|network ?error|network request failed|load failed/i.test(r)?t("postSaveErrors.network","The server response could not be received. Your edits are still in this form. Check your connection and check My Content in another tab before trying again to avoid creating a duplicate."):e instanceof km&&e.status>=500||/<(?:!doctype|html|body)\b/i.test(r)?t("postSaveErrors.server","The server is temporarily unavailable. Your edits are still in this form. Please try again later."):r||t("postSaveErrors.unknown","Unable to save the post. Your edits are still in this form.")}const B8="https://api.socialness.ai",U2="https://management.socialness.ai/posts",Rk=async(e,t=!1)=>{try{const r=Qe.currentUser;if(!r)throw new Error("You must be logged in to create a post");const n=await r.getIdToken(),a=U2;Ie.info("postService",`Creating post at ${a}`);const i={Authorization:`Bearer ${n}`};t||(i["Content-Type"]="application/json");let o;if(t){if(o=e,e instanceof FormData){const u=e.get("file");u instanceof File&&Ie.info("postService",`Uploading file: ${u.name} (${u.size} bytes)`)}}else o=JSON.stringify(e);const l=await fetch(a,{method:"POST",headers:i,body:o});if(!l.ok)throw await VE(l,"Failed to create post");const c=await l.json();return Ie.info("postService","Post created successfully"),c}catch(r){throw Ie.error("postService","Error in createPost",r),r}},ex=async e=>{var t;try{Ie.info("postService",`Fetching post with ID: ${e}`);const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const n=`${U2}/${encodeURIComponent(e)}`,a=await fetch(n,{method:"GET",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!a.ok){const l=await a.text();if(Ie.error("postService",`Error fetching post ${e}: ${a.status}`,l),a.status===404)throw new Error(`Post with ID "${e}" could not be found. It may have been deleted or never existed.`);try{const c=JSON.parse(l);throw new Error(c.message||`Failed to get post: ${a.status}`)}catch{throw new Error(`Failed to get post: ${a.status} - ${l||a.statusText}`)}}const i=await a.json();let o=i;return i.post&&typeof i.post=="object"?o=i.post:i.data&&typeof i.data=="object"&&(i.data.post&&typeof i.data.post=="object"?o=i.data.post:o=i.data),o.id||Ie.warn("postService","Post data has no id"),o.brandId||Ie.warn("postService","Post data has no brandId"),!o.content&&o.content!==""&&Ie.warn("postService","Post data has no content property"),(!o.platforms||!Array.isArray(o.platforms))&&Ie.warn("postService","Post data has invali
3776d platforms"),Ie.info("postService","Post fetched successfully"),o}catch(r){throw Ie.error("postService",`Error getting post ${e}`,r),r}},U8=async(e,t,r=!1)=>{try{const n=Qe.currentUser;if(!n)throw new Error("You must be logged in to update a post");const a=await n.getIdToken(),i=`${U2}/${encodeURIComponent(e)}`;Ie.info("postService",`Updating post ${e}`);const o={Authorization:`Bearer ${a}`};r||(o["Content-Type"]="application/json");let l;if(r){if(l=t,t instanceof FormData){const d=t.get("file");d instanceof File&&Ie.info("postService",`Updating with file: ${d.name} (${d.size} bytes)`)}}else l=JSON.stringify(t);const c=await fetch(i,{method:"PUT",headers:o,body:l});if(!c.ok)throw await VE(c,"Failed to update post");const u=await c.json();return Ie.info("postService","Post updated successfully"),u}catch(n){throw Ie.error("postService","Error in updatePost",n),n}},gje=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`${U2}/${encodeURIComponent(e)}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!n.ok)throw await VE(n,"Failed to delete post");return Ie.info("postService",`Post ${e} deleted successfully`),{success:!0}}catch(r){return Ie.error("postService",`Error deleting post ${e}`,r),{success:!1,message:r instanceof Error?r.message:"Unknown error occurred",...r instanceof km?{status:r.status,code:r.code}:{}}}},yje=async(e,t,r)=>{var n;try{const a=await((n=Qe.currentUser)==null?void 0:n.getIdToken());if(!a)throw new Error("No authentication token available");const i=`${B8}/management/posts/${encodeURIComponent(e)}/submit-review`;Ie.info("postService",`Submitting ${t} review for post ${e}`);const o=await fetch(i,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({reviewStatus:t,reviewComment:r})});if(!o.ok){const c=await o.text();Ie.error("postService",`Review submission failed: ${o.status}`,c);try{const u=JSON.parse(c);throw new Error(u.message||`Failed to submit review: ${o.status}`)}catch{throw new Error(`Failed to submit review: ${o.status} - ${c||o.statusText}`)}}const l=await o.json();return Ie.info("postService",`Review submitted successfully for post ${e}`),l}catch(a){throw Ie.error("postService",`Error submitting review for post ${e}`,a),a instanceof Error?new Error(`Failed to submit review: ${a.message}`):new Error("An unknown error occurred while submitting the review.")}},bje=async(e,t)=>{var r,n;try{const a=await((r=Qe.currentUser)==null?void 0:r.getIdToken());if(!a)throw new Error("No authentication token available");const i=`${B8}/management/posts/bulk-update`;Ie.info("postService",`Bulk updating ${e.length} posts`);const o=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({postIds:e,updateData:t})});if(!o.ok){const c=await o.text();if(Ie.error("postService",`Bulk update failed: ${o.status}`,c),o.status===404||o.status===405)return Ie.info("postService","Bulk endpoint not available, falling back to individual updates"),await jD(e,t);try{const u=JSON.parse(c);throw new Error(u.message||`Bulk update failed: ${o.status}`)}catch{throw new Error(`Bulk update failed: ${o.status} - ${c||o.statusText}`)}}const l=await o.json();return Ie.info("postService",`Bulk update completed: ${l.updated} updated, ${((n=l.failed)==null?void 0:n.length)||0} failed`),l}catch(a){return Ie.error("postService","Error in bulk update",a),Ie.info("postService","Attempting fallback to individual updates"),await jD(e,t)}},jD=async(e,t)=>{const r={success:!0,updated:0,failed:[],errors:[]};for(const n of e)try{await U8(n,t,!1),r.updated++,Ie.info("postService",`Successfully updated post ${n}`)}catch(a){r.failed.push(n),r.errors.push({postId:n,error:a instanceof Error?a.message:"Unknown error"}),Ie.error("postService",`Failed to update post ${n}`,a)}return r.success=r.updated>0,Ie.info("postService",`Fallback bulk update completed: ${r.updated} updated, ${r.failed.length} failed`),r},V2=()=>{const e=qr();
3776return mn({mutationFn:async({postData:t,isFormData:r=!1})=>{try{Ie.info("useCreatePost","Creating new post");const n=await Rk(t,r);return Ie.info("useCreatePost","Post created successfully"),{success:!0,data:n}}catch(n){throw Ie.error("useCreatePost","Error creating post:",n),n}},onSuccess:()=>{e.invalidateQueries({queryKey:["posts"]}),Ie.info("useCreatePost","Posts queries invalidated")}})},vje=()=>{var L,R;const{t:e}=Te(),t=vs(),r=pn(),[n,a]=b.useState(!1),[i,o]=b.useState(!1),[l,c]=b.useState(!1),[u,d]=b.useState(!1),f=V2(),{showToast:m}=bc(),h=qr(),{user:p,clearStore:g}=Ps(),{onboardingProgress:y}=ME(),v=[{category:e("sidebar.categories.summary"),items:[{icon:Yme,label:e("common.dashboard"),path:"/dashboard"},{icon:xE,label:e("sidebar.analytics"),path:"/analytics"}]},{category:e("sidebar.categories.content"),items:[{icon:vo,label:e("calendar.title"),path:"/calendar"},{icon:da,label:e("contentHub.title"),path:"/my-content-hub"}]},{category:e("sidebar.categories.aiStudio"),items:[{icon:x0,label:e("sidebar.brands"),path:"/brand-strategy-lab"},{icon:Fc,label:e("sidebar.personas"),path:"/ai-personas-builder"},{icon:Ti,label:e("sidebar.smartLinks"),path:"/ai-links-builder"},{icon:Hn,label:e("contentCreation.title"),path:"/content-creation"},{icon:cL,label:e("boostMode.title"),path:"/boost-mode",isNew:!0}]},{category:e("sidebar.categories.management"),items:[{icon:li,label:e("sidebar.connectedAccounts"),path:"/social-media-hub"},{icon:rf,label:e("sidebar.media"),path:"/media"},{icon:I2,label:e("sidebar.integrations"),path:"/integrations"}]},{category:e("sidebar.categories.extra","EXTRA"),items:[{icon:cL,label:"Onboarding",path:"/onboarding"}]}],x=[{icon:ohe,label:e("common.settings"),path:"/settings"},{icon:qg,label:e("common.billing"),path:"/billing"},{icon:che,label:e("sidebar.team"),path:"/team"}],j=()=>{console.log("Creating post with AI"),c(!1),r("/content-creation")},C=()=>{c(!1),r("/posts/new")},N=()=>{c(!1),d(!0)},S=async()=>{h.clear(),g(),await Qe.signOut(),r("/auth/login")};let M="User";if(p!=null&&p.firstName||p!=null&&p.lastName){const _=p.firstName?p.firstName.charAt(0).toUpperCase()+p.firstName.slice(1).toLowerCase():"",B=p.lastName?p.lastName.charAt(0).toUpperCase()+p.lastName.slice(1).toLowerCase():"";M=`${_} ${B}`.trim()}else p!=null&&p.name?M=p.name.split(" ").map(_=>_.charAt(0).toUpperCase()+_.slice(1).toLowerCase()).join(" "):p!=null&&p.email&&(M=p.email.split("@")[0]);const k=typeof(y==null?void 0:y.percentageCompleted)=="number"?Math.max(0,Math.min(100,Math.round(y.percentageCompleted))):void 0,{emoji:I,showPercent:T}=k===void 0?{emoji:"",showPercent:!1}:k===100?{emoji:"🏆",showPercent:!1}:k>=80?{emoji:"🥇",showPercent:!0}:k>=50?{emoji:"🥈",showPercent:!0}:{emoji:"🥉",showPercent:!0};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"lg:hidden fixed top-0 left-0 right-0 h-16 bg-white border-b border-gray-200 z-[60] px-4 flex items-center",children:[s.jsx("button",{onClick:()=>o(!i),className:"p-2 rounded-lg hover:bg-gray-100",children:i?s.jsx(_t,{className:"w-6 h-6 text-gray-600"}):s.jsx(ehe,{className:"w-6 h-6 text-gray-600"})}),s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"h-10 w-10 ml-4 object-contain"})]}),s.jsxs("aside",{className:`fixed top-16 lg:top-0 bottom-0 left-0 z-[51] bg-white border-r border-gray-200 transform transition-all duration-200 ease-in-out lg:translate-x-0 flex flex-col overflow-hidden shadow-none hover:shadow-xl ${i?"translate-x-0 w-64":"-translate-x-full lg:translate-x-0 lg:w-20 lg:hover:w-56"}`,onMouseEnter:()=>!i&&a(!0),onMouseLeave:()=>!i&&a(!1),children:[s.jsx("div",{className:"hidden lg:flex flex-shrink-0 h-16 items-center justify-center border-b border-gray-200",children:s.jsxs(Us,{to:"/",className:"relative flex items-center justify-center",children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"w-10 h-10 object-contain"}),s.jsx("span",{className:`font-title font-extrabold text-xl text-gray-900 transition-all duration-200 ${i||n?"relative ml-2 opacity-100":"absolute left-full opacity-0 invisible"}`,children:"Socialness"})]})}),s.jsx("div",{className:"p-1.5 border-b border-gray-200",children:s.jsxs("button",{onClick:()=>c(!0),className:`w-full flex items-center justify-center space-x-2 p-1 bg-[#7136ed] text-white rounded-lg hover:bg-[#6429e3] transition-colors ${i||n?"px-4":"px-2"}`,children:[s.jsx(tn,{className:"w-5 h-5 flex-shrink-0"}),s.jsx("span",{className:`${i||n?"inline":"hidden"}`,children:e("sidebar.createContent")})]})}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:v.map(_=>s.jsxs("div",{children:[s.jsx("h3",{className:`h-5 flex items-center px-4 text-[10px] font-semibold text-gray-400 uppercase tracking-wider ${!i&&!n?"lg:opacity-0":"opacity-100"} transition-opacity duration-200 mt-1.5`,children:_.category}),s.jsx("div",{children:_.items.map(B=>{const z=B.icon,D=t.pathname===B.path;return s.jsxs(Us,{to:B.path,onClick:()=>o(!1),className:`w-full flex items-center h-7 relative group ${D?"text-primary-600":"text-gray-700 hover:text-primary-600"}`,title:B.label,children:[D&&s.jsx("div",{className:"absolute inset-0 bg-primary-50"}),s.jsxs("div",{className:`flex items-center w-full ${i||n?"px-4":"justify-center"}`,children:[s.jsx("div",{className:"relative flex items-center justify-center w-5 flex-shrink-0",children:s.jsx(z,{className:"w-4 h-4"})}),s.jsxs("span",{className:`transition-all duration-200 text-sm whitespace-nowrap flex items-center gap-2 ${i||n?"relative ml-3 opacity-100":"absolute left-full opacity-0 invisible"}`,children:[B.label,B.path==="/onboarding"&&k!==void 0&&s.jsxs("span",{className:"inline-flex items-center text-xs text-gray-600",children:[I&&s.jsx("span",{className:"ml-1",children:I}),T&&s.jsxs(s.Fragment,{children:[" ",s.jsxs("span",{className:"text-primary-600 font-semibold underline decoration-transparent hover:
3776decoration-inherit cursor-pointer",title:"View onboarding progress",children:["(",k,"%)"]})]})]}),B.isNew&&s.jsx("span",{className:"inline-block px-1.5 py-0.5 text-xs font-semibold text-white bg-primary-600 rounded-full",children:"Beta"})]})]})]},B.path)})})]},_.category))}),s.jsxs("div",{className:"flex-shrink-0 py-2 border-t border-gray-200",children:[s.jsx("h3",{className:`h-5 flex items-center px-4 text-[10px] font-semibold text-gray-400 uppercase tracking-wider ${!i&&!n?"lg:opacity-0":"opacity-100"} transition-opacity duration-200 mt-1.5`,children:e("sidebar.categories.admin")}),x.map(_=>{const B=_.icon,z=t.pathname===_.path;return s.jsxs(Us,{to:_.path,onClick:()=>o(!1),className:`w-full flex items-center h-7 relative group ${z?"text-primary-600":"text-gray-700 hover:text-primary-600"}`,title:_.label,children:[z&&s.jsx("div",{className:"absolute inset-0 bg-primary-50"}),s.jsxs("div",{className:`flex items-center w-full ${i||n?"px-4":"justify-center"}`,children:[s.jsx("div",{className:"relative flex items-center justify-center w-5 flex-shrink-0",children:s.jsx(B,{className:"w-4 h-4"})}),s.jsx("span",{className:`transition-all duration-200 text-sm whitespace-nowrap ${i||n?"relative ml-3 opacity-100":"absolute left-full opacity-0 invisible"}`,children:_.label})]})]},_.path)})]}),s.jsx("div",{className:"flex-shrink-0 p-2 border-t border-gray-200 bg-white",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden flex-shrink-0",children:p!=null&&p.photoURL?s.jsx("img",{src:p.photoURL,alt:(p==null?void 0:p.name)||"User",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-blue-100 flex items-center justify-center text-blue-600 font-medium",children:((L=p==null?void 0:p.name)==null?void 0:L.slice(0,2))||((R=p==null?void 0:p.email)==null?void 0:R.slice(0,2).toUpperCase())||"U"})}),s.jsxs("div",{className:`min-w-0 flex-1 transition-opacity duration-200 ${i||n?"opacity-100":"lg:opacity-0 w-0"}`,children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:M}),s.jsx("p",{className:"text-xs text-gray-500 truncate",children:p==null?void 0:p.email}),s.jsx("p",{className:"text-xs flex items-center",children:s.jsxs("button",{onClick:S,className:"inline-flex items-center text-red-600 hover:text-red-700",children:[s.jsx(Xme,{className:"w-3 h-3 mr-1"}),s.jsx("span",{className:"text-xs",children:e("common.logout")})]})})]})]})})]}),i&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 lg:hidden z-[50]",onClick:()=>o(!1)}),s.jsx(np,{isOpen:l,onClose:()=>c(!1),onCreateWithAI:j,onCreateManually:C,onCreateIdea:N}),s.jsx(UE,{isOpen:u,onClose:()=>d(!1),isLoading:f.isPending,onSave:async _=>{try{await f.mutateAsync({postData:{title:_.title,description:_.description,brandId:_.brandId,status:"idea",reminderAt:_.reminderAt,platforms:{},content:""}}),m(e("calendar.ideaSaved","Idea saved!"),"success"),d(!1)}catch(B){console.error("Error saving idea:",B),m(e("calendar.ideaError","Failed to save idea."),"error")}}})]})};function Fa(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}function un(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}function dn(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?wje(l,f=>f.test(o)):xje(l,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function xje(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function wje(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function sp(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}function kn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let jje={};function ip(){return jje}function ll(e,t){var l,c,u,d;const r=ip(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=kn(e),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function ND(e,t,r){const n=ll(e,r),a=ll(t,r);return+n==+a}const SD={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},Nje=(e,t,r)=>{let n;const a=r!=null&&r.addSuffix?SD[e].withPreposition:SD[e].standalone;
3776return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",String(t)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:"vor "+n:n},Sje={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},Cje={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},kje={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Mje={date:Fa({formats:Sje,defaultWidth:"full"}),time:Fa({formats:Cje,defaultWidth:"full"}),dateTime:Fa({formats:kje,defaultWidth:"full"})},Ije={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},Eje=(e,t,r,n)=>Ije[e],Tje={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},Aje={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},$k={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},Pje={narrow:$k.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:$k.wide},_je={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},Lje={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},Dje={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},Oje=e=>Number(e)+".",Rje={ordinalNumber:Oje,era:un({values:Tje,defaultWidth:"wide"}),quarter:un({values:Aje,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:$k,formattingValues:Pje,defaultWidth:"wide"}),day:un({values:_je,defaultWidth:"wide"}),dayPeriod:un({values:Lje,defaultWidth:"wide",formattingValues:Dje,defaultFormattingWidth:"wide"})},$je=/^(\d+)(\.)?/i,Fje=/\d+/i,zje={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},Bje={any:[/^v/i,/^n/i]},Uje={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},Vje={any:[/1/i,/2/i,/3/i,/4/i]},Wje={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},qje={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gje={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},Hje={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Yje={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Qje={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Kje={ordinalNumber:sp({matchPattern:$je,parsePattern:Fje,valueCallback:e=>parseInt(e)}),era:dn({matchPatterns:zje,defaultMatchWidth:"wide",parsePatterns:Bje,defaultParseWidth:"any"}),quarter:dn({matchPatterns:Uje,defaultMatchWidth:"wide",parsePatterns:Vje,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:Wje,defaultMatchWidth:"wide",parsePatterns:qje,defaultParseWidth:"any"}),day:dn({matchPatterns:Gje,defaultMatchWidth:"wide",parsePatterns:Hje,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:Yje,defaultMatchWidth:"wide",parsePatterns:Qje,defaultParseWidth:"any"})},CD={code:"de",formatDistance:Nje,formatLong:Mje,formatRelative:Eje,localize:Rje,match:Kje,options:{weekStartsOn:1,firstWeekContainsDate:4}},Jje={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Zje=(e,t,r)=>{let n;const a=Jje[e];
vendor: 5,796 bytes, line 3776
3776return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},Xje={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},eNe=(e,t,r,n)=>Xje[e],tNe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rNe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nNe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},aNe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},sNe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},iNe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oNe=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},lNe={ordinalNumber:oNe,era:un({values:tNe,defaultWidth:"wide"}),quarter:un({values:rNe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:nNe,defaultWidth:"wide"}),day:un({values:aNe,defaultWidth:"wide"}),dayPeriod:un({values:sNe,defaultWidth:"wide",formattingValues:iNe,defaultFormattingWidth:"wide"})},cNe=/^(\d+)(th|st|nd|rd)?/i,uNe=/\d+/i,dNe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fNe={any:[/^b/i,/^(a|c)/i]},mNe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hNe={any:[/1/i,/2/i,/3/i,/4/i]},pNe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gNe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yNe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bNe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vNe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xNe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},wNe={ordinalNumber:sp({matchPattern:cNe,parsePattern:uNe,valueCallback:e=>parseInt(e,10)}),era:dn({matchPatterns:dNe,defaultMatchWidth:"wide",parsePatterns:fNe,defaultParseWidth:"any"}),quarter:dn({matchPatterns:mNe,defaultMatchWidth:"wide",parsePatterns:hNe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:pNe,defaultMatchWidth:"wide",parsePatterns:gNe,defaultParseWidth:"any"}),day:dn({matchPatterns:yNe,defaultMatchWidth:"wide",parsePatterns:bNe,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:vNe,defaultMatchWidth:"any",parsePatterns:xNe,defaultParseWidth:"any"})},jNe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},NNe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},SNe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CNe={date:Fa({formats:jNe,defaultWidth:"full"}),time:Fa({formats:NNe,defaultWidth:"full"}),dateTime:Fa({formats:SNe,defaultWidth:"full"})},uc={code:"en-US",formatDistance:Zje,formatLong:CNe,formatRelative:eNe,localize:lNe,match:wNe,options:{weekStartsOn:0,firstWeekContainsDate:1}},kNe={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},MNe=(e,t,r)=>{let n;const a=kNe[e];
3776return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"en "+n:"hace "+n:n},INe={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},ENe={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},TNe={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ANe={date:Fa({formats:INe,defaultWidth:"full"}),time:Fa({formats:ENe,defaultWidth:"full"}),dateTime:Fa({formats:TNe,defaultWidth:"full"})},PNe={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},_Ne={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},LNe=(e,t,r,n)=>t.getHours()!==1?_Ne[e]:PNe[e],DNe={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},ONe={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},RNe={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},$Ne={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},FNe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},zNe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},BNe=(e,t)=>Number(e)+"º",UNe={ordinalNumber:BNe,era:un({values:DNe,defaultWidth:"wide"}),quarter:un({values:ONe,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:un({values:RNe,defaultWidth:"wide"}),day:un({values:$Ne,defaultWidth:"wide"}),dayPeriod:un({values:FNe,defaultWidth:"wide",formattingValues:zNe,defaultFormattingWidth:"wide"})},VNe=/^(\d+)(º)?/i,WNe=/\d+/i,qNe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},GNe={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},HNe={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},YNe={any:[/1/i,/2/i,/3/i,/4/i]},QNe={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},KNe={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},JNe={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},ZNe={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},XNe={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},eSe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},tSe={ordinalNumber:sp({matchPattern:VNe,parsePattern:WNe,valueCallback:function(e){return parseInt(e,10)}}),era:dn({matchPatterns:qNe,defaultMatchWidth:"wide",parsePatterns:GNe,defaultParseWidth:"any"}),quarter:dn({matchPatterns:HNe,defaultMatchWidth:"wide",parsePatterns:YNe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:QNe,defaultMatchWidth:"wide",parsePatterns:KNe,defaultParseWidth:"any"}),day:dn({matchPatterns:JNe,defaultMatchWidth:"wide",parsePatterns:ZNe,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:XNe,defaultMatchWidth:"any",parsePatterns:eSe,defaultParseWidth:"any"})},A0={code:"es",formatDistance:MNe,formatLong:ANe,formatRelative:LNe,localize:UNe,match:tSe,options:{weekStartsOn:1,firstWeekContainsDate:1}},rSe={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},nSe=(e,t,r)=>{let n;const a=rSe[e];
3776return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",String(t)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"dans "+n:"il y a "+n:n},aSe={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},sSe={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},iSe={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oSe={date:Fa({formats:aSe,defaultWidth:"full"}),time:Fa({formats:sSe,defaultWidth:"full"}),dateTime:Fa({formats:iSe,defaultWidth:"full"})},lSe={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},cSe=(e,t,r,n)=>lSe[e],uSe={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},dSe={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},fSe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},mSe={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},hSe={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},pSe=(e,t)=>{const r=Number(e),n=t==null?void 0:t.unit;if(r===0)return"0";const a=["year","week","hour","minute","second"];let i;return r===1?i=n&&a.includes(n)?"ère":"er":i="ème",r+i},gSe=["MMM","MMMM"],ySe={preprocessor:(e,t)=>e.getDate()===1||!t.some(n=>n.isToken&&gSe.includes(n.value))?t:t.map(n=>n.isToken&&n.value==="do"?{isToken:!0,value:"d"}:n),ordinalNumber:pSe,era:un({values:uSe,defaultWidth:"wide"}),quarter:un({values:dSe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:fSe,defaultWidth:"wide"}),day:un({values:mSe,defaultWidth:"wide"}),dayPeriod:un({values:hSe,defaultWidth:"wide"})},bSe=/^(\d+)(ième|ère|ème|er|e)?/i,vSe=/\d+/i,xSe={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},wSe={any:[/^av/i,/^ap/i]},jSe={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},NSe={any:[/1/i,/2/i,/3/i,/4/i]},SSe={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},CSe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},kSe={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},MSe={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},ISe={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},ESe={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},TSe={ordinalNumber:sp({matchPattern:bSe,parsePattern:vSe,valueCallback:e=>parseInt(e)}),era:dn({matchPatterns:xSe,defaultMatchWidth:"wide",parsePatterns:wSe,defaultParseWidth:"any"}),quarter:dn({matchPatterns:jSe,defaultMatchWidth:"wide",parsePatterns:NSe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:SSe,defaultMatchWidth:"wide",parsePatterns:CSe,defaultParseWidth:"any"}),day:dn({matchPatterns:kSe,defaultMatchWidth:"wide",parsePatterns:MSe,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:ISe,defaultMatchWidth:"any",parsePatterns:ESe,defaultParseWidth:"any"})},of={code:"fr",formatDistance:nSe,formatLong:oSe,formatRelative:cSe,localize:ySe,match:TSe,options:{weekStartsOn:1,firstWeekContainsDate:4}},ASe={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},PSe=(e,t,r)=>{let n;const a=ASe[e];
3776return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"tra "+n:n+" fa":n},_Se={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},LSe={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},DSe={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},OSe={date:Fa({formats:_Se,defaultWidth:"full"}),time:Fa({formats:LSe,defaultWidth:"full"}),dateTime:Fa({formats:DSe,defaultWidth:"full"})},WE=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function RSe(e){switch(e){case 0:return"'domenica scorsa alle' p";default:return"'"+WE[e]+" scorso alle' p"}}function kD(e){return"'"+WE[e]+" alle' p"}function $Se(e){switch(e){case 0:return"'domenica prossima alle' p";default:return"'"+WE[e]+" prossimo alle' p"}}const FSe={lastWeek:(e,t,r)=>{const n=e.getDay();return ND(e,t,r)?kD(n):RSe(n)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,t,r)=>{const n=e.getDay();return ND(e,t,r)?kD(n):$Se(n)},other:"P"},zSe=(e,t,r,n)=>{const a=FSe[e];return typeof a=="function"?a(t,r,n):a},BSe={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},USe={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},VSe={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},WSe={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},qSe={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},GSe={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},HSe=(e,t)=>{const r=Number(e);return String(r)},YSe={ordinalNumber:HSe,era:un({values:BSe,defaultWidth:"wide"}),quarter:un({values:USe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:VSe,defaultWidth:"wide"}),day:un({values:WSe,defaultWidth:"wide"}),dayPeriod:un({values:qSe,defaultWidth:"wide",formattingValues:GSe,defaultFormattingWidth:"wide"})},QSe=/^(\d+)(º)?/i,KSe=/\d+/i,JSe={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},ZSe={any:[/^a/i,/^(d|e)/i]},XSe={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},eCe={any:[/1/i,/2/i,/3/i,/4/i]},tCe={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},rCe={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},nCe={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},aCe={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},sCe={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},iCe={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},oCe={ordinalNumber:sp({matchPattern:QSe,parsePattern:KSe,valueCallback:e=>parseInt(e,10)}),era:dn({matchPatterns:JSe,defaultMatchWidth:"wide",parsePatterns:ZSe,defaultParseWidth:"any"}),quarter:dn({matchPatterns:XSe,defaultMatchWidth:"wide",parsePatterns:eCe,defaultParseWidth:"any",valueCallback:e=>e+1}
3776),month:dn({matchPatterns:tCe,defaultMatchWidth:"wide",parsePatterns:rCe,defaultParseWidth:"any"}),day:dn({matchPatterns:nCe,defaultMatchWidth:"wide",parsePatterns:aCe,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:sCe,defaultMatchWidth:"any",parsePatterns:iCe,defaultParseWidth:"any"})},MD={code:"it",formatDistance:PSe,formatLong:OSe,formatRelative:zSe,localize:YSe,match:oCe,options:{weekStartsOn:1,firstWeekContainsDate:4}},lCe={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},cCe=(e,t,r)=>{let n;const a=lCe[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",String(t)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"em "+n:"há "+n:n},uCe={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},dCe={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},fCe={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mCe={date:Fa({formats:uCe,defaultWidth:"full"}),time:Fa({formats:dCe,defaultWidth:"full"}),dateTime:Fa({formats:fCe,defaultWidth:"full"})},hCe={lastWeek:e=>{const t=e.getDay();return"'"+(t===0||t===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},pCe=(e,t,r,n)=>{const a=hCe[e];return typeof a=="function"?a(t):a},gCe={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},yCe={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},bCe={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},vCe={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},xCe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},wCe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},jCe=(e,t)=>{const r=Number(e);return(t==null?void 0:t.unit)==="week"?r+"ª":r+"º"},NCe={ordinalNumber:jCe,era:un({values:gCe,defaultWidth:"wide"}),quarter:un({values:yCe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:bCe,defaultWidth:"wide"}),day:un({values:vCe,defaultWidth:"wide"}),dayPeriod:un({values:xCe,defaultWidth:"wide",formattingValues:wCe,defaultFormattingWidth:"wide"})},SCe=/^(\d+)[ºªo]?/i,CCe=/\d+/i,kCe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i}
3776,MCe={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},ICe={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ECe={any:[/1/i,/2/i,/3/i,/4/i]},TCe={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},ACe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},PCe={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},_Ce={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},LCe={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(d
3776a) (manhã|tarde|noite))/i},DCe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},OCe={ordinalNumber:sp({matchPattern:SCe,parsePattern:CCe,valueCallback:e=>parseInt(e,10)}),era:dn({matchPatterns:kCe,defaultMatchWidth:"wide",parsePatterns:MCe,defaultParseWidth:"any"}),quarter:dn({matchPatterns:ICe,defaultMatchWidth:"wide",parsePatterns:ECe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:TCe,defaultMatchWidth:"wide",parsePatterns:ACe,defaultParseWidth:"any"}),day:dn({matchPatterns:PCe,defaultMatchWidth:"wide",parsePatterns:_Ce,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:LCe,defaultMatchWidth:"any",parsePatterns:DCe,defaultParseWidth:"any"})},ID={code:"pt-BR",formatDistance:cCe,formatLong:mCe,formatRelative:pCe,localize:NCe,match:OCe,options:{weekStartsOn:0,firstWeekContainsDate:1}},RCe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%231877F2'%3e%3cpath%20d='M24%2012.073c0-6.627-5.373-12-12-12s-12%205.373-12%2012c0%205.99%204.388%2010.954%2010.125%2011.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007%201.792-4.669%204.533-4.669%201.312%200%202.686.235%202.686.235v2.953H15.83c-1.491%200-1.956.925-1.956%201.874v2.25h3.328l-.532%203.47h-2.796v8.385C19.612%2023.027%2024%2018.062%2024%2012.073z'/%3e%3c/svg%3e",$Ce="data:image/svg+xml,%3csvg%20fill='none'%20height='2260'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0.254%200.25%20500%20451.95400000000006'%3e%3cpath%20d='M394.033.25h76.67L303.202%20191.693l197.052%20260.511h-154.29L225.118%20294.205%2086.844%20452.204H10.127l179.16-204.77L.254.25H158.46l109.234%20144.417zm-26.908%20406.063h42.483L135.377%2043.73h-45.59z'%20fill='%23000'/%3e%3c/svg%3e",FCe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%23E4405F'%3e%3cpath%20d='M12%200C8.74%200%208.333.015%207.053.072%205.775.132%204.905.333%204.14.63c-.789.306-1.459.717-2.126%201.384S.935%203.35.63%204.14C.333%204.905.131%205.775.072%207.053.012%208.333%200%208.74%200%2012s.015%203.667.072%204.947c.06%201.277.261%202.148.558%202.913.306.788.717%201.459%201.384%202.126.667.666%201.336%201.079%202.126%201.384.766.296%201.636.499%202.913.558C8.333%2023.988%208.74%2024%2012%2024s3.667-.015%204.947-.072c1.277-.06%202.148-.262%202.913-.558.788-.306%201.459-.718%202.126-1.384.666-.667%201.079-1.335%201.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319%201.347%2020.651.935%2019.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012%2015.26%200%2012%200zm0%202.16c3.203%200%203.585.016%204.85.071%201.17.055%201.805.249%202.227.415.562.217.96.477%201.382.896.419.42.679.819.896%201.381.164.422.36%201.057.413%202.227.057%201.266.07%201.646.07%204.85s-.015%203.585-.074%204.85c-.061%201.17-.256%201.805-.421%202.227-.224.562-.479.96-.899%201.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211%200-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844%200-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689%201.379-.898.42-.166%201.051-.361%202.221-.421%201.275-.045%201.65-.06%204.859-.06l.045.03zm0%203.678c-3.405%200-6.162%202.76-6.162%206.162%200%203.405%202.76%206.162%206.162%206.162%203.405%200%206.162-2.76%206.162-6.162%200-3.405-2.76-6.162-6.162-6.162zM12%2016c-2.21%200-4-1.79-4-4s1.79-4%204-4%204%201.79%204%204-1.79%204-4%204zm7.846-10.405c0%20.795-.646%201.44-1.44%201.44-.795%200-1.44-.646-1.44-1.44%200-.794.646-1.439%201.44-1.439.793-.001%201.44.645%201.44%201.439z'/%3e%3c/svg%3e",zCe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%230A66C2'%3e%3cpath%20d='M20.447%2020.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853%200-2.136%201.445-2.136%202.939v5.667H9.351V9h3.414v1.561h.046c.477-.9%201.637-1.85%203.37-1.85%203.601%200%204.267%202.37%204.267%205.455v6.286zM5.337%207.433c-1.144%200-2.063-.926-2.063-2.065%200-1.138.92-2.063%202.063-2.063%201.14%200%202.064.925%202.064%202.063%200%201.139-.925%202.065-2.064%202.065zm1.782%2013.019H3.555V9h3.564v11.452zM22.225%200H1.771C.792%200%200%20.774%200%201.729v20.542C0%2023.227.792%2024%201.771%2024h20.451C23.2%2024%2024%2023.227%2024%2022.271V1.729C24%20.774%2023.2%200%2022.222%200h.003z'/%3e%3c/svg%3e",BCe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%23FF0000'%3e%3cpath%20d='M23.498%206.186a3.016%203.016%200%200%200-2.122-2.136C19.505%203.545%2012%203.545%2012%203.545s-7.505%200-9.377.505A3.017%203.017%200%200%200%20.502%206.186C0%208.07%200%2012%200%2012s0%203.93.502%205.814a3.016%203.016%200%200%200%202.122%202.136c1.871.505%209.376.505%209.376.505s7.505%200%209.377-.505a3.015%203.015%200%200%200%202.122-2.136C24%2015.93%2024%2012%2024%2012s0-3.93-.502-5.814zM9.545%2015.568V8.432L15.818%2012l-6.273%203.568z'/%3e%3c/svg%3e",UCe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%2
37760www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.319%20291.319'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23C8232C;'%20d='M145.659,0c80.45,0,145.66,65.219,145.66,145.66c0,80.45-65.21,145.659-145.66,145.659%20S0,226.109,0,145.66C0,65.219,65.21,0,145.659,0z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M150.066,63.781c-51.327,0-77.19,35.632-77.19,65.337c0,17.989,7.028,33.993,22.122,39.956%20c2.467,0.974,4.698,0.036,5.408-2.613l2.203-8.403c0.728-2.613,0.446-3.541-1.548-5.826c-4.361-4.962-7.128-11.398-7.128-20.511%20c0-26.428,20.42-50.089,53.175-50.089c29.014,0,44.945,17.161,44.945,40.075c0,30.152-13.783,55.606-34.248,55.606%20c-11.289,0-19.755-9.04-17.042-20.156c3.241-13.237,9.541-27.539,9.541-37.107c0-8.548-4.743-15.704-14.575-15.704%20c-11.553,0-20.829,11.571-20.829,27.074c0,9.878,3.45,16.551,3.45,16.551l-13.901,56.998c-4.124,16.906-0.61,37.644-0.319,39.738%20c0.182,1.238,1.821,1.529,2.567,0.601c1.065-1.347,14.821-17.798,19.5-34.239c1.329-4.652,7.602-28.75,7.602-28.75%20c3.751,6.946,14.721,13.046,26.383,13.046c34.712,0,58.273-30.652,58.273-71.674C218.444,92.676,191.315,63.781,150.066,63.781z'/%3e%3c/g%3e%3c/svg%3e",V8="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.321%206.29398C17.9365%206.29398%2016.7143%205.70695%2015.8648%204.78312C15.0153%203.85928%2014.5%202.52304%2014.5%201H11.2857V15.9078C11.2857%2017.5953%209.91518%2018.9672%208.23214%2018.9672C6.54911%2018.9672%205.17857%2017.5953%205.17857%2015.9078C5.17857%2014.2204%206.54911%2012.8485%208.23214%2012.8485C8.6596%2012.8485%209.06473%2012.9333%209.43571%2013.0821V9.71809C8.39152%209.52685%207.30804%209.61743%206.31473%209.97955C5.32143%2010.3417%204.44777%2010.9663%203.77455%2011.7851C3.10134%2012.604%202.64955%2013.5901%202.46339%2014.6397C2.27723%2015.6893%202.36223%2016.7697%202.71205%2017.7773C3.06188%2018.7849%203.66473%2019.6804%204.45848%2020.3704C5.25223%2021.0605%206.21205%2021.5223%207.24509%2021.7123C8.27813%2021.9023%209.34241%2021.8142%2010.3339%2021.456C11.3254%2021.0977%2012.2089%2020.4829%2012.8821%2019.6741C13.5554%2018.8653%2014%2017.8944%2014%2016.8953V9.13106C15.0946%209.92674%2016.4054%2010.3485%2017.7857%2010.3534V7.13106C18.2679%207.13106%2018.8036%207.02813%2019.3214%206.82453L19.321%206.29398Z'%20fill='currentColor'/%3e%3c/svg%3e",VCe="data:image/svg+xml,%3csvg%20height='2185'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200.43%201064%20928.69'%3e%3clinearGradient%20id='a'%20x1='0%25'%20x2='99.999%25'%20y1='49.999%25'%20y2='49.999%25'%3e%3cstop%20offset='.03'%20stop-color='%234079d8'/%3e%3cstop%20offset='1'%20stop-color='%234989f5'/%3e%3c/linearGradient%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20fill-rule='nonzero'%3e%3crect%20fill='%234989f5'%20height='696.14'%20rx='36.88'%20width='931'%20x='53.45'%20y='232.98'/%3e%3cpath%20d='M936.81%20227.75H100.06c-25.92%200-46.09%20200.6-46.09%20226.52L512.2%20929.12h424.61c26-.071%2047.059-21.13%2047.13-47.13V274.87c-.077-25.996-21.134-47.049-47.13-47.12z'%20fill='url(%23a)'/%3e%3cpath%20d='M266.03%20349.56h266V.44H305.86z'%20fill='%233c4ba6'/%3e%3cpath%20d='M798.03%20349.56h-266V.44H758.2zM984.45%2066.62l.33%201.19c-.08-.42-.24-.81-.33-1.19z'%20fill='%237babf7'/%3e%3cpath%20d='M984.78%2067.8l-.33-1.19C976.017%2027.993%20941.837.455%20902.31.43H758.2L798%20349.56h266z'%20fill='%233f51b5'/%3e%3cpath%20d='M79.61%2066.62l-.33%201.19c.08-.42.24-.81.33-1.19z'%20fill='%237babf7'/%3e%3cpath%20d='M79.27%2067.8l.33-1.19C88.033%2027.993%20122.213.455%20161.74.43h144.12L266%20349.56H0z'%20fill='%237babf7'/%3e%3c/g%3e%3cpath%20d='M266.48%20349.47c0%2073.412-59.513%20132.925-132.925%20132.925S.63%20422.882.63%20349.47z'%20fill='%23709be0'/%3e%3cpath%20d='M532.33%20349.47c0%2073.412-59.513%20132.925-132.925%20132.925S266.48%20422.882%20266.48%20349.47z'%20fill='%233c4ba6'/%3e%3cpath%20d='M798.18%20349.47c0%2073.412-59.513%20132.925-132.925%20132.925S532.33%20422.882%20532.33%20349.47z'%20fill='%23709be0'/%3e%3cpath%20d='M1064%20349.47c0%2073.412-59.513%20132.925-132.925%20132.925S798.15%20422.882%20798.15%20349.47z'%20fill='%233c4ba6'/%3e%3cpath%20d='M931.08%20709.6c-.47-6.33-1.25-12.11-2.36-19.49h-145c0%2020.28%200%2042.41-.08%2062.7h84a73.05%2073.05%200%200%201-30.75%2046.89s0-.35-.06-.36a88%2088%200%200%201-34%2013.27%2099.85%2099.85%200%200%201-36.79-.16%2091.9%2091.9%200%200%201-34.31-14.87%2095.72%2095.72%200%200%201-33.73-43.1c-.52-1.35-1-2.71-1.49-4.09v-.15l.13-.1a93%2093%200%200%201-.05-59.84A96.27%2096.27%200%200%201%20718.9%20654c23.587-24.399%2058.829-33.576%2091.32-23.78a83%2083%200%200%201%2033.23%2019.56l28.34-28.34c5-5.05%2010.19-9.94%2015-15.16a149.78%20149.78%200%200%200-49.64-30.74%20156.08%20156.08%200%200%200-103.83-.91c-1.173.4-2.34.817-3.5%201.25A155.18%20155.18%200%200%200%20646%20651a152.61%20152.61%200%200%200-13.42%2038.78c-16.052%2079.772%2032.623%20158.294%20111.21%20179.4%2025.69%206.88%2053%206.71%2078.89.83a139.88%20139.88%200%200%200%2063.14-32.81c18.64-17.15%2032-40%2039-64.27a179%20179%200%200%200%206.26-63.33z'%20fill='%23fff'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e",WCe={facebook:RCe,twitter:$Ce,instagram:FCe,linkedin:zCe,youtube:BCe,pinterest:UCe,tiktok:V8,"google-business":VCe},cr=({platform:e,className:t="",size:r=24})=>{const n=WCe[e];return n?s.jsx("img",{src:n,alt:`${e} icon`,className:t,style:{width:r,height:r}}):null},W2=e=>{const t=(e||"").toString().trim().toLowerCase();return!t||["x","x.com","x-twitter","x_twitter","twitter","tw"].includes(t)?"twitter":["googlebusiness","google_business","google my business","google-my-business","gmb"].includes(t)?"google-business":["facebook","twitter","instagram","linkedin","youtube","pinterest","tiktok","google-business"].find(a=>a===t)||"twitter"};function wo(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function W8(e,t){const r=kn(e);return isNaN(t)?wo(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function q8(e,t){const r=kn(e);if(isNaN(t))return wo(e,NaN);if(!t)return r;const n=r.getDate(),a=wo(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const i=a.getDate();return n>=i?a:(r.setFullYear(a.getFullYear(),a.getMonth(),n),r)}const G8=6048e5,qCe=864e5,H8=6e4,Y8=36e5;function p1(e){return ll(e,{weekStartsOn:1}
vendor: 8,569 bytes, line 3776
3776)}function Q8(e){const t=kn(e),r=t.getFullYear(),n=wo(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=p1(n),i=wo(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=p1(i);return t.getTime()>=a.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function uo(e){const t=kn(e);return t.setHours(0,0,0,0),t}function ED(e){const t=kn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function GCe(e,t){const r=uo(e),n=uo(t),a=+r-ED(r),i=+n-ED(n);return Math.round((a-i)/qCe)}function HCe(e){const t=Q8(e),r=wo(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),p1(r)}function K8(e,t){const r=t*7;return W8(e,r)}function YCe(e){return wo(e,Date.now())}function QCe(e,t){const r=uo(e),n=uo(t);return+r==+n}function KCe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Gn(e){if(!KCe(e)&&typeof e!="number")return!1;const t=kn(e);return!isNaN(Number(t))}function Hc(e){const t=kn(e);return t.setHours(23,59,59,999),t}function op(e){const t=kn(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function J8(e,t){const r=kn(e.start),n=kn(e.end);let a=+r>+n;const i=a?+r:+n,o=a?n:r;o.setHours(0,0,0,0);let l=1;const c=[];for(;+o<=i;)c.push(kn(o)),o.setDate(o.getDate()+l),o.setHours(0,0,0,0);return a?c.reverse():c}function Pu(e){const t=kn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Z8(e){const t=kn(e),r=wo(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function X8(e,t){var l,c,u,d;const r=ip(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=kn(e),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function JCe(e){const t=kn(e);return GCe(t,Z8(t))+1}function ZCe(e){const t=kn(e),r=+p1(t)-+HCe(t);return Math.round(r/G8)+1}function eV(e,t){var d,f,m,h;const r=kn(e),n=r.getFullYear(),a=ip(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(m=a.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=wo(e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=ll(o,t),c=wo(e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=ll(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function XCe(e,t){var l,c,u,d;const r=ip(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=eV(e,t),i=wo(e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),ll(i,t)}function eke(e,t){const r=kn(e),n=+ll(r,t)-+XCe(r,t);return Math.round(n/G8)+1}function vn(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Pc={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return vn(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):vn(r+1,2)},d(e,t){return vn(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return vn(e.getHours()%12||12,t.length)},H(e,t){return vn(e.getHours(),t.length)},m(e,t){return vn(e.getMinutes(),t.length)},s(e,t){return vn(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return vn(a,t.length)}},qf={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TD={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return Pc.y(e,t)},Y:function(e,t,r,n){const a=eV(e,n),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return vn(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):vn(i,t.length)},R:function(e,t){const r=Q8(e);return vn(r,t.length)},u:function(e,t){const r=e.getFullYear();return vn(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return vn(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return vn(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Pc.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return vn(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=eke(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):vn(a,t.length)},I:function(e,t,r){const n=ZCe(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):vn(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Pc.d(e,t)},D:function(e,t,r){const n=JCe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):vn(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return vn(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return vn(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return vn(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=qf.noon:n===0?a=qf.midnight:a=n/12>
vendor: 4,582 bytes, line 3776
3776=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=qf.evening:n>=12?a=qf.afternoon:n>=4?a=qf.morning:a=qf.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Pc.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Pc.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):vn(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):vn(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Pc.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Pc.s(e,t)},S:function(e,t){return Pc.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return PD(n);case"XXXX":case"XX":return id(n);case"XXXXX":case"XXX":default:return id(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return PD(n);case"xxxx":case"xx":return id(n);case"xxxxx":case"xxx":default:return id(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+AD(n,":");case"OOOO":default:return"GMT"+id(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+AD(n,":");case"zzzz":default:return"GMT"+id(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return vn(n,t.length)},T:function(e,t,r){const n=e.getTime();return vn(n,t.length)}};function AD(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+vn(i,2)}function PD(e,t){return e%60===0?(e>0?"-":"+")+vn(Math.abs(e)/60,2):id(e,t)}function id(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=vn(Math.trunc(n/60),2),i=vn(n%60,2);return r+a+t+i}const _D=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},tV=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},tke=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return _D(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",_D(n,t)).replace("{{time}}",tV(a,t))},rke={p:tV,P:tke},nke=/^D+$/,ake=/^Y+$/,ske=["D","DD","YY","YYYY"];function ike(e){return nke.test(e)}function oke(e){return ake.test(e)}function lke(e,t,r){const n=cke(e,t,r);if(console.warn(n),ske.includes(e))throw new RangeError(n)}function cke(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const uke=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dke=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fke=/^'([^]*?)'?$/,mke=/''/g,hke=/[a-zA-Z]/;function sr(e,t,r){var d,f,m,h,p,g,y,v;const n=ip(),a=(r==null?void 0:r.locale)??n.locale??uc,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(m=n.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(p=r==null?void 0:r.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((v=(y=n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,l=kn(e);if(!Gn(l))throw new RangeError("Invalid time value");let c=t.match(dke).map(x=>{const j=x[0];if(j==="p"||j==="P"){const C=rke[j];return C(x,a.formatLong)}return x}).join("").match(uke).map(x=>
3776{if(x==="''")return{isToken:!1,value:"'"};const j=x[0];if(j==="'")return{isToken:!1,value:pke(x)};if(TD[j])return{isToken:!0,value:x};if(j.match(hke))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:x}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(x=>{if(!x.isToken)return x.value;const j=x.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&oke(j)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ike(j))&&lke(j,t,String(e));const C=TD[j[0]];return C(l,j,a.localize,u)}).join("")}function pke(e){const t=e.match(fke);return t?t[1].replace(mke,"'"):e}function gke(e){return kn(e).getDay()}function yke(){return Object.assign({},ip())}function bke(e){return kn(e).getHours()}function vke(e,t){const r=kn(e),n=kn(t);return r.getTime()>n.getTime()}function xke(e,t){const r=kn(e),n=kn(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function wke(e,t){const r=kn(e),n=kn(t);return r.getFullYear()===n.getFullYear()}function Fk(e){return QCe(e,YCe(e))}function zc(e,t){return W8(e,-t)}function Xa(e,t){const n=Cke(e);let a;if(n.date){const c=kke(n.date,2);a=Mke(c.restDateString,c.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,l;if(n.time&&(o=Ike(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(l=Eke(n.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(i+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(i+o+l)}const av={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},jke=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nke=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ske=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Cke(e){const t={},r=e.split(av.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],av.timeZoneDelimiter.test(t.date)&&(t.date=e.split(av.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const a=av.timezone.exec(n);a?(t.time=n.replace(a[1],""),t.timezone=a[1]):t.time=n}return t}function kke(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((n[1]||n[2]).length)}}function Mke(e,t){if(t===null)return new Date(NaN);const r=e.match(jke);if(!r)return new Date(NaN);const n=!!r[4],a=rg(r[1]),i=rg(r[2])-1,o=rg(r[3]),l=rg(r[4]),c=rg(r[5])-1;if(n)return Lke(t,l,c)?Tke(t,l,c):new Date(NaN);{const u=new Date(0);return!Pke(t,i,o)||!_ke(t,a)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(a,o)),u)}}function rg(e){return e?parseInt(e):1}function Ike(e){const t=e.match(Nke);if(!t)return NaN;const r=sS(t[1]),n=sS(t[2]),a=sS(t[3]);return Dke(r,n,a)?r*Y8+n*H8+a*1e3:NaN}function sS(e){return e&&parseFloat(e.replace(",","."))||0}function Eke(e){if(e==="Z")return 0;const t=e.match(Ske);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return Oke(n,a)?r*(n*Y8+a*H8):NaN}function Tke(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const a=n.getUTCDay()||7,i=(t-1)*7+r+1-a;return n.setUTCDate(n.getUTCDate()+i),n}const Ake=[31,null,31,30,31,30,31,31,30,31,30,31];function rV(e){return e%400===0||e%4===0&&e%100!==0}function Pke(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Ake[t]||(rV(e)?29:28))}function _ke(e,t){return t>=1&&t<=(rV(e)?366:365)}function Lke(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function Dke(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Oke(e,t){return t>=0&&t<=59}function lp(e,t){return q8(e,-1)}function Rke(e,t){return K8(e,-1)}P8("fr",of);P8("es",A0);const $ke=365,Fke=[{key:"thisMonth",value:"this-month"},{key:"lastMonth",value:"last-month"},{key:"last15days",value:15},{key:"last30days",value:30},{key:"last90days",value:90},{key:"thisYear",value:"this-year"},{key:"last365days",value:365},{key:"custom",value:"custom"}];function nV({dateRange:e,customDateRange:t,onDateRangeChange:r,onCustomDateRangeChange:n,baseDate:a=new Date,fullWidth:i=!1}){const[o,l]=b.useState(!1),{t:c,i18n:u}=Te(),d=((u==null?void 0:u.language)||"").toLowerCase(),f=d.startsWith("fr"),m=d.startsWith("es"),h=f?of:m?A0:uc,[p,g]=b.useState(t.start),[
3776y,v]=b.useState(t.end);U.useEffect(()=>{e==="custom"&&(g(t.start),v(t.end))},[t.start,t.end,e,o]);const x=zc(new Date,1),j=zc(new Date,$ke),C=S=>S<j?uo(j):S>x?Hc(x):S,N=(()=>{if(e==="custom"){const S=f?"d MMM, yyyy":"MMM d, yyyy";return`${sr(t.start,S,{locale:h})} - ${sr(t.end,S,{locale:h})}`}else if(e==="this-month"){const S=new Date,M=new Date(S.getFullYear(),S.getMonth(),1),k=f?"d MMM, yyyy":"MMM d, yyyy";return`${c("analytics.dateRange.thisMonth")} (${sr(M,k,{locale:h})} - ${sr(S,k,{locale:h})})`}else if(e==="last-month"){const S=new Date,M=S.getMonth()===0?S.getFullYear()-1:S.getFullYear(),k=S.getMonth()===0?11:S.getMonth()-1,I=new Date(M,k,1),T=new Date(M,k+1,0),L=f?"d MMM, yyyy":"MMM d, yyyy";return`${c("analytics.dateRange.lastMonth")} (${sr(I,L,{locale:h})} - ${sr(T,L,{locale:h})})`}else if(e==="this-year"){const S=new Date;return`${c("analytics.dateRange.thisYear","Cette année")} (${S.getFullYear()})`}else{const S=Number(e),M=zc(a,Number(e)),k=zc(a,1),I=wke(M,k),T=f?"d MMM":"MMM d",L=f?"d MMM, yyyy":"MMM d, yyyy",R=sr(M,I?T:L,{locale:h}),_=sr(k,I?T:L,{locale:h});if(!Number.isFinite(S)||S<=0)return`${c("analytics.dateRange.last")} 30 ${c("analytics.dateRange.days")}`;if(f){const B=c("analytics.dateRange.lastPlural","derniers"),z=c("analytics.dateRange.days","jours");return`${S} ${B} ${z} (${R} - ${_})`}return`${c("analytics.dateRange.last")} ${S} ${c("analytics.dateRange.days")} (${R} - ${_})`}})();return s.jsxs("div",{className:`relative ${i?"w-full":""}`,children:[s.jsxs("button",{onClick:()=>l(!o),className:`${i?"w-full justify-start text-left":""} inline-flex items-center px-4 py-2 border border-gray-300 rounded-lg bg-white text-sm font-medium text-gray-700 hover:text-primary-600 focus:outline-none`,children:[s.jsx(vo,{className:"w-4 h-4 mr-2 text-primary-500"}),N,s.jsx(Vr,{className:"w-4 h-4 ml-2"})]}),o&&s.jsxs("div",{className:`absolute ${i?"left-0 w-full":"right-0 w-80"} mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-10`,children:[s.jsx("div",{className:"p-2",children:Fke.map(S=>s.jsx("button",{onClick:()=>{if(S.value==="custom"){g(t.start),v(t.end),r("custom");return}else S.value==="this-month"||S.value==="last-month"||S.value==="this-year"?r(S.value):(r(S.value),n({start:uo(zc(a,Number(S.value))),end:Hc(zc(a,1))}));l(!1)},className:`w-full text-left px-4 py-2 text-sm rounded-lg ${e===S.value?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:S.value==="this-year"?`${c("analytics.dateRange.thisYear","Cette année")} (${new Date().getFullYear()})`:c(`analytics.dateRange.${S.key}`)},S.value))}),e==="custom"&&s.jsxs("div",{className:"p-4 border-t border-gray-200",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("analytics.dateRange.startDate")}),s.jsx(bh,{selected:isNaN(p.getTime())?null:p,onChange:S=>{!S||isNaN(S.getTime())||g(C(uo(S)))},minDate:j,maxDate:x,locale:f?"fr":m?"es":void 0,dateFormat:f?"dd/MM/yyyy":"yyyy-MM-dd",showMonthYearDropdown:!1,className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm",wrapperClassName:"w-full"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("analytics.dateRange.endDate")}),s.jsx(bh,{selected:isNaN(y.getTime())?null:y,onChange:S=>{!S||isNaN(S.getTime())||v(C(Hc(S)))},minDate:j,maxDate:x,locale:f?"fr":m?"es":void 0,dateFormat:f?"dd/MM/yyyy":"yyyy-MM-dd",showMonthYearDropdown:!1,className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm",wrapperClassName:"w-full"})]})]}),s.jsxs("div",{className:"mt-4 flex justify-end space-x-2",children:[s.jsx("button",{onClick:()=>l(!1),type:"button",className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-primary-600 rounded-lg",children:c("analytics.dateRange.cancel")}),s.jsx("button",{onClick:()=>{const S=C(p),M=C(y);n({start:S,end:M}),r("custom"),l(!1)},type:"button",className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg",children:c("analytics.dateRange.apply")})]})]})]})]})}const P0=({className:e="",message:t,isLoading:r=!1})=>{const n=pn(),{t:a}
3776=Te(),i=()=>{n("/brand-strategy-lab?modal=analyze")};return r?s.jsx("div",{className:`relative rounded-xl border border-dashed border-gray-200 bg-gray-50 p-4 ${e}`,children:s.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4 animate-pulse",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-200 mb-3"}),s.jsx("div",{className:"h-5 bg-gray-200 rounded w-48 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-64 mb-4"}),s.jsx("div",{className:"h-10 bg-gray-200 rounded w-40"})]})}):s.jsx("div",{className:`relative rounded-xl border border-dashed border-primary-300 bg-primary-50 hover:bg-primary-100 transition-colors p-4 cursor-pointer ${e}`,onClick:i,children:s.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-primary-100 flex items-center justify-center mb-3",children:s.jsx(she,{className:"w-6 h-6 text-primary-600"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:a("common.noBrandsAvailable")}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:t||a("common.createBrandFirst")}),s.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",onClick:i,children:[a("common.createBrand"),s.jsx(Jy,{className:"w-4 h-4"})]})]})})},iS="",hl=({brands:e=[],selectedBrandId:t,onBrandSelect:r,className:n="",showRedirectionCard:a=!0,isLoading:i=!1,showAllBrandsOption:o=!1})=>{const{t:l}=Te(),[c,u]=b.useState(!1),[d,f]=b.useState({}),m=Array.isArray(e)?e:[],h=b.useMemo(()=>[...m].sort((x,j)=>x.name.localeCompare(j.name)),[m]),p=b.useMemo(()=>({id:iS,name:l("brandDropdown.allBrands","All Brands"),logo:""}),[l]),g=b.useMemo(()=>o?[p,...h]:h,[o,p,h]),y=b.useMemo(()=>{if(t===iS&&o)return p;const x=h.find(j=>(j==null?void 0:j.id)===t);return x||(h.length>0&&!o?h[0]:h.length>0&&o&&t!==iS&&!t?p:{id:"",name:l("brandDropdown.noBrands","No brands available"),logo:""})},[t,o,p,h,l]),v=x=>{f(j=>({...j,[x]:!0}))};return i?s.jsxs("div",{className:`min-w-60 flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg animate-pulse ${n}`,children:[s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-200"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-24"}),s.jsx(Vr,{className:"w-4 h-4 text-gray-300"})]}):m.length===0&&!o&&a?s.jsx(P0,{className:n}):g.length===0||m.length===0&&!o?s.jsxs("div",{className:`min-w-60 flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg text-gray-400 ${n}`,children:[s.jsx("span",{className:"text-sm max-w-[150px] truncate",children:l("brandDropdown.noBrands","No brands available")}),s.jsx(Vr,{className:"w-4 h-4 text-gray-300"})]}):s.jsxs("div",{className:"relative min-w-60",children:[s.jsxs("button",{type:"button",onClick:()=>u(!c),className:`w-full flex items-center justify-between gap-2 px-4 py-2 border border-gray-200 rounded-lg hover:text-primary-600 transition-colors ${n}`,children:[s.jsxs("span",{className:"flex items-center gap-2 overflow-hidden",children:[y.logo&&!d[y.id]&&s.jsx("img",{src:y.logo,alt:y.name,className:"w-5 h-5 rounded-full flex-shrink-0",onError:()=>v(y.id)}),s.jsx("span",{className:"text-sm text-gray-700 truncate",children:y.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500 flex-shrink-0"})]}),c&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>u(!1)}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 w-full rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsxs("div",{className:"py-1 max-h-60 overflow-y-auto",children:[" ",g.map(x=>s.jsxs("button",{type:"button",onClick:()=>{r(x.id),u(!1)},className:`w-full flex items-center gap-2 px-4 py-2 text-sm ${x.id===y.id?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:[x.logo&&!d[x.id]&&s.jsx("img",{src:x.logo,alt:x.name,className:"w-5 h-5 rounded-full",onError:()=>v(x.id)}),s.jsx("span",{className:"truncate",children:x.name})]},x.id))]})})]})]})},aV=({activeTab:e,onTabChange:t,showSummary:r=!0,showAllTab:n=!1})=>{const{t:a}
3776=Te(),i=[{id:"linkedin",name:"LinkedIn"},{id:"facebook",name:"Facebook"},{id:"instagram",name:"Instagram"},{id:"youtube",name:"YouTube"}],o=[...n?[{id:"all",name:"All"}]:[],...r?[{id:"summary",name:a("analytics.summary")}]:[],...i];return s.jsx("div",{className:"mb-6 overflow-x-auto",children:s.jsx("div",{className:"flex border-b border-gray-200 min-w-max lg:min-w-0",children:o.map(l=>s.jsx("button",{onClick:()=>t(l.id),className:`px-3 lg:px-4 py-2 font-medium text-sm flex items-center gap-1 whitespace-nowrap ${e===l.id?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:l.id==="summary"?s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden lg:inline",children:l.name})]}):l.id==="all"?s.jsxs(s.Fragment,{children:[s.jsx(NE,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden lg:inline",children:l.name})]}):s.jsxs(s.Fragment,{children:[s.jsx(cr,{platform:l.id,size:16}),s.jsx("span",{className:"hidden lg:inline",children:l.name})]})},l.id))})})},sV="https://api.socialness.ai",iV=`${sV}/management`,zke=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("User not authenticated");const n=new URLSearchParams;n.append("start",e.start),n.append("end",e.end),e.brandId&&e.brandId!=="all"&&n.append("brandId",e.brandId),e.applanguage&&n.append("applanguage",e.applanguage),e.withAnalysis!==void 0&&n.append("withAnalysis",String(e.withAnalysis));const a=await fetch(`${iV}/insights/summary?${n.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!a.ok){const o=await a.json().catch(()=>({}));throw new Error(o.error||o.message||`API request failed with status ${a.status}`)}return await a.json()}catch(r){throw console.error("Error fetching analytics summary:",r),r}},Bke=async e=>{var t,r,n;try{const a=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!a)throw new Error("User not authenticated");const i=new URLSearchParams;i.append("platform",e.platform),i.append("start",e.start),i.append("end",e.end),e.brandId&&e.brandId!=="all"&&i.append("brandId",e.brandId),e.pageId&&i.append("pageId",e.pageId),e.applanguage&&i.append("applanguage",e.applanguage),e.withAnalysis!==void 0&&i.append("withAnalysis",String(e.withAnalysis));const o=`${iV}/insights/overview?${i.toString()}`;console.log("Calling API:",o);const l=await fetch(o,{method:"GET",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"}});if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.error||u.message||`API request failed with status ${l.status}`)}const c=await l.json();return console.log("Platform Overview API Response:",{platform:c.platform,pageId:c.pageId,currentBrand:(r=c.currentBrand)==null?void 0:r.name,metrics:(n=c.metrics)==null?void 0:n.length}),c}catch(a){throw console.error(`Error fetching ${e.platform} analytics:`,a),a}},Uke=async e=>{var a;const t=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!t)throw new Error("User not authenticated");const r={appLanguage:e.appLanguage,data:e.data,...e.platform&&{platform:e.platform}},n=await fetch(`${sV}/ai-coach/insights/analyze`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){const i=await n.json().catch(()=>({}));throw console.error("On-demand AI Analysis API Error:",i),new Error(i.error||i.message||`On-demand AI analysis API request failed with status ${n.status}`)}return n.json()},Vke=e=>{const{i18n:t}=Te(),r={...e,applanguage:e.applanguage||t.language};return Wa({queryKey:["analyticsSummary",r],queryFn:()=>zke(r),enabled:e.enabled,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:2,select:n=>n})},Wke=({platform:e,start:t,end:r,brandId:n,pageId:a,hasPlatformAccount:i,refresh:o,withAnalysis:l})=>{const c=qr(),{i18n:u}=Te();return b.useEffect(()=>{e&&n&&(console.log("Invalidating platform-overview cache for:",e,n),c.invalidateQueries({queryKey:["platform-overview",e,n]}))},[e,n,c]),Wa({queryKey:["platform-overview",e,t,r,n,a,o,l],queryFn:async()=>
3776{if(!e||!i)throw new Error("No platform selected or no account connected");return console.log("Fetching platform data with pageId:",a),console.log("Query key:",["platform-overview",e,t,r,n,a]),Bke({platform:e,start:t,end:r,brandId:n,pageId:a,applanguage:u.language||"en",withAnalysis:l})},enabled:!!(e&&i),staleTime:5*60*1e3})};async function qke(){var e;try{const t=await((e=Qe.currentUser)==null?void 0:e.getIdToken());if(!t)return;await fetch("https://api.socialness.ai/management/accounts/refresh-images",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}}),console.log("Profile image refresh triggered successfully")}catch(t){console.warn("Failed to trigger profile image refresh:",t)}}const qE=()=>{var n;const e=qr(),t=b.useRef(!1),r=Wa({queryKey:["accounts"],staleTime:0,gcTime:60*1e3,refetchOnWindowFocus:!0,refetchOnMount:"always",retry:2,queryFn:async()=>{var c,u,d;const a=await((c=Qe.currentUser)==null?void 0:c.getIdToken());if(!a)throw new Error("No authentication token available");const i=new Date().getTime(),o=await fetch(`https://api.socialness.ai/management/accounts?limit=50&offset=0&_=${i}`,{headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!o.ok)throw new Error("Failed to fetch accounts");const l=await o.json();return console.log("Accounts API response:",{success:l.success,pageCount:(u=l.connected_pages)==null?void 0:u.length,pages:(d=l.connected_pages)==null?void 0:d.map(f=>({name:f.name,platform:f.platform,brandId:f.brandId,pageId:f.pageId}))}),l}});return b.useEffect(()=>{var a;(a=r.data)!=null&&a.has_stale_images&&!t.current&&(t.current=!0,console.log(`Detected ${r.data.stale_image_count} stale profile images, triggering refresh...`),qke().then(()=>{setTimeout(()=>{e.invalidateQueries({queryKey:["accounts"]})},5e3)}))},[(n=r.data)==null?void 0:n.has_stale_images,e]),r};function Gke(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,a]of e)if(!Object.is(a,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}const{useRef:Hke}=U;function Yke(e){const t=Hke();return r=>{const n=e(r);return Gke(t.current,n)?t.current:t.current=n}}const LD=wf((e,t)=>({urlSyncConfig:{},urlValues:{},setUrlSyncConfig:(r,n)=>{const a=t().urlSyncConfig[r];
3776a&&a.skipSync===n.skipSync&&a.serialize===n.serialize&&a.deserialize===n.deserialize||e(i=>({urlSyncConfig:{...i.urlSyncConfig,[r]:n}}))},setUrlValue:(r,n)=>{e(a=>a.urlValues[r]===n?a:{urlValues:{...a.urlValues,[r]:n}})},syncFromUrl:r=>{const{urlSyncConfig:n,urlValues:a}=t(),i={};let o=!1;Object.entries(n).forEach(([l,c])=>{if(!c.skipSync&&r.has(l)){const u=r.get(l)||"",f=(c.deserialize||zk)(u);a[l]!==f&&(i[l]=f,o=!0)}}),o&&e(l=>({urlValues:{...l.urlValues,...i}}))},syncToUrl:r=>{const{urlSyncConfig:n,urlValues:a}=t();return Object.entries(n).forEach(([i,o])=>{if(o.skipSync)return;const l=a[i];if(l==null)r.has(i)&&r.delete(i);else{const u=(o.serialize||oV)(l);u!==r.get(i)&&r.set(i,u)}}),r}}));function oV(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.join(","):JSON.stringify(e)}function zk(e){if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch{}if(e==="true")return!0;if(e==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(e)){const t=Number(e);if(!isNaN(t))return t}return e.includes(",")?e.split(",").map(n=>n.trim()).map(n=>{if(n==="true")return!0;if(n==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(n)){const a=Number(n);if(!isNaN(a))return a}return n}):e}function fa(e,t,r={}){const n=LD(),[a,i]=ui(),o=b.useRef(r),l=b.useRef(t),c=b.useRef(!1);let u;if(a.has(e)&&!o.current.skipSync){const p=a.get(e)||"",g=o.current.deserialize||zk;try{u=g(p)}catch(y){console.error(`Error deserializing URL parameter ${e} during initial read:`,y),u=n.urlValues[e]??l.current}}else u=n.urlValues[e]??l.current;const d=LD(Yke(p=>p.urlValues[e])),f=d===void 0?u:d,m=b.useRef(f);b.useEffect(()=>{o.current=r},[r]),b.useEffect(()=>{m.current=f},[f]),b.useEffect(()=>{l.current=t},[t]),b.useEffect(()=>{if(n.setUrlSyncConfig(e,o.current),!c.current){let p,g=!1;if(a.has(e)&&!o.current.skipSync){const y=a.get(e)||"",v=o.current.deserialize||zk;try{p=v(y),g=!0}catch(x){console.error(`Error deserializing URL parameter ${e} in effect:`,x)}}!g&&l.current!==void 0&&(p=l.current,g=!0),g&&n.urlValues[e]!==p&&n.setUrlValue(e,p),c.current=!0}},[e,n,a,t,r]);const h=b.useCallback(p=>{if(p===m.current&&n.urlValues[e]===p||(n.setUrlValue(e,p),o.current.skipSync))return;const g=new URLSearchParams(a.toString()),v=(o.current.serialize||oV)(p);p==null||v===""?g.has(e)&&g.delete(e):g.get(e)!==v&&g.set(e,v),a.toString()!==g.toString()&&i(g,{replace:!0})},[e,a,i,n]);return[f,h]}const Qke=wf((e,t)=>{const r=lp(new Date);return{dateRange:"last-month",customDateRange:{start:Pu(r),end:op(r)},selectedBrand:null,activeTab:"summary",setDateRange:n=>e(a=>a.dateRange===n?a:{dateRange:n}),setCustomDateRange:n=>e({customDateRange:n}),setSelectedBrand:n=>e(a=>a.selectedBrand===n?a:{selectedBrand:n}),setActiveTab:n=>e(a=>a.activeTab===n?a:{activeTab:n})}});function Kke(){const e=Qke(),[t,r]=ui(),n=b.useRef(!0),a=b.useRef(!1),i=b.useRef(e);b.useEffect(()=>{i.current=e},[e]);const o=b.useRef({skipSync:!1}).current,l=b.useRef({skipSync:!1}).current,c=b.useRef({skipSync:!1}).current,[u,d]=fa("platform",e.activeTab,o),[f,m]=fa("brand",e.selectedBrand,l),[h,p]=fa("dateRange",e.dateRange,c);b.useEffect(()=>{if(t.has("tab")&&t.has("platform")){const x=new URLSearchParams(t);x.delete("tab"),x.has("view")&&x.delete("view"),r(x)}},[t,r]),b.useEffect(()=>{if(n.current){const x=i.current;u!==x.activeTab&&x.setActiveTab(u),f!==x.selectedBrand&&x.setSelectedBrand(f),h!==x.dateRange&&x.setDateRange(h),n.current=!1}},[]);const g=b.useCallback(x=>{x!==u&&(d(x),a.current=!0,i.current.setActiveTab(x),a.current=!1)},[u,d]),y=b.useCallback(x=>{x!==f&&(m(x),a.current=!0,i.current.setSelectedBrand(x),a.current=!1)},[f,m]),v=b.useCallback(x=>{x!==h&&(p(x),a.current=!0,i.current.setDateRange(x),a.current=!1)},[h,p]);return b.useEffect(()=>{!n.current&&!a.current&&u!==i.current.activeTab&&i.current.setActiveTab(u)},[u]),b.useEffect(()=>{!n.current&&!a.current&&f!==i.current.selectedBrand&&i.current.setSelectedBrand(f)},[f]),b.useEffect(()=>{!n.current&&!a.current&&h!==i.current.dateRange&&i.current.setDateRange(h)},[h]),{activeTab:u,selectedBrand:f,dateRange:h,setActiveTab:g,setSelectedBrand:y,setDateRange:v,customDateRange:e.customDateRange,setCustomDateRange:e.setCustomDateRange}}const Jke=()=>mn({mutationFn:e=>Uke(e)}
vendor: 6,508 bytes, line 3776
3776),rs=({title:e,subtitle:t,children:r,actions:n,className:a="",headerClassName:i="",fullHeight:o=!0,outerClassName:l=""})=>s.jsx("div",{className:`${o?"min-h-screen":""} bg-white lg:ml-16 pt-16 sm:pt-6 lg:pt-0 ${l}`,children:s.jsx("div",{className:"w-[95%] mx-auto",children:s.jsxs("div",{className:"py-4",children:[s.jsxs("div",{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-8 ${i}`,children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 font-title mb-2",children:e}),t?s.jsx("div",{className:"mt-1 text-gray-500 font-body",children:t}):null]}),n&&s.jsx("div",{className:"flex items-center gap-3",children:n})]}),s.jsx("div",{className:a,children:r})]})})});var Zke=Array.isArray,Gs=Zke,Xke=typeof jg=="object"&&jg&&jg.Object===Object&&jg,lV=Xke,eMe=lV,tMe=typeof self=="object"&&self&&self.Object===Object&&self,rMe=eMe||tMe||Function("return this")(),pl=rMe,nMe=pl,aMe=nMe.Symbol,nb=aMe,DD=nb,cV=Object.prototype,sMe=cV.hasOwnProperty,iMe=cV.toString,ng=DD?DD.toStringTag:void 0;function oMe(e){var t=sMe.call(e,ng),r=e[ng];try{e[ng]=void 0;var n=!0}catch{}var a=iMe.call(e);return n&&(t?e[ng]=r:delete e[ng]),a}var lMe=oMe,cMe=Object.prototype,uMe=cMe.toString;function dMe(e){return uMe.call(e)}var fMe=dMe,OD=nb,mMe=lMe,hMe=fMe,pMe="[object Null]",gMe="[object Undefined]",RD=OD?OD.toStringTag:void 0;function yMe(e){return e==null?e===void 0?gMe:pMe:RD&&RD in Object(e)?mMe(e):hMe(e)}var xc=yMe;function bMe(e){return e!=null&&typeof e=="object"}var wc=bMe,vMe=xc,xMe=wc,wMe="[object Symbol]";function jMe(e){return typeof e=="symbol"||xMe(e)&&vMe(e)==wMe}var cp=jMe,NMe=Gs,SMe=cp,CMe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kMe=/^\w*$/;function MMe(e,t){if(NMe(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||SMe(e)?!0:kMe.test(e)||!CMe.test(e)||t!=null&&e in Object(t)}var GE=MMe;function IMe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Fu=IMe;const up=hn(Fu);var EMe=xc,TMe=Fu,AMe="[object AsyncFunction]",PMe="[object Function]",_Me="[object GeneratorFunction]",LMe="[object Proxy]";function DMe(e){if(!TMe(e))return!1;var t=EMe(e);return t==PMe||t==_Me||t==AMe||t==LMe}var HE=DMe;const yr=hn(HE);var OMe=pl,RMe=OMe["__core-js_shared__"],$Me=RMe,oS=$Me,$D=function(){var e=/[^.]+$/.exec(oS&&oS.keys&&oS.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function FMe(e){return!!$D&&$D in e}var zMe=FMe,BMe=Function.prototype,UMe=BMe.toString;function VMe(e){if(e!=null){try{return UMe.call(e)}catch{}try{return e+""}catch{}}return""}var uV=VMe,WMe=HE,qMe=zMe,GMe=Fu,HMe=uV,YMe=/[\\^$.*+?()[\]{}|]/g,QMe=/^\[object .+?Constructor\]$/,KMe=Function.prototype,JMe=Object.prototype,ZMe=KMe.toString,XMe=JMe.hasOwnProperty,e4e=RegExp("^"+ZMe.call(XMe).replace(YMe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t4e(e){if(!GMe(e)||qMe(e))return!1;var t=WMe(e)?e4e:QMe;return t.test(HMe(e))}var r4e=t4e;function n4e(e,t){return e==null?void 0:e[t]}var a4e=n4e,s4e=r4e,i4e=a4e;function o4e(e,t){var r=i4e(e,t);return s4e(r)?r:void 0}var Sf=o4e,l4e=Sf,c4e=l4e(Object,"create"),q2=c4e,FD=q2;function u4e(){this.__data__=FD?FD(null):{},this.size=0}var d4e=u4e;function f4e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var m4e=f4e,h4e=q2,p4e="__lodash_hash_undefined__",g4e=Object.prototype,y4e=g4e.hasOwnProperty;function b4e(e){var t=this.__data__;if(h4e){var r=t[e];return r===p4e?void 0:r}return y4e.call(t,e)?t[e]:void 0}var v4e=b4e,x4e=q2,w4e=Object.prototype,j4e=w4e.hasOwnProperty;function N4e(e){var t=this.__data__;return x4e?t[e]!==void 0:j4e.call(t,e)}var S4e=N4e,C4e=q2,k4e="__lodash_hash_undefined__";function M4e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=C4e&&t===void 0?k4e:t,this}var I4e=M4e,E4e=d4e,T4e=m4e,A4e=v4e,P4e=S4e,_4e=I4e;function dp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}dp.prototype.clear=E4e;dp.prototype.delete=T4e;dp.prototype.get=A4e;dp.prototype.has=P4e;dp.prototype.set=_4e;var L4e=dp;function D4e(){this.__data__=[],this.size=0}var O4e=D4e;function R4e(e,t){return e===t||e!==e&&t!==t}var YE=R4e,$4e=YE;function F4e(e,t){for(var r=e.length;r--;)if($4e(e[r][0],t))return r;return-1}var G2=F4e,z4e=G2,B4e=Array.prototype,U4e=B4e.splice;function V4e(e){var t=this.__data__,r=z4e(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():U4e.call(t,r,1),--this.size,!0}var W4e=V4e,q4e=G2;function G4e(e){var t=this.__data__,r=q4e(t,e);return r<0?void 0:t[r][1]}var H4e=G4e,Y4e=G2;function Q4e(e){return Y4e(this.__data__,e)>-1}var K4e=Q4e,J4e=G2;function Z4e(e,t){var r=this.__data__,n=J4e(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var X4e=Z4e,eIe=O4e,tIe=W4e,rIe=H4e,nIe=K4e,aIe=X4e;function fp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fp.prototype.clear=eIe;fp.prototype.delete=tIe;fp.prototype.get=rIe;fp.prototype.has=nIe;fp.prototype.set=aIe;var H2=fp,sIe=Sf,iIe=pl,oIe=sIe(iIe,"Map"),QE=oIe,zD=L4e,lIe=H2,cIe=QE;function uIe(){this.size=0,this.__data__={hash:new zD,map:new(cIe||lIe),string:new zD}}var dIe=uIe;function fIe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var mIe=fIe,hIe=mIe;function pIe(e,t){var r=e.__data__;return hIe(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Y2=pIe,gIe=Y2;function yIe(e){var t=gIe(this,e).delete(e);return this.size-=t?1:0,t}var bIe=yIe,vIe=Y2;function xIe(e){return vIe(this,e).get(e)}var wIe=xIe,jIe=Y2;function NIe(e){return jIe(this,e).has(e)}var SIe=NIe,CIe=Y2;function kIe(e,t){var r=CIe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var MIe=kIe,IIe=dIe,EIe=bIe,TIe=wIe,AIe=SIe,PIe=MIe;function mp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mp.prototype.clear=IIe;mp.prototype.delete=EIe;mp.prototype.get=TIe;mp.prototype.has=AIe;mp.prototype.set=PIe;var KE=mp,dV=KE,_Ie="Expected a function";function JE(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_Ie);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(JE.Cache||dV),r}JE.Cache=dV;var fV=JE;const LIe=hn(fV);var DIe=fV,OIe=500;function RIe(e){var t=DIe(e,function(n){return r.size===OIe&&r.clear(),n}
vendor: 6,734 bytes, lines 3776-3784
3776),r=t.cache;return t}var $Ie=RIe,FIe=$Ie,zIe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BIe=/\\(\\)?/g,UIe=FIe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(zIe,function(r,n,a,i){t.push(a?i.replace(BIe,"$1"):n||r)}),t}),VIe=UIe;function WIe(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var ZE=WIe,BD=nb,qIe=ZE,GIe=Gs,HIe=cp,UD=BD?BD.prototype:void 0,VD=UD?UD.toString:void 0;function mV(e){if(typeof e=="string")return e;if(GIe(e))return qIe(e,mV)+"";if(HIe(e))return VD?VD.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var YIe=mV,QIe=YIe;function KIe(e){return e==null?"":QIe(e)}var hV=KIe,JIe=Gs,ZIe=GE,XIe=VIe,eEe=hV;function tEe(e,t){return JIe(e)?e:ZIe(e,t)?[e]:XIe(eEe(e))}var pV=tEe,rEe=cp;function nEe(e){if(typeof e=="string"||rEe(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Q2=nEe,aEe=pV,sEe=Q2;function iEe(e,t){t=aEe(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[sEe(t[r++])];return r&&r==n?e:void 0}var XE=iEe,oEe=XE;function lEe(e,t,r){var n=e==null?void 0:oEe(e,t);return n===void 0?r:n}var gV=lEe;const Di=hn(gV);function cEe(e){return e==null}var uEe=cEe;const _r=hn(uEe);var dEe=xc,fEe=Gs,mEe=wc,hEe="[object String]";function pEe(e){return typeof e=="string"||!fEe(e)&&mEe(e)&&dEe(e)==hEe}var gEe=pEe;const lf=hn(gEe);var yV={exports:{}},Nn={};/**
3777 * @license React
3778 * react-is.production.min.js
3779 *
3780 * Copyright (c) Facebook, Inc. and its affiliates.
3781 *
3782 * This source code is licensed under the MIT license found in the
3783 * LICENSE file in the root directory of this source tree.
3784 */var eT=Symbol.for("react.element"),tT=Symbol.for("react.portal"),K2=Symbol.for("react.fragment"),J2=Symbol.for("react.strict_mode"),Z2=Symbol.for("react.profiler"),X2=Symbol.for("react.provider"),ej=Symbol.for("react.context"),yEe=Symbol.for("react.server_context"),tj=Symbol.for("react.forward_ref"),rj=Symbol.for("react.suspense"),nj=Symbol.for("react.suspense_list"),aj=Symbol.for("react.memo"),sj=Symbol.for("react.lazy"),bEe=Symbol.for("react.offscreen"),bV;bV=Symbol.for("react.module.reference");function Wi(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case eT:switch(e=e.type,e){case K2:case Z2:case J2:case rj:case nj:return e;default:switch(e=e&&e.$$typeof,e){case yEe:case ej:case tj:case sj:case aj:case X2:return e;default:return t}}case tT:return t}}}Nn.ContextConsumer=ej;Nn.ContextProvider=X2;Nn.Element=eT;Nn.ForwardRef=tj;Nn.Fragment=K2;Nn.Lazy=sj;Nn.Memo=aj;Nn.Portal=tT;Nn.Profiler=Z2;Nn.StrictMode=J2;Nn.Suspense=rj;Nn.SuspenseList=nj;Nn.isAsyncMode=function(){return!1};Nn.isConcurrentMode=function(){return!1};Nn.isContextConsumer=function(e){return Wi(e)===ej};Nn.isContextProvider=function(e){return Wi(e)===X2};Nn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===eT};Nn.isForwardRef=function(e){return Wi(e)===tj};Nn.isFragment=function(e){return Wi(e)===K2};Nn.isLazy=function(e){return Wi(e)===sj};Nn.isMemo=function(e){return Wi(e)===aj};Nn.isPortal=function(e){return Wi(e)===tT};Nn.isProfiler=function(e){return Wi(e)===Z2};Nn.isStrictMode=function(e){return Wi(e)===J2};Nn.isSuspense=function(e){return Wi(e)===rj};Nn.isSuspenseList=function(e){return Wi(e)===nj};Nn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===K2||e===Z2||e===J2||e===rj||e===nj||e===bEe||typeof e=="object"&&e!==null&&(e.$$typeof===sj||e.$$typeof===aj||e.$$typeof===X2||e.$$typeof===ej||e.$$typeof===tj||e.$$typeof===bV||e.getModuleId!==void 0)};Nn.typeOf=Wi;yV.exports=Nn;var vEe=yV.exports,xEe=xc,wEe=wc,jEe="[object Number]";function NEe(e){return typeof e=="number"||wEe(e)&&xEe(e)==jEe}var vV=NEe;const SEe=hn(vV);var CEe=vV;function kEe(e){return CEe(e)&&e!=+e}var MEe=kEe;const hp=hn(MEe);var fo=function(t){return t===0?0:t>0?1:-1},xd=function(t){return lf(t)&&t.indexOf("%")===t.length-1},ut=function(t){return SEe(t)&&!hp(t)},IEe=function(t){return _r(t)},Aa=function(t){return ut(t)||lf(t)},EEe=0,ab=function(t){var r=++EEe;return"".concat(t||"").concat(r)},cf=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ut(t)&&!lf(t))return n;var i;if(xd(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return hp(i)&&(i=n),a&&i>r&&(i=r),i},Yc=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},TEe=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},ki=function(t,r){return ut(t)&&ut(r)?function(n){return t+n*(r-t)}:function(){return r}};function g1(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Di(n,t))===r})}var AEe=function(t,r){return ut(t)&&ut(r)?t-r:lf(t)&&lf(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Mm(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Bk(e){"@babel/helpers - typeof";return Bk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bk(e)}var PEe=["viewBox","children"],_Ee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
3784dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],WD=["points","pathLength"],lS={svg:PEe,polygon:WD,polyline:WD},rT=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
3784Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],y1=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(b.isValidElement(t)&&(n=t.props),!up(n))return null;var a={};return Object.keys(n).forEach(function(i){rT.includes(i)&&(a[i]=r||function(o){return n[i](n,o)})}),a},LEe=function(t,r,n){return function(a){return t(r,n,a),null}},b1=function(t,r,n){if(!up(t)||Bk(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];rT.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=LEe(o,r,n))}),a},DEe=["children"],OEe=["children"];function qD(e,t){if(e==null)return{};var r=REe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function REe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Uk(e){"@babel/helpers - typeof";return Uk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uk(e)}var GD={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Jl=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},HD=null,cS=null,nT=function e(t){if(t===HD&&Array.isArray(cS))return cS;var r=[];return b.Children.forEach(t,function(n){_r(n)||(vEe.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),cS=r,HD=t,r};function yo(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Jl(a)}):n=[Jl(t)],nT(e).forEach(function(a){var i=Di(a,"type.displayName")||Di(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Ks(e,t){var r=yo(e,t);return r&&r[0]}var YD=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!ut(n)||n<=0||!ut(a)||a<=0)},$Ee=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],FEe=function(t){return t&&t.type&&lf(t.type)&&$Ee.indexOf(t.type)>=0},zEe=function(t){return t&&Uk(t)==="object"&&"clipDot"in t},BEe=function(t,r,n,a){var i,o=(i=lS==null?void 0:lS[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!yr(t)&&(a&&o.includes(r)||_Ee.includes(r))||n&&rT.includes(r)},Er=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(b.isValidElement(t)&&(a=t.props),!up(a))return null;var i={};
3784return Object.keys(a).forEach(function(o){var l;BEe((l=a)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=a[o])}),i},Vk=function e(t,r){if(t===r)return!0;var n=b.Children.count(t);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return QD(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],o=r[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!QD(i,o))return!1}return!0},QD=function(t,r){if(_r(t)&&_r(r))return!0;if(!_r(t)&&!_r(r)){var n=t.props||{},a=n.children,i=qD(n,DEe),o=r.props||{},l=o.children,c=qD(o,OEe);return a&&l?Mm(i,c)&&Vk(a,l):!a&&!l?Mm(i,c):!1}return!1},KD=function(t,r){var n=[],a={};return nT(t).forEach(function(i,o){if(FEe(i))n.push(i);else if(i){var l=Jl(i.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,o);n.push(f),a[l]=!0}}}),n},UEe=function(t){var r=t&&t.type;return r&&GD[r]?GD[r]:null},VEe=function(t,r){return nT(r).indexOf(t)},WEe=["children","width","height","viewBox","className","style","title","desc"];function Wk(){return Wk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wk.apply(this,arguments)}function qEe(e,t){if(e==null)return{};var r=GEe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qk(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=qEe(e,WEe),d=a||{width:r,height:n,x:0,y:0},f=Jt("recharts-surface",i);return U.createElement("svg",Wk({},Er(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),U.createElement("title",null,l),U.createElement("desc",null,c),t)}var HEe=["children","className"];function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gk.apply(this,arguments)}function YEe(e,t){if(e==null)return{};var r=QEe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Zn=U.forwardRef(function(e,t){var r=e.children,n=e.className,a=YEe(e,HEe),i=Jt("recharts-layer",n);return U.createElement("g",Gk({className:i},Er(a,!0),{ref:t}),r)}),Zl=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function KEe(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var JEe=KEe,ZEe=JEe;function XEe(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:ZEe(e,t,r)}var eTe=XEe,tTe="\\ud800-\\udfff",rTe="\\u0300-\\u036f",nTe="\\ufe20-\\ufe2f",aTe="\\u20d0-\\u20ff",sTe=rTe+nTe+aTe,iTe="\\ufe0e\\ufe0f",oTe="\\u200d",lTe=RegExp("["+oTe+tTe+sTe+iTe+"]");function cTe(e){return lTe.test(e)}var xV=cTe;function uTe(e){return e.split("")}var dTe=uTe,wV="\\ud800-\\udfff",fTe="\\u0300-\\u036f",mTe="\\ufe20-\\ufe2f",hTe="\\u20d0-\\u20ff",pTe=fTe+mTe+hTe,gTe="\\ufe0e\\ufe0f",yTe="["+wV+"]",Hk="["+pTe+"]",Yk="\\ud83c[\\udffb-\\udfff]",bTe="(?:"+Hk+"|"+Yk+")",jV="[^"+wV+"]",NV="(?:\\ud83c[\\udde6-\\uddff]){2}",SV="[\\ud800-\\udbff][\\udc00-\\udfff]",vTe="\\u200d",CV=bTe+"?",kV="["+gTe+"]?",xTe="(?:"+vTe+"(?:"+[jV,NV,SV].join("|")+")"+kV+CV+")*",wTe=kV+CV+xTe,jTe="(?:"+[jV+Hk+"?",Hk,NV,SV,yTe].join("|")+")",NTe=RegExp(Yk+"(?="+Yk+")|"+jTe+wTe,"g");function STe(e){return e.match(NTe)||[]}var CTe=STe,kTe=dTe,MTe=xV,ITe=CTe;function ETe(e){return MTe(e)?ITe(e):kTe(e)}var TTe=ETe,ATe=eTe,PTe=xV,_Te=TTe,LTe=hV;function DTe(e){return function(t){t=LTe(t);var r=PTe(t)?_Te(t):void 0,n=r?r[0]:t.charAt(0),a=r?ATe(r,1).join(""):t.slice(1);return n[e]()+a}}var OTe=DTe,RTe=OTe,$Te=RTe("toUpperCase"),FTe=$Te;const ij=hn(FTe);function Dn(e){return function(){return e}}const MV=Math.cos,v1=Math.sin,jo=Math.sqrt,x1=Math.PI,oj=2*x1,Qk=Math.PI,Kk=2*Qk,od=1e-6,zTe=Kk-od;function IV(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function BTe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return IV;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class UTe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?IV:BTe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,o){this._append`C${+t},${+r},${+n}
3784,${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,u=a-r,d=o-t,f=l-r,m=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>od)if(!(Math.abs(f*c-u*d)>od)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=a-l,g=c*c+u*u,y=h*h+p*p,v=Math.sqrt(g),x=Math.sqrt(m),j=i*Math.tan((Qk-Math.acos((g+m-y)/(2*v*x)))/2),C=j/x,N=j/v;Math.abs(C-1)>od&&this._append`L${t+C*d},${r+C*f}`,this._append`A${i},${i},0,0,${+(f*h>d*p)},${this._x1=t+N*c},${this._y1=r+N*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,d=r+c,f=1^o,m=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>od||Math.abs(this._y1-d)>od)&&this._append`L${u},${d}`,n&&(m<0&&(m=m%Kk+Kk),m>zTe?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:m>od&&this._append`A${n},${n},0,${+(m>=Qk)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function aT(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new UTe(t)}function sT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function EV(e){this._context=e}EV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function lj(e){return new EV(e)}function TV(e){return e[0]}function AV(e){return e[1]}function PV(e,t){var r=Dn(!0),n=null,a=lj,i=null,o=aT(l);e=typeof e=="function"?e:e===void 0?TV:Dn(e),t=typeof t=="function"?t:t===void 0?AV:Dn(t);function l(c){var u,d=(c=sT(c)).length,f,m=!1,h;for(n==null&&(i=a(h=o())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+e(f,u,c),+t(f,u,c));if(h)return i=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Dn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Dn(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Dn(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function sv(e,t,r){var n=null,a=Dn(!0),i=null,o=lj,l=null,c=aT(u);e=typeof e=="function"?e:e===void 0?TV:Dn(+e),t=typeof t=="function"?t:Dn(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?AV:Dn(+r);function u(f){var m,h,p,g=(f=sT(f)).length,y,v=!1,x,j=new Array(g),C=new Array(g);for(i==null&&(l=o(x=c())),m=0;m<=g;++m){if(!(m<g&&a(y=f[m],m,f))===v)if(v=!v)h=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=m-1;p>=h;--p)l.point(j[p],C[p]);l.lineEnd(),l.areaEnd()}v&&(j[m]=+e(y,m,f),C[m]=+t(y,m,f),l.point(n?+n(y,m,f):j[m],r?+r(y,m,f):C[m]))}if(x)return l=null,x+""||null}function d(){return PV().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Dn(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Dn(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Dn(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Dn(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Dn(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Dn(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:Dn(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),u):i},u}class _V{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function VTe(e){return new _V(e,!0)}function WTe(e){return new _V(e,!1)}const iT={draw(e,t){const r=jo(t/x1);e.moveTo(r,0),e.arc(0,0,r,0,oj)}},qTe={draw(e,t){const r=jo(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},LV=jo(1/3),GTe=LV*2,HTe={draw(e,t){const r=jo(t/GTe),n=r*LV;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},YTe={draw(e,t){const r=jo(t),n=-r/2;e.rect(n,n,r,r)}},QTe=.8908130915292852,DV=v1(x1/10)/v1(7*x1/10),KTe=v1(oj/10)*DV,JTe=-MV(oj/10)*DV,ZTe={draw(e,t){const r=jo(t*QTe),n=KTe*r,a=JTe*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=oj*i/5,l=MV(o),c=v1(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},uS=jo(3),XTe={draw(e,t){const r=-jo(t/(uS*3));e.moveTo(0,r*2),e.lineTo(-uS*r,-r),e.lineTo(uS*r,-r),e.closePath()}},pi=-.5,gi=jo(3)/2,Jk=1/jo(12),eAe=(Jk/2+1)*3,tAe={draw(e,t){const r=jo(t/eAe),n=r/2,a=r*Jk,i=n,o=r*Jk+r,l=-i,c=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(pi*n-gi*a,gi*n+pi*a),e.lineTo(pi*i-gi*o,gi*i+pi*o),e.lineTo(pi*l-gi*c,gi*l+pi*c),e.lineTo(pi*n+gi*a,pi*a-gi*n),e.lineTo(pi*i+gi*o,pi*o-gi*i),e.lineTo(pi*l+gi*c,pi*c-gi*l),e.closePath()}};function rAe(e,t){let r=null,n=aT(a);e=typeof e=="function"?e:Dn(e||iT),t=typeof t=="function"?t:Dn(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Dn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Dn(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function w1(){}function j1(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function OV(e){this._context=e}OV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:j1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:j1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nAe(e){return new OV(e)}function RV(e){this._context=e}RV.prototype={areaStart:w1,areaEnd:w1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:j1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aAe(e){return new RV(e)}function $V(e){this._context=e}$V.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:j1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sAe(e){return new $V(e)}function FV(e){this._context=e}FV.prototype={areaStart:w1,areaEnd:w1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function iAe(e){return new FV(e)}function JD(e){return e<0?-1:1}function ZD(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(JD(i)+JD(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function XD(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function dS(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,o-l*r,i,o)}function N1(e){this._context=e}N1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dS(this,this._t0,XD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,dS(this,XD(this,r=ZD(this,e,t)),r);break;default:dS(this,this._t0,r=ZD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function zV(e){this._context=new BV(e)}(zV.prototype=Object.create(N1.prototype)).point=function(e,t){N1.prototype.point.call(this,t,e)};function BV(e){this._context=e}BV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function oAe(e){return new N1(e)}function lAe(e){return new zV(e)}function UV(e){this._context=e}UV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=e6(e),a=e6(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function e6(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(a[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function cAe(e){return new UV(e)}function cj(e,t){this._context=e,this._t=t}cj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,144 bytes, lines 3784-3787
3784default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function uAe(e){return new cj(e,.5)}function dAe(e){return new cj(e,0)}function fAe(e){return new cj(e,1)}function vh(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,l=i.length;r<o;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function Zk(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function mAe(e,t){return e[t]}function hAe(e){const t=[];return t.key=e,t}function pAe(){var e=Dn([]),t=Zk,r=vh,n=mAe;function a(i){var o=Array.from(e.apply(this,arguments),hAe),l,c=o.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(f,o[l].key,u,i)]).data=f;for(l=0,d=sT(t(o));l<c;++l)o[d[l]].index=l;return r(o,d),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Dn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:Dn(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?Zk:typeof i=="function"?i:Dn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??vh,a):r},a}function gAe(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=e[r][a][1]||0;if(o)for(r=0;r<n;++r)e[r][a][1]/=o}vh(e,t)}}function yAe(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}vh(e,t)}}function bAe(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n<i;++n){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[n][1]||0,m=d[n-1][1]||0,h=(f-m)/2,p=0;p<l;++p){var g=e[t[p]],y=g[n][1]||0,v=g[n-1][1]||0;h+=y-v}c+=f,u+=h*f}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,vh(e,t)}}function _0(e){"@babel/helpers - typeof";return _0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_0(e)}var vAe=["type","size","sizeType"];function Xk(){return Xk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xk.apply(this,arguments)}function t6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t6(Object(r),!0).forEach(function(n){xAe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xAe(e,t,r){return t=wAe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wAe(e){var t=jAe(e,"string");return _0(t)=="symbol"?t:t+""}function jAe(e,t){if(_0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NAe(e,t){if(e==null)return{};var r=SAe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SAe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var VV={symbolCircle:iT,symbolCross:qTe,symbolDiamond:HTe,symbolSquare:YTe,symbolStar:ZTe,symbolTriangle:XTe,symbolWye:tAe},CAe=Math.PI/180,kAe=function(t){var r="symbol".concat(ij(t));return VV[r]||iT},MAe=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*CAe;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},IAe=function(t,r){VV["symbol".concat(ij(t))]=r},oT=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=NAe(t,vAe),u=r6(r6({},c),{},{type:n,size:i,sizeType:l}),d=function(){var y=kAe(n),v=rAe().type(y).size(MAe(i,l,n));return v()},f=u.className,m=u.cx,h=u.cy,p=Er(u,!0);return m===+m&&h===+h&&i===+i?U.createElement("path",Xk({},p,{className:Jt("recharts-symbols",f),transform:"translate(".concat(m,", ").concat(h,")"),d:d()})):null};oT.registerSymbol=IAe;function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xh(e)}function eM(){return eM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eM.apply(this,arguments)}function n6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function EAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n6(Object(r),!0).forEach(function(n){L0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AAe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qV(n.key),n)}}function PAe(e,t,r){return t&&AAe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Ae(e,t,r){return t=S1(t),LAe(e,WV()?Reflect.construct(t,r||[],S1(e).constructor):t.apply(e,r))}function LAe(e,t){if(t&&(xh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DAe(e)}function DAe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WV=function(){return!!e})()}function S1(e){return S1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},S1(e)}function OAe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tM(e,t)}function tM(e,t){return tM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},tM(e,t)}function L0(e,t,r){return t=qV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qV(e){var t=RAe(e,"string");return xh(t)=="symbol"?t:t+""}function RAe(e,t){if(xh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yi=32,lT=function(e){function t(){return TAe(this,t),_Ae(this,t,arguments)}return OAe(t,e),PAe(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=yi/2,o=yi/6,l=yi/3,c=n.inactive?a:n.color;if(n.type==="plainline")return U.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:yi,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return U.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
3785            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
3786            H`).concat(yi,"M").concat(2*l,",").concat(i,`
3787            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return U.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(yi/8,"h").concat(yi,"v").concat(yi*3/4,"h").concat(-yi,"z"),className:"recharts-legend-icon"});if(U.isValidElement(n.legendIcon)){var u=EAe({},n);return delete u.legendIcon,U.cloneElement(n.legendIcon,u)}return U.createElement(oT,{fill:c,cx:i,cy:i,size:yi,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:yi,height:yi}
3787,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(h,p){var g=h.formatter||c,y=Jt(L0(L0({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",h.inactive));if(h.type==="none")return null;var v=yr(h.value)?null:h.value;Zl(!yr(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var x=h.inactive?u:h.color;return U.createElement("li",eM({className:y,style:f,key:"legend-item-".concat(p)},b1(n.props,h,p)),U.createElement(qk,{width:o,height:o,viewBox:d,style:m},n.renderIcon(h)),U.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},g?g(v,h,p):v))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return U.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(b.PureComponent);L0(lT,"displayName","Legend");L0(lT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var $Ae=H2;function FAe(){this.__data__=new $Ae,this.size=0}var zAe=FAe;function BAe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var UAe=BAe;function VAe(e){return this.__data__.get(e)}var WAe=VAe;function qAe(e){return this.__data__.has(e)}var GAe=qAe,HAe=H2,YAe=QE,QAe=KE,KAe=200;function JAe(e,t){var r=this.__data__;if(r instanceof HAe){var n=r.__data__;if(!YAe||n.length<KAe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new QAe(n)}return r.set(e,t),this.size=r.size,this}var ZAe=JAe,XAe=H2,ePe=zAe,tPe=UAe,rPe=WAe,nPe=GAe,aPe=ZAe;function pp(e){var t=this.__data__=new XAe(e);this.size=t.size}pp.prototype.clear=ePe;pp.prototype.delete=tPe;pp.prototype.get=rPe;pp.prototype.has=nPe;pp.prototype.set=aPe;var GV=pp,sPe="__lodash_hash_undefined__";function iPe(e){return this.__data__.set(e,sPe),this}var oPe=iPe;function lPe(e){return this.__data__.has(e)}var cPe=lPe,uPe=KE,dPe=oPe,fPe=cPe;function C1(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new uPe;++t<r;)this.add(e[t])}C1.prototype.add=C1.prototype.push=dPe;C1.prototype.has=fPe;var HV=C1;function mPe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var YV=mPe;function hPe(e,t){return e.has(t)}var QV=hPe,pPe=HV,gPe=YV,yPe=QV,bPe=1,vPe=2;function xPe(e,t,r,n,a,i){var o=r&bPe,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,m=!0,h=r&vPe?new pPe:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var p=e[f],g=t[f];if(n)var y=o?n(g,p,f,t,e,i):n(p,g,f,e,t,i);if(y!==void 0){if(y)continue;m=!1;break}if(h){if(!gPe(t,function(v,x){if(!yPe(h,x)&&(p===v||a(p,v,r,n,i)))return h.push(x)})){m=!1;break}}else if(!(p===g||a(p,g,r,n,i))){m=!1;break}}return i.delete(e),i.delete(t),m}var KV=xPe,wPe=pl,jPe=wPe.Uint8Array,NPe=jPe;function SPe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var CPe=SPe;function kPe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var cT=kPe,a6=nb,s6=NPe,MPe=YE,IPe=KV,EPe=CPe,TPe=cT,APe=1,PPe=2,_Pe="[object Boolean]",LPe="[object Date]",DPe="[object Error]",OPe="[object Map]",RPe="[object Number]",$Pe="[object RegExp]",FPe="[object Set]",zPe="[object String]",BPe="[object Symbol]",UPe="[object ArrayBuffer]",VPe="[object DataView]",i6=a6?a6.prototype:void 0,fS=i6?i6.valueOf:void 0;function WPe(e,t,r,n,a,i,o){switch(r){case VPe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case UPe:return!(e.byteLength!=t.byteLength||!i(new s6(e),new s6(t)));case _Pe:case LPe:case RPe:return MPe(+e,+t);case DPe:return e.name==t.name&&e.message==t.message;case $Pe:case zPe:return e==t+"";case OPe:var l=EPe;case FPe:var c=n&APe;if(l||(l=TPe),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=PPe,o.set(e,t);var d=IPe(l(e),l(t),n,a,i,o);return o.delete(e),d;case BPe:if(fS)return fS.call(e)==fS.call(t)}return!1}var qPe=WPe;function GPe(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var JV=GPe,HPe=JV,YPe=Gs;function QPe(e,t,r){var n=t(e);return YPe(e)?n:HPe(n,r(e))}var KPe=QPe;function JPe(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}var ZPe=JPe;function XPe(){return[]}var e_e=XPe,t_e=ZPe,r_e=e_e,n_e=Object.prototype,a_e=n_e.propertyIsEnumerable,o6=Object.getOwnPropertySymbols,s_e=o6?function(e){return e==null?[]:(e=Object(e),t_e(o6(e),function(t){return a_e.call(e,t)}))}:r_e,i_e=s_e;function o_e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var l_e=o_e,c_e=xc,u_e=wc,d_e="[object Arguments]";function f_e(e){return u_e(e)&&c_e(e)==d_e}var m_e=f_e,l6=m_e,h_e=wc,ZV=Object.prototype,p_e=ZV.hasOwnProperty,g_e=ZV.propertyIsEnumerable,y_e=l6(function(){return arguments}())?l6:function(e){return h_e(e)&&p_e.call(e,"callee")&&!g_e.call(e,"callee")},uT=y_e,k1={exports:{}};function b_e(){return!1}var v_e=b_e;k1.exports;(function(e,t){var r=pl,n=v_e,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u}
vendor: 4,423 bytes, line 3787
3787)(k1,k1.exports);var XV=k1.exports,x_e=9007199254740991,w_e=/^(?:0|[1-9]\d*)$/;function j_e(e,t){var r=typeof e;return t=t??x_e,!!t&&(r=="number"||r!="symbol"&&w_e.test(e))&&e>-1&&e%1==0&&e<t}var dT=j_e,N_e=9007199254740991;function S_e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=N_e}var fT=S_e,C_e=xc,k_e=fT,M_e=wc,I_e="[object Arguments]",E_e="[object Array]",T_e="[object Boolean]",A_e="[object Date]",P_e="[object Error]",__e="[object Function]",L_e="[object Map]",D_e="[object Number]",O_e="[object Object]",R_e="[object RegExp]",$_e="[object Set]",F_e="[object String]",z_e="[object WeakMap]",B_e="[object ArrayBuffer]",U_e="[object DataView]",V_e="[object Float32Array]",W_e="[object Float64Array]",q_e="[object Int8Array]",G_e="[object Int16Array]",H_e="[object Int32Array]",Y_e="[object Uint8Array]",Q_e="[object Uint8ClampedArray]",K_e="[object Uint16Array]",J_e="[object Uint32Array]",Fn={};Fn[V_e]=Fn[W_e]=Fn[q_e]=Fn[G_e]=Fn[H_e]=Fn[Y_e]=Fn[Q_e]=Fn[K_e]=Fn[J_e]=!0;Fn[I_e]=Fn[E_e]=Fn[B_e]=Fn[T_e]=Fn[U_e]=Fn[A_e]=Fn[P_e]=Fn[__e]=Fn[L_e]=Fn[D_e]=Fn[O_e]=Fn[R_e]=Fn[$_e]=Fn[F_e]=Fn[z_e]=!1;function Z_e(e){return M_e(e)&&k_e(e.length)&&!!Fn[C_e(e)]}var X_e=Z_e;function e3e(e){return function(t){return e(t)}}var eW=e3e,M1={exports:{}};M1.exports;(function(e,t){var r=lV,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(M1,M1.exports);var t3e=M1.exports,r3e=X_e,n3e=eW,c6=t3e,u6=c6&&c6.isTypedArray,a3e=u6?n3e(u6):r3e,tW=a3e,s3e=l_e,i3e=uT,o3e=Gs,l3e=XV,c3e=dT,u3e=tW,d3e=Object.prototype,f3e=d3e.hasOwnProperty;function m3e(e,t){var r=o3e(e),n=!r&&i3e(e),a=!r&&!n&&l3e(e),i=!r&&!n&&!a&&u3e(e),o=r||n||a||i,l=o?s3e(e.length,String):[],c=l.length;for(var u in e)(t||f3e.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||c3e(u,c)))&&l.push(u);return l}var h3e=m3e,p3e=Object.prototype;function g3e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||p3e;return e===r}var y3e=g3e;function b3e(e,t){return function(r){return e(t(r))}}var rW=b3e,v3e=rW,x3e=v3e(Object.keys,Object),w3e=x3e,j3e=y3e,N3e=w3e,S3e=Object.prototype,C3e=S3e.hasOwnProperty;function k3e(e){if(!j3e(e))return N3e(e);var t=[];for(var r in Object(e))C3e.call(e,r)&&r!="constructor"&&t.push(r);return t}var M3e=k3e,I3e=HE,E3e=fT;function T3e(e){return e!=null&&E3e(e.length)&&!I3e(e)}var sb=T3e,A3e=h3e,P3e=M3e,_3e=sb;function L3e(e){return _3e(e)?A3e(e):P3e(e)}var uj=L3e,D3e=KPe,O3e=i_e,R3e=uj;function $3e(e){return D3e(e,R3e,O3e)}var F3e=$3e,d6=F3e,z3e=1,B3e=Object.prototype,U3e=B3e.hasOwnProperty;function V3e(e,t,r,n,a,i){var o=r&z3e,l=d6(e),c=l.length,u=d6(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var m=l[f];if(!(o?m in t:U3e.call(t,m)))return!1}var h=i.get(e),p=i.get(t);if(h&&p)return h==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var y=o;++f<c;){m=l[f];var v=e[m],x=t[m];if(n)var j=o?n(x,v,m,t,e,i):n(v,x,m,e,t,i);if(!(j===void 0?v===x||a(v,x,r,n,i):j)){g=!1;break}y||(y=m=="constructor")}if(g&&!y){var C=e.constructor,N=t.constructor;C!=N&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof N=="function"&&N instanceof N)&&(g=!1)}return i.delete(e),i.delete(t),g}var W3e=V3e,q3e=Sf,G3e=pl,H3e=q3e(G3e,"DataView"),Y3e=H3e,Q3e=Sf,K3e=pl,J3e=Q3e(K3e,"Promise"),Z3e=J3e,X3e=Sf,eLe=pl,tLe=X3e(eLe,"Set"),nW=tLe,rLe=Sf,nLe=pl,aLe=rLe(nLe,"WeakMap"),sLe=aLe,rM=Y3e,nM=QE,aM=Z3e,sM=nW,iM=sLe,aW=xc,gp=uV,f6="[object Map]",iLe="[object Object]",m6="[object Promise]",h6="[object Set]",p6="[object WeakMap]",g6="[object DataView]",oLe=gp(rM),lLe=gp(nM),cLe=gp(aM),uLe=gp(sM),dLe=gp(iM),ld=aW;(rM&&ld(new rM(new ArrayBuffer(1)))!=g6||nM&&ld(new nM)!=f6||aM&&ld(aM.resolve())!=m6||sM&&ld(new sM)!=h6||iM&&ld(new iM)!=p6)&&(ld=function(e){var t=aW(e),r=t==iLe?e.constructor:void 0,n=r?gp(r):"";if(n)switch(n){case oLe:return g6;case lLe:return f6;case cLe:return m6;case uLe:return h6;case dLe:return p6}return t});var fLe=ld,mS=GV,mLe=KV,hLe=qPe,pLe=W3e,y6=fLe,b6=Gs,v6=XV,gLe=tW,yLe=1,x6="[object Arguments]",w6="[object Array]",iv="[object Object]",bLe=Object.prototype,j6=bLe.hasOwnProperty;function vLe(e,t,r,n,a,i){var o=b6(e),l=b6(t),c=o?w6:y6(e),u=l?w6:y6(t);c=c==x6?iv:c,u=u==x6?iv:u;var d=c==iv,f=u==iv,m=c==u;if(m&&v6(e)){if(!v6(t))return!1;o=!0,d=!1}
vendor: 4,093 bytes, line 3787
3787if(m&&!d)return i||(i=new mS),o||gLe(e)?mLe(e,t,r,n,a,i):hLe(e,t,c,r,n,a,i);if(!(r&yLe)){var h=d&&j6.call(e,"__wrapped__"),p=f&&j6.call(t,"__wrapped__");if(h||p){var g=h?e.value():e,y=p?t.value():t;return i||(i=new mS),a(g,y,r,n,i)}}return m?(i||(i=new mS),pLe(e,t,r,n,a,i)):!1}var xLe=vLe,wLe=xLe,N6=wc;function sW(e,t,r,n,a){return e===t?!0:e==null||t==null||!N6(e)&&!N6(t)?e!==e&&t!==t:wLe(e,t,r,n,sW,a)}var mT=sW,jLe=GV,NLe=mT,SLe=1,CLe=2;function kLe(e,t,r,n){var a=r.length,i=a,o=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new jLe;if(n)var m=n(u,d,c,e,t,f);if(!(m===void 0?NLe(d,u,SLe|CLe,n,f):m))return!1}}return!0}var MLe=kLe,ILe=Fu;function ELe(e){return e===e&&!ILe(e)}var iW=ELe,TLe=iW,ALe=uj;function PLe(e){for(var t=ALe(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,TLe(a)]}return t}var _Le=PLe;function LLe(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var oW=LLe,DLe=MLe,OLe=_Le,RLe=oW;function $Le(e){var t=OLe(e);return t.length==1&&t[0][2]?RLe(t[0][0],t[0][1]):function(r){return r===e||DLe(r,e,t)}}var FLe=$Le;function zLe(e,t){return e!=null&&t in Object(e)}var BLe=zLe,ULe=pV,VLe=uT,WLe=Gs,qLe=dT,GLe=fT,HLe=Q2;function YLe(e,t,r){t=ULe(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=HLe(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&GLe(a)&&qLe(o,a)&&(WLe(e)||VLe(e)))}var QLe=YLe,KLe=BLe,JLe=QLe;function ZLe(e,t){return e!=null&&JLe(e,t,KLe)}var XLe=ZLe,eDe=mT,tDe=gV,rDe=XLe,nDe=GE,aDe=iW,sDe=oW,iDe=Q2,oDe=1,lDe=2;function cDe(e,t){return nDe(e)&&aDe(t)?sDe(iDe(e),t):function(r){var n=tDe(r,e);return n===void 0&&n===t?rDe(r,e):eDe(t,n,oDe|lDe)}}var uDe=cDe;function dDe(e){return e}var yp=dDe;function fDe(e){return function(t){return t==null?void 0:t[e]}}var mDe=fDe,hDe=XE;function pDe(e){return function(t){return hDe(t,e)}}var gDe=pDe,yDe=mDe,bDe=gDe,vDe=GE,xDe=Q2;function wDe(e){return vDe(e)?yDe(xDe(e)):bDe(e)}var jDe=wDe,NDe=FLe,SDe=uDe,CDe=yp,kDe=Gs,MDe=jDe;function IDe(e){return typeof e=="function"?e:e==null?CDe:typeof e=="object"?kDe(e)?SDe(e[0],e[1]):NDe(e):MDe(e)}var zu=IDe;function EDe(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var lW=EDe;function TDe(e){return e!==e}var ADe=TDe;function PDe(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var _De=PDe,LDe=lW,DDe=ADe,ODe=_De;function RDe(e,t,r){return t===t?ODe(e,t,r):LDe(e,DDe,r)}var $De=RDe,FDe=$De;function zDe(e,t){var r=e==null?0:e.length;return!!r&&FDe(e,t,0)>-1}var BDe=zDe;function UDe(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var VDe=UDe;function WDe(){}var qDe=WDe,hS=nW,GDe=qDe,HDe=cT,YDe=1/0,QDe=hS&&1/HDe(new hS([,-0]))[1]==YDe?function(e){return new hS(e)}:GDe,KDe=QDe,JDe=HV,ZDe=BDe,XDe=VDe,e6e=QV,t6e=KDe,r6e=cT,n6e=200;function a6e(e,t,r){var n=-1,a=ZDe,i=e.length,o=!0,l=[],c=l;if(r)o=!1,a=XDe;else if(i>=n6e){var u=t?null:t6e(e);if(u)return r6e(u);o=!1,a=e6e,c=new JDe}else c=t?[]:l;e:for(;++n<i;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var m=c.length;m--;)if(c[m]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,r)||(c!==l&&c.push(f),l.push(d))}return l}var s6e=a6e,i6e=zu,o6e=s6e;function l6e(e,t){return e&&e.length?o6e(e,i6e(t)):[]}var c6e=l6e;const S6=hn(c6e);function cW(e,t,r){return t===!0?S6(e,r):yr(t)?S6(e,t):e}function wh(e){"@babel/helpers - typeof";return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wh(e)}var u6e=["ref"];function C6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 4,211 bytes, line 3787
3787t%2?C6(Object(r),!0).forEach(function(n){dj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function d6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dW(n.key),n)}}function f6e(e,t,r){return t&&k6(e.prototype,t),r&&k6(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function m6e(e,t,r){return t=I1(t),h6e(e,uW()?Reflect.construct(t,r||[],I1(e).constructor):t.apply(e,r))}function h6e(e,t){if(t&&(wh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p6e(e)}function p6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uW=function(){return!!e})()}function I1(e){return I1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I1(e)}function g6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oM(e,t)}function oM(e,t){return oM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},oM(e,t)}function dj(e,t,r){return t=dW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dW(e){var t=y6e(e,"string");return wh(t)=="symbol"?t:t+""}function y6e(e,t){if(wh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function b6e(e,t){if(e==null)return{};var r=v6e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function v6e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function x6e(e){return e.value}function w6e(e,t){if(U.isValidElement(e))return U.cloneElement(e,t);if(typeof e=="function")return U.createElement(e,t);t.ref;var r=b6e(t,u6e);return U.createElement(lT,r)}var M6=1,Im=function(e){function t(){var r;d6e(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=m6e(this,t,[].concat(a)),dj(r,"lastBoundingBox",{width:-1,height:-1}),r}return g6e(t,e),f6e(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>M6||Math.abs(a.height-this.lastBoundingBox.height)>M6)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Nl({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapsh
3787ot();f={left:((u||0)-h.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var p=this.getBBoxSnapshot();m={top:((d||0)-p.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Nl(Nl({},f),m)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=Nl(Nl({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return U.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){n.wrapperNode=h}},w6e(i,Nl(Nl({},this.props),{},{payload:cW(d,u,x6e)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Nl(Nl({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&ut(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(b.PureComponent);dj(Im,"displayName","Legend");dj(Im,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var I6=nb,j6e=uT,N6e=Gs,E6=I6?I6.isConcatSpreadable:void 0;function S6e(e){return N6e(e)||j6e(e)||!!(E6&&e&&e[E6])}var C6e=S6e,k6e=JV,M6e=C6e;function fW(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=M6e),a||(a=[]);++i<o;){var l=e[i];t>0&&r(l)?t>1?fW(l,t-1,r,n,a):k6e(a,l):n||(a[a.length]=l)}return a}var mW=fW;function I6e(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var E6e=I6e,T6e=E6e,A6e=T6e(),P6e=A6e,_6e=P6e,L6e=uj;function D6e(e,t){return e&&_6e(e,t,L6e)}var hW=D6e,O6e=sb;function R6e(e,t){return function(r,n){if(r==null)return r;if(!O6e(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}var $6e=R6e,F6e=hW,z6e=$6e,B6e=z6e(F6e),hT=B6e,U6e=hT,V6e=sb;function W6e(e,t){var r=-1,n=V6e(e)?Array(e.length):[];return U6e(e,function(a,i,o){n[++r]=t(a,i,o)}),n}var pW=W6e;function q6e(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var G6e=q6e,T6=cp;function H6e(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=T6(e),o=t!==void 0,l=t===null,c=t===t,u=T6(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!o&&a||!c)return-1}return 0}var Y6e=H6e,Q6e=Y6e;function K6e(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,o=a.length,l=r.length;++n<o;){var c=Q6e(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var J6e=K6e,pS=ZE,Z6e=XE,X6e=zu,eOe=pW,tOe=G6e,rOe=eW,nOe=J6e,aOe=yp,sOe=Gs;function iOe(e,t,r){t.length?t=pS(t,function(i){return sOe(i)?function(o){return Z6e(o,i.length===1?i[0]:i)}:i}):t=[aOe];var n=-1;t=pS(t,rOe(X6e));var a=eOe(e,function(i,o,l){var c=pS(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return tOe(a,function(i,o){return nOe(i,o,r)})}var oOe=iOe;function lOe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var cOe=lOe,uOe=cOe,A6=Math.max;function dOe(e,t,r){return t=A6(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=A6(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),uOe(e,this,l)}}var fOe=dOe;function mOe(e){return function(){return e}}var hOe=mOe,pOe=Sf,gOe=function(){try{var e=pOe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),gW=gOe,yOe=hOe,P6=gW,bOe=yp,vOe=P6?function(e,t){return P6(e,"toString",{configurable:!0,enumerable:!1,value:yOe(t),writable:!0})}:bOe,xOe=vOe,wOe=800,jOe=16,NOe=Date.now;function SOe(e){var t=0,r=0;return function(){var n=NOe(),a=jOe-(n-r);if(r=n,a>0){if(++t>=wOe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var COe=SOe,kOe=xOe,MOe=COe,IOe=MOe(kOe),EOe=IOe,TOe=yp,AOe=fOe,POe=EOe;function _Oe(e,t){return POe(AOe(e,t,TOe),e+"")}var LOe=_Oe,DOe=YE,OOe=sb,ROe=dT,$Oe=Fu;function FOe(e,t,r){if(!$Oe(r))return!1;var n=typeof t;return(n=="number"?OOe(r)&&ROe(t,r.length):n=="string"&&t in r)?DOe(r[t],e):!1}var fj=FOe,zOe=mW,BOe=oOe,UOe=LOe,_6=fj,VOe=UOe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&_6(e,t[0],t[1])?t=[]:r>2&&_6(t[0],t[1],t[2])&&(t=[t[0]]),BOe(e,zOe(t,1),[])}),WOe=VOe;const pT=hn(WOe);function D0(e){"@babel/helpers - typeof";return D0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D0(e)}function lM(){return lM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 28,889 bytes, lines 3787-3794
3787for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lM.apply(this,arguments)}function qOe(e,t){return QOe(e)||YOe(e,t)||HOe(e,t)||GOe()}function GOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3788In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HOe(e,t){if(e){if(typeof e=="string")return L6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L6(e,t)}}function L6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YOe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function QOe(e){if(Array.isArray(e))return e}function D6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D6(Object(r),!0).forEach(function(n){KOe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KOe(e,t,r){return t=JOe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JOe(e){var t=ZOe(e,"string");return D0(t)=="symbol"?t:t+""}function ZOe(e,t){if(D0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(D0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XOe(e){return Array.isArray(e)&&Aa(e[0])&&Aa(e[1])?e.join(" ~ "):e}var eRe=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,m=t.itemSorter,h=t.wrapperClassName,p=t.labelClassName,g=t.label,y=t.labelFormatter,v=t.accessibilityLayer,x=v===void 0?!1:v,j=function(){if(d&&d.length){var R={padding:0,margin:0},_=(m?pT(d,m):d).map(function(B,z){if(B.type==="none")return null;var D=gS({display:"block",paddingTop:4,paddingBottom:4,color:B.color||"#000"},l),A=B.formatter||f||XOe,P=B.value,E=B.name,F=P,$=E;if(A&&F!=null&&$!=null){var H=A(P,E,B,z,d);if(Array.isArray(H)){var X=qOe(H,2);F=X[0],$=X[1]}else F=H}return U.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:D},Aa($)?U.createElement("span",{className:"recharts-tooltip-item-name"},$):null,Aa($)?U.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,U.createElement("span",{className:"recharts-tooltip-item-value"},F),U.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return U.createElement("ul",{className:"recharts-tooltip-item-list",style:R},_)}return null},C=gS({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),N=gS({margin:0},u),S=!_r(g),M=S?g:"",k=Jt("recharts-default-tooltip",h),I=Jt("recharts-tooltip-label",p);S&&y&&d!==void 0&&d!==null&&(M=y(g,d));var T=x?{role:"status","aria-live":"assertive"}:{};return U.createElement("div",lM({className:k,style:C},T),U.createElement("p",{className:I,style:N},U.isValidElement(M)?M:"".concat(M)),j())};function O0(e){"@babel/helpers - typeof";return O0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O0(e)}function ov(e,t,r){return t=tRe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tRe(e){var t=rRe(e,"string");return O0(t)=="symbol"?t:t+""}function rRe(e,t){if(O0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(O0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ag="recharts-tooltip-wrapper",nRe={visibility:"hidden"};function aRe(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Jt(ag,ov(ov(ov(ov({},"".concat(ag,"-right"),ut(r)&&t&&ut(t.x)&&r>=t.x),"".concat(ag,"-left"),ut(r)&&t&&ut(t.x)&&r<t.x),"".concat(ag,"-bottom"),ut(n)&&t&&ut(t.y)&&n>=t.y),"".concat(ag,"-top"),ut(n)&&t&&ut(t.y)&&n<t.y))}function O6(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&ut(i[n]))return i[n];var d=r[n]-l-a,f=r[n]+a;if(t[n])return o[n]?d:f;if(o[n]){var m=d,h=c[n];return m<h?Math.max(f,c[n]):Math.max(d,c[n])}var p=f+l,g=c[n]+u;return p>g?Math.max(d,c[n]):Math.max(f,c[n])}function sRe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function iRe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&r?(d=O6({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=O6({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=sRe({translateX:d,translateY:f,useTranslate3d:l})):u=nRe,{cssProperties:u,cssClasses:aRe({translateX:d,translateY:f,coordinate:r})}}function jh(e){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jh(e)}function R6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function $6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R6(Object(r),!0).forEach(function(n){uM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lRe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bW(n.key),n)}}function cRe(e,t,r){return t&&lRe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uRe(e,t,r){return t=E1(t),dRe(e,yW()?Reflect.construct(t,r||[],E1(e).constructor):t.apply(e,r))}function dRe(e,t){if(t&&(jh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fRe(e)}function fRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yW=function(){return!!e})()}function E1(e){return E1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},E1(e)}function mRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cM(e,t)}function cM(e,t){return cM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},cM(e,t)}function uM(e,t,r){return t=bW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bW(e){var t=hRe(e,"string");return jh(t)=="symbol"?t:t+""}function hRe(e,t){if(jh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var F6=1,pRe=function(e){function t(){var r;oRe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=uRe(this,t,[].concat(a)),uM(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),uM(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return mRe(t,e),cRe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>F6||Math.abs(n.height-this.state.lastBoundingBox.height)>F6)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,m=a.isAnimationActive,h=a.offset,p=a.position,g=a.reverseDirection,y=a.useTranslate3d,v=a.viewBox,x=a.wrapperStyle,j=iRe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:v}),C=j.cssClasses,N=j.cssProperties,S=$6($6({transition:m&&i?"transform ".concat(l,"ms ").concat(c):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return U.createElement("div",{tabIndex:-1,className:C,style:S,ref:function(k){n.wrapperNode=k}},u)}}])}(b.PureComponent),gRe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},bp={isSsr:gRe()};function Nh(e){"@babel/helpers - typeof";return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nh(e)}function z6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function B6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?z6(Object(r),!0).forEach(function(n){gT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bRe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xW(n.key),n)}}function vRe(e,t,r){return t&&bRe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xRe(e,t,r){return t=T1(t),wRe(e,vW()?Reflect.construct(t,r||[],T1(e).constructor):t.apply(e,r))}function wRe(e,t){if(t&&(Nh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jRe(e)}function jRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vW=function(){return!!e})()}function T1(e){return T1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},T1(e)}function NRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dM(e,t)}function dM(e,t){return dM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},dM(e,t)}function gT(e,t,r){return t=xW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xW(e){var t=SRe(e,"string");return Nh(t)=="symbol"?t:t+""}function SRe(e,t){if(Nh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function CRe(e){return e.dataKey}function kRe(e,t){return U.isValidElement(e)?U.cloneElement(e,t):typeof e=="function"?U.createElement(e,t):U.createElement(eRe,t)}var to=function(e){function t(){return yRe(this,t),xRe(this,t,arguments)}return NRe(t,e),vRe(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,m=a.isAnimationActive,h=a.offset,p=a.payload,g=a.payloadUniqBy,y=a.position,v=a.reverseDirection,x=a.useTranslate3d,j=a.viewBox,C=a.wrapperStyle,N=p??[];f&&N.length&&(N=cW(p.filter(function(M){return M.value!=null&&(M.hide!==!0||n.props.includeHidden)}),g,CRe));var S=N.length>0;return U.createElement(pRe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:i,coordinate:d,hasPayload:S,offset:h,position:y,reverseDirection:v,useTranslate3d:x,viewBox:j,wrapperStyle:C},kRe(u,B6(B6({},this.props),{},{payload:N})))}}])}(b.PureComponent);gT(to,"displayName","Tooltip");gT(to,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!bp.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var MRe=pl,IRe=function(){return MRe.Date.now()},ERe=IRe,TRe=/\s/;function ARe(e){for(var t=e.length;t--&&TRe.test(e.charAt(t)););return t}var PRe=ARe,_Re=PRe,LRe=/^\s+/;function DRe(e){return e&&e.slice(0,_Re(e)+1).replace(LRe,"")}var ORe=DRe,RRe=ORe,U6=Fu,$Re=cp,V6=NaN,FRe=/^[-+]0x[0-9a-f]+$/i,zRe=/^0b[01]+$/i,BRe=/^0o[0-7]+$/i,URe=parseInt;function VRe(e){if(typeof e=="number")return e;if($Re(e))return V6;if(U6(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=U6(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=RRe(e);var r=zRe.test(e);return r||BRe.test(e)?URe(e.slice(2),r?2:8):FRe.test(e)?V6:+e}var wW=VRe,WRe=Fu,yS=ERe,W6=wW,qRe="Expected a function",GRe=Math.max,HRe=Math.min;function YRe(e,t,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(qRe);t=W6(t)||0,WRe(r)&&(d=!!r.leading,f="maxWait"in r,i=f?GRe(W6(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function h(S){var M=n,k=a;return n=a=void 0,u=S,o=e.apply(k,M),o}function p(S){return u=S,l=setTimeout(v,t),d?h(S):o}function g(S){var M=S-c,k=S-u,I=t-M;return f?HRe(I,i-k):I}function y(S){var M=S-c,k=S-u;return c===void 0||M>=t||M<0||f&&k>=i}function v(){var S=yS();if(y(S))return x(S);l=setTimeout(v,g(S))}function x(S){return l=void 0,m&&n?h(S):(n=a=void 0,o)}function j(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:x(yS())}function N(){var S=yS(),M=y(S);if(n=arguments,a=this,c=S,M){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(v,t),h(c)}return l===void 0&&(l=setTimeout(v,t)),o}return N.cancel=j,N.flush=C,N}var QRe=YRe,KRe=QRe,JRe=Fu,ZRe="Expected a function";function XRe(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(ZRe);return JRe(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),KRe(e,t,{leading:n,maxWait:t,trailing:a})}var e5e=XRe;const jW=hn(e5e);function R0(e){"@babel/helpers - typeof";return R0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R0(e)}function q6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q6(Object(r),!0).forEach(function(n){t5e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t5e(e,t,r){return t=r5e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r5e(e){var t=n5e(e,"string");return R0(t)=="symbol"?t:t+""}function n5e(e,t){if(R0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(R0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a5e(e,t){return l5e(e)||o5e(e,t)||i5e(e,t)||s5e()}function s5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3789In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i5e(e,t){if(e){if(typeof e=="string")return G6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G6(e,t)}}function G6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o5e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function l5e(e){if(Array.isArray(e))return e}var NW=b.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,m=e.maxHeight,h=e.children,p=e.debounce,g=p===void 0?0:p,y=e.id,v=e.className,x=e.onResize,j=e.style,C=j===void 0?{}:j,N=b.useRef(null),S=b.useRef();S.current=x,b.useImperativeHandle(t,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var M=b.useState({containerWidth:a.width,containerHeight:a.height}),k=a5e(M,2),I=k[0],T=k[1],L=b.useCallback(function(_,B){T(function(z){var D=Math.round(_),A=Math.round(B);return z.containerWidth===D&&z.containerHeight===A?z:{containerWidth:D,containerHeight:A}})},[]);b.useEffect(function(){var _=function(E){var F,$=E[0].contentRect,H=$.width,X=$.height;L(H,X),(F=S.current)===null||F===void 0||F.call(S,H,X)};g>0&&(_=jW(_,g,{trailing:!0,leading:!1}));var B=new ResizeObserver(_),z=N.current.getBoundingClientRect(),D=z.width,A=z.height;return L(D,A),B.observe(N.current),function(){B.disconnect()}},[L,g]);var R=b.useMemo(function(){var _=I.containerWidth,B=I.containerHeight;if(_<0||B<0)return null;Zl(xd(o)||xd(c),`The width(%s) and height(%s) are both fixed numbers,
3790       maybe you don't need to use a ResponsiveContainer.`,o,c),Zl(!r||r>0,"The aspect(%s) must be greater than zero.",r);var z=xd(o)?_:o,D=xd(c)?B:c;r&&r>0&&(z?D=z/r:D&&(z=D*r),m&&D>m&&(D=m)),Zl(z>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0,
3791       please check the style of container, or the props width(%s) and height(%s),
3792       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
3793       height and width.`,z,D,o,c,d,f,r);var A=!Array.isArray(h)&&Jl(h.type).endsWith("Chart");return U.Children.map(h,function(P){return U.isValidElement(P)?b.cloneElement(P,lv({width:z,height:D},A?{style:lv({height:"100%",width:"100%",maxHeight:D,maxWidth:z},P.props.style)}:{})):P})},[r,h,c,m,f,d,I,o]);return U.createElement("div",{id:y?"".concat(y):void 0,className:Jt("recharts-responsive-container",v),style:lv(lv({},C),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:m}),ref:N},R)}),SW=function(t){return null};SW.displayName="Cell";function $0(e){"@babel/helpers - typeof";return $0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$0(e)}function H6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?H6(Object(r),!0).forEach(function(n){c5e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c5e(e,t,r){return t=u5e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u5e(e){var t=d5e(e,"string");return $0(t)=="symbol"?t:t+""}function d5e(e,t){if($0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gf={widthCache:{},cacheCount:0},f5e=2e3,m5e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Y6="recharts_measurement_span";function h5e(e){var t=fM({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Hg=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||bp.isSsr)return{width:0,height:0};var n=h5e(r),a=JSON.stringify({text:t,copyStyle:n});if(Gf.widthCache[a])return Gf.widthCache[a];try{var i=document.getElementById(Y6);i||(i=document.createElement("span"),i.setAttribute("id",Y6),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=fM(fM({},m5e),n);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Gf.widthCache[a]=c,++Gf.cacheCount>f5e&&(Gf.cacheCount=0,Gf.widthCache={}),c}catch{return{width:0,height:0}}},p5e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function F0(e){"@babel/helpers - typeof";return F0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F0(e)}function A1(e,t){return v5e(e)||b5e(e,t)||y5e(e,t)||g5e()}function g5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3794In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y5e(e,t){if(e){if(typeof e=="string")return Q6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q6(e,t)}}function Q6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b5e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function v5e(e){if(Array.isArray(e))return e}function x5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j5e(n.key),n)}}function w5e(e,t,r){return t&&K6(e.prototype,t),r&&K6(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j5e(e){var t=N5e(e,"string");return F0(t)=="symbol"?t:t+""}function N5e(e,t){if(F0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(F0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var J6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Z6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,S5e=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,C5e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,CW={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},k5e=Object.keys(CW),hm="NaN";function M5e(e,t){return e*CW[t]}var cv=function(){function e(t,r){x5e(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!S5e.test(r)&&(this.num=NaN,this.unit=""),k5e.includes(r)&&(this.num=M5e(t,r),this.unit="px")}return w5e(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=C5e.exec(r))!==null&&n!==void 0?n:[],i=A1(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function kW(e){if(e.includes(hm))return hm;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=J6.exec(t))!==null&&r!==void 0?r:[],a=A1(n,4),i=a[1],o=a[2],l=a[3],c=cv.parse(i??""),u=cv.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return hm;t=t.replace(J6,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,m=(f=Z6.exec(t))!==null&&f!==void 0?f:[],h=A1(m,4),p=h[1],g=h[2],y=h[3],v=cv.parse(p??""),x=cv.parse(y??""),j=g==="+"?v.add(x):v.subtract(x);if(j.isNaN())return hm;t=t.replace(Z6,j.toString())}return t}var X6=/\(([^()]*)\)/;function I5e(e){for(var t=e;t.includes("(");){var r=X6.exec(t),n=A1(r,2),a=n[1];t=t.replace(X6,kW(a))}return t}function E5e(e){var t=e.replace(/\s+/g,"");return t=I5e(t),t=kW(t),t}function T5e(e){try{return E5e(e)}catch{return hm}}function bS(e){var t=T5e(e.slice(5,-1));return t===hm?"":t}var A5e=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],P5e=["dx","dy","angle","className","breakAll"];function mM(){return mM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
3794for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mM.apply(this,arguments)}function eO(e,t){if(e==null)return{};var r=_5e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _5e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tO(e,t){return R5e(e)||O5e(e,t)||D5e(e,t)||L5e()}function L5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3795In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D5e(e,t){if(e){if(typeof e=="string")return rO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rO(e,t)}}function rO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O5e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function R5e(e){if(Array.isArray(e))return e}var MW=/[ \f\n\r\t\v\u2028\u2029]+/,IW=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];_r(r)||(n?i=r.toString().split(""):i=r.toString().split(MW));var o=i.map(function(c){return{word:c,width:Hg(c,a).width}}),l=n?0:Hg(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},$5e=function(t,r,n,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ut(o),f=l,m=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(D,A){var P=A.word,E=A.width,F=D[D.length-1];if(F&&(a==null||i||F.width+E+n<Number(a)))F.words.push(P),F.width+=E+n;else{var $={words:[P],width:E};D.push($)}return D},[])},h=m(r),p=function(z){return z.reduce(function(D,A){return D.width>A.width?D:A})};if(!d)return h;for(var g="…",y=function(z){var D=f.slice(0,z),A=IW({breakAll:u,style:c,children:D+g}).wordsWithComputedWidth,P=m(A),E=P.length>o||p(P).width>Number(a);return[E,P]},v=0,x=f.length-1,j=0,C;v<=x&&j<=f.length-1;){var N=Math.floor((v+x)/2),S=N-1,M=y(S),k=tO(M,2),I=k[0],T=k[1],L=y(N),R=tO(L,1),_=R[0];if(!I&&!_&&(v=N+1),I&&_&&(x=N-1),!I&&_){C=T;break}j++}return C||h},nO=function(t){var r=_r(t)?[]:t.toString().split(MW);return[{words:r}]},F5e=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!bp.isSsr){var c,u,d=IW({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,m=d.spaceWidth;c=f,u=m}else return nO(a);return $5e({breakAll:o,children:a,maxLines:l,style:i},c,u,r,n)}return nO(a)},aO="#808080",P1=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,m=t.textAnchor,h=m===void 0?"start":m,p=t.verticalAnchor,g=p===void 0?"end":p,y=t.fill,v=y===void 0?aO:y,x=eO(t,A5e),j=b.useMemo(function(){return F5e({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),C=x.dx,N=x.dy,S=x.angle,M=x.className,k=x.breakAll,I=eO(x,P5e);if(!Aa(n)||!Aa(i))return null;var T=n+(ut(C)?C:0),L=i+(ut(N)?N:0),R;switch(g){case"start":R=bS("calc(".concat(u,")"));break;case"middle":R=bS("calc(".concat((j.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:R=bS("calc(".concat(j.length-1," * -").concat(l,")"));break}var _=[];if(f){var B=j[0].width,z=x.width;_.push("scale(".concat((ut(z)?z/B:1)/B,")"))}return S&&_.push("rotate(".concat(S,", ").concat(T,", ").concat(L,")")),_.length&&(I.transform=_.join(" ")),U.createElement("text",mM({},Er(I,!0),{x:T,y:L,className:Jt("recharts-text",M),textAnchor:h,fill:v.includes("url")?aO:v}),j.map(function(D,A){var P=D.words.join(k?"":" ");return U.createElement("tspan",{x:T,dy:A===0?R:l,key:"".concat(P,"-").concat(A)},P)}))};function bu(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function z5e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yT(e){let t,r,n;e.length!==2?(t=bu,r=(l,c)=>bu(e(l),c),n=(l,c)=>e(l)-c):(t=e===bu||e===z5e?e:B5e,r=e,n=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function B5e(){return 0}function EW(e){return e===null?NaN:+e}function*U5e(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const V5e=yT(bu),ib=V5e.right;yT(EW).center;class sO extends Map{constructor(t,r=G5e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(iO(this,t))}has(t){return super.has(iO(this,t))}set(t,r){return super.set(W5e(this,t),r)}delete(t){return super.delete(q5e(this,t))}}function iO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function W5e({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function q5e({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function G5e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function H5e(e=bu){if(e===bu)return TW;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function TW(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Y5e=Math.sqrt(50),Q5e=Math.sqrt(10),K5e=Math.sqrt(2);function _1(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=Y5e?10:i>=Q5e?5:i>=K5e?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?_1(e,t,r*2):[l,c,u]}function hM(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,o]=n?_1(t,e,r):_1(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function pM(e,t,r){return t=+t,e=+e,r=+r,_1(e,t,r)[2]}function gM(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?pM(t,e,r):pM(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function oO(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function lO(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function AW(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?TW:H5e(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(r,Math.floor(t-u*f/c+m)),p=Math.min(n,Math.floor(t+(c-u)*f/c+m));AW(e,t,h,p,a)}const i=e[t];let o=r,l=n;for(sg(e,r,t),a(e[n],i)>0&&sg(e,r,n);o<l;){for(sg(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?sg(e,r,l):(++l,sg(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function sg(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function J5e(e,t,r){if(e=Float64Array.from(U5e(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return lO(e);if(t>=1)return oO(e);var n,a=(n-1)*t,i=Math.floor(a),o=oO(AW(e,i).subarray(0,i+1)),l=lO(e.subarray(i+1));return o+(l-o)*(a-i)}}function Z5e(e,t,r=EW){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function X5e(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function qi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function jc(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}
vendor: 10,011 bytes, line 3795
3795const yM=Symbol("implicit");function bT(){var e=new sO,t=[],r=[],n=yM;function a(i){let o=e.get(i);if(o===void 0){if(n!==yM)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new sO;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return bT(t,r).unknown(n)},qi.apply(a,arguments),a}function z0(){var e=bT().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var m=t().length,h=a<n,p=h?a:n,g=h?n:a;i=(g-p)/Math.max(1,m-c+u*2),l&&(i=Math.floor(i)),p+=(g-p-i*(m-c))*d,o=i*(1-c),l&&(p=Math.round(p),o=Math.round(o));var y=X5e(m).map(function(v){return p+i*v});return r(h?y.reverse():y)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,a]=m,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(m){return[n,a]=m,n=+n,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,u=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(u=+m,f()):u},e.align=function(m){return arguments.length?(d=Math.max(0,Math.min(1,m)),f()):d},e.copy=function(){return z0(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},qi.apply(f(),arguments)}function PW(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return PW(t())},e}function Yg(){return PW(z0.apply(null,arguments).paddingInner(1))}function vT(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function _W(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ob(){}var B0=.7,L1=1/B0,Em="\\s*([+-]?\\d+)\\s*",U0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e$e=/^#([0-9a-f]{3,8})$/,t$e=new RegExp(`^rgb\\(${Em},${Em},${Em}\\)$`),r$e=new RegExp(`^rgb\\(${Xo},${Xo},${Xo}\\)$`),n$e=new RegExp(`^rgba\\(${Em},${Em},${Em},${U0}\\)$`),a$e=new RegExp(`^rgba\\(${Xo},${Xo},${Xo},${U0}\\)$`),s$e=new RegExp(`^hsl\\(${U0},${Xo},${Xo}\\)$`),i$e=new RegExp(`^hsla\\(${U0},${Xo},${Xo},${U0}\\)$`),cO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vT(ob,V0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:uO,formatHex:uO,formatHex8:o$e,formatHsl:l$e,formatRgb:dO,toString:dO});function uO(){return this.rgb().formatHex()}function o$e(){return this.rgb().formatHex8()}function l$e(){return LW(this).formatHsl()}function dO(){return this.rgb().formatRgb()}function V0(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=e$e.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?fO(t):r===3?new Bs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?uv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?uv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=t$e.exec(e))?new Bs(t[1],t[2],t[3],1):(t=r$e.exec(e))?new Bs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n$e.exec(e))?uv(t[1],t[2],t[3],t[4]):(t=a$e.exec(e))?uv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=s$e.exec(e))?pO(t[1],t[2]/100,t[3]/100,1):(t=i$e.exec(e))?pO(t[1],t[2]/100,t[3]/100,t[4]):cO.hasOwnProperty(e)?fO(cO[e]):e==="transparent"?new Bs(NaN,NaN,NaN,0):null}function fO(e){return new Bs(e>>16&255,e>>8&255,e&255,1)}function uv(e,t,r,n){return n<=0&&(e=t=r=NaN),new Bs(e,t,r,n)}function c$e(e){return e instanceof ob||(e=V0(e)),e?(e=e.rgb(),new Bs(e.r,e.g,e.b,e.opacity)):new Bs}function bM(e,t,r,n){return arguments.length===1?c$e(e):new Bs(e,t,r,n??1)}function Bs(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}vT(Bs,bM,_W(ob,{brighter(e){return e=e==null?L1:Math.pow(L1,e),new Bs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?B0:Math.pow(B0,e),new Bs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bs(Fd(this.r),Fd(this.g),Fd(this.b),D1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mO,formatHex:mO,formatHex8:u$e,formatRgb:hO,toString:hO}));function mO(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}`}function u$e(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}${wd((isNaN(this.opacity)?1:this.opacity)*255)}`}function hO(){const e=D1(this.opacity);return`${e===1?"rgb(":"rgba("}${Fd(this.r)}, ${Fd(this.g)}, ${Fd(this.b)}${e===1?")":`, ${e})`}`}function D1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wd(e){return e=Fd(e),(e<16?"0":"")+e.toString(16)}function pO(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new io(e,t,r,n)}function LW(e){if(e instanceof io)return new io(e.h,e.s,e.l,e.opacity);if(e instanceof ob||(e=V0(e)),!e)return new io;if(e instanceof io)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new io(o,l,c,e.opacity)}function d$e(e,t,r,n){return arguments.length===1?LW(e):new io(e,t,r,n??1)}function io(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}vT(io,d$e,_W(ob,{brighter(e){return e=e==null?L1:Math.pow(L1,e),new io(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?B0:Math.pow(B0,e),new io(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Bs(vS(e>=240?e-240:e+120,a,n),vS(e,a,n),vS(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new io(gO(this.h),dv(this.s),dv(this.l),D1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=D1(this.opacity);return`${e===1?"hsl(":"hsla("}${gO(this.h)}, ${dv(this.s)*100}%, ${dv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gO(e){return e=(e||0)%360,e<0?e+360:e}function dv(e){return Math.max(0,Math.min(1,e||0))}function vS(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const xT=e=>()=>e;function f$e(e,t){return function(r){return e+r*t}}function m$e(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function h$e(e){return(e=+e)==1?DW:function(t,r){return r-t?m$e(t,r,e):xT(isNaN(t)?r:t)}}function DW(e,t){var r=t-e;return r?f$e(e,r):xT(isNaN(e)?t:e)}const yO=function e(t){var r=h$e(t);function n(a,i){var o=r((a=bM(a)).r,(i=bM(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=DW(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function p$e(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function g$e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function y$e(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=vp(e[o],t[o]);for(;o<r;
vendor: 5,216 bytes, line 3795
3795++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function b$e(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function O1(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function v$e(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=vp(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var vM=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xS=new RegExp(vM.source,"g");function x$e(e){return function(){return e}}function w$e(e){return function(t){return e(t)+""}}function j$e(e,t){var r=vM.lastIndex=xS.lastIndex=0,n,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=vM.exec(e))&&(a=xS.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:O1(n,a)})),r=xS.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?w$e(c[0].x):x$e(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function vp(e,t){var r=typeof t,n;return t==null||r==="boolean"?xT(t):(r==="number"?O1:r==="string"?(n=V0(t))?(t=n,yO):j$e:t instanceof V0?yO:t instanceof Date?b$e:g$e(t)?p$e:Array.isArray(t)?y$e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?v$e:O1)(e,t)}function wT(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function N$e(e,t){t===void 0&&(t=e,e=vp);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function S$e(e){return function(){return e}}function R1(e){return+e}var bO=[0,1];function As(e){return e}function xM(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:S$e(isNaN(t)?NaN:.5)}function C$e(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function k$e(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a<n?(n=xM(a,n),i=r(o,i)):(n=xM(n,a),i=r(i,o)),function(l){return i(n(l))}}function M$e(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)a[o]=xM(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=ib(e,l,1,n)-1;return i[c](a[c](l))}}function lb(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mj(){var e=bO,t=bO,r=vp,n,a,i,o=As,l,c,u;function d(){var m=Math.min(e.length,t.length);return o!==As&&(o=C$e(e[0],e[m-1])),l=m>2?M$e:k$e,c=u=null,f}function f(m){return m==null||isNaN(m=+m)?i:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return f.invert=function(m){return o(a((u||(u=l(t,e.map(n),O1)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,R1),d()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),r=wT,d()},f.clamp=function(m){return arguments.length?(o=m?!0:As,d()):o!==As},f.interpolate=function(m){return arguments.length?(r=m,d()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,h){return n=m,a=h,d()}}function jT(){return mj()(As,As)}function I$e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function $1(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Sh(e){return e=$1(Math.abs(e)),e?e[1]:NaN}function E$e(e,t){return function(r,n){for(var a=r.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function T$e(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var A$e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function W0(e){if(!(t=A$e.exec(e)))throw new Error("invalid format: "+e);var t;return new NT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}W0.prototype=NT.prototype;function NT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}NT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function P$e(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var OW;function _$e(e,t){var r=$1(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(OW=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>
vendor: 5,101 bytes, line 3795
37950?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+$1(e,Math.max(0,t+i-1))[0]}function vO(e,t){var r=$1(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const xO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:I$e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vO(e*100,t),r:vO,s:_$e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function wO(e){return e}var jO=Array.prototype.map,NO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function L$e(e){var t=e.grouping===void 0||e.thousands===void 0?wO:E$e(jO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?wO:T$e(jO.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=W0(f);var m=f.fill,h=f.align,p=f.sign,g=f.symbol,y=f.zero,v=f.width,x=f.comma,j=f.precision,C=f.trim,N=f.type;N==="n"?(x=!0,N="g"):xO[N]||(j===void 0&&(j=12),C=!0,N="g"),(y||m==="0"&&h==="=")&&(y=!0,m="0",h="=");var S=g==="$"?r:g==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",M=g==="$"?n:/[%p]/.test(N)?o:"",k=xO[N],I=/[defgprs%]/.test(N);j=j===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function T(L){var R=S,_=M,B,z,D;if(N==="c")_=k(L)+_,L="";else{L=+L;var A=L<0||1/L<0;if(L=isNaN(L)?c:k(Math.abs(L),j),C&&(L=P$e(L)),A&&+L==0&&p!=="+"&&(A=!1),R=(A?p==="("?p:l:p==="-"||p==="("?"":p)+R,_=(N==="s"?NO[8+OW/3]:"")+_+(A&&p==="("?")":""),I){for(B=-1,z=L.length;++B<z;)if(D=L.charCodeAt(B),48>D||D>57){_=(D===46?a+L.slice(B+1):L.slice(B))+_,L=L.slice(0,B);break}}}x&&!y&&(L=t(L,1/0));var P=R.length+L.length+_.length,E=P<v?new Array(v-P+1).join(m):"";switch(x&&y&&(L=t(E+L,E.length?v-_.length:1/0),E=""),h){case"<":L=R+L+_+E;break;case"=":L=R+E+L+_;break;case"^":L=E.slice(0,P=E.length>>1)+R+L+_+E.slice(P);break;default:L=E+R+L+_;break}return i(L)}return T.toString=function(){return f+""},T}function d(f,m){var h=u((f=W0(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Sh(m)/3)))*3,g=Math.pow(10,-p),y=NO[8+p/3];return function(v){return h(g*v)+y}}return{format:u,formatPrefix:d}}var fv,ST,RW;D$e({thousands:",",grouping:[3],currency:["$",""]});function D$e(e){return fv=L$e(e),ST=fv.format,RW=fv.formatPrefix,fv}function O$e(e){return Math.max(0,-Sh(Math.abs(e)))}function R$e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sh(t)/3)))*3-Sh(Math.abs(e)))}function $$e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sh(t)-Sh(e))+1}function $W(e,t,r,n){var a=gM(e,t,r),i;switch(n=W0(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=R$e(a,o))&&(n.precision=i),RW(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=$$e(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=O$e(a))&&(n.precision=i-(n.type==="%")*2);break}}return ST(n)}function Bu(e){var t=e.domain;return e.ticks=function(r){var n=t();return hM(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return $W(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],l=n[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=pM(o,l,r),u===c)return n[a]=o,n[i]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function F1(){var e=jT();return e.copy=function(){return lb(e,F1())},qi.apply(e,arguments),Bu(e)}function FW(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,R1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return FW(e).unknown(t)},e=arguments.length?Array.from(e,R1):[0,1],Bu(r)}function zW(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),e[r]=t.floor(a),e[n]=t.ceil(i),e}function SO(e){return Math.log(e)}function CO(e){return Math.exp(e)}function F$e(e){return-Math.log(-e)}function z$e(e){return-Math.exp(-e)}function B$e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function U$e(e){return e===10?B$e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function V$e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kO(e){return(t,r)=>-e(-t,r)}function CT(e){const t=e(SO,CO),r=t.domain;let n=10,a,i;function o(){return a=V$e(n),i=U$e(n),r()[0]<0?(a=kO(a),i=kO(i),e(F$e,z$e)):e(SO,CO),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let m=a(u),h=a(d),p,g;const y=l==null?10:+l;let v=[];
vendor: 4,894 bytes, line 3795
3795if(!(n%1)&&h-m<y){if(m=Math.floor(m),h=Math.ceil(h),u>0){for(;m<=h;++m)for(p=1;p<n;++p)if(g=m<0?p/i(-m):p*i(m),!(g<u)){if(g>d)break;v.push(g)}}else for(;m<=h;++m)for(p=n-1;p>=1;--p)if(g=m>0?p/i(-m):p*i(m),!(g<u)){if(g>d)break;v.push(g)}v.length*2<y&&(v=hM(u,d,y))}else v=hM(m,h,Math.min(h-m,y)).map(i);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=W0(c)).precision==null&&(c.trim=!0),c=ST(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(zW(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function BW(){const e=CT(mj()).domain([1,10]);return e.copy=()=>lb(e,BW()).base(e.base()),qi.apply(e,arguments),e}function MO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function IO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kT(e){var t=1,r=e(MO(t),IO(t));return r.constant=function(n){return arguments.length?e(MO(t=+n),IO(t)):t},Bu(r)}function UW(){var e=kT(mj());return e.copy=function(){return lb(e,UW()).constant(e.constant())},qi.apply(e,arguments)}function EO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function W$e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function q$e(e){return e<0?-e*e:e*e}function MT(e){var t=e(As,As),r=1;function n(){return r===1?e(As,As):r===.5?e(W$e,q$e):e(EO(r),EO(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Bu(t)}function IT(){var e=MT(mj());return e.copy=function(){return lb(e,IT()).exponent(e.exponent())},qi.apply(e,arguments),e}function G$e(){return IT.apply(null,arguments).exponent(.5)}function TO(e){return Math.sign(e)*e*e}function H$e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function VW(){var e=jT(),t=[0,1],r=!1,n;function a(i){var o=H$e(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(TO(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,R1)).map(TO)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return VW(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},qi.apply(a,arguments),Bu(a)}function WW(){var e=[],t=[],r=[],n;function a(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=Z5e(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[ib(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(bu),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return WW().domain(e).range(t).unknown(n)},qi.apply(i,arguments)}function qW(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[ib(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return qW().domain([e,t]).range(a).unknown(i)},qi.apply(Bu(o),arguments)}function GW(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[ib(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return GW().domain(e).range(t).unknown(r)},qi.apply(a,arguments)}const wS=new Date,jS=new Date;function _a(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>_a(o=>
vendor: 4,659 bytes, line 3795
3795{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(wS.setTime(+i),jS.setTime(+o),e(wS),e(jS),Math.floor(r(wS,jS))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const z1=_a(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);z1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_a(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):z1);z1.range;const Rl=1e3,Ai=Rl*60,$l=Ai*60,dc=$l*24,ET=dc*7,AO=dc*30,NS=dc*365,jd=_a(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rl)},(e,t)=>(t-e)/Rl,e=>e.getUTCSeconds());jd.range;const TT=_a(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rl)},(e,t)=>{e.setTime(+e+t*Ai)},(e,t)=>(t-e)/Ai,e=>e.getMinutes());TT.range;const AT=_a(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ai)},(e,t)=>(t-e)/Ai,e=>e.getUTCMinutes());AT.range;const PT=_a(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rl-e.getMinutes()*Ai)},(e,t)=>{e.setTime(+e+t*$l)},(e,t)=>(t-e)/$l,e=>e.getHours());PT.range;const _T=_a(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*$l)},(e,t)=>(t-e)/$l,e=>e.getUTCHours());_T.range;const cb=_a(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ai)/dc,e=>e.getDate()-1);cb.range;const hj=_a(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dc,e=>e.getUTCDate()-1);hj.range;const HW=_a(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dc,e=>Math.floor(e/dc));HW.range;function Cf(e){return _a(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ai)/ET)}const pj=Cf(0),B1=Cf(1),Y$e=Cf(2),Q$e=Cf(3),Ch=Cf(4),K$e=Cf(5),J$e=Cf(6);pj.range;B1.range;Y$e.range;Q$e.range;Ch.range;K$e.range;J$e.range;function kf(e){return _a(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ET)}const gj=kf(0),U1=kf(1),Z$e=kf(2),X$e=kf(3),kh=kf(4),e9e=kf(5),t9e=kf(6);gj.range;U1.range;Z$e.range;X$e.range;kh.range;e9e.range;t9e.range;const LT=_a(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());LT.range;const DT=_a(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());DT.range;const fc=_a(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());fc.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_a(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});fc.range;const mc=_a(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());mc.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_a(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});mc.range;function YW(e,t,r,n,a,i){const o=[[jd,1,Rl],[jd,5,5*Rl],[jd,15,15*Rl],[jd,30,30*Rl],[i,1,Ai],[i,5,5*Ai],[i,15,15*Ai],[i,30,30*Ai],[a,1,$l],[a,3,3*$l],[a,6,6*$l],[a,12,12*$l],[n,1,dc],[n,2,2*dc],[r,1,ET],[t,1,AO],[t,3,3*AO],[e,1,NS]];function l(u,d,f){const m=d<u;m&&([u,d]=[d,u]);const h=f&&typeof f.range=="function"?f:c(u,d,f),p=h?h.range(u,+d+1):[];return m?p.reverse():p}function c(u,d,f){const m=Math.abs(d-u)/f,h=yT(([,,y])=>y).right(o,m);if(h===o.length)return e.every(gM(u/NS,d/NS,f));if(h===0)return z1.every(Math.max(gM(u,d,f),1));const[p,g]=o[m/o[h-1][2]<o[h][2]/m?h-1:h];return p.every(g)}return[l,c]}const[r9e,n9e]=YW(mc,DT,gj,HW,_T,AT),[a9e,s9e]=YW(fc,LT,pj,cb,PT,TT);function SS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function CS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ig(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i9e(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=og(a),d=lg(a),f=og(i),m=lg(i),h=og(o),p=lg(o),g=og
vendor: 8,221 bytes, line 3795
3795(l),y=lg(l),v=og(c),x=lg(c),j={a:A,A:P,b:E,B:F,c:null,d:RO,e:RO,f:E9e,g:F9e,G:B9e,H:k9e,I:M9e,j:I9e,L:QW,m:T9e,M:A9e,p:$,q:H,Q:zO,s:BO,S:P9e,u:_9e,U:L9e,V:D9e,w:O9e,W:R9e,x:null,X:null,y:$9e,Y:z9e,Z:U9e,"%":FO},C={a:X,A:ue,b:le,B:ae,c:null,d:$O,e:$O,f:G9e,g:rFe,G:aFe,H:V9e,I:W9e,j:q9e,L:JW,m:H9e,M:Y9e,p:te,q:ne,Q:zO,s:BO,S:Q9e,u:K9e,U:J9e,V:Z9e,w:X9e,W:eFe,x:null,X:null,y:tFe,Y:nFe,Z:sFe,"%":FO},N={a:T,A:L,b:R,B:_,c:B,d:DO,e:DO,f:j9e,g:LO,G:_O,H:OO,I:OO,j:b9e,L:w9e,m:y9e,M:v9e,p:I,q:g9e,Q:S9e,s:C9e,S:x9e,u:d9e,U:f9e,V:m9e,w:u9e,W:h9e,x:z,X:D,y:LO,Y:_O,Z:p9e,"%":N9e};j.x=S(r,j),j.X=S(n,j),j.c=S(t,j),C.x=S(r,C),C.X=S(n,C),C.c=S(t,C);function S(J,G){return function(Q){var W=[],Y=-1,q=0,Z=J.length,me,we,he;for(Q instanceof Date||(Q=new Date(+Q));++Y<Z;)J.charCodeAt(Y)===37&&(W.push(J.slice(q,Y)),(we=PO[me=J.charAt(++Y)])!=null?me=J.charAt(++Y):we=me==="e"?" ":"0",(he=G[me])&&(me=he(Q,we)),W.push(me),q=Y+1);return W.push(J.slice(q,Y)),W.join("")}}function M(J,G){return function(Q){var W=ig(1900,void 0,1),Y=k(W,J,Q+="",0),q,Z;if(Y!=Q.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(G&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(q=CS(ig(W.y,0,1)),Z=q.getUTCDay(),q=Z>4||Z===0?U1.ceil(q):U1(q),q=hj.offset(q,(W.V-1)*7),W.y=q.getUTCFullYear(),W.m=q.getUTCMonth(),W.d=q.getUTCDate()+(W.w+6)%7):(q=SS(ig(W.y,0,1)),Z=q.getDay(),q=Z>4||Z===0?B1.ceil(q):B1(q),q=cb.offset(q,(W.V-1)*7),W.y=q.getFullYear(),W.m=q.getMonth(),W.d=q.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Z="Z"in W?CS(ig(W.y,0,1)).getUTCDay():SS(ig(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Z+5)%7:W.w+W.U*7-(Z+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,CS(W)):SS(W)}}function k(J,G,Q,W){for(var Y=0,q=G.length,Z=Q.length,me,we;Y<q;){if(W>=Z)return-1;if(me=G.charCodeAt(Y++),me===37){if(me=G.charAt(Y++),we=N[me in PO?G.charAt(Y++):me],!we||(W=we(J,Q,W))<0)return-1}else if(me!=Q.charCodeAt(W++))return-1}return W}function I(J,G,Q){var W=u.exec(G.slice(Q));return W?(J.p=d.get(W[0].toLowerCase()),Q+W[0].length):-1}function T(J,G,Q){var W=h.exec(G.slice(Q));return W?(J.w=p.get(W[0].toLowerCase()),Q+W[0].length):-1}function L(J,G,Q){var W=f.exec(G.slice(Q));return W?(J.w=m.get(W[0].toLowerCase()),Q+W[0].length):-1}function R(J,G,Q){var W=v.exec(G.slice(Q));return W?(J.m=x.get(W[0].toLowerCase()),Q+W[0].length):-1}function _(J,G,Q){var W=g.exec(G.slice(Q));return W?(J.m=y.get(W[0].toLowerCase()),Q+W[0].length):-1}function B(J,G,Q){return k(J,t,G,Q)}function z(J,G,Q){return k(J,r,G,Q)}function D(J,G,Q){return k(J,n,G,Q)}function A(J){return o[J.getDay()]}function P(J){return i[J.getDay()]}function E(J){return c[J.getMonth()]}function F(J){return l[J.getMonth()]}function $(J){return a[+(J.getHours()>=12)]}function H(J){return 1+~~(J.getMonth()/3)}function X(J){return o[J.getUTCDay()]}function ue(J){return i[J.getUTCDay()]}function le(J){return c[J.getUTCMonth()]}function ae(J){return l[J.getUTCMonth()]}function te(J){return a[+(J.getUTCHours()>=12)]}function ne(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var G=S(J+="",j);return G.toString=function(){return J},G},parse:function(J){var G=M(J+="",!1);return G.toString=function(){return J},G},utcFormat:function(J){var G=S(J+="",C);return G.toString=function(){return J},G},utcParse:function(J){var G=M(J+="",!0);return G.toString=function(){return J},G}}}var PO={"-":"",_:" ",0:"0"},qa=/^\s*\d+/,o9e=/^%/,l9e=/[\\^$*+?|[\]().{}]/g;function Xr(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function c9e(e){return e.replace(l9e,"\\$&")}function og(e){return new RegExp("^(?:"+e.map(c9e).join("|")+")","i")}function lg(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function u9e(e,t,r){var n=qa.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function d9e(e,t,r){var n=qa.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function f9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function m9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function h9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function _O(e,t,r){var n=qa.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function LO(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p9e(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function g9e(e,t,r){var n=qa.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function y9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function DO(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function b9e(e,t,r){var n=qa.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function OO(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function v9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function x9e(e,t,r){var n=qa.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function w9e(e,t,r){var n=qa.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function j9e(e,t,r){var n=qa.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function N9e(e,t,r){var n=o9e.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function S9e(e,t,r){var n=qa.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function C9e(e,t,r){var n=qa.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function RO(e,t){return Xr(e.getDate(),t,2)}function k9e(e,t){return Xr(e.getHours(),t,2)}function M9e(e,t){return Xr(e.getHours()%12||12,t,2)}function I9e(e,t){return Xr(1+cb.count(fc(e),e),t,3)}function QW(e,t){return Xr(e.getMilliseconds(),t,3)}function E9e(e,t){return QW(e,t)+"000"}function T9e(e,t){return Xr(e.getMonth()+1,t,2)}function A9e(e,t){return Xr(e.getMinutes(),t,2)}function P9e(e,t){return Xr(e.getSeconds(),t,2)}function _9e(e){var t=e.getDay();return t===0?7:t}function L9e(e,t){return Xr(pj.count(fc(e)-1,e),t,2)}function KW(e){var t=e.getDay();return t>=4||t===0?Ch(e):Ch.ceil(e)}function D9e(e,t){return e=KW(e),Xr(Ch.count(fc(e),e)+(fc(e).getDay()===4),t,2)}function O9e(e){return e.getDay()}function R9e(e,t){return Xr(B1.count(fc(e)-1,e),t,2)}function $9e(e,t){return Xr(e.getFullYear()%100,t,2)}function F9e(e,t){return e=KW(e),Xr(e.getFullYear()%100,t,2)}function z9e(e,t){return Xr(e.getFullYear()%1e4,t,4)}function B9e(e,t){var r=e.getDay();return e=r>=4||r===0?Ch(e):Ch.ceil(e),Xr(e.getFullYear()%1e4,t,4)}function U9e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Xr(t/60|0,"0",2)+Xr(t%60,"0",2)}function $O(e,t){return Xr(e.getUTCDate(),t,2)}function V9e(e,t){return Xr(e.getUTCHours(),t,2)}function W9e(e,t){return Xr(e.getUTCHours()%12||12,t,2)}function q9e(e,t){return Xr(1+hj.count(mc(e),e),t,3)}function JW(e,t){return Xr(e.getUTCMilliseconds(),t,3)}function G9e(e,t){return JW(e,t)+"000"}function H9e(e,t){return Xr(e.getUTCMonth()+1,t,2)}function Y9e(e,t){return Xr(e.getUTCMinutes(),t,2)}function Q9e(e,t){return Xr(e.getUTCSeconds(),t,2)}function K9e(e){var t=e.getUTCDay();return t===0?7:t}function J9e(e,t){return Xr(gj.count(mc(e)-1,e),t,2)}function ZW(e){var t=e.getUTCDay();return t>=4||t===0?kh(e):kh.ceil(e)}function Z9e(e,t){return e=ZW(e),Xr(kh.count(mc(e),e)+(mc(e).getUTCDay()===4),t,2)}function X9e(e){return e.getUTCDay()}function eFe(e,t){return Xr(U1.count(mc(e)-1,e),t,2)}function tFe(e,t){return Xr(e.getUTCFullYear()%100,t,2)}function rFe(e,t){return e=ZW(e),Xr(e.getUTCFullYear()%100,t,2)}function nFe(e,t){return Xr(e.getUTCFullYear()%1e4,t,4)}function aFe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?kh(e):kh.ceil(e),Xr(e.getUTCFullYear()%1e4,t,4)}function sFe(){return"+0000"}function FO(){return"%"}function zO(e){return+e}function BO(e){return Math.floor(+e/1e3)}var Hf,XW,eq;iFe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
3795ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iFe(e){return Hf=i9e(e),XW=Hf.format,Hf.parse,eq=Hf.utcFormat,Hf.utcParse,Hf}function oFe(e){return new Date(e)}function lFe(e){return e instanceof Date?+e:+new Date(+e)}function OT(e,t,r,n,a,i,o,l,c,u){var d=jT(),f=d.invert,m=d.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),j=u("%B"),C=u("%Y");function N(S){return(c(S)<S?h:l(S)<S?p:o(S)<S?g:i(S)<S?y:n(S)<S?a(S)<S?v:x:r(S)<S?j:C)(S)}return d.invert=function(S){return new Date(f(S))},d.domain=function(S){return arguments.length?m(Array.from(S,lFe)):m().map(oFe)},d.ticks=function(S){var M=m();return e(M[0],M[M.length-1],S??10)},d.tickFormat=function(S,M){return M==null?N:u(M)},d.nice=function(S){var M=m();return(!S||typeof S.range!="function")&&(S=t(M[0],M[M.length-1],S??10)),S?m(zW(M,S)):d},d.copy=function(){return lb(d,OT(e,t,r,n,a,i,o,l,c,u))},d}function cFe(){return qi.apply(OT(a9e,s9e,fc,LT,pj,cb,PT,TT,jd,XW).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function uFe(){return qi.apply(OT(r9e,n9e,mc,DT,gj,hj,_T,AT,jd,eq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yj(){var e=0,t=1,r,n,a,i,o=As,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-r)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(m){var h,p;return arguments.length?([h,p]=m,o=f(h,p),u):[o(0),o(1)]}}return u.range=d(vp),u.rangeRound=d(wT),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),u}}function Uu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function tq(){var e=Bu(yj()(As));return e.copy=function(){return Uu(e,tq())},jc.apply(e,arguments)}function rq(){var e=CT(yj()).domain([1,10]);return e.copy=function(){return Uu(e,rq()).base(e.base())},jc.apply(e,arguments)}function nq(){var e=kT(yj());return e.copy=function(){return Uu(e,nq()).constant(e.constant())},jc.apply(e,arguments)}function RT(){var e=MT(yj());return e.copy=function(){return Uu(e,RT()).exponent(e.exponent())},jc.apply(e,arguments)}function dFe(){return RT.apply(null,arguments).exponent(.5)}function aq(){var e=[],t=As;function r(n){if(n!=null&&!isNaN(n=+n))return t((ib(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(bu),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>J5e(e,i/n))},r.copy=function(){return aq(t).domain(e)},jc.apply(r,arguments)}function bj(){var e=0,t=.5,r=1,n=1,a,i,o,l,c,u=As,d,f=!1,m;function h(g){return isNaN(g=+g)?m:(g=.5+((g=+d(g))-i)*(n*g<n*i?l:c),u(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,r]=g,a=d(e=+e),i=d(t=+t),o=d(r=+r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,h):[e,t,r]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(u=g,h):u};function p(g){return function(y){var v,x,j;return arguments.length?([v,x,j]=y,u=N$e(g,[v,x,j]),h):[u(0),u(.5),u(1)]}}return h.range=p(vp),h.rangeRound=p(wT),h.unknown=function(g){return arguments.length?(m=g,h):m},function(g){return d=g,a=g(e),i=g(t),o=g(r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,h}}function sq(){var e=Bu(bj()(As));return e.copy=function(){return Uu(e,sq())},jc.apply(e,arguments)}function iq(){var e=CT(bj()).domain([.1,1,10]);return e.copy=function(){return Uu(e,iq()).base(e.base())},jc.apply(e,arguments)}function oq(){var e=kT(bj());return e.copy=function(){return Uu(e,oq()).constant(e.constant())},jc.apply(e,arguments)}function $T(){var e=MT(bj());return e.copy=function(){return Uu(e,$T()).exponent(e.exponent())},jc.apply(e,arguments)}function fFe(){return $T.apply(null,arguments).exponent(.5)}const UO=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:z0,scaleDiverging:sq,scaleDivergingLog:iq,scaleDivergingPow:$T,scaleDivergingSqrt:fFe,scaleDivergingSymlog:oq,scaleIdentity:FW,scaleImplicit:yM,scaleLinear:F1,scaleLog:BW,scaleOrdinal:bT,scalePoint:Yg,scalePow:IT,scaleQuantile:WW,scaleQuantize:qW,scaleRadial:VW,scaleSequential:tq,scaleSequentialLog:rq,scaleSequentialPow:RT,scaleSequentialQuantile:aq,scaleSequentialSqrt:dFe,scaleSequentialSymlog:nq,scaleSqrt:G$e,scaleSymlog:UW,
vendor: 60,987 bytes, lines 3795-3821
3795scaleThreshold:GW,scaleTime:cFe,scaleUtc:uFe,tickFormat:$W},Symbol.toStringTag,{value:"Module"}));var mFe=cp;function hFe(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],o=t(i);if(o!=null&&(l===void 0?o===o&&!mFe(o):r(o,l)))var l=o,c=i}return c}var lq=hFe;function pFe(e,t){return e>t}var gFe=pFe,yFe=lq,bFe=gFe,vFe=yp;function xFe(e){return e&&e.length?yFe(e,vFe,bFe):void 0}var wFe=xFe;const iu=hn(wFe);function jFe(e,t){return e<t}var NFe=jFe,SFe=lq,CFe=NFe,kFe=yp;function MFe(e){return e&&e.length?SFe(e,kFe,CFe):void 0}var IFe=MFe;const vj=hn(IFe);var EFe=ZE,TFe=zu,AFe=pW,PFe=Gs;function _Fe(e,t){var r=PFe(e)?EFe:AFe;return r(e,TFe(t))}var LFe=_Fe,DFe=mW,OFe=LFe;function RFe(e,t){return DFe(OFe(e,t),1)}var $Fe=RFe;const FFe=hn($Fe);var zFe=mT;function BFe(e,t){return zFe(e,t)}var UFe=BFe;const q0=hn(UFe);var xp=1e9,VFe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},zT,Yn=!0,Bi="[DecimalError] ",zd=Bi+"Invalid argument: ",FT=Bi+"Exponent out of range: ",wp=Math.floor,cd=Math.pow,WFe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ei,Oa=1e7,zn=7,cq=9007199254740991,V1=wp(cq/zn),Tt={};Tt.absoluteValue=Tt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Tt.comparedTo=Tt.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Tt.decimalPlaces=Tt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*zn;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Tt.dividedBy=Tt.div=function(e){return Xl(this,new this.constructor(e))};Tt.dividedToIntegerBy=Tt.idiv=function(e){var t=this,r=t.constructor;return An(Xl(t,new r(e),0,1),r.precision)};Tt.equals=Tt.eq=function(e){return!this.cmp(e)};Tt.exponent=function(){return ja(this)};Tt.greaterThan=Tt.gt=function(e){return this.cmp(e)>0};Tt.greaterThanOrEqualTo=Tt.gte=function(e){return this.cmp(e)>=0};Tt.isInteger=Tt.isint=function(){return this.e>this.d.length-2};Tt.isNegative=Tt.isneg=function(){return this.s<0};Tt.isPositive=Tt.ispos=function(){return this.s>0};Tt.isZero=function(){return this.s===0};Tt.lessThan=Tt.lt=function(e){return this.cmp(e)<0};Tt.lessThanOrEqualTo=Tt.lte=function(e){return this.cmp(e)<1};Tt.logarithm=Tt.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(ei))throw Error(Bi+"NaN");if(r.s<1)throw Error(Bi+(r.s?"NaN":"-Infinity"));return r.eq(ei)?new n(0):(Yn=!1,t=Xl(G0(r,i),G0(e,i),i),Yn=!0,An(t,a))};Tt.minus=Tt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?fq(t,e):uq(t,(e.s=-e.s,e))};Tt.modulo=Tt.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Bi+"NaN");return r.s?(Yn=!1,t=Xl(r,e,0,1).times(e),Yn=!0,r.minus(t)):An(new n(r),a)};Tt.naturalExponential=Tt.exp=function(){return dq(this)};Tt.naturalLogarithm=Tt.ln=function(){return G0(this)};Tt.negated=Tt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Tt.plus=Tt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uq(t,e):fq(t,(e.s=-e.s,e))};Tt.precision=Tt.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zd+e);if(t=ja(a)+1,n=a.d.length-1,r=n*zn+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Tt.squareRoot=Tt.sqrt=function(){var e,t,r,n,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Bi+"NaN")}for(e=ja(l),Yn=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=Go(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=wp((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=o=r+3;;)if(i=n,n=i.plus(Xl(l,i,o+2)).times(.5),Go(i.d).slice(0,o)===(t=Go(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(An(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return Yn=!0,An(n,r)};Tt.times=Tt.mul=function(e){var t,r,n,a,i,o,l,c,u,d=this,f=d.constructor,m=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=m.length,u=h.length,c<u&&(i=m,m=h,h=i,o=c,c=u,u=o),i=[],o=c+u,n=o;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+h[n]*m[a-n-1]+t,i[a--]=l%Oa|0,t=l/Oa|0;i[a]=(i[a]+t)%Oa|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Yn?An(e,f.precision):e};Tt.toDecimalPlaces=Tt.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(cl(e,0,xp),t===void 0?t=n.rounding:cl(t,0,8),An(r,e+ja(r)+1,t))};Tt.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=uf(n,!0):(cl(e,0,xp),t===void 0?t=a.rounding:cl(t,0,8),n=An(new a(n),e+1,t),r=uf(n,!0,e+1)),r};Tt.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?uf(a):(cl(e,0,xp),t===void 0?t=i.rounding:cl(t,0,8),n=An(new i(a),e+ja(a)+1,t),r=uf(n.abs(),!1,e+ja(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Tt.toInteger=Tt.toint=function(){var e=this,t=e.constructor;return An(new t(e),ja(e)+1,t.rounding)};Tt.toNumber=function(){return+this};Tt.toPower=Tt.pow=function(e){var t,r,n,a,i,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(ei);if(l=new c(l),!l.s){if(e.s<1)throw Error(Bi+"Infinity");return l}if(l.eq(ei))return l;if(n=c.precision,e.eq(ei))return An(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=d<0?-d:d)<=cq){for(a=new c(ei),t=Math.ceil(n/zn+4),Yn=!1;r%2&&(a=a.times(l),WO(a.d,t)),r=wp(r/2),r!==0;)l=l.times(l),WO(l.d,t);return Yn=!0,e.s<0?new c(ei).div(a):An(a,n)}}else if(i<0)throw Error(Bi+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Yn=!1,a=e.times(G0(l,n+u)),Yn=!0,a=dq(a),a.s=i,a};Tt.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=ja(a),n=uf(a,r<=i.toExpNeg||r>=i.toExpPos)):(cl(e,1,xp),t===void 0?t=i.rounding:cl(t,0,8),a=An(new i(a),e,t),r=ja(a),n=uf(a,e<=r||r<=i.toExpNeg,e)),n};Tt.toSignificantDigits=Tt.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(cl(e,1,xp),t===void 0?t=n.rounding:cl(t,0,8)),An(new n(r),e,t)};Tt.toString=Tt.valueOf=Tt.val=Tt.toJSON=Tt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ja(e),r=e.constructor;return uf(e,t<=r.toExpNeg||t>=r.toExpPos)};function uq(e,t){var r,n,a,i,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Yn?An(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=o,l=c.length),o=Math.ceil(f/zn),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/Oa|0,c[i]%=Oa;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Yn?An(t,f):t}function cl(e,t,r){if(e!==~~e||e<t||e>r)throw Error(zd+e)}function Go(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)n=e[t]+"",r=zn-n.length,r&&(i+=Bc(r)),i+=n;o=e[t],n=o+"",r=zn-n.length,r&&(i+=Bc(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Xl=function(){function e(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%Oa|0,o=i/Oa|0;return o&&n.unshift(o),n}function t(n,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*Oa+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,c,u,d,f,m,h,p,g,y,v,x,j,C,N,S,M,k,I=n.constructor,T=n.s==a.s?1:-1,L=n.d,R=a.d;if(!n.s)return new I(n);if(!a.s)throw Error(Bi+"Division by zero");for(c=n.e-a.e,M=R.length,N=L.length,h=new I(T),p=h.d=[],u=0;R[u]==(L[u]||0);)++u;if(R[u]>(L[u]||0)&&--c,i==null?x=i=I.precision:o?x=i+(ja(n)-ja(a))+1:x=i,x<0)return new I(0);if(x=x/zn+2|0,u=0,M==1)for(d=0,R=R[0],x++;(u<N||d)&&x--;u++)j=d*Oa+(L[u]||0),p[u]=j/R|0,d=j%R|0;else{for(d=Oa/(R[0]+1)|0,d>1&&(R=e(R,d),L=e(L,d),M=R.length,N=L.length),C=M,g=L.slice(0,M),y=g.length;y<M;)g[y++]=0;k=R.slice(),k.unshift(0),S=R[0],R[1]>=Oa/2&&++S;do d=0,l=t(R,g,M,y),l<0?(v=g[0],M!=y&&(v=v*Oa+(g[1]||0)),d=v/S|0,d>1?(d>=Oa&&(d=Oa-1),f=e(R,d),m=f.length,y=g.length,l=t(f,g,m,y),l==1&&(d--,r(f,M<m?k:R,m))):(d==0&&(l=d=1),f=R.slice()),m=f.length,m<y&&f.unshift(0),r(g,f,y),l==-1&&(y=g.length,l=t(R,g,M,y),l<1&&(d++,r(g,M<y?k:R,y))),y=g.length):l===0&&(d++,g=[0]),p[u++]=d,l&&g[0]?g[y++]=L[C]||0:(g=[L[C]],y=1);while((C++<N||g[0]!==void 0)&&x--)}return p[0]||p.shift(),h.e=c,An(h,o?i+ja(h)+1:i)}}();function dq(e,t){var r,n,a,i,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(ja(e)>16)throw Error(FT+ja(e));if(!e.s)return new d(ei);for(Yn=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(cd(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new d(ei),d.precision=l;;){if(a=An(a.times(e),l),r=r.times(++c),o=i.plus(Xl(a,r,l)),Go(o.d).slice(0,l)===Go(i.d).slice(0,l)){for(;u--;)i=An(i.times(i),l);return d.precision=f,t==null?(Yn=!0,An(i,f)):i}i=o}}function ja(e){for(var t=e.e*zn,r=e.d[0];r>=10;r/=10)t++;return t}function kS(e,t,r){if(t>e.LN10.sd())throw Yn=!0,r&&(e.precision=r),Error(Bi+"LN10 precision limit exceeded");return An(new e(e.LN10),t)}function Bc(e){for(var t="";e--;)t+="0";return t}function G0(e,t){var r,n,a,i,o,l,c,u,d,f=1,m=10,h=e,p=h.d,g=h.constructor,y=g.precision;if(h.s<1)throw Error(Bi+(h.s?"NaN":"-Infinity"));if(h.eq(ei))return new g(0);if(t==null?(Yn=!1,u=y):u=t,h.eq(10))return t==null&&(Yn=!0),kS(g,u);if(u+=m,g.precision=u,r=Go(p),n=r.charAt(0),i=ja(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Go(h.d),n=r.charAt(0),f++;i=ja(h),n>1?(h=new g("0."+r),i++):h=new g(n+"."+r.slice(1))}else return c=kS(g,u+2,y).times(i+""),h=G0(new g(n+"."+r.slice(1)),u-m).plus(c),g.precision=y,t==null?(Yn=!0,An(h,y)):h;for(l=o=h=Xl(h.minus(ei),h.plus(ei),u),d=An(h.times(h),u),a=3;;){if(o=An(o.times(d),u),c=l.plus(Xl(o,new g(a),u)),Go(c.d).slice(0,u)===Go(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(kS(g,u+2,y).times(i+""))),l=Xl(l,new g(f),u),g.precision=y,t==null?(Yn=!0,An(l,y)):l;l=c,a+=2}}function VO(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=wp(r/zn),e.d=[],n=(r+1)%zn,r<0&&(n+=zn),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=zn;n<a;)e.d.push(+t.slice(n,n+=zn));t=t.slice(n),n=zn-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Yn&&(e.e>V1||e.e<-V1))throw Error(FT+r)}else e.s=0,e.e=0,e.d=[0];return e}function An(e,t,r){var n,a,i,o,l,c,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=zn,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/zn),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;n%=zn,a=n-zn+o}if(r!==void 0&&(i=cd(10,o-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/cd(10,o-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=ja(e),f.length=1,t=t-i-1,f[0]=cd(10,(zn-t%zn)%zn),e.e=wp(-t/zn)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=cd(10,zn-n),f[d]=a>0?(u/cd(10,o-a)%cd(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==Oa&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=Oa)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(Yn&&(e.e>V1||e.e<-V1))throw Error(FT+ja(e));return e}function fq(e,t){var r,n,a,i,o,l,c,u,d,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Yn?An(t,h):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=f.length):(r=f,n=u,l=c.length),a=Math.max(Math.ceil(h/zn),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=Oa-1;--c[i],c[a]+=Oa}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Yn?An(t,h):t):new m(0)}function uf(e,t,r){var n,a=ja(e),i=Go(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Bc(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Bc(-a-1)+i,r&&(n=r-o)>0&&(i+=Bc(n))):a>=o?(i+=Bc(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Bc(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=Bc(n))),e.s<0?"-"+i:i}function WO(e,t){if(e.length>t)return e.length=t,!0}function mq(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(zd+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return VO(o,i.toString())}else if(typeof i!="string")throw Error(zd+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,WFe.test(i))VO(o,i);else throw Error(zd+i)}if(a.prototype=Tt,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=mq,a.config=a.set=qFe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function qFe(e){if(!e||typeof e!="object")throw Error(Bi+"Object expected");var t,r,n,a=["precision",1,xp,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(wp(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(zd+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(zd+r+": "+n);return this}var zT=mq(VFe);ei=new zT(1);const Cn=zT;function GFe(e){return KFe(e)||QFe(e)||YFe(e)||HFe()}function HFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3796In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YFe(e,t){if(e){if(typeof e=="string")return wM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wM(e,t)}}function QFe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function KFe(e){if(Array.isArray(e))return wM(e)}function wM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var JFe=function(t){return t},hq={},pq=function(t){return t===hq},qO=function(t){return function r(){return arguments.length===0||arguments.length===1&&pq(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},ZFe=function e(t,r){return t===1?r:qO(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==hq}).length;return o>=t?r.apply(void 0,a):e(t-o,qO(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return pq(f)?c.shift():f});return r.apply(void 0,GFe(d).concat(c))}))})},xj=function(t){return ZFe(t.length,t)},jM=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},XFe=xj(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),eze=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return JFe;var a=r.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},NM=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},gq=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function tze(e){var t;return e===0?t=1:t=Math.floor(new Cn(e).abs().log(10).toNumber())+1,t}function rze(e,t,r){for(var n=new Cn(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var nze=xj(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),aze=xj(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),sze=xj(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const wj={rangeStep:rze,getDigitCount:tze,interpolateNumber:nze,uninterpolateNumber:aze,uninterpolateTruncation:sze};function SM(e){return lze(e)||oze(e)||yq(e)||ize()}function ize(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3797In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oze(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function lze(e){if(Array.isArray(e))return CM(e)}function H0(e,t){return dze(e)||uze(e,t)||yq(e,t)||cze()}function cze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3798In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yq(e,t){if(e){if(typeof e=="string")return CM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CM(e,t)}}function CM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uze(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function dze(e){if(Array.isArray(e))return e}function bq(e){var t=H0(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function vq(e,t,r){if(e.lte(0))return new Cn(0);var n=wj.getDigitCount(e.toNumber()),a=new Cn(10).pow(n),i=e.div(a),o=n!==1?.05:.1,l=new Cn(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(a);return t?c:new Cn(Math.ceil(c))}function fze(e,t,r){var n=1,a=new Cn(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new Cn(10).pow(wj.getDigitCount(e)-1),a=new Cn(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new Cn(Math.floor(e)))}else e===0?a=new Cn(Math.floor((t-1)/2)):r||(a=new Cn(Math.floor(e)));var o=Math.floor((t-1)/2),l=eze(XFe(function(c){return a.add(new Cn(c-o).mul(n)).toNumber()}),jM);return l(0,t)}function xq(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Cn(0),tickMin:new Cn(0),tickMax:new Cn(0)};var i=vq(new Cn(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new Cn(0):(o=new Cn(e).add(t).div(2),o=o.sub(new Cn(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Cn(t).sub(o).div(i).toNumber()),u=l+c+1;return u>r?xq(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:o.sub(new Cn(l).mul(i)),tickMax:o.add(new Cn(c).mul(i))})}function mze(e){var t=H0(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=bq([r,n]),c=H0(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(SM(jM(0,a-1).map(function(){return 1/0}))):[].concat(SM(jM(0,a-1).map(function(){return-1/0})),[d]);return r>n?NM(f):f}if(u===d)return fze(u,a,i);var m=xq(u,d,o,i),h=m.step,p=m.tickMin,g=m.tickMax,y=wj.rangeStep(p,g.add(new Cn(.1).mul(h)),h);return r>n?NM(y):y}function hze(e,t){var r=H0(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=bq([n,a]),l=H0(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var d=Math.max(t,2),f=vq(new Cn(u).sub(c).div(d-1),i,0),m=[].concat(SM(wj.rangeStep(new Cn(c),new Cn(u).sub(new Cn(.99).mul(f)),f)),[u]);return n>a?NM(m):m}var pze=gq(mze),gze=gq(hze),yze="Invariant failed";function _u(e,t){throw new Error(yze)}var bze=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Mh(e){"@babel/helpers - typeof";return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mh(e)}function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},W1.apply(this,arguments)}function vze(e,t){return Nze(e)||jze(e,t)||wze(e,t)||xze()}function xze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3799In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wze(e,t){if(e){if(typeof e=="string")return GO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GO(e,t)}}function GO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jze(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Nze(e){if(Array.isArray(e))return e}function Sze(e,t){if(e==null)return{};var r=Cze(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cze(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mze(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nq(n.key),n)}}function Ize(e,t,r){return t&&Mze(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eze(e,t,r){return t=q1(t),Tze(e,wq()?Reflect.construct(t,r||[],q1(e).constructor):t.apply(e,r))}function Tze(e,t){if(t&&(Mh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Aze(e)}function Aze(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wq=function(){return!!e})()}function q1(e){return q1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},q1(e)}function Pze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kM(e,t)}function kM(e,t){return kM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},kM(e,t)}function jq(e,t,r){return t=Nq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nq(e){var t=_ze(e,"string");return Mh(t)=="symbol"?t:t+""}function _ze(e,t){if(Mh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jj=function(e){function t(){return kze(this,t),Eze(this,t,arguments)}return Pze(t,e),Ize(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,m=Sze(n,bze),h=Er(m,!1);this.props.direction==="x"&&d.type!=="number"&&_u();var p=c.map(function(g){var y=u(g,l),v=y.x,x=y.y,j=y.value,C=y.errorVal;if(!C)return null;var N=[],S,M;if(Array.isArray(C)){var k=vze(C,2);S=k[0],M=k[1]}else S=M=C;if(i==="vertical"){var I=d.scale,T=x+a,L=T+o,R=T-o,_=I(j-S),B=I(j+M);N.push({x1:B,y1:L,x2:B,y2:R}),N.push({x1:_,y1:T,x2:B,y2:T}),N.push({x1:_,y1:L,x2:_,y2:R})}else if(i==="horizontal"){var z=f.scale,D=v+a,A=D-o,P=D+o,E=z(j-S),F=z(j+M);N.push({x1:A,y1:F,x2:P,y2:F}),N.push({x1:D,y1:E,x2:D,y2:F}),N.push({x1:A,y1:E,x2:P,y2:E})}return U.createElement(Zn,W1({className:"recharts-errorBar",key:"bar-".concat(N.map(function($){return"".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))},h),N.map(function($){return U.createElement("line",W1({},$,{key:"line-".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))}))});return U.createElement(Zn,{className:"recharts-errorBars"},p)}}])}(U.Component);jq(jj,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});jq(jj,"displayName","ErrorBar");function Y0(e){"@babel/helpers - typeof";return Y0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y0(e)}function HO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HO(Object(r),!0).forEach(function(n){Lze(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lze(e,t,r){return t=Dze(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dze(e){var t=Oze(e,"string");return Y0(t)=="symbol"?t:t+""}function Oze(e,t){if(Y0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Y0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sq=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Ks(r,Im);if(!o)return null;var l=Im.defaultProps,c=l!==void 0?Xu(Xu({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(n||[]).reduce(function(d,f){var m=f.item,h=f.props,p=h.sectors||h.data||[];return d.concat(p.map(function(g){return{type:o.props.iconType||m.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(n||[]).map(function(d){var f=d.item,m=f.type.defaultProps,h=m!==void 0?Xu(Xu({},m),f.props):{},p=h.dataKey,g=h.name,y=h.legendType,v=h.hide;return{inactive:v,dataKey:p,type:c.iconType||y||"square",color:BT(f),value:g||p,payload:h}}),Xu(Xu(Xu({},c),Im.getWithHeight(o,a)),{},{payload:u,item:o})};function Q0(e){"@babel/helpers - typeof";return Q0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q0(e)}function YO(e){return zze(e)||Fze(e)||$ze(e)||Rze()}function Rze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3800In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ze(e,t){if(e){if(typeof e=="string")return MM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MM(e,t)}}function Fze(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zze(e){if(Array.isArray(e))return MM(e)}function MM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function QO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function aa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QO(Object(r),!0).forEach(function(n){Tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tm(e,t,r){return t=Bze(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bze(e){var t=Uze(e,"string");return Q0(t)=="symbol"?t:t+""}function Uze(e,t){if(Q0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Q0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ci(e,t,r){return _r(e)||_r(t)?r:Aa(t)?Di(e,t,r):yr(t)?t(e):r}function Qg(e,t,r,n){var a=FFe(e,function(l){return ci(l,t)});if(r==="number"){var i=a.filter(function(l){return ut(l)||parseFloat(l)});return i.length?[vj(i),iu(i)]:[1/0,-1/0]}var o=n?a.filter(function(l){return!_r(l)}):a;return o.map(function(l){return Aa(l)||l instanceof Date?l:""})}var Vze=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,m=u>=l-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(fo(f-d)!==fo(m-f)){var p=[];if(fo(m-f)===fo(c[1]-c[0])){h=m;var g=f+c[1]-c[0];p[0]=Math.min(g,(g+d)/2),p[1]=Math.max(g,(g+d)/2)}else{h=d;var y=m+c[1]-c[0];p[0]=Math.min(f,(y+f)/2),p[1]=Math.max(f,(y+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>v[0]&&t<=v[1]||t>=p[0]&&t<=p[1]){o=a[u].index;break}}else{var x=Math.min(d,m),j=Math.max(d,m);if(t>(x+f)/2&&t<=(j+f)/2){o=a[u].index;break}}}else for(var C=0;C<l;C++)if(C===0&&t<=(n[C].coordinate+n[C+1].coordinate)/2||C>0&&C<l-1&&t>(n[C].coordinate+n[C-1].coordinate)/2&&t<=(n[C].coordinate+n[C+1].coordinate)/2||C===l-1&&t>(n[C].coordinate+n[C-1].coordinate)/2){o=n[C].index;break}return o},BT=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?aa(aa({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Wze=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),m=0,h=f.length;m<h;m++){var p=d[f[m]],g=p.items,y=p.cateAxisId,v=g.filter(function(M){return Jl(M.type).indexOf("Bar")>=0});if(v&&v.length){var x=v[0].type.defaultProps,j=x!==void 0?aa(aa({},x),v[0].props):v[0].props,C=j.barSize,N=j[y];o[N]||(o[N]=[]);var S=_r(C)?r:C;o[N].push({item:v[0],stackList:v.slice(1),barSize:_r(S)?void 0:cf(S,n,0)})}}return o},qze=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=cf(r,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var m=!1,h=a/c,p=o.reduce(function(C,N){return C+N.barSize||0},0);p+=(c-1)*u,p>=a&&(p-=(c-1)*u,u=0),p>=a&&h>0&&(m=!0,h*=.9,p=c*h);var g=(a-p)/2>>0,y={offset:g-u,size:0};d=o.reduce(function(C,N){var S={item:N.item,position:{offset:y.offset+y.size+u,size:m?h:N.barSize}},M=[].concat(YO(C),[S]);return y=M[M.length-1].position,N.stackList&&N.stackList.length&&N.stackList.forEach(function(k){M.push({item:k,position:y})}),M},f)}else{var v=cf(n,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var x=(a-2*v-(c-1)*u)/c;x>1&&(x>>=0);var j=l===+l?Math.min(x,l):x;d=o.reduce(function(C,N,S){var M=[].concat(YO(C),[{item:N.item,position:{offset:v+(x+u)*S+(x-j)/2,size:j}}]);return N.stackList&&N.stackList.length&&N.stackList.forEach(function(k){M.push({item:k,position:M[M.length-1].position})}),M},f)}return d},Gze=function(t,r,n,a){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=Sq({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,m=d.height,h=u.align,p=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&ut(t[h]))return aa(aa({},t),{},Tm({},h,t[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&ut(t[p]))return aa(aa({},t),{},Tm({},p,t[p]+(m||0)))}return t},Hze=function(t,r,n){return _r(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Cq=function(t,r,n,a,i){var o=r.props.children,l=yo(o,jj).filter(function(u){return Hze(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=ci(d,n);if(_r(f))return u;var m=Array.isArray(f)?[vj(f),iu(f)]:[f,f],h=c.reduce(function(p,g){var y=ci(d,g,0),v=m[0]-Math.abs(Array.isArray(y)?y[0]:y),x=m[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(v,p[0]),Math.max(x,p[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},Yze=function(t,r,n,a,i){var o=r.map(function(l){return Cq(t,l,n,i,a)}).filter(function(l){return!_r(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},kq=function(t,r,n,a,i){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&Cq(t,c,u,a)||Qg(t,u,n,i)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},Mq=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},Iq=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},Fl=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?fo(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var m=i?i.indexOf(f):f;return{coordinate:a(m)+u,value:f,offset:u}});return d.filter(function(f){return!hp(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,m){return{coordinate:a(f)+u,value:f,index:m,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,m){return{coordinate:a(f)+u,value:i?i[f]:f,index:m,offset:u}})},MS=new WeakMap,mv=function(t,r){if(typeof r!="function")return t;MS.has(t)||MS.set(t,new WeakMap);var n=MS.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},Qze=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:z0(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:F1(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Yg(),realScaleType:"point"}:i==="category"?{scale:z0(),realScaleType:"band"}:{scale:F1(),realScaleType:"linear"};if(lf(a)){var c="scale".concat(ij(a));return{scale:(UO[c]||Yg)(),realScaleType:UO[c]?c:"point"}}return yr(a)?{scale:a}:{scale:Yg(),realScaleType:"point"}},KO=1e-4,Kze=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-KO,o=Math.max(a[0],a[1])+KO,l=t(r[0]),c=t(r[n-1]);(l<i||l>o||c<i||c>o)&&t.domain([r[0],r[n-1]])}},Jze=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},Zze=function(t,r){if(!r||r.length!==2||!ut(r[0])||!ut(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!ut(t[0])||t[0]<n)&&(i[0]=n),(!ut(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},Xze=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0,l=0;l<r;++l){var c=hp(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},eBe=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0;o<r;++o){var l=hp(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},tBe={sign:Xze,expand:gAe,none:vh,silhouette:yAe,wiggle:bAe,positive:eBe},rBe=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=tBe[n],o=pAe().keys(a).value(function(l,c){return+ci(l,c,0)}).order(Zk).offset(i);return o(t)},nBe=function(t,r,n,a,i,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(f,m){var h,p=(h=m.type)!==null&&h!==void 0&&h.defaultProps?aa(aa({},m.type.defaultProps),m.props):m.props,g=p.stackId,y=p.hide;if(y)return f;var v=p[n],x=f[v]||{hasStack:!1,stackGroups:{}};if(Aa(g)){var j=x.stackGroups[g]||{numericAxisId:n,cateAxisId:a,items:[]};j.items.push(m),x.hasStack=!0,x.stackGroups[g]=j}else x.stackGroups[ab("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return aa(aa({},f),{},Tm({},v,x))},c),d={};return Object.keys(u).reduce(function(f,m){var h=u[m];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,y){var v=h.stackGroups[y];return aa(aa({},g),{},Tm({},y,{numericAxisId:n,cateAxisId:a,items:v.items,stackedData:rBe(t,v.items,i)}))},p)}return aa(aa({},f),{},Tm({},m,h))},d)},aBe=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=pze(u,i,l);return t.domain([vj(d),iu(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),m=gze(f,i,l);return{niceTicks:m}}return null};function JO(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!_r(a[t.dataKey])){var l=g1(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=ci(a,_r(o)?t.dataKey:o);return _r(c)?null:t.scale(c)}var ZO=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=ci(o,r.dataKey,r.domain[l]);return _r(c)?null:r.scale(c)-i/2+a},sBe=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},iBe=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?aa(aa({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Aa(i)){var o=r[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},oBe=function(t){return t.reduce(function(r,n){return[vj(n.concat([r[0]]).filter(ut)),iu(n.concat([r[1]]).filter(ut))]},[1/0,-1/0])},Eq=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,d){var f=oBe(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},XO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,IM=function(t,r,n){if(yr(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(ut(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(XO.test(t[0])){var i=+XO.exec(t[0])[1];a[0]=r[0]-i}else yr(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(ut(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(eR.test(t[1])){var o=+eR.exec(t[1])[1];a[1]=r[1]+o}else yr(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},G1=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=pT(r,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},tR=function(t,r,n){return!t||!t.length||q0(t,Di(n,"type.defaultProps.domain"))?r:t},Tq=function(t,r){var n=t.type.defaultProps?aa(aa({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return aa(aa({},Er(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:BT(t),value:ci(r,a),type:c,payload:r,chartType:u,hide:d})};function K0(e){"@babel/helpers - typeof";return K0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K0(e)}function rR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rR(Object(r),!0).forEach(function(n){lBe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lBe(e,t,r){return t=cBe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cBe(e){var t=uBe(e,"string");return K0(t)=="symbol"?t:t+""}function uBe(e,t){if(K0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(K0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H1=Math.PI/180,dBe=function(t){return t*180/Math.PI},Ka=function(t,r,n,a){return{x:t+Math.cos(-H1*a)*n,y:r+Math.sin(-H1*a)*n}},fBe=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},mBe=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,l=fBe({x:n,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:dBe(u),angleInRadian:u}},hBe=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},pBe=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},aR=function(t,r){var n=t.x,a=t.y,i=mBe({x:n,y:a},r),o=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=hBe(r),f=d.startAngle,m=d.endAngle,h=l,p;if(f<=m){for(;h>m;)h-=360;for(;h<f;)h+=360;p=h>=f&&h<=m}else{for(;h>f;)h-=360;for(;h<m;)h+=360;p=h>=m&&h<=f}return p?nR(nR({},r),{},{radius:o,angle:pBe(h,r)}):null};function J0(e){"@babel/helpers - typeof";return J0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J0(e)}var gBe=["offset"];function yBe(e){return wBe(e)||xBe(e)||vBe(e)||bBe()}function bBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3801In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vBe(e,t){if(e){if(typeof e=="string")return EM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return EM(e,t)}}function xBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wBe(e){if(Array.isArray(e))return EM(e)}function EM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jBe(e,t){if(e==null)return{};var r=NBe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NBe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ma(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(r),!0).forEach(function(n){SBe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SBe(e,t,r){return t=CBe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CBe(e){var t=kBe(e,"string");return J0(t)=="symbol"?t:t+""}function kBe(e,t){if(J0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(J0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z0(){return Z0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z0.apply(this,arguments)}var MBe=function(t){var r=t.value,n=t.formatter,a=_r(t.children)?r:t.children;return yr(n)?n(a):a},IBe=function(t,r){var n=fo(r-t),a=Math.min(Math.abs(r-t),360);return n*a},EBe=function(t,r,n){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,m=c.outerRadius,h=c.startAngle,p=c.endAngle,g=c.clockWise,y=(f+m)/2,v=IBe(h,p),x=v>=0?1:-1,j,C;a==="insideStart"?(j=h+x*o,C=g):a==="insideEnd"?(j=p-x*o,C=!g):a==="end"&&(j=p+x*o,C=g),C=v<=0?C:!C;var N=Ka(u,d,y,j),S=Ka(u,d,y,j+(C?1:-1)*359),M="M".concat(N.x,",").concat(N.y,`
3802    A`).concat(y,",").concat(y,",0,1,").concat(C?0:1,`,
3803    `).concat(S.x,",").concat(S.y),k=_r(t.id)?ab("recharts-radial-line-"):t.id;return U.createElement("text",Z0({},n,{dominantBaseline:"central",className:Jt("recharts-radial-bar-label",l)}),U.createElement("defs",null,U.createElement("path",{id:k,d:M})),U.createElement("textPath",{xlinkHref:"#".concat(k)},r))},TBe=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,m=(d+f)/2;if(a==="outside"){var h=Ka(o,l,u+n,m),p=h.x,g=h.y;return{x:p,y:g,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,v=Ka(o,l,y,m),x=v.x,j=v.y;return{x,y:j,textAnchor:"middle",verticalAnchor:"middle"}},ABe=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,m=f*a,h=f>0?"end":"start",p=f>0?"start":"end",g=u>=0?1:-1,y=g*a,v=g>0?"end":"start",x=g>0?"start":"end";if(i==="top"){var j={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:h};return Ma(Ma({},j),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var C={x:l+u/2,y:c+d+m,textAnchor:"middle",verticalAnchor:p};return Ma(Ma({},C),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var N={x:l-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Ma(Ma({},N),n?{width:Math.max(N.x-n.x,0),height:d}:{})}if(i==="right"){var S={x:l+u+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Ma(Ma({},S),n?{width:Math.max(n.x+n.width-S.x,0),height:d}:{})}var M=n?{width:u,height:d}:{};return i==="insideLeft"?Ma({x:l+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},M):i==="insideRight"?Ma({x:l+u-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},M):i==="insideTop"?Ma({x:l+u/2,y:c+m,textAnchor:"middle",verticalAnchor:p},M):i==="insideBottom"?Ma({x:l+u/2,y:c+d-m,textAnchor:"middle",verticalAnchor:h},M):i==="insideTopLeft"?Ma({x:l+y,y:c+m,textAnchor:x,verticalAnchor:p},M):i==="insideTopRight"?Ma({x:l+u-y,y:c+m,textAnchor:v,verticalAnchor:p},M):i==="insideBottomLeft"?Ma({x:l+y,y:c+d-m,textAnchor:x,verticalAnchor:h},M):i==="insideBottomRight"?Ma({x:l+u-y,y:c+d-m,textAnchor:v,verticalAnchor:h},M):up(i)&&(ut(i.x)||xd(i.x))&&(ut(i.y)||xd(i.y))?Ma({x:l+cf(i.x,u),y:c+cf(i.y,d),textAnchor:"end",verticalAnchor:"end"},M):Ma({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},M)},PBe=function(t){return"cx"in t&&ut(t.cx)};function fs(e){var t=e.offset,r=t===void 0?5:t,n=jBe(e,gBe),a=Ma({offset:r},n),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,m=a.textBreakAll;if(!i||_r(l)&&_r(c)&&!b.isValidElement(u)&&!yr(u))return null;if(b.isValidElement(u))return b.cloneElement(u,a);var h;if(yr(u)){if(h=b.createElement(u,a),b.isValidElement(h))return h}else h=MBe(a);var p=PBe(i),g=Er(a,!0);if(p&&(o==="insideStart"||o==="insideEnd"||o==="end"))return EBe(a,h,g);var y=p?TBe(a):ABe(a);return U.createElement(P1,Z0({className:Jt("recharts-label",f)},g,y,{breakAll:m}),h)}fs.displayName="Label";var Aq=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,m=t.y,h=t.top,p=t.left,g=t.width,y=t.height,v=t.clockWise,x=t.labelViewBox;if(x)return x;if(ut(g)&&ut(y)){if(ut(f)&&ut(m))return{x:f,y:m,width:g,height:y};if(ut(h)&&ut(p))return{x:h,y:p,width:g,height:y}}return ut(f)&&ut(m)?{x:f,y:m,width:0,height:0}:ut(r)&&ut(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},_Be=function(t,r){return t?t===!0?U.createElement(fs,{key:"label-implicit",viewBox:r}):Aa(t)?U.createElement(fs,{key:"label-implicit",viewBox:r,value:t}):b.isValidElement(t)?t.type===fs?b.cloneElement(t,{key:"label-implicit",viewBox:r}):U.createElement(fs,{key:"label-implicit",content:t,viewBox:r}):yr(t)?U.createElement(fs,{key:"label-implicit",content:t,viewBox:r}):up(t)?U.createElement(fs,Z0({viewBox:r},t,{key:"label-implicit"})):null:null},LBe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=Aq(t),o=yo(a,fs).map(function(c,u){return b.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var l=_Be(t.label,r||i);return[l].concat(yBe(o))};fs.parseViewBox=Aq;fs.renderCallByParent=LBe;function DBe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var OBe=DBe;const RBe=hn(OBe);function X0(e){"@babel/helpers - typeof";return X0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X0(e)}var $Be=["valueAccessor"],FBe=["data","dataKey","clockWise","id","textBreakAll"];function zBe(e){return WBe(e)||VBe(e)||UBe(e)||BBe()}function BBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3804In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UBe(e,t){if(e){if(typeof e=="string")return TM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TM(e,t)}}function VBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WBe(e){if(Array.isArray(e))return TM(e)}function TM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y1.apply(this,arguments)}function iR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(r),!0).forEach(function(n){qBe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qBe(e,t,r){return t=GBe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GBe(e){var t=HBe(e,"string");return X0(t)=="symbol"?t:t+""}function HBe(e,t){if(X0(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(X0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lR(e,t){if(e==null)return{};var r=YBe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YBe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var QBe=function(t){return Array.isArray(t.value)?RBe(t.value):t.value};function vu(e){var t=e.valueAccessor,r=t===void 0?QBe:t,n=lR(e,$Be),a=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=lR(n,FBe);return!a||!a.length?null:U.createElement(Zn,{className:"recharts-label-list"},a.map(function(d,f){var m=_r(i)?r(d,f):ci(d&&d.payload,i),h=_r(l)?{}:{id:"".concat(l,"-").concat(f)};return U.createElement(fs,Y1({},Er(d,!0),u,h,{parentViewBox:d.parentViewBox,value:m,textBreakAll:c,viewBox:fs.parseViewBox(_r(o)?d:oR(oR({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}vu.displayName="LabelList";function KBe(e,t){return e?e===!0?U.createElement(vu,{key:"labelList-implicit",data:t}):U.isValidElement(e)||yr(e)?U.createElement(vu,{key:"labelList-implicit",data:t,content:e}):up(e)?U.createElement(vu,Y1({data:t},e,{key:"labelList-implicit"})):null:null}function JBe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=yo(n,vu).map(function(o,l){return b.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=KBe(e.label,t);return[i].concat(zBe(a))}vu.renderCallByParent=JBe;function ey(e){"@babel/helpers - typeof";return ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ey(e)}function AM(){return AM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AM.apply(this,arguments)}function cR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function uR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cR(Object(r),!0).forEach(function(n){ZBe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZBe(e,t,r){return t=XBe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XBe(e){var t=eUe(e,"string");return ey(t)=="symbol"?t:t+""}function eUe(e,t){if(ey(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ey(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tUe=function(t,r){var n=fo(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},hv=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/H1,m=u?i:i+o*f,h=Ka(r,n,d,m),p=Ka(r,n,a,m),g=u?i-o*f:i,y=Ka(r,n,d*Math.cos(f*H1),g);return{center:h,circleTangency:p,lineTangency:y,theta:f}},Pq=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=tUe(o,l),u=o+c,d=Ka(r,n,i,o),f=Ka(r,n,i,u),m="M ".concat(d.x,",").concat(d.y,`
3805    A `).concat(i,",").concat(i,`,0,
3806    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
3807    `).concat(f.x,",").concat(f.y,`
3808  `);if(a>0){var h=Ka(r,n,a,o),p=Ka(r,n,a,u);m+="L ".concat(p.x,",").concat(p.y,`
3809            A `).concat(a,",").concat(a,`,0,
3810            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
3811            `).concat(h.x,",").concat(h.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},rUe=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=fo(d-u),m=hv({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),h=m.circleTangency,p=m.lineTangency,g=m.theta,y=hv({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),v=y.circleTangency,x=y.lineTangency,j=y.theta,C=c?Math.abs(u-d):Math.abs(u-d)-g-j;if(C<0)return l?"M ".concat(p.x,",").concat(p.y,`
3812        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
3813        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
3814      `):Pq({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var N="M ".concat(p.x,",").concat(p.y,`
3815    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,`
3816    A`).concat(i,",").concat(i,",0,").concat(+(C>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
3817    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
3818  `);if(a>0){var S=hv({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),M=S.circleTangency,k=S.lineTangency,I=S.theta,T=hv({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=T.circleTangency,R=T.lineTangency,_=T.theta,B=c?Math.abs(u-d):Math.abs(u-d)-I-_;if(B<0&&o===0)return"".concat(N,"L").concat(r,",").concat(n,"Z");N+="L".concat(R.x,",").concat(R.y,`
3819      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(L.x,",").concat(L.y,`
3820      A`).concat(a,",").concat(a,",0,").concat(+(B>180),",").concat(+(f>0),",").concat(M.x,",").concat(M.y,`
3821      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else N+="L".concat(r,",").concat(n,"Z");return N},nUe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},_q=function(t){var r=uR(uR({},nUe),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,m=r.className;if(o<i||d===f)return null;var h=Jt("recharts-sector",m),p=o-i,g=cf(l,p,0,!0),y;return g>0&&Math.abs(d-f)<360?y=rUe({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(g,p/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=Pq({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),U.createElement("path",AM({},Er(r,!0),{className:h,d:y,role:"img"}))};function ty(e){"@babel/helpers - typeof";return ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ty(e)}function PM(){return PM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
3821for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PM.apply(this,arguments)}function dR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dR(Object(r),!0).forEach(function(n){aUe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aUe(e,t,r){return t=sUe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sUe(e){var t=iUe(e,"string");return ty(t)=="symbol"?t:t+""}function iUe(e,t){if(ty(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ty(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mR={curveBasisClosed:aAe,curveBasisOpen:sAe,curveBasis:nAe,curveBumpX:VTe,curveBumpY:WTe,curveLinearClosed:iAe,curveLinear:lj,curveMonotoneX:oAe,curveMonotoneY:lAe,curveNatural:cAe,curveStep:uAe,curveStepAfter:fAe,curveStepBefore:dAe},pv=function(t){return t.x===+t.x&&t.y===+t.y},cg=function(t){return t.x},ug=function(t){return t.y},oUe=function(t,r){if(yr(t))return t;var n="curve".concat(ij(t));return(n==="curveMonotone"||n==="curveBump")&&r?mR["".concat(n).concat(r==="vertical"?"Y":"X")]:mR[n]||lj},lUe=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=oUe(n,l),f=u?i.filter(function(g){return pv(g)}):i,m;if(Array.isArray(o)){var h=u?o.filter(function(g){return pv(g)}):o,p=f.map(function(g,y){return fR(fR({},g),{},{base:h[y]})});return l==="vertical"?m=sv().y(ug).x1(cg).x0(function(g){return g.base.x}):m=sv().x(cg).y1(ug).y0(function(g){return g.base.y}),m.defined(pv).curve(d),m(p)}return l==="vertical"&&ut(o)?m=sv().y(ug).x1(cg).x0(o):ut(o)?m=sv().x(cg).y1(ug).y0(o):m=PV().x(cg).y(ug),m.defined(pv).curve(d),m(f)},Kg=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var o=n&&n.length?lUe(t):a;return b.createElement("path",PM({},Er(t,!1),y1(t),{className:Jt("recharts-curve",r),d:o,ref:i}))},Lq={exports:{}},cUe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",uUe=cUe,dUe=uUe;function Dq(){}function Oq(){}Oq.resetWarningCache=Dq;var fUe=function(){function e(n,a,i,o,l,c){if(c!==dUe){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Oq,resetWarningCache:Dq};return r.PropTypes=r,r};Lq.exports=fUe();var mUe=Lq.exports;const ln=hn(mUe);var hUe=Object.getOwnPropertyNames,pUe=Object.getOwnPropertySymbols,gUe=Object.prototype.hasOwnProperty;function hR(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function gv(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);var i=a.cache,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);var c=e(r,n,a);return i.delete(r),i.delete(n),c}}function pR(e){return hUe(e).concat(pUe(e))}var yUe=Object.hasOwn||function(e,t){return gUe.call(e,t)};function Mf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var bUe="__v",vUe="__o",xUe="_owner",gR=Object.getOwnPropertyDescriptor,yR=Object.keys;function wUe(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function jUe(e,t){return Mf(e.getTime(),t.getTime())}function NUe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function SUe(e,t){return e===t}function bR(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var m=o.value,h=l.value;if(r.equals(m[0],h[0],c,f,e,t,r)&&r.equals(m[1],h[1],m[0],h[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var CUe=Mf;function kUe(e,t,r){var n=yR(e),a=n.length;if(yR(t).length!==a)return!1;for(;a-- >0;)if(!Rq(e,t,r,n[a]))return!1;return!0}function dg(e,t,r){var n=pR(e),a=n.length;if(pR(t).length!==a)return!1;for(var i,o,l;a-- >0;
3821)if(i=n[a],!Rq(e,t,r,i)||(o=gR(e,i),l=gR(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function MUe(e,t){return Mf(e.valueOf(),t.valueOf())}function IUe(e,t){return e.source===t.source&&e.flags===t.flags}function vR(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function EUe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function TUe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Rq(e,t,r,n){return(n===xUe||n===vUe||n===bUe)&&(e.$$typeof||t.$$typeof)?!0:yUe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var AUe="[object Arguments]",PUe="[object Boolean]",_Ue="[object Date]",LUe="[object Error]",DUe="[object Map]",OUe="[object Number]",RUe="[object Object]",$Ue="[object RegExp]",FUe="[object Set]",zUe="[object String]",BUe="[object URL]",UUe=Array.isArray,xR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,wR=Object.assign,VUe=Object.prototype.toString.call.bind(Object.prototype.toString);function WUe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,m=e.areUrlsEqual;return function(p,g,y){if(p===g)return!0;if(p==null||g==null)return!1;var v=typeof p;if(v!==typeof g)return!1;if(v!=="object")return v==="number"?o(p,g,y):v==="function"?a(p,g,y):!1;var x=p.constructor;if(x!==g.constructor)return!1;if(x===Object)return l(p,g,y);if(UUe(p))return t(p,g,y);if(xR!=null&&xR(p))return f(p,g,y);if(x===Date)return r(p,g,y);if(x===RegExp)return u(p,g,y);if(x===Map)return i(p,g,y);if(x===Set)return d(p,g,y);var j=VUe(p);return j===_Ue?r(p,g,y):j===$Ue?u(p,g,y):j===DUe?i(p,g,y):j===FUe?d(p,g,y):j===RUe?typeof p.then!="function"&&typeof g.then!="function"&&l(p,g,y):j===BUe?m(p,g,y):j===LUe?n(p,g,y):j===AUe?l(p,g,y):j===PUe||j===OUe||j===zUe?c(p,g,y):!1}}function qUe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?dg:wUe,areDatesEqual:jUe,areErrorsEqual:NUe,areFunctionsEqual:SUe,areMapsEqual:n?hR(bR,dg):bR,areNumbersEqual:CUe,areObjectsEqual:n?dg:kUe,arePrimitiveWrappersEqual:MUe,areRegExpsEqual:IUe,areSetsEqual:n?hR(vR,dg):vR,areTypedArraysEqual:n?dg:EUe,areUrlsEqual:TUe};if(r&&(a=wR({},a,r(a))),t){var i=gv(a.areArraysEqual),o=gv(a.areMapsEqual),l=gv(a.areObjectsEqual),c=gv(a.areSetsEqual);a=wR({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return a}function GUe(e){return function(t,r,n,a,i,o,l){return e(t,r,l)}}function HUe(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,m=f===void 0?t?new WeakMap:void 0:f,h=d.meta;return r(c,u,{cache:m,equals:a,meta:h,strict:i})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return r(c,u,o)}}var YUe=Vu();Vu({strict:!0});Vu({circular:!0});Vu({circular:!0,strict:!0});Vu({createInternalComparator:function(){return Mf}});Vu({strict:!0,createInternalComparator:function(){return Mf}});Vu({circular:!0,createInternalComparator:function(){return Mf}});Vu({circular:!0,createInternalComparator:function(){return Mf},strict:!0});function Vu(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,l=qUe(e),c=WUe(l),u=n?n(c):GUe(c);return HUe({circular:r,comparator:c,createState:a,equals:u,strict:o})}function QUe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function jR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):QUe(a)};requestAnimationFrame(n)}function _M(e){"@babel/helpers - typeof";return _M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_M(e)}function KUe(e){return e7e(e)||XUe(e)||ZUe(e)||JUe()}
vendor: 163,473 bytes, lines 3821-3843
3821function JUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3822In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZUe(e,t){if(e){if(typeof e=="string")return NR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NR(e,t)}}function NR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XUe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function e7e(e){if(Array.isArray(e))return e}function t7e(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=KUe(o),c=l[0],u=l.slice(1);if(typeof c=="number"){jR(a.bind(null,u),c);return}a(c),jR(a.bind(null,u));return}_M(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function ry(e){"@babel/helpers - typeof";return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function SR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function CR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(r),!0).forEach(function(n){$q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $q(e,t,r){return t=r7e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r7e(e){var t=n7e(e,"string");return ry(t)==="symbol"?t:String(t)}function n7e(e,t){if(ry(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ry(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a7e=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},s7e=function(t){return t},i7e=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Jg=function(t,r){return Object.keys(r).reduce(function(n,a){return CR(CR({},n),{},$q({},a,t(a,r[a])))},{})},kR=function(t,r,n){return t.map(function(a){return"".concat(i7e(a)," ").concat(r,"ms ").concat(n)}).join(",")};function o7e(e,t){return u7e(e)||c7e(e,t)||Fq(e,t)||l7e()}function l7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3823In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c7e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function u7e(e){if(Array.isArray(e))return e}function d7e(e){return h7e(e)||m7e(e)||Fq(e)||f7e()}function f7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3824In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fq(e,t){if(e){if(typeof e=="string")return LM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LM(e,t)}}function m7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h7e(e){if(Array.isArray(e))return LM(e)}function LM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Q1=1e-4,zq=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},Bq=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},MR=function(t,r){return function(n){var a=zq(t,r);return Bq(a,n)}},p7e=function(t,r){return function(n){var a=zq(t,r),i=[].concat(d7e(a.map(function(o,l){return o*l}).slice(1)),[0]);return Bq(i,n)}},IR=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=o7e(u,4);a=d[0],i=d[1],o=d[2],l=d[3]}}}var f=MR(a,o),m=MR(i,l),h=p7e(a,o),p=function(v){return v>1?1:v<0?0:v},g=function(v){for(var x=v>1?1:v,j=x,C=0;C<8;++C){var N=f(j)-x,S=h(j);if(Math.abs(N-x)<Q1||S<Q1)return m(j);j=p(j-N/S)}return m(j)};return g.isStepper=!1,g},g7e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,m){var h=-(d-f)*n,p=m*i,g=m+(h-p)*l/1e3,y=m*l/1e3+d;return Math.abs(y-f)<Q1&&Math.abs(g)<Q1?[f,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},y7e=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return IR(a);case"spring":return g7e();default:if(a.split("(")[0]==="cubic-bezier")return IR(a)}return typeof a=="function"?a:null};function ny(e){"@babel/helpers - typeof";return ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ny(e)}function ER(e){return x7e(e)||v7e(e)||Uq(e)||b7e()}function b7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3825In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function x7e(e){if(Array.isArray(e))return OM(e)}function TR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(r),!0).forEach(function(n){DM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DM(e,t,r){return t=w7e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w7e(e){var t=j7e(e,"string");return ny(t)==="symbol"?t:String(t)}function j7e(e,t){if(ny(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ny(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N7e(e,t){return k7e(e)||C7e(e,t)||Uq(e,t)||S7e()}function S7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3826In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uq(e,t){if(e){if(typeof e=="string")return OM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OM(e,t)}}function OM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function C7e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function k7e(e){if(Array.isArray(e))return e}var K1=function(t,r,n){return t+(r-t)*n},RM=function(t){var r=t.from,n=t.to;return r!==n},M7e=function e(t,r,n){var a=Jg(function(i,o){if(RM(o)){var l=t(o.from,o.to,o.velocity),c=N7e(l,2),u=c[0],d=c[1];return Ha(Ha({},o),{},{from:u,velocity:d})}return o},r);return n<1?Jg(function(i,o){return RM(o)?Ha(Ha({},o),{},{velocity:K1(o.velocity,a[i].velocity,n),from:K1(o.from,a[i].from,n)}):o},r):e(t,a,n-1)};const I7e=function(e,t,r,n,a){var i=a7e(e,t),o=i.reduce(function(y,v){return Ha(Ha({},y),{},DM({},v,[e[v],t[v]]))},{}),l=i.reduce(function(y,v){return Ha(Ha({},y),{},DM({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,f=function(){return null},m=function(){return Jg(function(v,x){return x.from},l)},h=function(){return!Object.values(l).filter(RM).length},p=function(v){u||(u=v);var x=v-u,j=x/r.dt;l=M7e(r,l,j),a(Ha(Ha(Ha({},e),t),m())),u=v,h()||(c=requestAnimationFrame(f))},g=function(v){d||(d=v);var x=(v-d)/n,j=Jg(function(N,S){return K1.apply(void 0,ER(S).concat([r(x)]))},o);if(a(Ha(Ha(Ha({},e),t),j)),x<1)c=requestAnimationFrame(f);else{var C=Jg(function(N,S){return K1.apply(void 0,ER(S).concat([r(1)]))},o);a(Ha(Ha(Ha({},e),t),C))}};return f=r.isStepper?p:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Ih(e){"@babel/helpers - typeof";return Ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ih(e)}var E7e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function T7e(e,t){if(e==null)return{};var r=A7e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function A7e(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function IS(e){return D7e(e)||L7e(e)||_7e(e)||P7e()}function P7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3827In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _7e(e,t){if(e){if(typeof e=="string")return $M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $M(e,t)}}function L7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function D7e(e){if(Array.isArray(e))return $M(e)}function $M(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ki(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AR(Object(r),!0).forEach(function(n){Pg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pg(e,t,r){return t=Vq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R7e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vq(n.key),n)}}function $7e(e,t,r){return t&&R7e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vq(e){var t=F7e(e,"string");return Ih(t)==="symbol"?t:String(t)}function F7e(e,t){if(Ih(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ih(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FM(e,t)}function FM(e,t){return FM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},FM(e,t)}function B7e(e){var t=U7e();return function(){var n=J1(e),a;if(t){var i=J1(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return zM(this,a)}}function zM(e,t){if(t&&(Ih(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BM(e)}function BM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function J1(e){return J1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},J1(e)}var hc=function(e){z7e(r,e);var t=B7e(r);function r(n,a){var i;O7e(this,r),i=t.call(this,n,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,m=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(BM(i)),i.changeStyle=i.changeStyle.bind(BM(i)),!l||h<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:d}),zM(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof m=="function")return i.state={style:u},zM(i);i.state={style:c?Pg({},c,u):u}}else i.state={style:{}};return i}return $7e(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,m=this.state.style;if(l){if(!o){var h={style:c?Pg({},c,d):d};this.state&&m&&(c&&m[c]!==d||!c&&m!==d)&&this.setState(h);return}if(!(YUe(a.to,d)&&a.canBegin&&a.isActive)){var p=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||u?f:a.to;if(this.state&&m){var y={style:c?Pg({},c,g):g};(c&&m[c]!==g||!c&&m!==g)&&this.setState(y)}this.runAnimation(Ki(Ki({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,m=a.onAnimationStart,h=I7e(o,l,y7e(u),c,this.changeStyle),p=function(){i.stopJSAnimation=h()};this.manager.start([m,d,p,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,m=f===void 0?0:f,h=function(g,y,v){if(v===0)return g;var x=y.duration,j=y.easing,C=j===void 0?"ease":j,N=y.style,S=y.properties,M=y.onAnimationEnd,k=v>0?o[v-1]:y,I=S||Object.keys(N);if(typeof C=="function"||C==="spring")return[].concat(IS(g),[i.runJSAnimation.bind(i,{from:k.style,to:N,duration:x,easing:C}),x]);var T=kR(I,x,C),L=Ki(Ki(Ki({},k.style),N),{},{transition:T});return[].concat(IS(g),[L,x,M]).filter(s7e)};return this.manager.start([c].concat(IS(o.reduce(h,[d,Math.max(m,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=t7e());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,m=a.steps,h=a.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var g=l?Pg({},l,c):c,y=kR(Object.keys(g),o,u);p.start([d,i,Ki(Ki({},g),{},{transition:y}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=T7e(a,E7e),u=b.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var f=function(h){var p=h.props,g=p.style,y=g===void 0?{}:g,v=p.className,x=b.cloneElement(h,Ki(Ki({},c),{},{style:Ki(Ki({},y),d),className:v}));return x};return u===1?f(b.Children.only(i)):U.createElement("div",null,b.Children.map(i,function(m){return f(m)}))}}]),r}(b.PureComponent);hc.displayName="Animate";hc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};hc.propTypes={from:ln.oneOfType([ln.object,ln.string]),to:ln.oneOfType([ln.object,ln.string]),attributeName:ln.string,duration:ln.number,begin:ln.number,easing:ln.oneOfType([ln.string,ln.func]),steps:ln.arrayOf(ln.shape({duration:ln.number.isRequired,style:ln.object.isRequired,easing:ln.oneOfType([ln.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ln.func]),properties:ln.arrayOf("string"),onAnimationEnd:ln.func})),children:ln.oneOfType([ln.node,ln.func]),isActive:ln.bool,canBegin:ln.bool,onAnimationEnd:ln.func,shouldReAnimate:ln.bool,onAnimationStart:ln.func,onAnimationReStart:ln.func};function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(null,arguments)}function Z1(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function UM(e,t){return UM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},UM(e,t)}function Wq(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,UM(e,t)}function ay(e){"@babel/helpers - typeof";return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function X1(){return X1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X1.apply(this,arguments)}function V7e(e,t){return H7e(e)||G7e(e,t)||q7e(e,t)||W7e()}function W7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3828In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q7e(e,t){if(e){if(typeof e=="string")return PR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return PR(e,t)}}function PR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G7e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function H7e(e){if(Array.isArray(e))return e}function _R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function LR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_R(Object(r),!0).forEach(function(n){Y7e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_R(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Y7e(e,t,r){return t=Q7e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q7e(e){var t=K7e(e,"string");return ay(t)=="symbol"?t:t+""}function K7e(e,t){if(ay(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ay(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DR=function(t,r,n,a,i){var o=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],m=0,h=4;m<h;m++)f[m]=i[m]>o?o:i[m];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
3829        `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
3830        `).concat(t+n-c*f[2],",").concat(r+a)),d+="L ".concat(t+c*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
3831        `).concat(t,",").concat(r+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var p=Math.min(o,i);d="M ".concat(t,",").concat(r+l*p,`
3832            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+c*p,",").concat(r,`
3833            L `).concat(t+n-c*p,",").concat(r,`
3834            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*p,`
3835            L `).concat(t+n,",").concat(r+a-l*p,`
3836            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+n-c*p,",").concat(r+a,`
3837            L `).concat(t+c*p,",").concat(r+a,`
3838            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*p," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},J7e=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+c),m=Math.max(o,o+c);return n>=u&&n<=d&&a>=f&&a<=m}return!1},Z7e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},UT=function(t){var r=LR(LR({},Z7e),t),n=b.useRef(),a=b.useState(-1),i=V7e(a,2),o=i[0],l=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var C=n.current.getTotalLength();C&&l(C)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,m=r.radius,h=r.className,p=r.animationEasing,g=r.animationDuration,y=r.animationBegin,v=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var j=Jt("recharts-rectangle",h);return x?U.createElement(hc,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:p,isActive:x},function(C){var N=C.width,S=C.height,M=C.x,k=C.y;return U.createElement(hc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:v,easing:p},U.createElement("path",X1({},Er(r,!0),{className:j,d:DR(M,k,N,S,m),ref:n})))}):U.createElement("path",X1({},Er(r,!0),{className:j,d:DR(c,u,d,f,m)}))};function VM(){return VM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VM.apply(this,arguments)}var VT=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,o=Jt("recharts-dot",i);return r===+r&&n===+n&&a===+a?b.createElement("circle",VM({},Er(t,!1),y1(t),{className:o,cx:r,cy:n,r:a})):null};function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}var X7e=["x","y","top","left","width","height","className"];function WM(){return WM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WM.apply(this,arguments)}function OR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function e8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(r),!0).forEach(function(n){t8e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t8e(e,t,r){return t=r8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r8e(e){var t=n8e(e,"string");return sy(t)=="symbol"?t:t+""}function n8e(e,t){if(sy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a8e(e,t){if(e==null)return{};var r=s8e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s8e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var i8e=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},o8e=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,m=t.height,h=m===void 0?0:m,p=t.className,g=a8e(t,X7e),y=e8e({x:n,y:i,top:l,left:u,width:f,height:h},g);return!ut(n)||!ut(i)||!ut(f)||!ut(h)||!ut(l)||!ut(u)?null:U.createElement("path",WM({},Er(y,!0),{className:Jt("recharts-cross",p),d:i8e(n,i,f,h,l,u)}))},l8e=rW,c8e=l8e(Object.getPrototypeOf,Object),u8e=c8e,d8e=xc,f8e=u8e,m8e=wc,h8e="[object Object]",p8e=Function.prototype,g8e=Object.prototype,qq=p8e.toString,y8e=g8e.hasOwnProperty,b8e=qq.call(Object);function v8e(e){if(!m8e(e)||d8e(e)!=h8e)return!1;var t=f8e(e);if(t===null)return!0;var r=y8e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qq.call(r)==b8e}var x8e=v8e;const w8e=hn(x8e);var j8e=xc,N8e=wc,S8e="[object Boolean]";function C8e(e){return e===!0||e===!1||N8e(e)&&j8e(e)==S8e}var k8e=C8e;const M8e=hn(k8e);function iy(e){"@babel/helpers - typeof";return iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iy(e)}function ew(){return ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ew.apply(this,arguments)}function I8e(e,t){return P8e(e)||A8e(e,t)||T8e(e,t)||E8e()}function E8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3839In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T8e(e,t){if(e){if(typeof e=="string")return RR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RR(e,t)}}function RR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A8e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function P8e(e){if(Array.isArray(e))return e}function $R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function FR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$R(Object(r),!0).forEach(function(n){_8e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$R(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _8e(e,t,r){return t=L8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L8e(e){var t=D8e(e,"string");return iy(t)=="symbol"?t:t+""}function D8e(e,t){if(iy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(iy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zR=function(t,r,n,a,i){var o=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+i),l+="L ".concat(t+n-o/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},O8e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},R8e=function(t){var r=FR(FR({},O8e),t),n=b.useRef(),a=b.useState(-1),i=I8e(a,2),o=i[0],l=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&l(j)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,m=r.height,h=r.className,p=r.animationEasing,g=r.animationDuration,y=r.animationBegin,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||m!==+m||d===0&&f===0||m===0)return null;var x=Jt("recharts-trapezoid",h);return v?U.createElement(hc,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:m,x:c,y:u},duration:g,animationEasing:p,isActive:v},function(j){var C=j.upperWidth,N=j.lowerWidth,S=j.height,M=j.x,k=j.y;return U.createElement(hc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:p},U.createElement("path",ew({},Er(r,!0),{className:x,d:zR(M,k,C,N,S),ref:n})))}):U.createElement("g",null,U.createElement("path",ew({},Er(r,!0),{className:x,d:zR(c,u,d,f,m)})))},$8e=["option","shapeType","propTransformer","activeClassName","isActive"];function oy(e){"@babel/helpers - typeof";return oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oy(e)}function F8e(e,t){if(e==null)return{};var r=z8e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function z8e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(r),!0).forEach(function(n){B8e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B8e(e,t,r){return t=U8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U8e(e){var t=V8e(e,"string");return oy(t)=="symbol"?t:t+""}function V8e(e,t){if(oy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(oy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W8e(e,t){return tw(tw({},t),e)}function q8e(e,t){return e==="symbols"}function UR(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return U.createElement(UT,r);case"trapezoid":return U.createElement(R8e,r);case"sector":return U.createElement(_q,r);case"symbols":if(q8e(t))return U.createElement(oT,r);break;default:return null}}function G8e(e){return b.isValidElement(e)?e.props:e}function H8e(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?W8e:n,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=F8e(e,$8e),u;if(b.isValidElement(t))u=b.cloneElement(t,tw(tw({},c),G8e(t)));else if(yr(t))u=t(c);else if(w8e(t)&&!M8e(t)){var d=a(t,c);u=U.createElement(UR,{shapeType:r,elementProps:d})}else{var f=c;u=U.createElement(UR,{shapeType:r,elementProps:f})}return l?U.createElement(Zn,{className:o},u):u}function Nj(e,t){return t!=null&&"trapezoids"in e.props}function Sj(e,t){return t!=null&&"sectors"in e.props}function ly(e,t){return t!=null&&"points"in e.props}function Y8e(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function Q8e(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function K8e(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function J8e(e,t){var r;return Nj(e,t)?r=Y8e:Sj(e,t)?r=Q8e:ly(e,t)&&(r=K8e),r}function Z8e(e,t){var r;return Nj(e,t)?r="trapezoids":Sj(e,t)?r="sectors":ly(e,t)&&(r="points"),r}function X8e(e,t){if(Nj(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Sj(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return ly(e,t)?t.payload:{}}function eVe(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=Z8e(r,t),i=X8e(r,t),o=n.filter(function(c,u){var d=q0(i,c),f=r.props[a].filter(function(p){var g=J8e(r,t);return g(p,t)}),m=r.props[a].indexOf(f[f.length-1]),h=u===m;return d&&h}),l=n.indexOf(o[o.length-1]);return l}var tVe=Math.ceil,rVe=Math.max;function nVe(e,t,r,n){for(var a=-1,i=rVe(tVe((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var aVe=nVe,sVe=wW,VR=1/0,iVe=17976931348623157e292;function oVe(e){if(!e)return e===0?e:0;if(e=sVe(e),e===VR||e===-VR){var t=e<0?-1:1;return t*iVe}return e===e?e:0}var Gq=oVe,lVe=aVe,cVe=fj,ES=Gq;function uVe(e){return function(t,r,n){return n&&typeof n!="number"&&cVe(t,r,n)&&(r=n=void 0),t=ES(t),r===void 0?(r=t,t=0):r=ES(r),n=n===void 0?t<r?1:-1:ES(n),lVe(t,r,n,e)}}var dVe=uVe,fVe=dVe,mVe=fVe(),hVe=mVe;const rw=hn(hVe);function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function WR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WR(Object(r),!0).forEach(function(n){Hq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hq(e,t,r){return t=pVe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pVe(e){var t=gVe(e,"string");return cy(t)=="symbol"?t:t+""}function gVe(e,t){if(cy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yVe=["Webkit","Moz","O","ms"],bVe=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=yVe.reduce(function(i,o){return qR(qR({},i),{},Hq({},o+n,r))},{});return a[t]=r,a};function Eh(e){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(e)}function nw(){return nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nw.apply(this,arguments)}function GR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function TS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GR(Object(r),!0).forEach(function(n){Qs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qq(n.key),n)}}function xVe(e,t,r){return t&&HR(e.prototype,t),r&&HR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wVe(e,t,r){return t=aw(t),jVe(e,Yq()?Reflect.construct(t,r||[],aw(e).constructor):t.apply(e,r))}function jVe(e,t){if(t&&(Eh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NVe(e)}function NVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yq=function(){return!!e})()}function aw(e){return aw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},aw(e)}function SVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qM(e,t)}function qM(e,t){return qM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},qM(e,t)}function Qs(e,t,r){return t=Qq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qq(e){var t=CVe(e,"string");return Eh(t)=="symbol"?t:t+""}function CVe(e,t){if(Eh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kVe=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Yg().domain(rw(0,c)).range([i,i+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:d}},YR=function(t){return t.changedTouches&&!!t.changedTouches.length},Th=function(e){function t(r){var n;return vVe(this,t),n=wVe(this,t,[r]),Qs(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),Qs(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),Qs(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),Qs(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Qs(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Qs(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Qs(n,"handleSlideDragStart",function(a){var i=YR(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return SVe(t,e),xVe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),m=Math.max(a,i),h=t.getIndexInRange(o,f),p=t.getIndexInRange(o,m);return{startIndex:h-h%c,endIndex:p===d?d:p-p%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=ci(i[n],l,n);return yr(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,m=c.startIndex,h=c.endIndex,p=c.onChange,g=n.pageX-i;g>0?g=Math.min(g,u+d-f-l,u+d-f-o):g<0&&(g=Math.max(g,u-o,u-l));var y=this.getIndex({startX:o+g,endX:l+g});(y.startIndex!==m||y.endIndex!==h)&&p&&p(y),this.setState({startX:o+g,endX:l+g,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=YR(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,m=d.width,h=d.travellerWidth,p=d.onChange,g=d.gap,y=d.data,v={startX:this.state.startX,endX:this.state.endX},x=n.pageX-i;x>0?x=Math.min(x,f+m-h-u):x<0&&(x=Math.max(x,f-u)),v[o]=u+x;var j=this.getIndex(v),C=j.startIndex,N=j.endIndex,S=function(){var k=y.length-1;return o==="startX"&&(l>c?C%g===0:N%g===0)||l<c&&N===k||o==="endX"&&(l>c?N%g===0:C%g===0)||l>c&&N===k};this.setState(Qs(Qs({},o,u+x),"brushMoveStartX",n.pageX),function(){p&&S()&&p(j)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var m=f+n;if(!(m===-1||m>=l.length)){var h=l[m];a==="startX"&&h>=u||a==="endX"&&h<=c||this.setState(Qs({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return U.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=b.Children.only(u);return f?U.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,m=c.traveller,h=c.ariaLabel,p=c.data,g=c.startIndex,y=c.endIndex,v=Math.max(n,this.props.x),x=TS(TS({},Er(this.props,!1)),{},{x:v,y:u,width:d,height:f}),j=h||"Min value: ".concat((i=p[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=p[y])===null||o===void 0?void 0:o.name);return U.createElement(Zn,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(N){["ArrowLeft","ArrowRight"].includes(N.key)&&(N.preventDefault(),N.stopPropagation(),l.handleTravellerMoveKeyboard(N.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,x))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return U.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,m=d.endX,h=5,p={pointerEvents:"none",fill:u};return U.createElement(Zn,{className:"recharts-brush-texts"},U.createElement(P1,nw({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,m)-h,y:o+l/2},p),this.getTextOfTick(a)),U.createElement(P1,nw({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,m)+c+h,y:o+l/2},p),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,m=this.state,h=m.startX,p=m.endX,g=m.isTextActive,y=m.isSlideMoving,v=m.isTravellerMoving,x=m.isTravellerFocused;if(!a||!a.length||!ut(l)||!ut(c)||!ut(u)||!ut(d)||u<=0||d<=0)return null;var j=Jt("recharts-brush",i),C=U.Children.count(o)===1,N=bVe("userSelect","none");return U.createElement(Zn,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:N},this.renderBackground(),C&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||y||v||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return U.createElement(U.Fragment,null,U.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),U.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),U.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return U.isValidElement(n)?i=U.cloneElement(n,a):yr(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return TS({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?kVe({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var m=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>a?l=c:o=c}return a>=n[l]?l:o}}])}(b.PureComponent);Qs(Th,"displayName","Brush");Qs(Th,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var MVe=hT;function IVe(e,t){var r;return MVe(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var EVe=IVe,TVe=YV,AVe=zu,PVe=EVe,_Ve=Gs,LVe=fj;function DVe(e,t,r){var n=_Ve(e)?TVe:PVe;return r&&LVe(e,t,r)&&(t=void 0),n(e,AVe(t))}var OVe=DVe;const RVe=hn(OVe);var el=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},QR=gW;function $Ve(e,t,r){t=="__proto__"&&QR?QR(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var FVe=$Ve,zVe=FVe,BVe=hW,UVe=zu;function VVe(e,t){var r={};return t=UVe(t),BVe(e,function(n,a,i){zVe(r,a,t(n,a,i))}),r}var WVe=VVe;const qVe=hn(WVe);function GVe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var HVe=GVe,YVe=hT;function QVe(e,t){var r=!0;return YVe(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var KVe=QVe,JVe=HVe,ZVe=KVe,XVe=zu,eWe=Gs,tWe=fj;function rWe(e,t,r){var n=eWe(e)?JVe:ZVe;return r&&tWe(e,t,r)&&(t=void 0),n(e,XVe(t))}var nWe=rWe;const Kq=hn(nWe);var aWe=["x","y"];function uy(e){"@babel/helpers - typeof";return uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uy(e)}function GM(){return GM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GM.apply(this,arguments)}function KR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KR(Object(r),!0).forEach(function(n){sWe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sWe(e,t,r){return t=iWe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iWe(e){var t=oWe(e,"string");return uy(t)=="symbol"?t:t+""}function oWe(e,t){if(uy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lWe(e,t){if(e==null)return{};var r=cWe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cWe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uWe(e,t){var r=e.x,n=e.y,a=lWe(e,aWe),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),m=parseInt(f,10);return fg(fg(fg(fg(fg({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:m,name:t.name,radius:t.radius})}function JR(e){return U.createElement(H8e,GM({shapeType:"rectangle",propTransformer:uWe,activeClassName:"recharts-active-bar"},e))}var dWe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=ut(n)||IEe(n);return i?t(n,a):(i||_u(),r)}},fWe=["value","background"],Jq;function Ah(e){"@babel/helpers - typeof";return Ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ah(e)}function mWe(e,t){if(e==null)return{};var r=hWe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hWe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sw(){return sw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sw.apply(this,arguments)}function ZR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function va(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(r),!0).forEach(function(n){ou(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xq(n.key),n)}}function gWe(e,t,r){return t&&XR(e.prototype,t),r&&XR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yWe(e,t,r){return t=iw(t),bWe(e,Zq()?Reflect.construct(t,r||[],iw(e).constructor):t.apply(e,r))}function bWe(e,t){if(t&&(Ah(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vWe(e)}function vWe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zq=function(){return!!e})()}function iw(e){return iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},iw(e)}function xWe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HM(e,t)}function HM(e,t){return HM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},HM(e,t)}function ou(e,t,r){return t=Xq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xq(e){var t=wWe(e,"string");return Ah(t)=="symbol"?t:t+""}function wWe(e,t){if(Ah(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ah(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var If=function(e){function t(){var r;pWe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=yWe(this,t,[].concat(a)),ou(r,"state",{isAnimationFinished:!1}),ou(r,"id",ab("recharts-bar-")),ou(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),ou(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return xWe(t,e),gWe(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=Er(this.props,!1);return n&&n.map(function(f,m){var h=m===c,p=h?u:o,g=va(va(va({},d),f),{},{isActive:h,option:p,index:m,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return U.createElement(Zn,sw({className:"recharts-bar-rectangle"},b1(a.props,f,m),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(m)}),U.createElement(JR,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,m=this.state.prevData;return U.createElement(hc,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var p=h.t,g=i.map(function(y,v){var x=m&&m[v];if(x){var j=ki(x.x,y.x),C=ki(x.y,y.y),N=ki(x.width,y.width),S=ki(x.height,y.height);return va(va({},y),{},{x:j(p),y:C(p),width:N(p),height:S(p)})}if(o==="horizontal"){var M=ki(0,y.height),k=M(p);return va(va({},y),{},{y:y.y+y.height-k,height:k})}var I=ki(0,y.width),T=I(p);return va(va({},y),{},{width:T})});return U.createElement(Zn,null,n.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!q0(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=Er(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,m=mWe(u,fWe);if(!f)return null;var h=va(va(va(va(va({},m),{},{fill:"#eee"},f),c),b1(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return U.createElement(JR,sw({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},h))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=yo(d,jj);if(!f)return null;var m=u==="vertical"?o[0].height/2:o[0].width/2,h=function(y,v){var x=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:x,errorVal:ci(y,v)}},p={clipPath:n?"url(#clipPath-".concat(a,")"):null};return U.createElement(Zn,p,f.map(function(g){return U.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:m,dataPointFormatter:h})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,m=n.height,h=n.isAnimationActive,p=n.background,g=n.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,v=Jt("recharts-bar",o),x=l&&l.allowDataOverflow,j=c&&c.allowDataOverflow,C=x||j,N=_r(g)?this.id:g;return U.createElement(Zn,{className:v},x||j?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(N)},U.createElement("rect",{x:x?u:u-f/2,y:j?d:d-m/2,width:x?f:f*2,height:j?m:m*2}))):null,U.createElement(Zn,{className:"recharts-bar-rectangles",clipPath:C?"url(#clipPath-".concat(N,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(C,N),(!h||y)&&vu.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(b.PureComponent);Jq=If;ou(If,"displayName","Bar");ou(If,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!bp.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});ou(If,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,m=e.offset,h=Jze(n,r);if(!h)return null;var p=t.layout,g=r.type.defaultProps,y=g!==void 0?va(va({},g),r.props):r.props,v=y.dataKey,x=y.children,j=y.minPointSize,C=p==="horizontal"?o:i,N=u?C.scale.domain():null,S=sBe({numericAxis:C}),M=yo(x,SW),k=f.map(function(I,T){var L,R,_,B,z,D;u?L=Zze(u[d+T],N):(L=ci(I,v),Array.isArray(L)||(L=[S,L]));var A=dWe(j,Jq.defaultProps.minPointSize)(L[1],T);if(p==="horizontal"){var P,E=[o.scale(L[0]),o.scale(L[1])],F=E[0],$=E[1];R=ZO({axis:i,ticks:l,bandSize:a,offset:h.offset,entry:I,index:T}),_=(P=$??F)!==null&&P!==void 0?P:void 0,B=h.size;var H=F-$;if(z=Number.isNaN(H)?0:H,D={x:R,y:o.y,width:B,height:o.height},Math.abs(A)>0&&Math.abs(z)<Math.abs(A)){var X=fo(z||A)*(Math.abs(A)-Math.abs(z));_-=X,z+=X}}else{var ue=[i.scale(L[0]),i.scale(L[1])],le=ue[0],ae=ue[1];if(R=le,_=ZO({axis:o,ticks:c,bandSize:a,offset:h.offset,entry:I,index:T}),B=ae-le,z=h.size,D={x:i.x,y:_,width:i.width,height:z},Math.abs(A)>0&&Math.abs(B)<Math.abs(A)){var te=fo(B||A)*(Math.abs(A)-Math.abs(B));B+=te}}return va(va(va({},I),{},{x:R,y:_,width:B,height:z,value:u?L:L[1],payload:I,background:D},M&&M[T]&&M[T].props),{},{tooltipPayload:[Tq(r,I)],tooltipPosition:{x:R+B/2,y:_+z/2}})});return va({data:k,layout:p},m)});function dy(e){"@babel/helpers - typeof";return dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dy(e)}function jWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,eG(n.key),n)}}function NWe(e,t,r){return t&&e5(e.prototype,t),r&&e5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ro(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t5(Object(r),!0).forEach(function(n){Cj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cj(e,t,r){return t=eG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eG(e){var t=SWe(e,"string");return dy(t)=="symbol"?t:t+""}function SWe(e,t){if(dy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tG=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},m=!!Ks(u,If);return d.reduce(function(h,p){var g=r[p],y=g.orientation,v=g.domain,x=g.padding,j=x===void 0?{}:x,C=g.mirror,N=g.reversed,S="".concat(y).concat(C?"Mirror":""),M,k,I,T,L;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var R=v[1]-v[0],_=1/0,B=g.categoricalDomain.sort(AEe);if(B.forEach(function(ue,le){le>0&&(_=Math.min((ue||0)-(B[le-1]||0),_))}),Number.isFinite(_)){var z=_/R,D=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(M=z*D/2),g.padding==="no-gap"){var A=cf(t.barCategoryGap,z*D),P=z*D/2;M=P-A-(P-A)/D*A}}}a==="xAxis"?k=[n.left+(j.left||0)+(M||0),n.left+n.width-(j.right||0)-(M||0)]:a==="yAxis"?k=c==="horizontal"?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(M||0),n.top+n.height-(j.bottom||0)-(M||0)]:k=g.range,N&&(k=[k[1],k[0]]);var E=Qze(g,i,m),F=E.scale,$=E.realScaleType;F.domain(v).range(k),Kze(F);var H=aBe(F,ro(ro({},g),{},{realScaleType:$}));a==="xAxis"?(L=y==="top"&&!C||y==="bottom"&&C,I=n.left,T=f[S]-L*g.height):a==="yAxis"&&(L=y==="left"&&!C||y==="right"&&C,I=f[S]-L*g.width,T=n.top);var X=ro(ro(ro({},g),H),{},{realScaleType:$,x:I,y:T,scale:F,width:a==="xAxis"?n.width:g.width,height:a==="yAxis"?n.height:g.height});return X.bandSize=G1(X,H),!g.hide&&a==="xAxis"?f[S]+=(L?-1:1)*X.height:g.hide||(f[S]+=(L?-1:1)*X.width),ro(ro({},h),{},Cj({},p,X))},{})},rG=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},CWe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return rG({x:r,y:n},{x:a,y:i})},nG=function(){function e(t){jWe(this,e),this.scale=t}return NWe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Cj(nG,"EPS",1e-4);var WT=function(t){var r=Object.keys(t).reduce(function(n,a){return ro(ro({},n),{},Cj({},a,nG.create(t[a])))},{});return ro(ro({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return qVe(a,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return Kq(a,function(i,o){return r[o].isInRange(i)})}})};function kWe(e){return(e%180+180)%180}var MWe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=kWe(a),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},IWe=zu,EWe=sb,TWe=uj;function AWe(e){return function(t,r,n){var a=Object(t);if(!EWe(t)){var i=IWe(r);t=TWe(t),r=function(l){return i(a[l],l,a)}}var o=e(t,r,n);return o>-1?a[i?t[o]:o]:void 0}}var PWe=AWe,_We=Gq;function LWe(e){var t=_We(e),r=t%1;return t===t?r?t-r:t:0}var DWe=LWe,OWe=lW,RWe=zu,$We=DWe,FWe=Math.max;function zWe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:$We(r);return a<0&&(a=FWe(n+a,0)),OWe(e,RWe(t),a)}var BWe=zWe,UWe=PWe,VWe=BWe,WWe=UWe(VWe),qWe=WWe;const GWe=hn(qWe);var HWe=LIe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),qT=b.createContext(void 0),GT=b.createContext(void 0),aG=b.createContext(void 0),sG=b.createContext({}),iG=b.createContext(void 0),oG=b.createContext(0),lG=b.createContext(0),r5=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=HWe(i);return U.createElement(qT.Provider,{value:n},U.createElement(GT.Provider,{value:a},U.createElement(sG.Provider,{value:i},U.createElement(aG.Provider,{value:d},U.createElement(iG.Provider,{value:o},U.createElement(oG.Provider,{value:u},U.createElement(lG.Provider,{value:c},l)))))))},YWe=function(){return b.useContext(iG)},cG=function(t){var r=b.useContext(qT);r==null&&_u();var n=r[t];return n==null&&_u(),n},QWe=function(){var t=b.useContext(qT);return Yc(t)},KWe=function(){var t=b.useContext(GT),r=GWe(t,function(n){return Kq(n.domain,Number.isFinite)});return r||Yc(t)},uG=function(t){var r=b.useContext(GT);r==null&&_u();var n=r[t];return n==null&&_u(),n},JWe=function(){var t=b.useContext(aG);return t},ZWe=function(){return b.useContext(sG)},HT=function(){return b.useContext(lG)},YT=function(){return b.useContext(oG)};function Ph(e){"@babel/helpers - typeof";return Ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ph(e)}function XWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eqe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fG(n.key),n)}}function tqe(e,t,r){return t&&eqe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rqe(e,t,r){return t=ow(t),nqe(e,dG()?Reflect.construct(t,r||[],ow(e).constructor):t.apply(e,r))}function nqe(e,t){if(t&&(Ph(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aqe(e)}function aqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dG=function(){return!!e})()}function ow(e){return ow=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ow(e)}function sqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YM(e,t)}function YM(e,t){return YM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},YM(e,t)}function n5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function a5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n5(Object(r),!0).forEach(function(n){QT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QT(e,t,r){return t=fG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fG(e){var t=iqe(e,"string");return Ph(t)=="symbol"?t:t+""}function iqe(e,t){if(Ph(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function oqe(e,t){return dqe(e)||uqe(e,t)||cqe(e,t)||lqe()}function lqe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3840In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cqe(e,t){if(e){if(typeof e=="string")return s5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s5(e,t)}}function s5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uqe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function dqe(e){if(Array.isArray(e))return e}function QM(){return QM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QM.apply(this,arguments)}var fqe=function(t,r){var n;return U.isValidElement(t)?n=U.cloneElement(t,r):yr(t)?n=t(r):n=U.createElement("line",QM({},r,{className:"recharts-reference-line-line"})),n},mqe=function(t,r,n,a,i,o,l,c,u){var d=i.x,f=i.y,m=i.width,h=i.height;if(n){var p=u.y,g=t.y.apply(p,{position:o});if(el(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+m,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(r){var v=u.x,x=t.x.apply(v,{position:o});if(el(u,"discard")&&!t.x.isInRange(x))return null;var j=[{x,y:f+h},{x,y:f}];return l==="top"?j.reverse():j}if(a){var C=u.segment,N=C.map(function(S){return t.apply(S,{position:o})});return el(u,"discard")&&RVe(N,function(S){return!t.isInRange(S)})?null:N}return null};function hqe(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=YWe(),d=cG(a),f=uG(i),m=JWe();if(!u||!m)return null;Zl(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=WT({x:d.scale,y:f.scale}),p=Aa(t),g=Aa(r),y=n&&n.length===2,v=mqe(h,p,g,y,m,e.position,d.orientation,f.orientation,e);if(!v)return null;var x=oqe(v,2),j=x[0],C=j.x,N=j.y,S=x[1],M=S.x,k=S.y,I=el(e,"hidden")?"url(#".concat(u,")"):void 0,T=a5(a5({clipPath:I},Er(e,!0)),{},{x1:C,y1:N,x2:M,y2:k});return U.createElement(Zn,{className:Jt("recharts-reference-line",l)},fqe(o,T),fs.renderCallByParent(e,CWe({x1:C,y1:N,x2:M,y2:k})))}var KT=function(e){function t(){return XWe(this,t),rqe(this,t,arguments)}return sqe(t,e),tqe(t,[{key:"render",value:function(){return U.createElement(hqe,this.props)}}])}(U.Component);QT(KT,"displayName","ReferenceLine");QT(KT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function KM(){return KM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KM.apply(this,arguments)}function _h(e){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_h(e)}function i5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function o5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(r),!0).forEach(function(n){kj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gqe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hG(n.key),n)}}function yqe(e,t,r){return t&&gqe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bqe(e,t,r){return t=lw(t),vqe(e,mG()?Reflect.construct(t,r||[],lw(e).constructor):t.apply(e,r))}function vqe(e,t){if(t&&(_h(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xqe(e)}function xqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mG=function(){return!!e})()}function lw(e){return lw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lw(e)}function wqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JM(e,t)}function JM(e,t){return JM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},JM(e,t)}function kj(e,t,r){return t=hG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hG(e){var t=jqe(e,"string");return _h(t)=="symbol"?t:t+""}function jqe(e,t){if(_h(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_h(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nqe=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,o=WT({x:a.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return el(t,"discard")&&!o.isInRange(l)?null:l},Mj=function(e){function t(){return pqe(this,t),bqe(this,t,arguments)}return wqe(t,e),yqe(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Aa(a),d=Aa(i);if(Zl(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Nqe(this.props);if(!f)return null;var m=f.x,h=f.y,p=this.props,g=p.shape,y=p.className,v=el(this.props,"hidden")?"url(#".concat(c,")"):void 0,x=o5(o5({clipPath:v},Er(this.props,!0)),{},{cx:m,cy:h});return U.createElement(Zn,{className:Jt("recharts-reference-dot",y)},t.renderDot(g,x),fs.renderCallByParent(this.props,{x:m-o,y:h-o,width:2*o,height:2*o}))}}])}(U.Component);kj(Mj,"displayName","ReferenceDot");kj(Mj,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});kj(Mj,"renderDot",function(e,t){var r;return U.isValidElement(e)?r=U.cloneElement(e,t):yr(e)?r=e(t):r=U.createElement(VT,KM({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function ZM(){return ZM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZM.apply(this,arguments)}function Lh(e){"@babel/helpers - typeof";return Lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lh(e)}function l5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function c5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l5(Object(r),!0).forEach(function(n){Ij(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cqe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gG(n.key),n)}}function kqe(e,t,r){return t&&Cqe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mqe(e,t,r){return t=cw(t),Iqe(e,pG()?Reflect.construct(t,r||[],cw(e).constructor):t.apply(e,r))}function Iqe(e,t){if(t&&(Lh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eqe(e)}function Eqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pG=function(){return!!e})()}function cw(e){return cw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cw(e)}function Tqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XM(e,t)}function XM(e,t){return XM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},XM(e,t)}function Ij(e,t,r){return t=gG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gG(e){var t=Aqe(e,"string");return Lh(t)=="symbol"?t:t+""}function Aqe(e,t){if(Lh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Lh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pqe=function(t,r,n,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var m=WT({x:d.scale,y:f.scale}),h={x:t?m.x.apply(o,{position:"start"}):m.x.rangeMin,y:n?m.y.apply(c,{position:"start"}):m.y.rangeMin},p={x:r?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:a?m.y.apply(u,{position:"end"}):m.y.rangeMax};return el(i,"discard")&&(!m.isInRange(h)||!m.isInRange(p))?null:rG(h,p)},Ej=function(e){function t(){return Sqe(this,t),Mqe(this,t,arguments)}return Tqe(t,e),kqe(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;Zl(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Aa(a),m=Aa(i),h=Aa(o),p=Aa(l),g=this.props.shape;if(!f&&!m&&!h&&!p&&!g)return null;var y=Pqe(f,m,h,p,this.props);if(!y&&!g)return null;var v=el(this.props,"hidden")?"url(#".concat(d,")"):void 0;return U.createElement(Zn,{className:Jt("recharts-reference-area",c)},t.renderRect(g,c5(c5({clipPath:v},Er(this.props,!0)),y)),fs.renderCallByParent(this.props,y))}}])}(U.Component);Ij(Ej,"displayName","ReferenceArea");Ij(Ej,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Ij(Ej,"renderRect",function(e,t){var r;return U.isValidElement(e)?r=U.cloneElement(e,t):yr(e)?r=e(t):r=U.createElement(UT,ZM({},t,{className:"recharts-reference-area-rect"})),r});function yG(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function _qe(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return MWe(n,r)}function Lqe(e,t,r){var n=r==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function uw(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Dqe(e,t){return yG(e,t+1)}function Oqe(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var p=n==null?void 0:n[c];if(p===void 0)return{v:yG(n,u)};var g=c,y,v=function(){return y===void 0&&(y=r(p,g)),y},x=p.coordinate,j=c===0||uw(e,x,v,d,l);j||(c=0,d=o,u+=1),j&&(d=x+e*(v()/2+a),c+=u)},m;u<=i.length;)if(m=f(),m)return m.v;return[]}function fy(e){"@babel/helpers - typeof";return fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fy(e)}function u5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(r),!0).forEach(function(n){Rqe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rqe(e,t,r){return t=$qe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $qe(e){var t=Fqe(e,"string");return fy(t)=="symbol"?t:t+""}function Fqe(e,t){if(fy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zqe(e,t,r,n,a){for(var i=(n||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(m){var h=i[m],p,g=function(){return p===void 0&&(p=r(h,m)),p};if(m===o-1){var y=e*(h.coordinate+e*g()/2-c);i[m]=h=cs(cs({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate})}else i[m]=h=cs(cs({},h),{},{tickCoord:h.coordinate});var v=uw(e,h.tickCoord,g,l,c);v&&(c=h.tickCoord-e*(g()/2+a),i[m]=cs(cs({},h),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function Bqe(e,t,r,n,a,i){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var d=n[l-1],f=r(d,l-1),m=e*(d.coordinate+e*f/2-u);o[l-1]=d=cs(cs({},d),{},{tickCoord:m>0?d.coordinate-m*e:d.coordinate});var h=uw(e,d.tickCoord,function(){return f},c,u);h&&(u=d.tickCoord-e*(f/2+a),o[l-1]=cs(cs({},d),{},{isShow:!0}))}for(var p=i?l-1:l,g=function(x){var j=o[x],C,N=function(){return C===void 0&&(C=r(j,x)),C};if(x===0){var S=e*(j.coordinate-e*N()/2-c);o[x]=j=cs(cs({},j),{},{tickCoord:S<0?j.coordinate-S*e:j.coordinate})}else o[x]=j=cs(cs({},j),{},{tickCoord:j.coordinate});var M=uw(e,j.tickCoord,N,c,u);M&&(c=j.tickCoord+e*(N()/2+a),o[x]=cs(cs({},j),{},{isShow:!0}))},y=0;y<p;y++)g(y);return o}function JT(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!n)return[];if(ut(c)||bp.isSsr)return Dqe(a,typeof c=="number"&&ut(c)?c:0);var m=[],h=l==="top"||l==="bottom"?"width":"height",p=d&&h==="width"?Hg(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},g=function(j,C){var N=yr(u)?u(j.value,C):j.value;return h==="width"?_qe(Hg(N,{fontSize:t,letterSpacing:r}),p,f):Hg(N,{fontSize:t,letterSpacing:r})[h]},y=a.length>=2?fo(a[1].coordinate-a[0].coordinate):1,v=Lqe(i,y,h);return c==="equidistantPreserveStart"?Oqe(y,v,g,a,o):(c==="preserveStart"||c==="preserveStartEnd"?m=Bqe(y,v,g,a,o,c==="preserveStartEnd"):m=zqe(y,v,g,a,o),m.filter(function(x){return x.isShow}))}var Uqe=["viewBox"],Vqe=["viewBox"],Wqe=["ticks"];function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}function pm(){return pm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pm.apply(this,arguments)}function d5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(r),!0).forEach(function(n){ZT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AS(e,t){if(e==null)return{};var r=qqe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qqe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vG(n.key),n)}}function Hqe(e,t,r){return t&&f5(e.prototype,t),r&&f5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yqe(e,t,r){return t=dw(t),Qqe(e,bG()?Reflect.construct(t,r||[],dw(e).constructor):t.apply(e,r))}function Qqe(e,t){if(t&&(Dh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kqe(e)}function Kqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bG=function(){return!!e})()}function dw(e){return dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dw(e)}function Jqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e4(e,t)}function e4(e,t){return e4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},e4(e,t)}function ZT(e,t,r){return t=vG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vG(e){var t=Zqe(e,"string");return Dh(t)=="symbol"?t:t+""}function Zqe(e,t){if(Dh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jp=function(e){function t(r){var n;return Gqe(this,t),n=Yqe(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return Jqe(t,e),Hqe(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,o=AS(n,Uqe),l=this.props,c=l.viewBox,u=AS(l,Vqe);return!Mm(i,c)||!Mm(o,u)||!Mm(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,m=a.tickMargin,h,p,g,y,v,x,j=f?-1:1,C=n.tickSize||d,N=ut(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":h=p=n.coordinate,y=o+ +!f*c,g=y-j*C,x=g-j*m,v=N;break;case"left":g=y=n.coordinate,p=i+ +!f*l,h=p-j*C,v=h-j*m,x=N;break;case"right":g=y=n.coordinate,p=i+ +f*l,h=p+j*C,v=h+j*m,x=N;break;default:h=p=n.coordinate,y=o+ +f*c,g=y+j*C,x=g+j*m,v=N;break}return{line:{x1:h,y1:g,x2:p,y2:y},tick:{x:v,y:x}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=ka(ka(ka({},Er(this.props,!1)),Er(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!u||c==="bottom"&&u);f=ka(ka({},f),{},{x1:a,y1:i+m*l,x2:a+o,y2:i+m*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);f=ka(ka({},f),{},{x1:a+h*o,y1:i,x2:a+h*o,y2:i+l})}return U.createElement("line",pm({},f,{className:Jt("recharts-cartesian-axis-line",Di(d,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,m=l.unit,h=JT(ka(ka({},this.props),{},{ticks:n}),a,i),p=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=Er(this.props,!1),v=Er(d,!1),x=ka(ka({},y),{},{fill:"none"},Er(c,!1)),j=h.map(function(C,N){var S=o.getTickLineCoord(C),M=S.line,k=S.tick,I=ka(ka(ka(ka({textAnchor:p,verticalAnchor:g},y),{},{stroke:"none",fill:u},v),k),{},{index:N,payload:C,visibleTicksCount:h.length,tickFormatter:f});return U.createElement(Zn,pm({className:"recharts-cartesian-axis-tick",key:"tick-".concat(C.value,"-").concat(C.coordinate,"-").concat(C.tickCoord)},b1(o.props,C,N)),c&&U.createElement("line",pm({},x,M,{className:Jt("recharts-cartesian-axis-tick-line",Di(c,"className"))})),d&&t.renderTickItem(d,I,"".concat(yr(f)?f(C.value,N):C.value).concat(m||"")))});return U.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,m=f.ticks,h=AS(f,Wqe),p=m;return yr(c)&&(p=m&&m.length>0?c(this.props):c(h)),o<=0||l<=0||!p||!p.length?null:U.createElement(Zn,{className:Jt("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),fs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,l=Jt(a.className,"recharts-cartesian-axis-tick-value");return U.isValidElement(n)?o=U.cloneElement(n,ka(ka({},a),{},{className:l})):yr(n)?o=n(ka(ka({},a),{},{className:l})):o=U.createElement(P1,pm({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(b.Component);ZT(jp,"displayName","CartesianAxis");ZT(jp,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Xqe=["x1","y1","x2","y2","key"],eGe=["offset"];function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function m5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(r),!0).forEach(function(n){tGe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tGe(e,t,r){return t=rGe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rGe(e){var t=nGe(e,"string");return df(t)=="symbol"?t:t+""}function nGe(e,t){if(df(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(df(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nd(){return Nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nd.apply(this,arguments)}function h5(e,t){if(e==null)return{};var r=aGe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function aGe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var sGe=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return U.createElement("rect",{x:a,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function xG(e,t){var r;if(U.isValidElement(e))r=U.cloneElement(e,t);else if(yr(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,l=t.key,c=h5(t,Xqe),u=Er(c,!1);u.offset;var d=h5(u,eGe);r=U.createElement("line",Nd({},d,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:l}))}return r}function iGe(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ms(ms({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return xG(a,u)});return U.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function oGe(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=ms(ms({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return xG(a,u)});return U.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function lGe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(m){return Math.round(m+a-a)}).sort(function(m,h){return m-h});a!==d[0]&&d.unshift(0);var f=d.map(function(m,h){var p=!d[h+1],g=p?a+o-m:d[h+1]-m;if(g<=0)return null;var y=h%t.length;return U.createElement("rect",{key:"react-".concat(h),y:m,x:n,height:g,width:i,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function cGe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,h){return m-h});i!==d[0]&&d.unshift(0);var f=d.map(function(m,h){var p=!d[h+1],g=p?i+l-m:d[h+1]-m;if(g<=0)return null;var y=h%n.length;return U.createElement("rect",{key:"react-".concat(h),x:m,y:o,width:g,height:c,stroke:"none",fill:n[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var uGe=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return Iq(JT(ms(ms(ms({},jp.defaultProps),n),{},{ticks:Fl(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},dGe=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return Iq(JT(ms(ms(ms({},jp.defaultProps),n),{},{ticks:Fl(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Yf={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function XT(e){var t,r,n,a,i,o,l=HT(),c=YT(),u=ZWe(),d=ms(ms({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Yf.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Yf.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Yf.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Yf.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Yf.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Yf.verticalFill,x:ut(e.x)?e.x:u.left,y:ut(e.y)?e.y:u.top,width:ut(e.width)?e.width:u.width,height:ut(e.height)?e.height:u.height}),f=d.x,m=d.y,h=d.width,p=d.height,g=d.syncWithTicks,y=d.horizontalValues,v=d.verticalValues,x=QWe(),j=KWe();if(!ut(h)||h<=0||!ut(p)||p<=0||!ut(f)||f!==+f||!ut(m)||m!==+m)return null;var C=d.verticalCoordinatesGenerator||uGe,N=d.horizontalCoordinatesGenerator||dGe,S=d.horizontalPoints,M=d.verticalPoints;if((!S||!S.length)&&yr(N)){var k=y&&y.length,I=N({yAxis:j?ms(ms({},j),{},{ticks:k?y:j.ticks}):void 0,width:l,height:c,offset:u},k?!0:g);Zl(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(df(I),"]")),Array.isArray(I)&&(S=I)}if((!M||!M.length)&&yr(C)){var T=v&&v.length,L=C({xAxis:x?ms(ms({},x),{},{ticks:T?v:x.ticks}):void 0,width:l,height:c,offset:u},T?!0:g);Zl(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(df(L),"]")),Array.isArray(L)&&(M=L)}return U.createElement("g",{className:"recharts-cartesian-grid"},U.createElement(sGe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),U.createElement(iGe,Nd({},d,{offset:u,horizontalPoints:S,xAxis:x,yAxis:j})),U.createElement(oGe,Nd({},d,{offset:u,verticalPoints:M,xAxis:x,yAxis:j})),U.createElement(lGe,Nd({},d,{horizontalPoints:S})),U.createElement(cGe,Nd({},d,{verticalPoints:M})))}XT.displayName="CartesianGrid";var fGe=["layout","type","stroke","connectNulls","isRange","ref"],mGe=["key"],wG;function Oh(e){"@babel/helpers - typeof";return Oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oh(e)}function jG(e,t){if(e==null)return{};var r=hGe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hGe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sd(){return Sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sd.apply(this,arguments)}function p5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(r),!0).forEach(function(n){Ho(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,SG(n.key),n)}}function gGe(e,t,r){return t&&g5(e.prototype,t),r&&g5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yGe(e,t,r){return t=fw(t),bGe(e,NG()?Reflect.construct(t,r||[],fw(e).constructor):t.apply(e,r))}function bGe(e,t){if(t&&(Oh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vGe(e)}function vGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NG=function(){return!!e})()}function fw(e){return fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fw(e)}function xGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&t4(e,t)}function t4(e,t){return t4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},t4(e,t)}function Ho(e,t,r){return t=SG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SG(e){var t=wGe(e,"string");return Oh(t)=="symbol"?t:t+""}function wGe(e,t){if(Oh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Oh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tl=function(e){function t(){var r;pGe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=yGe(this,t,[].concat(a)),Ho(r,"state",{isAnimationFinished:!0}),Ho(r,"id",ab("recharts-area-")),Ho(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),yr(o)&&o()}),Ho(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),yr(o)&&o()}),r}return xGe(t,e),gGe(t,[{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,m=Er(this.props,!1),h=Er(u,!0),p=d.map(function(y,v){var x=Lc(Lc(Lc({key:"dot-".concat(v),r:3},m),h),{},{index:v,cx:y.x,cy:y.y,dataKey:f,value:y.value,payload:y.payload,points:d});return t.renderDotItem(u,x)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return U.createElement(Zn,Sd({className:"recharts-area-dots"},g),p)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=n*Math.abs(c-u),f=iu(o.map(function(m){return m.y||0}));return ut(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(iu(i.map(function(m){return m.y||0})),f)),ut(f)?U.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=n*Math.abs(c-u),f=iu(o.map(function(m){return m.x||0}));return ut(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(iu(i.map(function(m){return m.x||0})),f)),ut(f)?U.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,m=l.isRange;l.ref;var h=jG(l,fGe);return U.createElement(Zn,{clipPath:i?"url(#clipPath-".concat(o,")"):null},U.createElement(Kg,Sd({},Er(h,!0),{points:n,connectNulls:f,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&U.createElement(Kg,Sd({},Er(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&m&&U.createElement(Kg,Sd({},Er(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,m=o.animationEasing,h=o.animationId,p=this.state,g=p.prevPoints,y=p.prevBaseLine;return U.createElement(hc,{begin:d,duration:f,isActive:u,easing:m,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t;if(g){var j=g.length/l.length,C=l.map(function(k,I){var T=Math.floor(I*j);if(g[T]){var L=g[T],R=ki(L.x,k.x),_=ki(L.y,k.y);return Lc(Lc({},k),{},{x:R(x),y:_(x)})}return k}),N;if(ut(c)&&typeof c=="number"){var S=ki(y,c);N=S(x)}else if(_r(c)||hp(c)){var M=ki(y,0);N=M(x)}else N=c.map(function(k,I){var T=Math.floor(I*j);if(y[T]){var L=y[T],R=ki(L.x,k.x),_=ki(L.y,k.y);return Lc(Lc({},k),{},{x:R(x),y:_(x)})}return k});return i.renderAreaStatically(C,N,n,a)}return U.createElement(Zn,null,U.createElement("defs",null,U.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(x))),U.createElement(Zn,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,m=u.totalLength;return c&&o&&o.length&&(!d&&m>0||!q0(d,o)||!q0(f,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,u=a.top,d=a.left,f=a.xAxis,m=a.yAxis,h=a.width,p=a.height,g=a.isAnimationActive,y=a.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,x=l.length===1,j=Jt("recharts-area",c),C=f&&f.allowDataOverflow,N=m&&m.allowDataOverflow,S=C||N,M=_r(y)?this.id:y,k=(n=Er(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=k.r,T=I===void 0?3:I,L=k.strokeWidth,R=L===void 0?2:L,_=zEe(o)?o:{},B=_.clipDot,z=B===void 0?!0:B,D=T*2+R;return U.createElement(Zn,{className:j},C||N?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(M)},U.createElement("rect",{x:C?d:d-h/2,y:N?u:u-p/2,width:C?h:h*2,height:N?p:p*2})),!z&&U.createElement("clipPath",{id:"clipPath-dots-".concat(M)},U.createElement("rect",{x:d-D/2,y:u-D/2,width:h+D,height:p+D}))):null,x?null:this.renderArea(S,M),(o||x)&&this.renderDots(S,z,M),(!g||v)&&vu.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(b.PureComponent);wG=tl;Ho(tl,"displayName","Area");Ho(tl,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!bp.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ho(tl,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(ut(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Ho(tl,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,m=e.offset,h=t.layout,p=u&&u.length,g=wG.getBaseValue(t,r,n,a),y=h==="horizontal",v=!1,x=f.map(function(C,N){var S;p?S=u[d+N]:(S=ci(C,c),Array.isArray(S)?v=!0:S=[g,S]);var M=S[1]==null||p&&ci(C,c)==null;return y?{x:JO({axis:n,ticks:i,bandSize:l,entry:C,index:N}),y:M?null:a.scale(S[1]),value:S,payload:C}:{x:M?null:n.scale(S[1]),y:JO({axis:a,ticks:o,bandSize:l,entry:C,index:N}),value:S,payload:C}}),j;return p||v?j=x.map(function(C){var N=Array.isArray(C.value)?C.value[0]:null;return y?{x:C.x,y:N!=null&&C.y!=null?a.scale(N):null}:{x:N!=null?n.scale(N):null,y:C.y}}):j=y?a.scale(g):n.scale(g),Lc({points:x,baseLine:j,layout:h,isRange:v},m)});Ho(tl,"renderDotItem",function(e,t){var r;if(U.isValidElement(e))r=U.cloneElement(e,t);else if(yr(e))r=e(t);else{var n=Jt("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=jG(t,mGe);r=U.createElement(VT,Sd({},i,{key:a,className:n}))}return r});function Rh(e){"@babel/helpers - typeof";return Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh(e)}function jGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NGe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,MG(n.key),n)}}function SGe(e,t,r){return t&&NGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function CGe(e,t,r){return t=mw(t),kGe(e,CG()?Reflect.construct(t,r||[],mw(e).constructor):t.apply(e,r))}function kGe(e,t){if(t&&(Rh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MGe(e)}function MGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CG=function(){return!!e})()}function mw(e){return mw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mw(e)}function IGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r4(e,t)}function r4(e,t){return r4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},r4(e,t)}function kG(e,t,r){return t=MG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MG(e){var t=EGe(e,"string");return Rh(t)=="symbol"?t:t+""}function EGe(e,t){if(Rh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function n4(){return n4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n4.apply(this,arguments)}function TGe(e){var t=e.xAxisId,r=HT(),n=YT(),a=cG(t);return a==null?null:b.createElement(jp,n4({},a,{className:Jt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Fl(o,!0)}}))}var Np=function(e){function t(){return jGe(this,t),CGe(this,t,arguments)}return IGe(t,e),SGe(t,[{key:"render",value:function(){return b.createElement(TGe,this.props)}}])}(b.Component);kG(Np,"displayName","XAxis");kG(Np,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function $h(e){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(e)}function AGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PGe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TG(n.key),n)}}function _Ge(e,t,r){return t&&PGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LGe(e,t,r){return t=hw(t),DGe(e,IG()?Reflect.construct(t,r||[],hw(e).constructor):t.apply(e,r))}function DGe(e,t){if(t&&($h(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OGe(e)}function OGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IG=function(){return!!e})()}function hw(e){return hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hw(e)}function RGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a4(e,t)}function a4(e,t){return a4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},a4(e,t)}function EG(e,t,r){return t=TG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TG(e){var t=$Ge(e,"string");return $h(t)=="symbol"?t:t+""}function $Ge(e,t){if($h(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($h(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function s4(){return s4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s4.apply(this,arguments)}var FGe=function(t){var r=t.yAxisId,n=HT(),a=YT(),i=uG(r);return i==null?null:b.createElement(jp,s4({},i,{className:Jt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Fl(l,!0)}}))},Sp=function(e){function t(){return AGe(this,t),LGe(this,t,arguments)}return RGe(t,e),_Ge(t,[{key:"render",value:function(){return b.createElement(FGe,this.props)}}])}(b.Component);EG(Sp,"displayName","YAxis");EG(Sp,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function y5(e){return VGe(e)||UGe(e)||BGe(e)||zGe()}function zGe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3841In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BGe(e,t){if(e){if(typeof e=="string")return i4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i4(e,t)}}function UGe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VGe(e){if(Array.isArray(e))return i4(e)}function i4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o4=function(t,r,n,a,i){var o=yo(t,KT),l=yo(t,Mj),c=[].concat(y5(o),y5(l)),u=yo(t,Ej),d="".concat(a,"Id"),f=a[0],m=r;if(c.length&&(m=c.reduce(function(g,y){if(y.props[d]===n&&el(y.props,"extendDomain")&&ut(y.props[f])){var v=y.props[f];return[Math.min(g[0],v),Math.max(g[1],v)]}return g},m)),u.length){var h="".concat(f,"1"),p="".concat(f,"2");m=u.reduce(function(g,y){if(y.props[d]===n&&el(y.props,"extendDomain")&&ut(y.props[h])&&ut(y.props[p])){var v=y.props[h],x=y.props[p];return[Math.min(g[0],v,x),Math.max(g[1],v,x)]}return g},m)}return i&&i.length&&(m=i.reduce(function(g,y){return ut(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},m)),m},AG={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new a(d,f||c,m),p=r?r+u:u;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,h=f.length,p=new Array(h);m<h;m++)p[m]=f[m].fn;return p},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,m,h,p){var g=r?r+u:u;if(!this._events[g])return!1;var y=this._events[g],v=arguments.length,x,j;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,m),!0;case 5:return y.fn.call(y.context,d,f,m,h),!0;case 6:return y.fn.call(y.context,d,f,m,h,p),!0}for(j=1,x=new Array(v-1);j<v;j++)x[j-1]=arguments[j];y.fn.apply(y.context,x)}else{var C=y.length,N;for(j=0;j<C;j++)switch(y[j].once&&this.removeListener(u,y[j].fn,void 0,!0),v){case 1:y[j].fn.call(y[j].context);break;case 2:y[j].fn.call(y[j].context,d);break;case 3:y[j].fn.call(y[j].context,d,f);break;case 4:y[j].fn.call(y[j].context,d,f,m);break;default:if(!x)for(N=1,x=new Array(v-1);N<v;N++)x[N-1]=arguments[N];y[j].fn.apply(y[j].context,x)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,m){var h=r?r+u:u;if(!this._events[h])return this;if(!d)return o(this,h),this;var p=this._events[h];if(p.fn)p.fn===d&&(!m||p.once)&&(!f||p.context===f)&&o(this,h);else{for(var g=0,y=[],v=p.length;g<v;g++)(p[g].fn!==d||m&&!p[g].once||f&&p[g].context!==f)&&y.push(p[g]);y.length?this._events[h]=y.length===1?y[0]:y:o(this,h)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(AG);var WGe=AG.exports;const qGe=hn(WGe);var PS=new qGe,_S="recharts.syncMouseEvents";function my(e){"@babel/helpers - typeof";return my=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},my(e)}function GGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HGe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,PG(n.key),n)}}function YGe(e,t,r){return t&&HGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LS(e,t,r){return t=PG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PG(e){var t=QGe(e,"string");return my(t)=="symbol"?t:t+""}function QGe(e,t){if(my(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(my(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var KGe=function(){function e(){GGe(this,e),LS(this,"activeIndex",0),LS(this,"coordinateList",[]),LS(this,"layout","horizontal")}return YGe(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,m=r.mouseHandlerCallback,h=m===void 0?null:m;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+c+u,m=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:m})}}}])}();function JGe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&ut(n)&&ut(a))return!0}return!1}function ZGe(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function _G(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,o=Ka(t,r,n,a),l=Ka(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function XGe(e,t,r){var n,a,i,o;if(e==="horizontal")n=t.x,i=n,a=r.top,o=r.top+r.height;else if(e==="vertical")a=t.y,o=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,m=Ka(l,c,u,f),h=Ka(l,c,d,f);n=m.x,a=m.y,i=h.x,o=h.y}else return _G(t);return[{x:n,y:a},{x:i,y:o}]}function hy(e){"@babel/helpers - typeof";return hy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hy(e)}function b5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(r),!0).forEach(function(n){eHe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eHe(e,t,r){return t=tHe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tHe(e){var t=rHe(e,"string");return hy(t)=="symbol"?t:t+""}function rHe(e,t){if(hy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nHe(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,m=e.chartName,h=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!h||!i||!o||m!=="ScatterChart"&&a!=="axis")return null;var p,g=Kg;if(m==="ScatterChart")p=o,g=o8e;else if(m==="BarChart")p=ZGe(f,o,c,d),g=UT;else if(f==="radial"){var y=_G(o),v=y.cx,x=y.cy,j=y.radius,C=y.startAngle,N=y.endAngle;p={cx:v,cy:x,startAngle:C,endAngle:N,innerRadius:j,outerRadius:j},g=_q}else p={points:XGe(f,o,c)},g=Kg;var S=yv(yv(yv(yv({stroke:"#ccc",pointerEvents:"none"},c),p),Er(h,!1)),{},{payload:l,payloadIndex:u,className:Jt("recharts-tooltip-cursor",h.className)});return b.isValidElement(h)?b.cloneElement(h,S):b.createElement(g,S)}var aHe=["item"],sHe=["children","className","width","height","style","compact","title","desc"];function Fh(e){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(e)}function gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gm.apply(this,arguments)}function v5(e,t){return lHe(e)||oHe(e,t)||DG(e,t)||iHe()}function iHe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3842In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oHe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function lHe(e){if(Array.isArray(e))return e}function x5(e,t){if(e==null)return{};var r=cHe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cHe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dHe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OG(n.key),n)}}function fHe(e,t,r){return t&&dHe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mHe(e,t,r){return t=pw(t),hHe(e,LG()?Reflect.construct(t,r||[],pw(e).constructor):t.apply(e,r))}function hHe(e,t){if(t&&(Fh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pHe(e)}function pHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LG=function(){return!!e})()}function pw(e){return pw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pw(e)}function gHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l4(e,t)}function l4(e,t){return l4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},l4(e,t)}function zh(e){return vHe(e)||bHe(e)||DG(e)||yHe()}function yHe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3843In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DG(e,t){if(e){if(typeof e=="string")return c4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c4(e,t)}}function bHe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vHe(e){if(Array.isArray(e))return c4(e)}function c4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function w5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w5(Object(r),!0).forEach(function(n){Kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kt(e,t,r){return t=OG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OG(e){var t=xHe(e,"string");return Fh(t)=="symbol"?t:t+""}function xHe(e,t){if(Fh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wHe={xAxis:["bottom","top"],yAxis:["left","right"]},jHe={width:"100%",height:"100%"},RG={x:0,y:0};function bv(e){return e}var NHe=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},SHe=function(t,r,n,a){var i=r.find(function(d){return d&&d.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return Ve(Ve(Ve({},a),Ka(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return Ve(Ve(Ve({},a),Ka(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return RG},Tj=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(zh(l),zh(u)):l},[]);return o.length>0?o:t&&t.length&&ut(a)&&ut(i)?t.slice(a,i+1):[]};function $G(e){return e==="number"?[0,"auto"]:void 0}var u4=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,l=Tj(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?l:f;m=g1(h,o.dataKey,a)}else m=f&&f[n]||l[n];return m?[].concat(zh(c),[Tq(u,m)]):c},[])},j5=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=NHe(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Vze(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,m=u4(t,r,d,f),h=SHe(n,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:m,activeCoordinate:h}}return null},CHe=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,m=t.stackOffset,h=Mq(d,i);return n.reduce(function(p,g){var y,v=g.type.defaultProps!==void 0?Ve(Ve({},g.type.defaultProps),g.props):g.props,x=v.type,j=v.dataKey,C=v.allowDataOverflow,N=v.allowDuplicatedCategory,S=v.scale,M=v.ticks,k=v.includeHidden,I=v[o];if(p[I])return p;var T=Tj(t.data,{graphicalItems:a.filter(function(H){var X,ue=o in H.props?H.props[o]:(X=H.type.defaultProps)===null||X===void 0?void 0:X[o];return ue===I}),dataStartIndex:c,dataEndIndex:u}),L=T.length,R,_,B;JGe(v.domain,C,x)&&(R=IM(v.domain,null,C),h&&(x==="number"||S!=="auto")&&(B=Qg(T,j,"category")));var z=$G(x);if(!R||R.length===0){var D,A=(D=v.domain)!==null&&D!==void 0?D:z;if(j){if(R=Qg(T,j,x),x==="category"&&h){var P=TEe(R);N&&P?(_=R,R=rw(0,L)):N||(R=tR(A,R,g).reduce(function(H,X){return H.indexOf(X)>=0?H:[].concat(zh(H),[X])},[]))}else if(x==="category")N?R=R.filter(function(H){return H!==""&&!_r(H)}):R=tR(A,R,g).reduce(function(H,X){return H.indexOf(X)>=0||X===""||_r(X)?H:[].concat(zh(H),[X])},[]);else if(x==="number"){var E=Yze(T,a.filter(function(H){var X,ue,le=o in H.props?H.props[o]:(X=H.type.defaultProps)===null||X===void 0?void 0:X[o],ae="hide"in H.props?H.props.hide:(ue=H.type.defaultProps)===null||ue===void 0?void 0:ue.hide;return le===I&&(k||!ae)}),j,i,d);E&&(R=E)}h&&(x==="number"||S!=="auto")&&(B=Qg(T,j,"category"))}else h?R=rw(0,L):l&&l[I]&&l[I].hasStack&&x==="number"?R=m==="expand"?[0,1]:Eq(l[I].stackGroups,c,u):R=kq(T,a.filter(function(H){var X=o in H.props?H.props[o]:H.type.defaultProps[o],ue="hide"in H.props?H.props.hide:H.type.defaultProps.hide;return X===I&&(k||!ue)}),x,d,!0);if(x==="number")R=o4(f,R,I,i,M),A&&(R=IM(A,R,C));else if(x==="category"&&A){var F=A,$=R.every(function(H){return F.indexOf(H)>=0});$&&(R=F)}}return Ve(Ve({},p),{},Kt({},I,Ve(Ve({},v),{},{axisType:i,domain:R,categoricalDomain:B,duplicateDomain:_,originalDomain:(y=v.domain)!==null&&y!==void 0?y:z,isCategorical:h,layout:d})))},{})},kHe=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,m=Tj(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),h=m.length,p=Mq(d,i),g=-1;return n.reduce(function(y,v){var x=v.type.defaultProps!==void 0?Ve(Ve({},v.type.defaultProps),v.props):v.props,j=x[o],C=$G("number");if(!y[j]){g++;var N;return p?N=rw(0,h):l&&l[j]&&l[j].hasStack?(N=Eq(l[j].stackGroups,c,u),N=o4(f,N,j,i)):(N=IM(C,kq(m,n.filter(function(S){var M,k,I=o in S.props?S.props[o]:(M=S.type.defaultProps)===null||M===void 0?void 0:M[o],T="hide"in S.props?S.props.hide:(k=S.type.defaultProps)===null||k===void 0?void 0:k.hide;return I===j&&!T}),"number",d),a.defaultProps.allowDataOverflow),N=o4(f,N,j,i)),Ve(Ve({},y),{},Kt({},j,Ve(Ve({axisType:i},a.defaultProps),{},{hide:!0,orientation:Di(wHe,"".concat(i,".").concat(g%2),null),domain:N,originalDomain:C,isCategorical:p,layout:d})))}return y},{})},MHe=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),m=yo(d,i),h={};return m&&m.length?h=CHe(t,{axes:m,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(h=kHe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),h},IHe=function(t){var r=Yc(t),n=Fl(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:pT(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:G1(r,n)}},N5=function(t){var r=t.children,n=t.defaultShowTooltip,a=Ks(r,Th),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},EHe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Jl(r&&r.type);return n&&n.indexOf("Bar")>=0})},S5=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},THe=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,m=n.margin||{},h=Ks(f,Th),p=Ks(f,Im),g=Object.keys(c).reduce(function(N,S){var M=c[S],k=M.orientation;return!M.mirror&&!M.hide?Ve(Ve({},N),{},Kt({},k,N[k]+M.width)):N},{left:m.left||0,right:m.right||0}),y=Object.keys(o).reduce(function(N,S){var M=o[S],k=M.orientation;return!M.mirror&&!M.hide?Ve(Ve({},N),{},Kt({},k,Di(N,"".concat(k))+M.height)):N},{top:m.top||0,bottom:m.bottom||0}),v=Ve(Ve({},y),g),x=v.bottom;h&&(v.bottom+=h.props.height||Th.defaultProps.height),p&&r&&(v=Gze(v,a,n,r));var j=u-v.left-v.right,C=d-v.top-v.bottom;return Ve(Ve({brushBottom:x},v),{},{width:Math.max(j,0),height:Math.max(C,0)})},AHe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},FG=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,m=function(v,x){var j=x.graphicalItems,C=x.stackGroups,N=x.offset,S=x.updateId,M=x.dataStartIndex,k=x.dataEndIndex,I=v.barSize,T=v.layout,L=v.barGap,R=v.barCategoryGap,_=v.maxBarSize,B=S5(T),z=B.numericAxisName,D=B.cateAxisName,A=EHe(j),P=[];return j.forEach(function(E,F){var $=Tj(v.data,{graphicalItems:[E],dataStartIndex:M,dataEndIndex:k}),H=E.type.defaultProps!==void 0?Ve(Ve({},E.type.defaultProps),E.props):E.props,X=H.dataKey,ue=H.maxBarSize,le=H["".concat(z,"Id")],ae=H["".concat(D,"Id")],te={},ne=c.reduce(function(pe,ce){var xe=x["".concat(ce.axisType,"Map")],Ee=H["".concat(ce.axisType,"Id")];xe&&xe[Ee]||ce.axisType==="zAxis"||_u();var Ye=xe[Ee];return Ve(Ve({},pe),{},Kt(Kt({},ce.axisType,Ye),"".concat(ce.axisType,"Ticks"),Fl(Ye)))},te),J=ne[D],G=ne["".concat(D,"Ticks")],Q=C&&C[le]&&C[le].hasStack&&iBe(E,C[le].stackGroups),W=Jl(E.type).indexOf("Bar")>=0,Y=G1(J,G),q=[],Z=A&&Wze({barSize:I,stackGroups:C,totalSize:AHe(ne,D)});if(W){var me,we,he=_r(ue)?_:ue,ie=(me=(we=G1(J,G,!0))!==null&&we!==void 0?we:he)!==null&&me!==void 0?me:0;q=qze({barGap:L,barCategoryGap:R,bandSize:ie!==Y?ie:Y,sizeList:Z[ae],maxBarSize:he}),ie!==Y&&(q=q.map(function(pe){return Ve(Ve({},pe),{},{position:Ve(Ve({},pe.position),{},{offset:pe.position.offset-ie/2})})}))}var ye=E&&E.type&&E.type.getComposedData;ye&&P.push({props:Ve(Ve({},ye(Ve(Ve({},ne),{},{displayedData:$,props:v,dataKey:X,item:E,bandSize:Y,barPosition:q,offset:N,stackedData:Q,layout:T,dataStartIndex:M,dataEndIndex:k}))),{},Kt(Kt(Kt({key:E.key||"item-".concat(F)},z,ne[z]),D,ne[D]),"animationId",S)),childIndex:VEe(E,v.children),item:E})}),P},h=function(v,x){var j=v.props,C=v.dataStartIndex,N=v.dataEndIndex,S=v.updateId;if(!YD({props:j}))return null;var M=j.children,k=j.layout,I=j.stackOffset,T=j.data,L=j.reverseStackOrder,R=S5(k),_=R.numericAxisName,B=R.cateAxisName,z=yo(M,n),D=nBe(T,z,"".concat(_,"Id"),"".concat(B,"Id"),I,L),A=c.reduce(function(H,X){var ue="".concat(X.axisType,"Map");return Ve(Ve({},H),{},Kt({},ue,MHe(j,Ve(Ve({},X),{},{graphicalItems:z,stackGroups:X.axisType===_&&D,dataStartIndex:C,dataEndIndex:N}))))},{}),P=THe(Ve(Ve({},A),{},{props:j,graphicalItems:z}),x==null?void 0:x.legendBBox);Object.keys(A).forEach(function(H){A[H]=d(j,A[H],P,H.replace("Map",""),r)});var E=A["".concat(B,"Map")],F=IHe(E),$=m(j,Ve(Ve({},A),{},{dataStartIndex:C,dataEndIndex:N,updateId:S,graphicalItems:z,stackGroups:D,offset:P}));return Ve(Ve({formattedGraphicalItems:$,graphicalItems:z,offset:P,stackGroups:D},F),A)},p=function(y){function v(x){var j,C,N;return uHe(this,v),N=mHe(this,v,[x]),Kt(N,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Kt(N,"accessibilityManager",new KGe),Kt(N,"handleLegendBBoxUpdate",function(S){if(S){var M=N.state,k=M.dataStartIndex,I=M.dataEndIndex,T=M.updateId;N.setState(Ve({legendBBox:S},h({props:N.props,dataStartIndex:k,dataEndIndex:I,updateId:T},Ve(Ve({},N.state),{},{legendBBox:S}))))}}),Kt(N,"handleReceiveSyncEvent",function(S,M,k){if(N.props.syncId===S){if(k===N.eventEmitterSymbol&&typeof N.props.syncMethod!="function")return;N.applySyncEvent(M)}}),Kt(N,"handleBrushChange",function(S){var M=S.startIndex,k=S.endIndex;if(M!==N.state.dataStartIndex||k!==N.state.dataEndIndex){var I=N.state.updateId;N.setState(function(){return Ve({dataStartIndex:M,dataEndIndex:k},h({props:N.props,dataStartIndex:M,dataEndIndex:k,updateId:I},N.state))}),N.triggerSyncEvent({dataStartIndex:M,dataEndIndex:k})}}),Kt(N,"handleMouseEnter",function(S){var M=N.getMouseInfo(S);if(M){var k=Ve(Ve({},M),{},{isTooltipActive:!0});N.setState(k),N.triggerSyncEvent(k);var I=N.props.onMouseEnter;yr(I)&&I(k,S)}}),Kt(N,"triggeredAfterMouseMove",function(S){var M=N.getMouseInfo(S),k=M?Ve(Ve({},M),{},{isTooltipActive:!0}):{isTooltipActive:!1};N.setState(k),N.triggerSyncEvent(k);var I=N.props.onMouseMove;yr(I)&&I(k,S)}),Kt(N,"handleItemMouseEnter",function(S){N.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),Kt(N,"handleItemMouseLeave",function(){N.setState(function(){return{isTooltipActive:!1}})}),Kt(N,"handleMouseMove",function(S){S.persist(),N.throttleTriggeredAfterMouseMove(S)}),Kt(N,"handleMouseLeave",function(S){N.throttleTriggeredAfterMouseMove.cancel();var M={isTooltipActive:!1};N.setState(M),N.triggerSyncEvent(M);var k=N.props.onMouseLeave;yr(k)&&k(M,S)}),Kt(N,"handleOuterEvent",function(S){var M=UEe(S),k=Di(N.props,"".concat(M));if(M&&yr(k)){var I,T;/.*touch.*/i.test(M)?T=N.getMouseInfo(S.changedTouches[0]):T=N.getMouseInfo(S),k((I=T)!==null&&I!==void 0?I:{},S)}}),Kt(N,"handleClick",function(S){var M=N.getMouseInfo(S);if(M){var k=Ve(Ve({},M),{},{isTooltipActive:!0});N.setState(k),N.triggerSyncEvent(k);var I=N.props.onClick;yr(I)&&I(k,S)}}),Kt(N,"handleMouseDown",function(S){var M=N.props.onMouseDown;if(yr(M)){var k=N.getMouseInfo(S);M(k,S)}}),Kt(N,"handleMouseUp",function(S){var M=N.props.onMouseUp;if(yr(M)){var k=N.getMouseInfo(S);M(k,S)}}),Kt(N,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),Kt(N,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.handleMouseDown(S.changedTouches[0])}),Kt(N,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.handleMouseUp(S.changedTouches[0])}),Kt(N,"handleDoubleClick",function(S){var M=N.props.onDoubleClick;if(yr(M)){var k=N.getMouseInfo(S);M(k,S)}}),Kt(N,"handleContextMenu",function(S){var M=N.props.onContextMenu;if(yr(M)){var k=N.getMouseInfo(S);M(k,S)}}),Kt(N,"triggerSyncEvent",function(S){N.props.syncId!==void 0&&PS.emit(_S,N.props.syncId,S,N.eventEmitterSymbol)}),Kt(N,"applySyncEvent",function(S){var M=N.props,k=M.layout,I=M.syncMethod,T=N.state.updateId,L=S.dataStartIndex,R=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)N.setState(Ve({dataStartIndex:L,dataEndIndex:R},h({props:N.props,dataStartIndex:L,dataEndIndex:R,updateId:T},N.state)));else if(S.activeTooltipIndex!==void 0){var _=S.chartX,B=S.chartY,z=S.activeTooltipIndex,D=N.state,A=D.offset,P=D.tooltipTicks;if(!A)return;if(typeof I=="function")z=I(P,S);else if(I==="value"){z=-1;for(var E=0;E<P.length;E++)if(P[E].value===S.activeLabel){z=E;break}}var F=Ve(Ve({},A),{},{x:A.left,y:A.top}),$=Math.min(_,F.x+F.width),H=Math.min(B,F.y+F.height),X=P[z]&&P[z].value,ue=u4(N.state,N.props.data,z),le=P[z]?{x:k==="horizontal"?P[z].coordinate:$,y:k==="horizontal"?H:P[z].coordinate}:RG;N.setState(Ve(Ve({},S),{},{activeLabel:X,activeCoordinate:le,activePayload:ue,activeTooltipIndex:z}))}else N.setState(S)}),Kt(N,"renderCursor",function(S){var M,k=N.state,I=k.isTooltipActive,T=k.activeCoordinate,L=k.activePayload,R=k.offset,_=k.activeTooltipIndex,B=k.tooltipAxisBandSize,z=N.getTooltipEventType(),D=(M=S.props.active)!==null&&M!==void 0?M:I,A=N.props.layout,P=S.key||"_recharts-cursor";return U.createElement(nHe,{key:P,activeCoordinate:T,activePayload:L,activeTooltipIndex:_,chartName:r,element:S,isActive:D,layout:A,offset:R,tooltipAxisBandSize:B,tooltipEventType:z})}),Kt(N,"renderPolarAxis",function(S,M,k){var I=Di(S,"type.axisType"),T=Di(N.state,"".concat(I,"Map")),L=S.type.defaultProps,R=L!==void 0?Ve(Ve({},L),S.props):S.props,_=T&&T[R["".concat(I,"Id")]];return b.cloneElement(S,Ve(Ve({},_),{},{className:Jt(I,_.className),key:S.key||"".concat(M,"-").concat(k),ticks:Fl(_,!0)}))}),Kt(N,"renderPolarGrid",function(S){var M=S.props,k=M.radialLines,I=M.polarAngles,T=M.polarRadius,L=N.state,R=L.radiusAxisMap,_=L.angleAxisMap,B=Yc(R),z=Yc(_),D=z.cx,A=z.cy,P=z.innerRadius,E=z.outerRadius;return b.cloneElement(S,{polarAngles:Array.isArray(I)?I:Fl(z,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(T)?T:Fl(B,!0).map(function(F){return F.coordinate}),cx:D,cy:A,innerRadius:P,outerRadius:E,key:S.key||"polar-grid",radialLines:k})}),Kt(N,"renderLegend",function(){var S=N.state.formattedGraphicalItems,M=N.props,k=M.children,I=M.width,T=M.height,L=N.props.margin||{},R=I-(L.left||0)-(L.right||0),_=Sq({children:k,formattedGraphicalItems:S,legendWidth:R,legendContent:u});if(!_)return null;var B=_.item,z=x5(_,aHe);return b.cloneElement(B,Ve(Ve({},z),{},{chartWidth:I,chartHeight:T,margin:L,onBBoxUpdate:N.handleLegendBBoxUpdate}))}),Kt(N,"renderTooltip",function(){var S,M=N.props,k=M.children,I=M.accessibilityLayer,T=Ks(k,to);if(!T)return null;var L=N.state,R=L.isTooltipActive,_=L.activeCoordinate,B=L.activePayload,z=L.activeLabel,D=L.offset,A=(S=T.props.active)!==null&&S!==void 0?S:R;return b.cloneElement(T,{viewBox:Ve(Ve({},D),{},{x:D.left,y:D.top}),active:A,label:z,payload:A?B:[],coordinate:_,accessibilityLayer:I})}),Kt(N,"renderBrush",function(S){var M=N.props,k=M.margin,I=M.data,T=N.state,L=T.offset,R=T.dataStartIndex,_=T.dataEndIndex,B=T.updateId;return b.cloneElement(S,{key:S.key||"_recharts-brush",onChange:mv(N.handleBrushChange,S.props.onChange),data:I,x:ut(S.props.x)?S.props.x:L.left,y:ut(S.props.y)?S.props.y:L.top+L.height+L.brushBottom-(k.bottom||0),width:ut(S.props.width)?S.props.width:L.width,startIndex:R,endIndex:_,updateId:"brush-".concat(B)})}),Kt(N,"renderReferenceElement",function(S,M,k){if(!S)return null;var I=N,T=I.clipPathId,L=N.state,R=L.xAxisMap,_=L.yAxisMap,B=L.offset,z=S.type.defaultProps||{},D=S.props,A=D.xAxisId,P=A===void 0?z.xAxisId:A,E=D.yAxisId,F=E===void 0?z.yAxisId:E;return b.cloneElement(S,{key:S.key||"".concat(M,"-").concat(k),xAxis:R[P],yAxis:_[F],viewBox:{x:B.left,y:B.top,width:B.width,height:B.height},clipPathId:T})}),Kt(N,"renderActivePoints",function(S){var M=S.item,k=S.activePoint,I=S.basePoint,T=S.childIndex,L=S.isRange,R=[],_=M.props.key,B=M.item.type.defaultProps!==void 0?Ve(Ve({},M.item.type.defaultProps),M.item.props):M.item.props,z=B.activeDot,D=B.dataKey,A=Ve(Ve({index:T,dataKey:D,cx:k.x,cy:k.y,r:4,fill:BT(M.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value},Er(z,!1)),y1(z));return R.push(v.renderActiveDot(z,A,"".concat(_,"-activePoint-").concat(T))),I?R.push(v.renderActiveDot(z,Ve(Ve({},A),{},{cx:I.x,cy:I.y}),"".concat(_,"-basePoint-").concat(T))):L&&R.push(null),R}),Kt(N,"renderGraphicChild",function(S,M,k){var I=N.filterFormatItem(S,M,k);if(!I)return null;var T=N.getTooltipEventType(),L=N.state,R=L.isTooltipActive,_=L.tooltipAxis,B=L.activeTooltipIndex,z=L.activeLabel,D=N.props.children,A=Ks(D,to),P=I.props,E=P.points,F=P.isRange,$=P.baseLine,H=I.item.type.defaultProps!==void 0?Ve(Ve({},I.item.type.defaultProps),I.item.props):I.item.props,X=H.activeDot,ue=H.hide,le=H.activeBar,ae=H.activeShape,te=!!(!ue&&R&&A&&(X||le||ae)),ne={};T!=="axis"&&A&&A.props.trigger==="click"?ne={onClick:mv(N.handleItemMouseEnter,S.props.onClick)}:T!=="axis"&&(ne={onMouseLeave:mv(N.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:mv(N.handleItemMouseEnter,S.props.onMouseEnter)});var J=b.cloneElement(S,Ve(Ve({},I.props),ne));function G(ce){return typeof _.dataKey=="function"?_.dataKey(ce.payload):null}if(te)if(B>=0){var Q,W;if(_.dataKey&&!_.allowDuplicatedCategory){var Y=typeof _.dataKey=="function"?G:"payload.".concat(_.dataKey.toString());Q=g1(E,Y,z),W=F&&$&&g1($,Y,z)}else Q=E==null?void 0:E[B],W=F&&$&&$[B];if(ae||le){var q=S.props.activeIndex!==void 0?S.props.activeIndex:B;return[b.cloneElement(S,Ve(Ve(Ve({},I.props),ne),{},{activeIndex:q})),null,null]}if(!_r(Q))return[J].concat(zh(N.renderActivePoints({item:I,activePoint:Q,basePoint:W,childIndex:B,isRange:F})))}else{var Z,me=(Z=N.getItemByXY(N.state.activeCoordinate))!==null&&Z!==void 0?Z:{graphicalItem:J},we=me.graphicalItem,he=we.item,ie=he===void 0?S:he,ye=we.childIndex,pe=Ve(Ve(Ve({},I.props),ne),{},{activeIndex:ye});return[b.cloneElement(ie,pe),null,null]}return F?[J,null,null]:[J,null]}),Kt(N,"renderCustomized",function(S,M,k){return b.cloneElement(S,Ve(Ve({key:"recharts-customized-".concat(k)},N.props),N.state))}),Kt(N,"renderMap",{CartesianGrid:{handler:bv,once:!0},ReferenceArea:{handler:N.renderReferenceElement},ReferenceLine:{handler:bv},ReferenceDot:{handler:N.renderReferenceElement},XAxis:{handler:bv},YAxis:{handler:bv},Brush:{handler:N.renderBrush,once:!0},Bar:{handler:N.renderGraphicChild},Line:{handler:N.renderGraphicChild},Area:{handler:N.renderGraphicChild},Radar:{handler:N.renderGraphicChild},RadialBar:{handler:N.renderGraphicChild},Scatter:{handler:N.renderGraphicChild},Pie:{handler:N.renderGraphicChild},Funnel:{handler:N.renderGraphicChild},Tooltip:{handler:N.renderCursor,once:!0},PolarGrid:{handler:N.renderPolarGrid,once:!0},PolarAngleAxis:{handler:N.renderPolarAxis},PolarRadiusAxis:{handler:N.renderPolarAxis},Customized:{handler:N.renderCustomized}}),N.clipPathId="".concat((j=x.id)!==null&&j!==void 0?j:ab("recharts"),"-clip"),N.throttleTriggeredAfterMouseMove=jW(N.triggeredAfterMouseMove,(C=x.throttleDelay)!==null&&C!==void 0?C:1e3/60),N.state={},N}return gHe(v,y),fHe(v,[{key:"componentDidMount",value:function(){var j,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,C=j.children,N=j.data,S=j.height,M=j.layout,k=Ks(C,to);if(k){var I=k.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,L=u4(this.state,N,I,T),R=this.state.tooltipTicks[I].coordinate,_=(this.state.offset.top+S)/2,B=M==="horizontal",z=B?{x:R,y:_}:{y:R,x:_},D=this.state.formattedGraphicalItems.find(function(P){var E=P.item;return E.type.name==="Scatter"});D&&(z=Ve(Ve({},z),D.props.points[I].tooltipPosition),L=D.props.points[I].tooltipPayload);var A={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:T,activePayload:L,activeCoordinate:z};this.setState(A),this.renderCursor(k),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var N,S;this.accessibilityManager.setDetails({offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(j){Vk([Ks(j.children,to)],[Ks(this.props.children,to)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=Ks(this.props.children,to);if(j&&typeof j.props.shared=="boolean"){var C=j.props.shared?"axis":"item";return l.indexOf(C)>=0?C:i}return i}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var C=this.container,N=C.getBoundingClientRect(),S=p5e(N),M={chartX:Math.round(j.pageX-S.left),chartY:Math.round(j.pageY-S.top)},k=N.width/C.offsetWidth||1,I=this.inRange(M.chartX,M.chartY,k);if(!I)return null;var T=this.state,L=T.xAxisMap,R=T.yAxisMap,_=this.getTooltipEventType(),B=j5(this.state,this.props.data,this.props.layout,I);if(_!=="axis"&&L&&R){var z=Yc(L).scale,D=Yc(R).scale,A=z&&z.invert?z.invert(M.chartX):null,P=D&&D.invert?D.invert(M.chartY):null;return Ve(Ve({},M),{},{xValue:A,yValue:P},B)}return B?Ve(Ve({},M),B):null}},{key:"inRange",value:function(j,C){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,M=j/N,k=C/N;if(S==="horizontal"||S==="vertical"){var I=this.state.offset,T=M>=I.left&&M<=I.left+I.width&&k>=I.top&&k<=I.top+I.height;return T?{x:M,y:k}:null}var L=this.state,R=L.angleAxisMap,_=L.radiusAxisMap;if(R&&_){var B=Yc(R);return aR({x:M,y:k},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,C=this.getTooltipEventType(),N=Ks(j,to),S={};N&&C==="axis"&&(N.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var M=y1(this.props,this.handleOuterEvent);return Ve(Ve({},M),S)}},{key:"addListener",value:function(){PS.on(_S,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){PS.removeListener(_S,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,C,N){for(var S=this.state.formattedGraphicalItems,M=0,k=S.length;M<k;M++){var I=S[M];if(I.item===j||I.props.key===j.key||C===Jl(I.item.type)&&N===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var j=this.clipPathId,C=this.state.offset,N=C.left,S=C.top,M=C.height,k=C.width;return U.createElement("defs",null,U.createElement("clipPath",{id:j},U.createElement("rect",{x:N,y:S,height:M,width:k})))}},{key:"getXScales",value:function(){var j=this.state.xAxisMap;return j?Object.entries(j).reduce(function(C,N){var S=v5(N,2),M=S[0],k=S[1];return Ve(Ve({},C),{},Kt({},M,k.scale))},{}):null}},{key:"getYScales",value:function(){var j=this.state.yAxisMap;return j?Object.entries(j).reduce(function(C,N){var S=v5(N,2),M=S[0],k=S[1];return Ve(Ve({},C),{},Kt({},M,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(j){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[j])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(j){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[j])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(j){var C=this.state,N=C.formattedGraphicalItems,S=C.activeItem;if(N&&N.length)for(var M=0,k=N.length;M<k;M++){var I=N[M],T=I.props,L=I.item,R=L.type.defaultProps!==void 0?Ve(Ve({},L.type.defaultProps),L.props):L.props,_=Jl(L.type);if(_==="Bar"){var B=(T.data||[]).find(function(P){return J7e(j,P)});if(B)return{graphicalItem:I,payload:B}}else if(_==="RadialBar"){var z=(T.data||[]).find(function(P){return aR(j,P)});if(z)return{graphicalItem:I,payload:z}}else if(Nj(I,S)||Sj(I,S)||ly(I,S)){var D=eVe({graphicalItem:I,activeTooltipItem:S,itemData:R.data}),A=R.activeIndex===void 0?D:R.activeIndex;return{graphicalItem:Ve(Ve({},I),{},{childIndex:A}),payload:ly(I,S)?R.data[D]:I.props.data[D]}}}return null}},{key:"render",value:function(){var j=this;if(!YD(this))return null;var C=this.props,N=C.children,S=C.className,M=C.width,k=C.height,I=C.style,T=C.compact,L=C.title,R=C.desc,_=x5(C,sHe),B=Er(_,!1);if(T)return U.createElement(r5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement(qk,gm({},B,{width:M,height:k,title:L,desc:R}),this.renderClipPath(),KD(N,this.renderMap)));if(this.props.accessibilityLayer){var z,D;B.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,B.role=(D=this.props.role)!==null&&D!==void 0?D:"application",B.onKeyDown=function(P){j.accessibilityManager.keyboardEvent(P)},B.onFocus=function(){j.accessibilityManager.focus()}}var A=this.parseEventsOfWrapper();return U.createElement(r5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement("div",gm({className:Jt("recharts-wrapper",S),style:Ve({position:"relative",cursor:"default",width:M,height:k},I)},A,{ref:function(E){j.container=E}}),U.createElement(qk,gm({},B,{width:M,height:k,title:L,desc:R,style:jHe}),this.renderClipPath(),KD(N,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Kt(p,"displayName",r),Kt(p,"defaultProps",Ve({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Kt(p,"getDerivedStateFromProps",function(y,v){var x=y.dataKey,j=y.data,C=y.children,N=y.width,S=y.height,M=y.layout,k=y.stackOffset,I=y.margin,T=v.dataStartIndex,L=v.dataEndIndex;if(v.updateId===void 0){var R=N5(y);return Ve(Ve(Ve({},R),{},{updateId:0},h(Ve(Ve({props:y},R),{},{updateId:0}),v)),{},{prevDataKey:x,prevData:j,prevWidth:N,prevHeight:S,prevLayout:M,prevStackOffset:k,prevMargin:I,prevChildren:C})}if(x!==v.prevDataKey||j!==v.prevData||N!==v.prevWidth||S!==v.prevHeight||M!==v.prevLayout||k!==v.prevStackOffset||!Mm(I,v.prevMargin)){var _=N5(y),B={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},z=Ve(Ve({},j5(v,j,M)),{},{updateId:v.updateId+1}),D=Ve(Ve(Ve({},_),B),z);return Ve(Ve(Ve({},D),h(Ve({props:y},D),v)),{},{prevDataKey:x,prevData:j,prevWidth:N,prevHeight:S,prevLayout:M,prevStackOffset:k,prevMargin:I,prevChildren:C})}if(!Vk(C,v.prevChildren)){var A,P,E,F,$=Ks(C,Th),H=$&&(A=(P=$.props)===null||P===void 0?void 0:P.startIndex)!==null&&A!==void 0?A:T,X=$&&(E=(F=$.props)===null||F===void 0?void 0:F.endIndex)!==null&&E!==void 0?E:L,ue=H!==T||X!==L,le=!_r(j),ae=le&&!ue?v.updateId:v.updateId+1;return Ve(Ve({updateId:ae},h(Ve(Ve({props:y},v),{},{updateId:ae,dataStartIndex:H,dataEndIndex:X}),v)),{},{prevChildren:C,dataStartIndex:H,dataEndIndex:X})}return null}),Kt(p,"renderActiveDot",function(y,v,x){var j;return b.isValidElement(y)?j=b.cloneElement(y,v):yr(y)?j=y(v):j=U.createElement(VT,v),U.createElement(Zn,{className:"recharts-active-dot",key:x},j)});var g=b.forwardRef(function(v,x){return U.createElement(p,gm({},v,{ref:x}))});return g.displayName=p.displayName,g},PHe=FG({chartName:"BarChart",GraphicalChild:If,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Np},{axisType:"yAxis",AxisComp:Sp}],formatAxisMap:tG}),_He=FG({chartName:"AreaChart",GraphicalChild:tl,axisComponents:[{axisType:"xAxis",AxisComp:Np},{axisType:"yAxis",AxisComp:Sp}],formatAxisMap:tG});const C5=({data:e,previousData:t,metricKey:r,color:n="#6366f1",previousColor:a="#a5b4fc",dimmed:i=!1,overlayText:o,showLegend:l=!0,currentLegend:c,previousLegend:u,currentTooltipLabel:d,previousTooltipLabel:f,dateLocale:m,multiSeries:h,platformColors:p})=>{const g=b.useMemo(()=>h?Object.keys(h):[],[h]),[y,v]=b.useState({}),x=b.useCallback(I=>
3843{v(T=>({...T,[I]:!T[I]}))},[]),j=b.useMemo(()=>Array.isArray(e)?e.map(I=>{var T;return{date:I.date,value:Number(((T=I==null?void 0:I.values)==null?void 0:T[r])??0)}}):[],[e,r]),C=b.useMemo(()=>Array.isArray(t)?t.map(I=>{var T;return{date:I.date,value:Number(((T=I==null?void 0:I.values)==null?void 0:T[r])??0)}}):[],[t,r]),N=b.useMemo(()=>{const I=j.length>0?j.map(L=>L.date):Array.from({length:30}).map((L,R)=>{const _=new Date;return _.setDate(_.getDate()-(29-R)),sr(_,"yyyy-MM-dd")}),T=[2,8,20,35,12,5,1,0,6,22,40,18,3,1,15,28,6,2,12,4,1,0,10,2,0,8,1,0,14,3];return I.map((L,R)=>({date:L,value:T[R%T.length]}))},[j]),S=b.useMemo(()=>j.length===0||j.every(I=>(I.value||0)===0),[j]),M=b.useMemo(()=>{if(h&&g.length>0)return(Array.isArray(e)?e:[]).map(_=>{var z;const B={date:_.date};for(const D of g)B[D]=Number(((z=_==null?void 0:_.values)==null?void 0:z[D])??0);return B});const I=i&&S?N:j;if(!I.length)return[];if(!C.length)return I.map(_=>({date:_.date,current:_.value}));const T=I.length,L=C.length;return I.map((_,B)=>{var A;const z=T>1?Math.round(B*(L-1)/(T-1)):0,D=((A=C[z])==null?void 0:A.value)??0;return{date:_.date,current:_.value,previous:D}})},[e,j,C,N,i,S,h]),k=({active:I,payload:T,label:L})=>{if(!(I&&T&&T.length))return null;const R=L?sr(Xa(L),"P",{locale:m}):"";if(h&&Object.keys(h).length>0){const z=(T||[]).reduce((D,A)=>D+Number((A==null?void 0:A.value)??0),0);return s.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg p-2 shadow-sm text-sm",children:[s.jsx("div",{className:"text-gray-500",children:R}),s.jsxs("div",{className:"mt-1 space-y-0.5",children:[T.map(D=>s.jsxs("div",{className:"flex items-center gap-2 text-gray-900",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-sm",style:{backgroundColor:D.stroke||"#6366f1"}}),s.jsx("span",{className:"capitalize",children:D.dataKey}),s.jsx("span",{className:"ml-auto font-medium",children:Number(D.value??0).toLocaleString()})]},`tip-${D.dataKey}`)),s.jsx("div",{className:"h-px bg-gray-200 my-1"}),s.jsxs("div",{className:"flex items-center gap-2 text-gray-900",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-sm bg-gray-800"}),s.jsx("span",{className:"font-medium",children:"Total"}),s.jsx("span",{className:"ml-auto font-semibold",children:z.toLocaleString()})]})]})]})}const _=T.find(z=>z.dataKey==="current"),B=T.find(z=>z.dataKey==="previous");return s.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg p-2 shadow-sm text-sm",children:[s.jsx("div",{className:"text-gray-500",children:R}),_&&s.jsxs("div",{className:"font-medium text-gray-900",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-sm mr-2",style:{backgroundColor:n}}),Number(_.value??0).toLocaleString()," ",d?s.jsxs("span",{className:"text-gray-500",children:["(",d,")"]}):null]}),B&&s.jsxs("div",{className:"text-gray-700",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-sm mr-2",style:{backgroundColor:a}}),Number(B.value??0).toLocaleString()," ",f?s.jsxs("span",{className:"text-gray-500",children:["(",f,")"]}):null]})]})};return M.length?s.jsxs("div",{children:[s.jsxs("div",{className:`h-80 relative ${i?"opacity-60 blur-[2px]":""}`,children:[s.jsx(NW,{width:"100%",height:"100%",children:s.jsxs(_He,{data:M,margin:{top:10,right:20,left:0,bottom:0},children:[s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:"timeseriesColorCurrent",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:n,stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:n,stopOpacity:0})]}),s.jsxs("linearGradient",{id:"timeseriesColorPrevious",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:a,stopOpacity:.15}),s.jsx("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})]}),s.jsx(XT,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),s.jsx(Np,{dataKey:"date",stroke:"#6b7280",fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:I=>{try{return sr(Xa(I),"d MMM",{locale:m})}catch{return I}}}),s.jsx(Sp,{stroke:"#6b7280",fontSize:12,tickLine:!1,axisLine:!1}),s.jsx(to,{content:s.jsx(k,{})}),h&&g.length>0?s.jsx(s.Fragment,{children:g.map(I=>s.jsx(tl,{type:"monotone",dataKey:I,stroke:(p==null?void 0:p[I])||"#6366f1",strokeWidth:2,fillOpacity:.2,f
3843ill:(p==null?void 0:p[I])||"#6366f1",dot:!1,isAnimationActive:!0,animationDuration:400,stackId:"platforms",hide:!!y[I]},`series-${I}`))}):s.jsxs(s.Fragment,{children:[M.some(I=>typeof I.previous=="number")&&s.jsx(tl,{type:"monotone",dataKey:"previous",stroke:a,strokeWidth:2,strokeDasharray:"4 4",fillOpacity:.2,fill:"url(#timeseriesColorPrevious)",dot:!1,isAnimationActive:!1}),s.jsx(tl,{type:"monotone",dataKey:"current",stroke:n,strokeWidth:2,fillOpacity:1,fill:"url(#timeseriesColorCurrent)",dot:!1})]})]})}),i&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"bg-black/40 text-white px-4 py-2 rounded-lg border border-white/40 text-sm",children:o||"No activity for this period"})})]}),l&&s.jsxs("div",{className:"h-14 mt-1 flex items-center justify-center gap-6 text-xs text-gray-600 text-center",children:[!h&&typeof c=="string"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{backgroundColor:n}}),s.jsx("span",{children:c})]}),!h&&C.length>0&&typeof u=="string"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block w-5 h-0 align-middle border-t-2",style:{borderTopColor:a,borderTopStyle:"dashed"}}),s.jsx("span",{children:u})]}),h&&g.length>0&&g.map(I=>s.jsxs("button",{type:"button",onClick:()=>x(I),className:`flex items-center gap-2 cursor-pointer transition-opacity ${y[I]?"opacity-40":"opacity-100"}`,children:[s.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{backgroundColor:(p==null?void 0:p[I])||"#6366f1"}}),s.jsx("span",{className:"capitalize",children:I})]},`legend-${I}`))]})]}):s.jsx("div",{className:"flex items-center justify-center h-64 text-gray-500 text-sm",children:"No time series data"})},sm=({message:e,position:t="top",className:r=""})=>{const[n,a]=b.useState(!1),i=()=>{switch(t){case"bottom":return"top-full left-1/2 -translate-x-1/2 mt-2";case"left":return"top-1/2 -translate-y-1/2 right-full mr-2";case"right":return"top-1/2 -translate-y-1/2 left-full ml-2";case"top":default:return"bottom-full left-1/2 -translate-x-1/2 mb-2"}},o=()=>{switch(t){case"bottom":return"absolute bottom-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-l-transparent border-r-transparent border-b-primary-100";case"left":return"absolute top-1/2 -translate-y-1/2 left-full w-0 h-0 border-t-4 border-b-4 border-l-4 border-t-transparent border-b-transparent border-l-primary-100";case"right":return"absolute top-1/2 -translate-y-1/2 right-full w-0 h-0 border-t-4 border-b-4 border-r-4 border-t-transparent border-b-transparent border-r-primary-100";case"top":default:return"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-primary-100"}};return s.jsxs("div",{className:`relative inline-flex items-center ${r}`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),tabIndex:0,role:"tooltip","aria-describedby":n?"info-tooltip-content":void 0,children:[s.jsx(uh,{className:"w-4 h-4 text-gray-500 hover:text-gray-700 cursor-pointer"}),n&&s.jsxs("div",{id:"info-tooltip-content",className:`absolute ${i()} w-max max-w-xs z-50 px-3 py-1.5 bg-primary-100 text-gray-900 text-xs rounded-md shadow whitespace-normal`,children:[e,s.jsx("div",{className:o()})]})]})},vv=[{id:"linkedin",name:"LinkedIn"},{id:"youtube",name:"YouTube"},{id:"instagram",name:"Instagram"},{id:"facebook",name:"Facebook"}],LHe=[{title:"Total Followers",value:1823,previousValue:1642,change:11.02,icon:Jr,color:"bg-blue-500"},{title:"Total Engagement",value:3127,previousValue:2819,change:10.93,icon:co,color:"bg-green-500"},{title:"Total Posts",value:58,previousValue:62,change:-6.45,icon:da,color:"bg-orange-500"},{title:"Total Impressions",value:27305,previousValue:24112,change:13.24,icon:xa,color:"bg-indigo-500"},{title:"Avg. Engagement Rate",value:6.93,previousValue:5.72,change:21.15,icon:Ck,color:"bg-rose-500"}],DHe=()=>{var Lt,_e,et,ft,pt,$t,Pt,Ft,Dr;const[e,t]=b.useState("daily"),r=b.useCallback(K=>{if(!Array.isArray(K))return[];const ke=new Map;
3843for(const Ze of K){if(!Ze||!Ze.date)continue;const bt=Xa(Ze.date),Re=sr(ll(bt,{weekStartsOn:1}),"yyyy-MM-dd"),dt=ke.get(Re)||{},Et=Ze.values||{};for(const xt of Object.keys(Et)){const qt=Number(Et[xt]??0);dt[xt]=(dt[xt]||0)+(isFinite(qt)?qt:0)}ke.set(Re,dt)}return Array.from(ke.entries()).sort(([Ze],[bt])=>Ze.localeCompare(bt)).map(([Ze,bt])=>({date:Ze,values:bt}))},[]),{t:n,i18n:a}=Te(),i=lp(new Date),[o]=ui(),l=o.get("refresh"),[c,u]=b.useState(null),{activeTab:d,setActiveTab:f,selectedBrand:m,setSelectedBrand:h,dateRange:p,setDateRange:g,customDateRange:y,setCustomDateRange:v}=Kke(),[x,j]=b.useState("linkedin"),{data:C,isLoading:N}=oa(),S=b.useMemo(()=>{const K=C;return K!=null&&K.brands?K.brands.map(ke=>({id:ke.id,name:ke.name,logo:ke.logo,website:ke.website||""})):[]},[C]),{data:M,isLoading:k}=qE(),I=(M==null?void 0:M.connected_pages)||[],T=b.useMemo(()=>{if(!I.length)return S;const K=[...new Set(I.map(ke=>ke.brandId).filter(Boolean))];return S.filter(ke=>K.includes(ke.id))},[S,I]),L=I.length>0,R=b.useMemo(()=>!N&&!k&&T.length>1&&!m,[N,k,T,m]);b.useEffect(()=>{!N&&!k&&!m&&T.length===1&&h(T[0].id)},[N,k,T,m,h]);const _=()=>{if(p==="custom")return{start:sr(y.start,"yyyy-MM-dd"),end:sr(y.end,"yyyy-MM-dd")};if(p==="this-month"){const K=new Date;return{start:sr(Pu(K),"yyyy-MM-dd"),end:sr(K,"yyyy-MM-dd")}}else{if(p==="last-month")return{start:sr(Pu(i),"yyyy-MM-dd"),end:sr(op(i),"yyyy-MM-dd")};if(p==="this-year"){const K=new Date;return{start:sr(Z8(K),"yyyy-MM-dd"),end:sr(K,"yyyy-MM-dd")}}else{const K=Number(p),ke=new Date,Ze=new Date(ke);return Ze.setDate(Ze.getDate()-((Number.isFinite(K)&&K>0?K:30)-1)),{start:sr(Ze,"yyyy-MM-dd"),end:sr(ke,"yyyy-MM-dd")}}}},B=_(),{data:z,isLoading:D,isError:A,error:P}=Vke({start:B.start,end:B.end,brandId:m&&m!=="all"?m:void 0,applanguage:a.language,enabled:d==="summary"&&!R,refresh:l,withAnalysis:!1}),E=b.useMemo(()=>d==="summary"?!0:m?I.some(K=>K.platform===d&&K.brandId===m):I.some(K=>K.platform===d),[d,m,I]),F=b.useMemo(()=>{if(!m||d==="summary"||!I.length)return;const K=I.find(ke=>ke.platform===d&&ke.brandId===m);return console.log("Selected Brand:",m),console.log("Active Tab (Platform):",d),console.log("Connected Pages:",I),console.log("Found Platform Account:",K),console.log("PageId for API call:",K==null?void 0:K.pageId),K==null?void 0:K.pageId},[m,d,I]),{data:$,isLoading:H,isError:X,error:ue}=Wke({platform:!R&&d!=="summary"?d:null,start:B.start,end:B.end,brandId:m&&m!=="all"?m:void 0,pageId:F,hasPlatformAccount:!R&&E,refresh:l,withAnalysis:!1}),le=Jke(),[ae,te]=b.useState("IMPRESSIONS"),ne=b.useMemo(()=>{const K=$==null?void 0:$.timeGroupedData;return!Array.isArray(K)||K.length===0?[]:Array.from(K.reduce((bt,Re)=>
3843(Object.keys((Re==null?void 0:Re.values)||{}).forEach(dt=>bt.add(dt)),bt),new Set)).filter(bt=>K.some(Re=>{var dt;return Number(((dt=Re==null?void 0:Re.values)==null?void 0:dt[bt])||0)>0})).slice().sort((bt,Re)=>ze(bt).localeCompare(ze(Re)))},[$]),J=b.useMemo(()=>{const K=$==null?void 0:$.timeGroupedData;return!Array.isArray(K)||K.length===0?[]:Array.from(K.reduce((ke,Ze)=>(Object.keys((Ze==null?void 0:Ze.values)||{}).forEach(bt=>ke.add(bt)),ke),new Set))},[$]);b.useEffect(()=>{if(ne.length>0){if(!ne.includes(ae)){const ke=["IMPRESSIONS","VIEWS","POST_ENGAGEMENTS","LIKES","FOLLOWER_COUNT"].find(Ze=>ne.includes(Ze));te(ke||ne[0])}}else ae&&te("")},[d,ne]);const[G,Q]=b.useState(!1),W=$==null?void 0:$.timeGroupedData,Y=$==null?void 0:$.previousTimeGroupedData,q=b.useMemo(()=>{var ke;const K=(ke=$==null?void 0:$.timeframes)==null?void 0:ke.previous;if(!K||!K.start||!K.end)return null;try{const Ze=new Date(K.start),bt=new Date(K.end),Re=dt=>`${String(dt.getDate()).padStart(2,"0")}/${String(dt.getMonth()+1).padStart(2,"0")}/${dt.getFullYear()}`;return`${Re(Ze)} - ${Re(bt)}`}catch{return null}},[$]),Z=ne.length>0?ne:J,me=b.useMemo(()=>(Z||[]).slice().sort((K,ke)=>ze(K).localeCompare(ze(ke))),[Z]),we=Z[0]||"IMPRESSIONS",he=ae&&(J.includes(ae)||Z.includes(ae))?ae:we,ie=b.useMemo(()=>{const K=W||[];return!Array.isArray(K)||K.length===0?!0:!K.some(ke=>{var Ze;return Number(((Ze=ke==null?void 0:ke.values)==null?void 0:Ze[he])||0)>0})},[W,he]),ye=K=>{const ke=Array.isArray(W)?W:[];if(ke.length===0)return 0;const Ze=ke.map(Re=>{var dt;return Number(((dt=Re==null?void 0:Re.values)==null?void 0:dt[K])||0)}).filter(Re=>Re>0);return Ze.length===0?0:Ze.reduce((Re,dt)=>Re+dt,0)/Ze.length},[pe,ce]=b.useState(!1),xe=()=>typeof window>"u"||typeof window.matchMedia>"u"?4:window.matchMedia("(min-width: 1280px)").matches?5:4,[Ee,Ye]=b.useState(xe());b.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia>"u")return;const K=window.matchMedia("(min-width: 1280px)"),ke=()=>Ye(K.matches?5:4);return ke(),K.addEventListener?K.addEventListener("change",ke):K.addListener&&K.addListener(ke),()=>{K.removeEventListener?K.removeEventListener("change",ke):K.removeListener&&K.removeListener(ke)}},[]);const fe=b.useMemo(()=>{const ke=d==="summary"?z==null?void 0:z.topPosts:$==null?void 0:$.topPosts;return Array.isArray(ke)?ke.slice(0,5):[]},[z,$,d]),je=K=>{if(!K)return"📝";const ke=K.toLowerCase();return/(\.mp4|\.mov|\.webm|\.avi|\.mkv|\.m4v)(\?|$)/.test(ke)?"🎬":"🖼️"},We=K=>{if(!K)return"Text";const ke=K.toLowerCase();return/(\.mp4|\.mov|\.webm|\.avi|\.mkv|\.m4v)(\?|$)/.test(ke)?"Video":"Image"},yt=K=>{var Re,dt,Et,xt;const Ze=((K==null?void 0:K.type)||((Re=K==null?void 0:K.content)==null?void 0:Re.type)||"").toString().toLowerCase();if(Ze==="video")return{emoji:"🎬",label:"Video"};if(Ze==="image"||Ze==="photo"||Ze==="picture")return{emoji:"🖼️",label:"Image"};if(Ze==="text"||Ze==="status")return{emoji:"📝",label:"Text"};const bt=((dt=K==null?void 0:K.content)==null?void 0:dt.media_url)||((Et=K==null?void 0:K.content)==null?void 0:Et.thumbnail_url)||((xt=K==null?void 0:K.content)==null?void 0:xt.permalink);return{emoji:je(bt),label:We(bt)}};b.useEffect(()=>{var ke,Ze;let K=null;d==="summary"&&((ke=z==null?void 0:z.ai)!=null&&ke.summary)?K=z.ai:d!=="summary"&&((Ze=$==null?void 0:$.ai)!=null&&Ze.summary)&&(K=$.ai),le.isSuccess||u(K)},[z,$,d,le.isSuccess]),b.useEffect(()=>{var ke,Ze;let K=null;d==="summary"&&((ke=z==null?void 0:z.currentBrand)!=null&&ke.id)?K=z.currentBrand.id:d!=="summary"&&((Ze=$==null?void 0:$.currentBrand)!=null&&Ze.id)&&(K=$.currentBrand.id),!m&&K&&(T.some(Re=>Re.id===K)?h(K):T.length>0)},[z,$,T,d,m,h]),b.useEffect(()=>{d!=="summary"&&d!=="all"&&j(d)},[d]);function gt(K){const ke=/^(\w+)_FOLLOWERS$/,Ze=/^(\w+)_SUBSCRIBERS$/,bt=K.match(ke),Re=K.match(Ze);if(bt){const dt=bt[1].toLowerCase(),xt={instagram:"Instagram",facebook:"Facebook",linkedin:"LinkedIn",tiktok:"TikTok",twitter:"Twitter"}[dt];if(xt)return n("analytics.metrics.dynamicFollowers",{platform:xt})}if(Re){const dt=Re[1].toLowerCase(),xt={youtube:"YouTube",linkedin:"LinkedIn"}[dt];if(xt)return n("analytics.metrics.dynamicSubscribers",{platform:xt})}return null}function qe(K){const ke=gt(K),bt={FOLLOWERS:"followers",TOTAL_FOLLOWERS:"followers",TOTAL_FOLLOWERS_COUNT:"followers",FOLLOWER_COUNT:"followers",ORGANIC_FOLLOWERS:"organicFollowers",PAID_FOLLOWERS:"paidFollowers",POSTS:"posts",TOTAL_POSTS:"posts",IMPRESSIONS:"impressions",TOTAL_IMPRESSIONS:"impressions",UNIQUE_IMPRESSIONS:"uniqueImpressions",UNIQUE_VIEWS:"uniqueViews",CLICKS:"clicks",PAGE_CLICKS:"pageClicks",REACTIONS:"reactions",COMMENTS:"comments",ENGAGEMENT:"totalEngagement",REPOSTS:"reposts",CTR:"ctr",ENGAGEMENT_RATE:"engagementRate",AVG_ENGAGEMENT_RATE:"engagementRate",PAGE_VIEWS:"pageViews",TOTAL_PAGE_VIEWS:"pageViews",UNIQUE_PAGE_VIEWS:"uniquePageViews",VIEWS:"views",LIKES:"like
3843s",DISLIKES:"dislikes",ESTIMATEDMINUTESWATCHED:"minutesWatched",AVERAGEVIEWDURATION:"averageViewDuration",TOTAL_ENGAGEMENT:"totalEngagement",NEW_FOLLOWERS:"newFollowers",FOLLOWERS_COUNT:"followers",ORGANIC_FOLLOWER_GAIN:"organicFollowers",PAID_FOLLOWER_GAIN:"paidFollowers",NEWSUBSCRIBERS:"newSubscribers",PROFILE_VIEWS:"profileViews",ACCOUNTS_ENGAGED:"accountsEngaged",SAVES:"saves",SHARES:"shares",WEBSITE_CLICKS:"websiteClicks",VIDEOSPOSTED:"videosPosted",VIDEOS_POSTED:"videosPosted",FOLLOWSANDUNFOLLOWS:"followsAndUnfollows",FOLLOWS_AND_UNFOLLOWS:"followsAndUnfollows",POSTS_PUBLISHED:"postsPublished",POSTSPUBLISHED:"postsPublished",MEDIA_COUNT:"mediaCount",REACH:"reach",FAN_ADDS:"fanAdds",FAN_REMOVES:"fanRemoves",IMPRESSIONS_PAID:"impressionsPaid",IMPRESSIONS_PAID_UNIQUE:"impressionsPaidUnique",IMPRESSIONS_UNIQUE:"impressionsUnique",IMPRESSIONS_VIRAL:"impressionsViral",IMPRESSIONS_VIRAL_UNIQUE:"impressionsViralUnique",POST_ENGAGEMENTS:"postEngagements",POSTS_IMPRESSIONS:"postImpressions",TOTAL_ACTIONS:"totalActions",LOSTSUBSCRIBERS:"lostSubscribers",SUBSCRIBERSGAIN:"subscribersGain",SUBSCRIBERSGAINED:"subscribersGained",SUBSCRIBERSLOST:"subscribersLost",CONNECTED_PLATFORMS:"connectedPlatforms"}[K]||K.replace(/_/g,"").toLowerCase();let Re=ke||n(`analytics.metrics.${bt}`,bt.replace(/([A-Z])/g," $1").replace(/^./,dt=>dt.toUpperCase()));switch(K==="NEW_FOLLOWERS"&&(Re=n("analytics.metrics.followerGrowth","Follower Growth")),K){case"FOLLOWERS":case"TOTAL_FOLLOWERS":case"FOLLOWER_COUNT":case"TOTAL_FOLLOWERS_COUNT":return{title:Re,icon:Jr,color:"bg-blue-500"};case"ORGANIC_FOLLOWERS":return{title:Re,icon:Jr,color:"bg-green-500"};case"PAID_FOLLOWERS":return{title:Re,icon:lL,color:"bg-purple-500"};case"POSTS":case"TOTAL_POSTS":return{title:Re,icon:da,color:"bg-orange-500"};case"IMPRESSIONS":case"TOTAL_IMPRESSIONS":return{title:Re,icon:xa,color:"bg-indigo-500"};case"UNIQUE_IMPRESSIONS":return{title:Re,icon:xa,color:"bg-cyan-500"};case"CLICKS":return{title:Re,icon:UN,color:"bg-emerald-500"};case"REACTIONS":return{title:Re,icon:R7,color:"bg-yellow-500"};case"COMMENTS":return{title:Re,icon:jf,color:"bg-amber-500"};case"ENGAGEMENT":return{title:Re,icon:co,color:"bg-green-600"};case"REPOSTS":return{title:Re,icon:nf,color:"bg-red-500"};case"CTR":return{title:Re,icon:Bf,color:"bg-pink-500"};case"ENGAGEMENT_RATE":case"AVG_ENGAGEMENT_RATE":return{title:Re,icon:Ck,color:"bg-rose-500"};case"PAGE_VIEWS":case"TOTAL_PAGE_VIEWS":return{title:Re,icon:da,color:"bg-slate-500"};case"UNIQUE_PAGE_VIEWS":return{title:Re,icon:Sk,color:"bg-gray-500"};case"UNIQUE_VIEWS":return{title:Re,icon:xa,color:"bg-cyan-500"};case"VIEWS":return{title:Re,icon:xa,color:"bg-indigo-500"};case"LIKES":return{title:Re,icon:co,color:"bg-green-500"};case"DISLIKES":return{title:Re,icon:rhe,color:"bg-red-500"};case"ESTIMATEDMINUTESWATCHED":return{title:Re,icon:Bf,color:"bg-purple-500"};case"AVERAGEVIEWDURATION":return{title:Re,icon:Bf,color:"bg-teal-500"};case"TOTAL_ENGAGEMENT":return{title:Re,icon:co,color:"bg-green-500"};case"FOLLOWERS_COUNT":return{title:Re,icon:Jr,color:"bg-blue-600"};case"ORGANIC_FOLLOWER_GAIN":return{title:Re,icon:Jr,color:"bg-green-600"};case"PAID_FOLLOWER_GAIN":return{title:Re,icon:lL,color:"bg-purple-600"};case"NEWSUBSCRIBERS":return{title:Re,icon:Jr,color:"bg-sky-500"};case"ACCOUNTS_ENGAGED":return{title:Re,icon:Jr,color:"bg-blue-400"};case"MEDIA_COUNT":return{title:Re,icon:da,color:"bg-orange-400"};case"POSTS_PUBLISHED":case"POSTSPUBLISHED":return{title:Re,icon:nhe,color:"bg-orange-500"};case"PROFILE_VIEWS":return{title:Re,icon:xa,color:"bg-cyan-400"};case"REACH":return{title:Re,icon:Bf,color:"bg-indigo-400"};case"SAVES":return{title:Re,icon:da,color:"bg-green-400"};case"SHARES":return{title:Re,icon:nf,color:"bg-purple-400"};case"WEBSITE_CLICKS":return{title:Re,icon:UN,color:"bg-pink-400"};case"VIDEOSPOSTED":case"VIDEOS_POSTED":return{title:Re,icon:da,color:"bg-orange-500"};case"FOLLOWSANDUNFOLLOWS":case"FOLLOWS_AND_UNFOLLOWS":return{title:Re,icon:Jr,color:"bg-sky-500"};case"FAN_ADDS":case"FAN_REMOVES":return{title:Re,icon:Jr,color:"bg-blue-500"};case"IMPRESSIONS_PAID":case"IMPRESSIONS_PAID_UNIQUE":case"IMPRESSIONS_UNIQUE":case"IMPRESSIONS_VIRAL":case"IMPRESSIONS_VIRAL_UNIQUE":return{title:Re,icon:xa,color:"bg-indigo-500"};case"POST_ENGAGEMENTS":return{title:Re,icon:co,color:"bg-green-500"};case"POSTS_IMPRESSIONS":return{title:Re,icon:xa,color:"bg-indigo-400"};case"TOTAL_ACTIONS":return{title:Re,icon:Bf,color:"bg-orange-500"};case"LOSTSUBSCRIBERS":return{title:Re,icon:Jr,color:"bg-red-500"};case"SUBSCRIBERSGAIN":return{title:Re,icon:Jr,color:"bg-green-500"};case"SUBSCRIBERSGAINED":return{title:Re,icon:Jr,color:"bg-green-500"};case"SUBSCRIBERSLOST":return{title:Re,icon:Jr,color:"bg-red-500"};case"CONNECTED_PLATFORMS":return{title:Re,icon:da,color:"bg-teal-500"};case"PAGE_CLICKS":return{title:Re,icon:UN,color:"bg-emerald-500"};case"NEW_FOLLOWERS":return{title:Re,icon:Jr,color:"bg-sky-600"};case"INSTAGRAM_FOLLOWERS":case"FACEBOOK_FOLLOWERS":case"LINKEDIN_FOLLOWERS":case"TIKTOK_FOLLOWERS":case"TWITTER_FOLLOWERS":return{title:Re,icon:Jr,color:"bg-pink-600"};case"YOUTUBE_SUBSCRIBERS":return{title:Re,icon:Jr,color:"bg-red-700"};default:return console.warn("Unknown metric type for display:",K),{title:Re,icon:Bf,color:"bg-gray-500"}}}function ze(K){const ke=qe(K);return(ke==null?void 0:ke.title)||K.replace(/_/g," ").toLowerCase().replace(/^.|\s\w/g,Ze=>Ze.toUpperCase())}const $e=K=>{if(typeof K=="number")return K;if(K==="∞"||K==="Infinity")return 1/0;if(K==="-∞"||K==="-Infinity")return-1/0;const ke=parseFloat(K);return isNaN(ke)?0:ke},ct=()=>{const K=z==null?void 0:z.keyMetrics;if(!K||!Array.isArray(K)||K.length===0)return console.warn("Analytics summary data (analyticsSummary.keyMetrics) not available or empty. Using fallback mock data."),LHe.map(dt=>{var Et;return{...dt,rawValueChange:((Et=dt.change)==null?void 0:Et.toString())??"0"}});const ke=K,Ze=dt=>ke.find(Et=>Et.type===dt),bt=[];return[{type:"TOTAL_FOLLOWERS_COUNT",i18nKey:"analytics.metrics.totalFollowersCount",defaultTitle:"Total Followers",icon:Jr,color:"bg-blue-500",oldMockTitle:"Total Followers"},{type:"VIEWS",i18nKey:"analytics.metrics.views",defaultTitle:"Total Views",icon:xa,color:"bg-indigo-500",oldMockTitle:"Total Impressions"},{type:"ENGAGEMENT_RATE",i18nKey:"analytics.metrics.engagementRate",defaultTitle:"Engagement Rate",icon:Ck,color:"bg-rose-500",oldMockTitle:"Avg. Engagement Rate"}
3843].forEach(dt=>{var xt;const Et=Ze(dt.type);Et?bt.push({title:n(dt.i18nKey,dt.defaultTitle),value:Et.total,previousValue:Et.previousTotal,change:$e(Et.variationsPercentage),icon:dt.icon,color:dt.color,rawValueChange:(xt=Et.variationsPercentage)==null?void 0:xt.toString(),isPercentage:dt.type==="ENGAGEMENT_RATE",description:Et.description}):console.warn(`Metric type "${dt.type}" not found in summary keyMetrics. Card will not be displayed.`)}),bt},oe=K=>{f(K)},Ne=K=>{h(K)},Ae=K=>{g(K)},lt=K=>{v(K),g("custom")},jt=(()=>{var dt;const K=n("analytics.ai.noData","AI analysis is not available for this period."),ke=n("analytics.ai.noStrengths","No specific strengths identified yet."),Ze=n("analytics.ai.noImprovements","No specific weaknesses identified yet.");if((dt=z==null?void 0:z.ai)!=null&&dt.error&&!le.isPending&&!c)return{summary:n("analytics.ai.errorAnalysis","AI analysis encountered an error. You can try generating it again."),strengths:[ke],weaknesses:[Ze],showRequestButton:!0};if(!c&&!le.isPending)return{summary:n("analytics.ai.requestPrompt","Click to generate AI analysis."),strengths:[ke],weaknesses:[Ze],showRequestButton:!0};if(!c)return{summary:K,strengths:[ke],weaknesses:[Ze],showRequestButton:!1};const bt=c.strenghts&&c.strenghts.length>0?c.strenghts:[ke],Re=c.weaknesses&&c.weaknesses.length>0?c.weaknesses:[Ze];return{summary:c.summary||K,strengths:bt,weaknesses:Re,showRequestButton:!1}})(),Xe=z==null?void 0:z.aggregatedDailyMetrics,Bt=b.useMemo(()=>!Array.isArray(Xe)||Xe.length===0?[]:Array.from(Xe.reduce((K,ke)=>(Object.keys((ke==null?void 0:ke.metrics)||{}).forEach(Ze=>K.add(Ze)),K),new Set)),[Xe]),ve=b.useMemo(()=>{if(!Array.isArray(Xe)||Xe.length===0)return[];const K=new Set;return Xe.forEach(Ze=>{Object.keys((Ze==null?void 0:Ze.metrics)||{}).forEach(bt=>K.add(bt))}),Array.from(K).filter(Ze=>(Xe||[]).some(bt=>{var xt;const Re=(xt=bt==null?void 0:bt.metrics)==null?void 0:xt[Ze];if(!Re)return!1;if(Number(Re.total??0)>0)return!0;const Et=Re.platforms||{};return Object.values(Et).some(qt=>Number(qt??0)>0)}))},[Xe]),[Fe,nt]=b.useState(()=>{const K=ve.length>0?ve:Bt;return K.includes("VIEWS")?"VIEWS":K[0]||""});b.useEffect(()=>{const K=ve.length>0?ve:Bt;if(K.length===0){nt("");return}K.includes(Fe)||nt(K.includes("VIEWS")?"VIEWS":K[0])},[Bt,ve]);const[At,Wt]=b.useState(!1),In=()=>{const K=d==="summary"?z:$,ke=_();if(!K){console.error("Source data is not available for AI analysis."),c||u(null);return}let Ze=[];if(d==="summary"){if(!z||!z.keyMetrics){console.error("Summary keyMetrics data is not available for AI analysis."),c||u(null);return}Ze=z.keyMetrics.map(Et=>{var xt;return{type:Et.type,total:Et.total,previousTotal:Et.previousTotal,variationsPercentage:((xt=Et.variationsPercentage)==null?void 0:xt.toString())||"0"}})}else if($){const Et=$;if(!Et.keyMetrics&&!Et.secondaryMetrics){console.error("Platform metrics data (keyMetrics or secondaryMetrics) is not available for AI analysis.");return}Ze=(Et.keyMetrics||[]).concat(Et.secondaryMetrics||[]).map(xt=>({type:xt.type,total:xt.total,previousTotal:xt.previousTotal,variationsPercentage:xt.variationsPercentage}))}else{console.error("No data source available for AI analysis.");return}if(!Ze||Ze.length===0){console.error("No valid metrics found for AI analysis.");return}const bt={start:new Date(ke.start).getTime(),end:new Date(ke.end).getTime()},dt=JSON.stringify({payload:{metrics:Ze,debug:{currentTimeframe:bt}}});le.mutate({appLanguage:a.language||"en",platform:d==="summary"?void 0:d,data:dt},{onSuccess:Et=>{console.log("On-demand AI Analysis successful:",Et),u(Et.analysis)},onError:Et=>{console.error("On-demand AI Analysis error:",Et),alert(n("analytics.ai.errorOnDemand","Failed to get AI analysis. Please try again.")),u(null)}})},ir=d==="summary"&&D||d!=="summary"&&H||k||N,Qt=le.isPending,Sn=d==="summary"&&A||d!=="summary"&&X&&E,nn=d==="summary"?P==null?void 0:P.message:ue==null?void 0:ue.message;return s.jsxs(rs,{title:n("analytics.title"),subtitle:n("analytics.subtitle"),actions:s.jsxs("div",{className:"w-full flex flex-col items-start sm:items-end gap-3",children:[s.jsx("button",{onClick:In,disabled:Qt,className:"inline-flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors disabled:bg-indigo-400",children:Qt?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"}),n("analytics.ai.analyzing","Analyzing...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Eu,{className:"w-5 h-5 mr-2"}),n("analytics.ai.analyzeButton","Analyze Now")]})}),s.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end",children:[s.jsx(hl,{brands:T||[],selectedBrandId:m||"",onBrandSelect:Ne,showRedirectionCard:!1,isLoading:N}),s.jsx(nV,{dateRange:p,customDateRange:y,onDateRangeChange:Ae,onCustomDateRangeChange:lt,baseDate:new Date,fullWidth:!1})]})]}),children:[s.jsx("div",{className:"mb-6",children:s.jsx(aV,{activeTab:d,onTabChange:oe,showSummary:!0})}),!k&&!L?s.jsx("div",{className:"mb-8",children:s.jsx(P0,{message:n("analytics.connectAccountFirst","Connect a social media account to view anal
3843ytics"),isLoading:k})}):d!=="summary"&&!E?s.jsx("div",{className:"mb-8",children:s.jsx(P0,{message:n("analytics.connectAccountForPlatform",{platform:((Lt=vv.find(K=>K.id===d))==null?void 0:Lt.name)||d}),isLoading:k||H})}):R?s.jsx("div",{className:"mb-8 flex justify-center",children:s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white p-6 w-[95%] sm:w-full sm:max-w-[60%]",children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:n("analytics.selectBrand.title","Choose a brand")}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:n("analytics.selectBrand.subtitle","Select a brand to view analytics. This avoids unnecessary data fetching.")}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 md:grid-cols-3 gap-3",children:T.map(K=>s.jsxs("button",{type:"button",onClick:()=>Ne(K.id),className:"flex flex-col items-center gap-2 p-4 border border-black rounded-lg hover:bg-gray-50 text-center",children:[K.logo?s.jsx("img",{src:K.logo,alt:K.name,className:"w-12 h-12 rounded object-cover"}):s.jsx("div",{className:"w-12 h-12 rounded bg-gray-200"}),s.jsx("span",{className:"text-sm font-medium",children:K.name})]},K.id))})]})}):ir?s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"lg:col-span-3 rounded-xl border border-black shadow-lg bg-white overflow-hidden animate-pulse",children:[s.jsx("div",{className:"p-6 border-b border-gray-200 bg-gray-100",children:s.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/3"})}),s.jsx("div",{className:"p-4",children:s.jsx("div",{className:"h-64 bg-gray-100 rounded"})})]}),s.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((K,ke)=>s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white p-4 animate-pulse",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("div",{className:"h-8 w-8 bg-gray-200 rounded"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/3"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/3"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/4"})]})]},`metric-skel-${ke}`))})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/4"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:Array(4).fill(0).map((K,ke)=>s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg bg-white animate-pulse",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("div",{className:"h-8 w-8 bg-gray-200 rounded"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/4"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/2"}),s.jsx("div",{className:"h-6 bg-gray-200 rounded w-2/3"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-1/3"})]})]},`more-skel-${ke}`))}),s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-8 w-56 bg-gray-100 border border-gray-200 rounded-full animate-pulse"})})]}),s.jsxs("div",{className:"space-y-4 pb-8",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/3"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:Array(3).fill(0).map((K,ke)=>s.jsxs("div",{className:"flex gap-3 p-3 border border-black rounded-lg bg-white shadow animate-pulse",children:[s.jsx("div",{className:"w-20 h-20 bg-gray-200 rounded-md"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-3/4"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/3"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("div",{className:"h-5 w-12 bg-gray-100 border border-gray-200 rounded-full"}),s.jsx("div",{className:"h-5 w-16 bg-gray-100 border border-gray-200 rounded-full"}),s.jsx("div",{className:"h-5 w-14 bg-gray-100 border border-gray-200 rounded-full"})]})]})]},`toppost-skel-${ke}`))})]})]}):Sn?s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-8",children:[s.jsx("h3",{className:"text-red-800 font-medium",children:"Error loading analytics data"}),s.jsx("p",{className:"text-red-600 text-sm mt-1",children:nn||"An unknown error occurred"})]}):s.jsxs(s.Fragment,{children:[!jt.showRequestButton&&!Qt&&jt.summary&&s.jsxs("div",{className:"mb-8 rounded-xl border border-black shadow-lg bg-white overflow-hidden",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",style:{backgroundColor:"#F2F0FD"},children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Hn,{className:"w-6 h-6 text-indigo-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900 font-title",children:d==="summary"?n("analytics.ai.title","AI Performance Analysis"):s.jsxs("div",{className:"flex items-center",children:[s.jsx(cr,{platform:x,size:20,className:"mr-2"}),n("analytics.ai.platformAnalysisTitle",`${((_e=vv.find(K=>K.id===d))==null?void 0:_e.name)||"Platform"} Analysis`,{platform:((et=vv.find(K=>K.id===d))==null?void 0:et.name)||"Platform"})]})})]})}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-indigo-900 mb-3",children:n("analytics.ai.summary","Summary")}
3843),s.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:jt.summary})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"flex-1 border-2 border-green-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-green-600 mb-2 flex items-center whitespace-nowrap",children:[s.jsx("div",{className:"w-1 h-4 bg-green-500 mr-2 rounded-full"}),n("analytics.ai.strengths","Points Forts")]}),jt.strengths.length>0?s.jsx("ul",{className:"list-disc list-inside text-gray-700 space-y-1",children:jt.strengths.map((K,ke)=>s.jsx("li",{children:K},ke))}):s.jsx("p",{className:"text-gray-700",children:n("analytics.ai.noStrengths","No specific strengths identified yet.")})]}),s.jsxs("div",{className:"flex-1 border-2 border-orange-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-orange-600 mb-2 flex items-center whitespace-nowrap",children:[s.jsx("div",{className:"w-1 h-4 bg-orange-500 mr-2 rounded-full"}),n("analytics.ai.improvements","Axes d'Amélioration")]}),jt.weaknesses.length>0?s.jsx("ul",{className:"list-disc list-inside text-gray-700 space-y-1",children:jt.weaknesses.map((K,ke)=>s.jsx("li",{children:K},ke))}):s.jsx("p",{className:"text-gray-700",children:n("analytics.ai.noImprovements","No specific areas for improvement identified yet.")})]})]})]})})]}),s.jsxs("div",{className:"mb-8 grid grid-cols-1 lg:grid-cols-4 gap-4",children:[s.jsx("div",{className:"lg:col-span-3",children:d==="summary"?(()=>{var Gr,la,$n,Rt,rr;const K=ve.length>0?ve:Bt,ke=K.slice().sort((se,Be)=>ze(se).localeCompare(ze(Be))),Ze=Fe&&K.includes(Fe)?Fe:ke[0]||"VIEWS",bt=Array.from((Xe||[]).reduce((se,Be)=>{var Ke;const at=(Ke=Be==null?void 0:Be.metrics)==null?void 0:Ke[Ze];return at&&at.platforms&&Object.keys(at.platforms).forEach(ee=>se.add(ee)),se},new Set)),Re=(Xe||[]).map(se=>{var Ke,ee;const Be={},at=(Ke=se==null?void 0:se.metrics)==null?void 0:Ke[Ze];for(const de of bt)Be[de]=Number(((ee=at==null?void 0:at.platforms)==null?void 0:ee[de])??0);return{date:se.date,values:Be}}),dt={tiktok:"#000000",youtube:"#ff0132",facebook:"#0765ff",instagram:"#9a1855",linkedin:"#0270ae"},Et=(Gr=a.language)!=null&&Gr.startsWith("fr")?of:(la=a.language)!=null&&la.startsWith("de")?CD:($n=a.language)!=null&&$n.startsWith("it")?MD:(Rt=a.language)!=null&&Rt.startsWith("es")?A0:(rr=a.language)!=null&&rr.startsWith("pt")?ID:uc,xt=qe(Ze);return Array.isArray(Xe)&&Xe.length>0&&bt.length>0?s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white overflow-hidden h-full",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",style:{backgroundColor:"#F2F0FD"},children:s.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900 font-title",children:n("analytics.timeSeries.summaryTitle","Daily evolution by platform")}),s.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[s.jsxs("div",{className:"inline-flex border border-black rounded-lg overflow-hidden",children:[s.jsx("button",{type:"button",onClick:()=>t("daily"),className:`px-3 py-1 text-xs ${e==="daily"?"bg-black text-white":"bg-white text-gray-700"}`,children:n("analytics.timeSeries.daily","Daily")}),s.jsx("button",{type:"button",onClick:()=>t("weekly"),className:`px-3 py-1 text-xs border-l border-black ${e==="weekly"?"bg-black text-white":"bg-white text-gray-700"}`,children:n("analytics.timeSeries.weekly","Weekly")})]}),ke.length>0&&s.jsxs("div",{className:"relative min-w-60",children:[s.jsxs("button",{type:"button",onClick:()=>Wt(!At),className:"w-full flex items-center justify-between gap-2 px-4 py-2 rounded-lg hover:text-primary-600 transition-colors bg-white border-[0.5px] border-black",children:[s.jsx("span",{className:"text-sm text-gray-700 truncate",children:ze(Ze)}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500 flex-shrink-0"})]}),At&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>Wt(!1)}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 w-full rounded-lg bg-white shadow-lg z-20 border-[0.5px] border-black",children:s.jsx("div",{className:"py-1 max-h-[28rem] overflow-y-auto",children:ke.map(se=>s.jsx("button",{type:"button",onClick:()=>{nt(se),Wt(!1)},className:`w-full flex items-center gap-2 px-4 py-2 text-sm ${se===Ze?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsx("span",{className:"truncate",children:ze(se)})},`summary-${se}`))})})]})]})]})]})}),s.jsx("div",{className:"p-4",children:s.jsx(C5,{data:e==="weekly"?r(Re):Re,metricKey:Ze,multiSeries:bt.reduce((se,Be)=>(se[Be]=[Ze],se),{}),platformColors:dt,showLegend:!0,currentLegend:xt==null?void 0:xt.title,dateLocale:Et})})]}):null})():s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white overflow-hidden h-full",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",style:{backgroundColor:"#F2F0FD"},children:s.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(cr,{platform:x,size:20,className:"mr-1"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900 font-title",children:n("analytics.timeSeries.title","Daily evolution")})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[s.jsxs("div",{className:"inline-flex border border-black rounded-lg overflow-hidden",children:[s.jsx("button",{type:"button",onClick:()=>t("daily"),className:`px-3 py-1 text-xs ${e==="daily"?"bg-black text-white":"bg-white text-gray-700"}`,children:n("analytics.timeSeries.daily","Daily")}),s.jsx("button",{type:"button",onClick:()=>t("weekly"),className:`px-3 py-1 text-xs border-l border-black ${e==="weekly"?"bg-black text-white":"bg-white text-gray-700"}`,children:n("analytics.timeSeries.weekly","Weekly")})]}),me.length>0&&s.jsxs("div",{className:"relative min-w-60",children:[s.jsxs("button",{type:"button",onClick:()=>Q(!G),className:"w-full flex items-center justify-between gap-2 px-4 py-2 rounded-lg hover:text-primary-600 transition-colors bg-white border-[0.5px] border-black",children:[s.jsx("span",{className:"text-sm text-gray-700 truncate",children:ze(he)}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500 flex-shrink-0"})]}),G&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>Q(!1)}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 w-full rounded-lg bg-white shadow-lg z-20 border-[0.5px] border-black",children:s.jsx("div",{className:"py-1 max-h-[28rem] overflow-y-auto",children:me.map(K=>s.jsx("button",{type:"button",onClick:()=>{te(K),Q(!1)},className:`w-full flex items-center gap-2 px-4 py-2 text-sm ${K===he?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsx("span",{className:"truncate",children:ze(K)})},K))})})]})]})]})]})}),s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"relative",children:[s.jsx(C5,{data:Array.isArray(W)?e==="weekly"?r(W):W:[],previousData:Array.isArray(Y)?e==="weekly"?r(Y):Y:void 0,metricKey:he,color:"#6366f1",previousColor:"#a5b4fc",dimmed:Array.isArray(W)?ie:!0,overlayText:n("analytics.noActivity","No activity for this period"),showLegend:!0,currentLegend:`${n("analytics.timeSeries.current","Current period")} · ${(()=>{try{const K=new Date(B.start),ke=new Date(B.end),Ze=bt=>`${String(bt.getDate()).padStart(2,"0")}/${String(bt.getMonth()+1).padStart(2,"0")}/${bt.getFullYear()}`;return`${Ze(K)} - ${Ze(ke)}`}catch{return""}})()}`,previousLegend:q?`${n("analytics.timeSeries.previous","Previous period")} · ${q}`:void 0,currentTooltipLabel:n("analytics.timeSeries.currentShort","Current"),previousTooltipLabel:n("analytics.timeSeries.previousShort","Previous"),dateLocale:(ft=a.language)!=null&&ft.startsWith("fr")?of:(pt=a.language)!=null&&pt.startsWith("de")?CD:($t=a.language)!=null&&$t.startsWith("it")?MD:(Pt=a.language)!=null&&Pt.startsWith("es")?A0:(Ft=a.language)!=null&&Ft.startsWith("pt")?ID:uc}),(!Array.isArray(W)||ie)&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:s.jsx("div",{className:"bg-white/70 text-gray-700 px-4 py-2 rounded-lg border border-gray-300 text-sm",children:n("analytics.noActivity","No activity for this period")})})]})})]})}),s.jsx("div",{className:"space-y-4",children:(d==="summary"?ct():(($==null?void 0:$.keyMetrics)||[]).map(K=>{var dt;
3843const ke=qe(K.type),Ze=$e(K.variationsPercentage),bt=K.type==="AVERAGEVIEWDURATION"?ye("AVERAGEVIEWDURATION"):K.total,Re=["FOLLOWERS_COUNT","TOTAL_FOLLOWERS_COUNT","FOLLOWERS","TOTAL_FOLLOWERS","FOLLOWER_COUNT","INSTAGRAM_FOLLOWERS","FACEBOOK_FOLLOWERS","LINKEDIN_FOLLOWERS"].includes(K.type);return{title:ke.title,value:bt,previousValue:K.previousTotal,change:Ze,icon:ke.icon,color:ke.color,rawValueChange:(dt=K.variationsPercentage)==null?void 0:dt.toString(),isPercentage:["ENGAGEMENT_RATE","AVG_ENGAGEMENT_RATE","CTR"].includes(K.type),description:K.description,hideChange:Re,hidePrevious:Re}})).map((K,ke)=>s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`${K.color} bg-opacity-10 p-2 rounded-lg`,children:s.jsx(K.icon,{className:`w-5 h-5 ${K.color.replace("bg-","text-")}`})}),!K.hideChange&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:`text-xs font-medium ${K.change>0?"text-green-600":K.change===0?"text-gray-600":K.change<0?"text-red-600":"text-gray-600"}`,children:isFinite(K.change)?`${K.change>0?"+":""}${K.change.toFixed(1)}%`:K.rawValueChange||(K.change>0?"∞":K.change<0?"-∞":n("common.notAvailable","N/A"))}),isFinite(K.change)&&K.change!==0?K.change>0?s.jsx(Io,{size:12,className:"text-green-600"}):s.jsx(Mo,{size:12,className:"text-red-600"}):K.rawValueChange==="∞"||K.change===1/0?s.jsx(Io,{size:12,className:"text-green-600"}):K.rawValueChange==="-∞"||K.change===-1/0?s.jsx(Mo,{size:12,className:"text-red-600"}):(K.rawValueChange==="0"&&K.change===0||K.rawValueChange||K.change!==0,null)]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("h3",{className:"text-base font-semibold text-gray-500 font-body flex items-center gap-1",children:[s.jsx("span",{children:K.title}),K.description?s.jsx(sm,{message:K.description,position:"top"}):null]}),s.jsx("p",{className:"mt-1 text-2xl font-semibold text-gray-900 font-title",children:K.isPercentage?`${K.value.toFixed(2)}%`:K.title&&(K.title.includes("Rate")||K.title.includes("CTR")||K.title.includes("Avg. View Duration"))?`${K.value.toFixed(2)}${K.title.includes("Rate")||K.title.includes("CTR")?"%":""}`:K.value.toLocaleString()}),!K.hidePrevious&&s.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:[n("common.previous"),": ",typeof K.previousValue=="number"?K.previousValue.toLocaleString():n("common.notAvailable","N/A")]})]})]},ke))})]}),(d==="summary"&&(z==null?void 0:z.secondaryMetrics)&&z.secondaryMetrics.length>0||d!=="summary"&&($==null?void 0:$.secondaryMetrics)&&$.secondaryMetrics.length>0)&&s.jsxs("div",{className:"space-y-6 pb-8",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:d==="summary"?n("analytics.specificPlatformsMetricsTitle","Specific Platforms Metrics"):s.jsxs("div",{className:"flex items-center",children:[s.jsx(cr,{platform:x,size:20,className:"mr-2"}),n("analytics.moreMetricsTitle","More {{platform}} Metrics",{platform:((Dr=vv.find(K=>K.id===d))==null?void 0:Dr.name)||"Platform"})]})})}),d==="youtube"&&s.jsx("p",{className:"-mt-4 text-sm text-gray-500",children:n("analytics.youtubeIngestionLag","Certaines données peuvent prendre jusqu'à 48h pour nous être envoyées par YouTube.")}),(()=>{const K=d==="summary",ke=K?z.secondaryMetrics||[]:$.secondaryMetrics||[];if(!K){const Rt=[...ke],rr=new Set,se=Rt.filter(Ke=>{const de=qe(Ke.type).title||Ke.type,Se=Ke.platform||"",Ue=`${de}::${Se}`;return rr.has(Ue)?!1:(rr.add(Ue),!0)}),Be=se.slice(0,Ee),at=Math.max(se.length-Ee,0);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:Be.map((Ke,ee)=>{var Nr;const de=qe(Ke.type),Se=$e(Ke.variationsPercentage),Ue=de.color,Pe=de.icon,tt=de.title,kt=Ke.previousTotal,or=(Nr=Ke.variationsPercentage)==null?void 0:Nr.toString();return s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`${Ue} bg-opacity-10 p-2 rounded-lg`,children:"platform"in Ke&&Ke.platform?s.jsx(cr,{platform:Ke.platform,size:20}):s.jsx(Pe,{className:`w-5 h-5 ${Ue.replace("bg-","text-")}`})}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:`text-xs font-medium ${Se>0?"text-green-600":Se===0?"text-gray-600":Se<0?"text-red-600":"text-gray-600"}`,children:isFinite(Se)?`${Se>0?"+":""}${Se.toFixed(1)}%`:or||(Se>0?"∞":Se<0?"-∞":n("common.notAvailable","N/A"))}),isFinite(Se)&&Se!==0?Se>0?s.jsx(Io,{size:12,className:"text-green-600"}):s.jsx(Mo,{size:12,className:"text-red-600"}):or==="∞"||Se===1/0?s.jsx(Io,{size:12,className:"text-green-600"}):or==="-∞"||Se===-1/0?s.jsx(Mo,{size:12,className:"text-red-600"}):null]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("h3",{className:"text-base font-semibold text-gray-500 font-body flex items-center gap-1",children:[s.jsx("span",{children:tt}),Ke.description?s.jsx(sm,{message:Ke.description,position:"top"}):null]}),s.jsx("p",{className:"mt-1 text-2xl font-semibold text-gray-900 font-title",children:tt&&(tt.includes("Rate")||tt.includes("CTR")||tt.includes("Avg. View Duration"))?`${(Ke.type==="AVERAGEVIEWDURATION"?ye("AVERAGEVIEWDURATION"):Ke.total).toFixed(2)}${tt.includes("Rate")||tt.includes("CTR")?"%":""}`:Ke.type==="AVERAGEVIEWDURATION"?Math.round(ye("AVERAGEVIEWDURATION")).toLocaleStr
3843ing():Ke.total.toLocaleString()}),s.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:[n("common.previous"),": ",typeof kt=="number"?kt.toLocaleString():n("common.notAvailable","N/A")]})]})]},`${Ke.type}-${ee}`)})}),at>0&&s.jsx("div",{className:`overflow-hidden transition-all duration-500 ease-in-out ${pe?"max-h-[4000px] opacity-100":"max-h-0 opacity-0"}`,children:s.jsx("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:se.slice(Ee).map((Ke,ee)=>{var Fr;const de=qe(Ke.type),Se=$e(Ke.variationsPercentage),Ue=de.color,Pe=de.icon,tt=de.title,kt=Ke.previousTotal,or=(Fr=Ke.variationsPercentage)==null?void 0:Fr.toString(),Nr=Ke.type==="AVERAGEVIEWDURATION"?ye("AVERAGEVIEWDURATION"):Ke.total;return s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`${Ue} bg-opacity-10 p-2 rounded-lg`,children:"platform"in Ke&&Ke.platform?s.jsx(cr,{platform:Ke.platform,size:20}):s.jsx(Pe,{className:`w-5 h-5 ${Ue.replace("bg-","text-")}`})}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:`text-xs font-medium ${Se>0?"text-green-600":Se===0?"text-gray-600":Se<0?"text-red-600":"text-gray-600"}`,children:isFinite(Se)?`${Se>0?"+":""}${Se.toFixed(1)}%`:or||(Se>0?"∞":Se<0?"-∞":n("common.notAvailable","N/A"))}),isFinite(Se)&&Se!==0?Se>0?s.jsx(Io,{size:12,className:"text-green-600"}):s.jsx(Mo,{size:12,className:"text-red-600"}):or==="∞"||Se===1/0?s.jsx(Io,{size:12,className:"text-green-600"}):or==="-∞"||Se===-1/0?s.jsx(Mo,{size:12,className:"text-red-600"}):null]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("h3",{className:"text-base font-semibold text-gray-500 font-body flex items-center gap-1",children:[s.jsx("span",{children:tt}),Ke.description?s.jsx(sm,{message:Ke.description,position:"top"}):null]}),s.jsx("p",{className:"mt-1 text-2xl font-semibold text-gray-900 font-title",children:tt&&(tt.includes("Rate")||tt.includes("CTR")||tt.includes("Avg. View Duration"))?`${Nr.toFixed(2)}${tt.includes("Rate")||tt.includes("CTR")?"%":""}`:Ke.type==="AVERAGEVIEWDURATION"?Math.round(Nr).toLocaleString():Nr.toLocaleString()}),s.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:[n("common.previous"),": ",typeof kt=="number"?kt.toLocaleString():n("common.notAvailable","N/A")]})]})]},`${Ke.type}-more-${ee}`)})})}),at>0&&s.jsx("div",{className:"mt-4 flex justify-center",children:s.jsxs("button",{type:"button",onClick:()=>ce(!pe),className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-primary-600 text-primary-700 rounded-full shadow-sm hover:bg-primary-50 transition-colors",children:[s.jsx("span",{className:"text-sm font-medium",children:pe?n("analytics.secondaryMetrics.hide","Hide additional metrics"):n("analytics.secondaryMetrics.seeMore","See the {{count}} other metrics",{count:at})}),s.jsx(Vr,{className:`w-4 h-4 transition-transform ${pe?"rotate-180":""}`})]})})]})}const Ze=Rt=>/_FOLLOWERS$/.test(Rt)||/SUBSCRIBERS$/.test(Rt),bt=Rt=>Rt==="TOTAL_POSTS"||Rt==="POSTS",Re=Rt=>{const rr=new Set;return Rt.filter(se=>{const at=qe(se.type).title||se.type,Ke=se.platform||"",ee=`${at}::${Ke}`;return rr.has(ee)?!1:(rr.add(ee),!0)})},dt=Re(ke.filter(Rt=>Ze(Rt.type))),Et=Re(ke.filter(Rt=>bt(Rt.type))),xt=ke.filter(Rt=>!Ze(Rt.type)&&!bt(Rt.type)),qt=Re(xt),Gr=(Rt,rr,se="")=>{var tt;const Be=qe(Rt.type),at=$e(Rt.variationsPercentage),Ke=Be.color,ee=Be.icon,de=Be.title,Se=Rt.previousTotal,Ue=(tt=Rt.variationsPercentage)==null?void 0:tt.toString(),Pe=Rt.type==="AVERAGEVIEWDURATION"?ye("AVERAGEVIEWDURATION"):Rt.total;return s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`${Ke} bg-opacity-10 p-2 rounded-lg`,children:"platform"in Rt&&Rt.platform?s.jsx(cr,{platform:Rt.platform,size:20}):s.jsx(ee,{className:`w-5 h-5 ${Ke.replace("bg-","text-")}`})}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:`text-xs font-medium ${at>0?"text-green-600":at===0?"text-gray-600":at<0?"text-red-600":"text-gray-600"}`,children:isFinite(at)?`${at>0?"+":""}${at.toFixed(1)}%`:Ue||(at>0?"∞":at<0?"-∞":n("common.notAvailable","N/A"))}),isFinite(at)&&at!==0?at>0?s.jsx(Io,{size:12,className:"text-green-600"}):s.jsx(Mo,{size:12,className:"text-red-600"}):Ue==="∞"||at===1/0?s.jsx(Io,{size:12,className:"text-green-600"}
3843):Ue==="-∞"||at===-1/0?s.jsx(Mo,{size:12,className:"text-red-600"}):null]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("h3",{className:"text-base font-semibold text-gray-500 font-body flex items-center gap-1",children:[s.jsx("span",{children:de}),Rt.description?s.jsx(sm,{message:Rt.description,position:"top"}):null]}),s.jsx("p",{className:"mt-1 text-2xl font-semibold text-gray-900 font-title",children:de&&(de.includes("Rate")||de.includes("CTR")||de.includes("Avg. View Duration"))?`${Pe.toFixed(2)}${de.includes("Rate")||de.includes("CTR")?"%":""}`:Rt.type==="AVERAGEVIEWDURATION"?Math.round(Pe).toLocaleString():Pe.toLocaleString()}),s.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:[n("common.previous"),": ",typeof Se=="number"?Se.toLocaleString():n("common.notAvailable","N/A")]})]})]},`${Rt.type}-${se}-${rr}`)},la=qt.slice(0,Ee),$n=Math.max(qt.length-Ee,0);return s.jsxs(s.Fragment,{children:[dt.length>0&&s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:dt.map((Rt,rr)=>Gr(Rt,rr,"followers"))}),Et.length>0&&s.jsx("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:Et.map((Rt,rr)=>Gr(Rt,rr,"posts"))}),la.length>0&&s.jsx("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:la.map((Rt,rr)=>Gr(Rt,rr,"others"))}),$n>0&&s.jsx("div",{className:`overflow-hidden transition-all duration-500 ease-in-out ${pe?"max-h-[4000px] opacity-100":"max-h-0 opacity-0"}`,children:s.jsx("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:qt.slice(Ee).map((Rt,rr)=>Gr(Rt,rr,"others-more"))})}),$n>0&&s.jsx("div",{className:"mt-4 flex justify-center",children:s.jsxs("button",{type:"button",onClick:()=>ce(!pe),className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-primary-600 text-primary-700 rounded-full shadow-sm hover:bg-primary-50 transition-colors",children:[s.jsx("span",{className:"text-sm font-medium",children:pe?n("analytics.secondaryMetrics.hide","Hide additional metrics"):n("analytics.secondaryMetrics.seeMore","See the {{count}} other metrics",{count:$n})}),s.jsx(Vr,{className:`w-4 h-4 transition-transform ${pe?"rotate-180":""}`})]})})]})})()]}),Array.isArray(fe)&&s.jsxs("div",{className:"space-y-4 pb-8 mt-6",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:s.jsxs("div",{className:"flex items-center",children:[d!=="summary"&&s.jsx(cr,{platform:x,size:20,className:"mr-2"}),n("analytics.topPosts.title","🏆 Your top posts from the last 30 days")]})})}),fe.length===0?s.jsx("div",{className:"text-sm text-gray-500 border border-gray-200 rounded-lg p-4 bg-white",children:n("analytics.topPosts.none","No posts have been published during this period")}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:fe.map((K,ke)=>{var se,Be,at,Ke;const Ze=((se=K==null?void 0:K.content)==null?void 0:se.thumbnail_url)||((Be=K==null?void 0:K.content)==null?void 0:Be.media_url)||"",bt=((at=K==null?void 0:K.content)==null?void 0:at.text)||"",Re=bt.length>110?`${bt.slice(0,110)}…`:bt,dt=K!=null&&K.created_at?new Date(K.created_at):null,Et=dt&&!isNaN(dt.getTime())?sr(dt,"MMM d, yyyy"):"",xt=(Ke=K==null?void 0:K.content)==null?void 0:Ke.permalink,qt=(K==null?void 0:K.metrics)||{},Gr=(K==null?void 0:K.platform)||(d!=="summary"?x:void 0),la=Gr?{facebook:"Facebook",instagram:"Instagram",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",twitter:"Twitter",pinterest:"Pinterest","google-business":"Google Business"}[Gr]||Gr.charAt(0).toUpperCase()+Gr.slice(1):"",{emoji:$n,label:Rt}=yt(K),rr=ke===0?"🥇":ke===1?"🥈":ke===2?"🥉":"";return s.jsxs("div",{className:"flex gap-3 p-3 border border-black rounded-lg bg-white",children:[s.jsxs("div",{className:"relative w-20 h-20 flex-shrink-0",children:[s.jsx("div",{className:"w-full h-full border border-black overflow-hidden rounded-md bg-gray-50",children:Ze?s.jsx("img",{src:Ze,alt:"post",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-400",children:"No image"})}),rr&&s.jsx("div",{className:"absolute -top-2 -right-2 w-9 h-9 bg-white border border-black rounded-md flex items-center justify-center shadow-sm z-10",children:s.jsx("span",{className:"text-2xl leading-none","aria-hidden":"true",children:rr})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:Re||n("analytics.topPosts.noText","No text")}),xt&&s.jsx("a",{href:xt,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-600 hover:underline flex-shrink-0",children:n("analytics.topPosts.view","Open")})]}),s.jsxs("div",{className:"mt-1 text-xs text-gray-500 flex items-center gap-2",children:[s.jsx("span",{children:Et}),Gr&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-white border border-gray-300 text-gray-700",children:[s.jsx(cr,{platform:Gr,size:12}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:la})]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-primary-50 border border-primary-200 text-primary-700",children:[$n," ",Rt]})]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:["likes"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"❤️"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.likes}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.likes","Likes")})]}),"comments"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"💬"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.comments}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.comments","Comments")})]}),"shares"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔗"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.shares}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.shares","Shares")}
3843)]}),"clicks"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"👉"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.clicks}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n(Gr==="facebook"?"analytics.metrics.pageClicks":"analytics.metrics.clicks",Gr==="facebook"?"Page Clicks":"Clicks")})]}),"views"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"👁️"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.views}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.views","Views")})]}),"unique_views"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔍"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.unique_views}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.uniqueViews","Unique Views")})]}),"reactions"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"☺️"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:qt.reactions}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.reactions","Reactions")})]}),"engagement_rate"in qt&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔥"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:`${Math.round(typeof qt.engagement_rate=="number"?qt.engagement_rate:Number(qt.engagement_rate||0))}%`}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:n("analytics.metrics.engagementRate","Engagement Rate")})]})]})]})]},K.id)})})]}),d==="summary"&&(z==null?void 0:z.thirdMetrics)&&z.thirdMetrics.length>0&&s.jsxs("div",{className:"space-y-6 pb-8",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:n("analytics.thirdMetricsSummaryTitle","Other relevant metrics")})}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:(z.thirdMetrics||[]).map(K=>{var bt;const ke=qe(K.type),Ze=$e(K.variationsPercentage);return{...K,title:ke.title,value:K.total,previousValue:K.previousTotal,change:Ze,icon:ke.icon,color:ke.color,rawValueChange:(bt=K.variationsPercentage)==null?void 0:bt.toString(),description:K.description}}).map((K,ke)=>s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`${K.c
3843olor} bg-opacity-10 p-2 rounded-lg`,children:K.platform?s.jsx(cr,{platform:K.platform,size:20}):s.jsx(K.icon,{className:`w-5 h-5 ${K.color.replace("bg-","text-")}`})}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("span",{className:`text-xs font-medium ${K.change>0?"text-green-600":K.change===0?"text-gray-600":K.change<0?"text-red-600":"text-gray-600"}`,children:isFinite(K.change)?`${K.change>0?"+":""}${K.change.toFixed(1)}%`:K.rawValueChange||(K.change>0?"∞":K.change<0?"-∞":n("common.notAvailable","N/A"))}),isFinite(K.change)&&K.change!==0?K.change>0?s.jsx(Io,{size:12,className:"text-green-600"}):s.jsx(Mo,{size:12,className:"text-red-600"}):K.rawValueChange==="∞"||K.change===1/0?s.jsx(Io,{size:12,className:"text-green-600"}):K.rawValueChange==="-∞"||K.change===-1/0?s.jsx(Mo,{size:12,className:"text-red-600"}):(K.rawValueChange==="0"&&K.change===0||K.rawValueChange||K.change!==0,null)]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsxs("h3",{className:"text-base font-semibold text-gray-500 font-body flex items-center gap-1",children:[s.jsx("span",{children:K.title}),K.description?s.jsx(sm,{message:K.description,position:"top"}):null]}),s.jsx("p",{className:"mt-1 text-2xl font-semibold text-gray-900 font-title",children:K.title&&(K.title.includes("Rate")||K.title.includes("CTR")||K.title.includes("Avg. View Duration"))?`${K.value.toFixed(2)}${K.title.includes("Rate")||K.title.includes("CTR")?"%":""}`:K.value.toLocaleString()}),s.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:[n("common.previous"),": ",typeof K.previousValue=="number"?K.previousValue.toLocaleString():n("common.notAvailable","N/A")]})]})]},ke))})]})]})]})},DS=e=>{try{const t=e.startsWith("http")?e:`https://${e}`;return new URL(t)}catch{return null}},zG=({children:e,className:t="",onClick:r})=>{const a=`bg-white rounded-xl border border-black shadow-lg hover:shadow-xl transition-shadow p-6 ${t}`;return r?s.jsx("button",{onClick:r,className:`${a} cursor-pointer text-left w-full`,children:e}):s.jsx("div",{className:a,children:e})},k5=({message:e,position:t="top",className:r="",children:n})=>{const[a,i]=b.useState(!1),o=()=>{switch(t){case"bottom":return"top-full left-1/2 -translate-x-1/2 mt-2";case"left":return"top-1/2 -translate-y-1/2 right-full mr-2";case"right":return"top-1/2 -translate-y-1/2 left-full ml-2";case"top":default:return"bottom-full left-1/2 -translate-x-1/2 mb-2"}},l=()=>{switch(t){case"bottom":return"absolute bottom-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-l-transparent border-r-transparent border-b-primary-100";case"left":return"absolute top-1/2 -translate-y-1/2 left-full w-0 h-0 border-t-4 border-b-4 border-l-4 border-t-transparent border-b-transparent border-l-primary-100";case"right":return"absolute top-1/2 -translate-y-1/2 right-full w-0 h-0 border-t-4 border-b-4 border-r-4 border-t-transparent border-b-transparent border-r-primary-100";case"top":default:return"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-primary-100"}};return s.jsxs("span",{className:`relative inline-flex ${r}`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),children:[n,a&&s.jsxs("div",{className:`absolute ${o()} w-max max-w-xs z-50 px-3 py-1.5 bg-primary-100 text-gray-900 text-xs rounded-md shadow whitespace-normal`,children:[e,s.jsx("div",{className:l()})]})]})},BG=({isOpen:e,onClose:t,onCreateWithAI:r,onCreateManually:n})=>{const{t:a}=Te();return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:a("personas.createPersona","Create Persona")}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("button",{onClick:r,className:"flex flex-col h-full items-center justify-center gap-4 p-6 rounded-lg border border-black hover:border-primary-600 hover:bg-primary-50 transition-colors text-center",children:[s.jsx("div",{className:"bg-purple-100 p-3 rounded-lg",children:s.jsx(Hn,{className:"h-6 w-6 text-purple-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:a("personas.createWithAI","Create with AI")}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("personas.createWithAIDescription","
3843Let AI help you create a realistic persona based on your brand")})]})]}),s.jsxs("button",{onClick:n,className:"flex flex-col h-full items-center justify-center gap-4 p-6 rounded-lg border border-black hover:border-primary-600 hover:bg-primary-50 transition-colors text-center",children:[s.jsx("div",{className:"bg-gray-100 p-3 rounded-lg",children:s.jsx(da,{className:"h-6 w-6 text-gray-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:a("personas.createManually","Create Manually")}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("personas.createManuallyDescription","Write your own persona from scratch")})]})]})]})]})]})}):null},ub=[{id:"facebook",name:"Facebook",status:"available",icon:"/facebook.svg",description:"Social networking and community building"},{id:"google-business",name:"Google Business",status:"coming-soon",icon:"/google-business.svg",description:"Local business presence and customer engagement"},{id:"instagram",name:"Instagram",status:"available",icon:"/instagram.svg",description:"Visual storytelling and lifestyle content"},{id:"linkedin",name:"LinkedIn",status:"available",icon:"/linkedin.svg",description:"Professional networking and business content"},{id:"pinterest",name:"Pinterest",status:"available",icon:"/pinterest.svg",description:"Visual discovery and inspiration"}
3843,{id:"tiktok",name:"TikTok",status:"available",icon:"/tiktok.svg",description:"Short-form video content"},{id:"twitter",name:"Twitter",status:"available",icon:"/twitter.svg",description:"Real-time updates and conversations"},{id:"youtube",name:"YouTube",status:"available",icon:"/youtube.svg",description:"Video content and community engagement"}],OHe=()=>ub.filter(e=>e.status==="available"),RHe=e=>ub.find(t=>t.id===e),eA=()=>{const e=b.useMemo(()=>ub,[]),t=b.useMemo(()=>OHe(),[]);return{allPlatforms:e,availablePlatforms:t,getPlatform:n=>RHe(n)}},UG=async e=>{var t,r,n;try{const a=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!a)throw new Error("No authentication token available");console.log("🔍 Firebase token length:",a.length),console.log("🔍 Firebase token starts with:",a.substring(0,50)+"..."),console.log("🔍 Firebase user:",(r=Qe.currentUser)==null?void 0:r.uid),console.log("🔍 Firebase user email:",(n=Qe.currentUser)==null?void 0:n.email);const o=(d=>d==="facebook"?"meta":d)(e);console.log(`Connecting to platform: ${e}, API endpoint: management/accounts/${o}/config`);const l={Authorization:`Bearer ${a}`,"Content-Type":"application/json"};console.log("🔍 Request headers:",l),console.log("🔍 Authorization header:",l.Authorization.substring(0,50)+"...");const c=await fetch(`https://api.socialness.ai/management/accounts/${o}/config`,{headers:l});if(console.log("🔍 Response status:",c.status),console.log("🔍 Response headers:",Object.fromEntries([...c.headers.entries()])),!c.ok){const d=await c.text();throw console.error(`Platform configuration request failed with status: ${c.status}`),console.error("Error details:",d),new Error(`Failed to get platform configuration: ${c.statusText}`)}const u=await c.json();if(u.success&&u.authUrl)return localStorage.setItem("socialness_oauth_pending","true"),localStorage.setItem("socialness_oauth_platform",e),localStorage.setItem("socialness_oauth_timestamp",Date.now().toString()),window.location.href=u.authUrl,!0;throw new Error("Invalid platform configuration response: Missing authUrl")}catch(a){console.error("Error connecting to platform:",a);let i="Failed to connect to platform. Please try again.";throw a instanceof Error&&(a.message.includes("401")||a.message.includes("Unauthorized")?i="Authentication failed. Please log out and log back in to try again.":a.message.includes("404")||a.message.includes("Not Found")?i=`The ${e} connection service is currently unavailable. Please try again later.`:a.message.includes("500")?i="Server error occurred. Our team has been notified. Please try again later.":(a.message.includes("Network Error")||a.message.includes("Failed to fetch"))&&(i="Network connection issue. Please check your internet connection and try again."),console.error("Detailed error:",a.message)),new Error(i)}},VG=async()=>{var e;try{const t=await((e=Qe.currentUser)==null?void 0:e.getIdToken());if(!t){console.error("No authentication token available");return}console.log("Invalidating accounts cache via API");const r=await fetch("https://api.socialness.ai/management/accounts/invalidate-cache",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok){console.error("Failed to invalidate cache:",r.status,r.statusText);return}const n=await r.json();console.log("Cache invalidation response:",n)}catch(t){console.error("Error invalidating accounts cache:",t)}},$He=({isOpen:e,onClose:t,onConnectViaFacebook:r,onConnectDirectlyInstagram:n,isConnecting:a=!1,connectingPlatform:i=null})=>{const{t:o}=Te();return e?s.jsx("div",{className:"fixed inset-0 z-[60] overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-4xl w-full p-6",children:[" ",s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("h2",{className:"text-xl font-semibold",children:o("instagramOptionsModal.title")}),s.jsx(cr,{platform:"instagram",size:24})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"flex flex-col p-4 rounded-lg border border-gray-300 bg-gray-100 opacity-70 h-full",children:[" ",s.jsxs("div",{className:"flex-grow pt-6",children:[s.jsx("div",{className:"text-3xl mb-3 text-center",children:"👤"})," ",s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[" ",s.jsxs("h3",{className:"font-semibold text-gray-700 text-center w-full",children:[o("instagramOptionsModal.option1.titleLine1"),o("instagramOptionsModal.option1.titleLine2")&&s.jsx("br",{}),o("instagramOptionsModal.option1.titleLine2")]})]}),s.jsx("p",{className:"text-sm text-gray-500 text-center mb-4",children:o("instagramOptionsModal.option1.description")})," "]}),s.jsx("div",{className:"mt-auto text-center",children:s.jsx("span",{className:"text-xs font-medium bg-gray-200 text-gray-600 px-2 py-1 rounded-md",children:o("instagramOptionsModal.option1.tag")})})]}),s.jsxs("div",{className:"relative flex flex-col p-4 rounded-lg border-2 border-purple-500 bg-purple-50 shadow-sm h-full",children:[" ",s.jsx("span",{className:"absolute top-2 right-2 text-xs font-medium bg-purple-100 text-purple-700 px-2 py-1 rounded-md",children:o("instagramOptionsModal.option2.tag")}),s.jsxs("div",{className:"flex-grow pt-6",children:[s.jsxs("div",{className:"flex justify-center items-center space-x-1 mb-3",children:[s.jsx(cr,{platform:"instagram",size:28}),s.jsx(tn,{className:"w-4 h-4 text-gray-500"}),s.jsx(cr,{platform:"facebook",size:28})]}),s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[" ",s.jsx("h3",{className:"font-semibold text-gray-800 text-center w-full",children:o("instagramOptionsModal.option2.title")})]}),s.jsx("p",{className:"text-sm text-gray-600 text-center mb-4",children:o("instagramOptionsModal.option2.description")})," "]}),s.jsx("div",{className:"mt-auto",children:s.jsx("button",{onClick:r,disabled:a,className:`w-full px-4 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-150 ease-in-out ${a?"bg-purple-400 text-white cursor-not-allowed":"bg-purple-600 text-white hover:bg-purple-700"}`,children:i==="facebook"?"Connecting...":o("instagramOptionsModal.option2.cta")})})]}),s.jsxs("div",{className:"flex flex-col p-4 rounded-lg border border-gray-300 hover:border-gray-400 h-full",children:[" ",s.jsxs("div",{className:"flex-grow pt-6",children:[s.jsxs("div",{className:"flex justify-center items-center mb-3",children:[s.jsx(cr,{platform:"instagram",size:32})," "]}),s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[" ",s.jsx("h3",{className:"font-semibold text-gray-700 text-center w-full",children:o("instagramOptionsModal.option3.title")})]}),s.jsx("p",{className:"text-sm text-gray-500 text-center mb-4",children:o("instagramOptionsModal.option3.description")})," "]}),s.jsx("div",{className:"mt-auto",children:s.jsx("button",{onClick:n,disabled:a,className:`w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-150 ease-in-out ${a?"bg-gray-100 text-gray-400 border-gray-300 cursor-not-allowed":"bg-white text-purple-600 border-purple-600 hover:bg-purple-50 hover:text-purple-700"}`,children:i==="instagram"?"Connecting...":o("instagramOptionsModal.option3.cta")})})]})]})]})]})}):null},WG=({isOpen:e,onClose:t,onConnect:r,existingPlatforms:n=[]})=>{const{t:a}
3843=Te(),[i,o]=b.useState(null),[l,c]=b.useState(!1),{allPlatforms:u}=eA(),d=qr();if(!e)return null;const f=async p=>{try{o(p),d.removeQueries({queryKey:["accounts"]}),d.invalidateQueries({queryKey:["accounts"]}),await VG(),await UG(p)}catch(g){console.error("Error connecting to platform:",g);let y="Failed to connect to platform. Please try again.";g instanceof Error&&(y=g.message),alert(y),o(null),(p==="instagram"||p==="facebook")&&c(!1)}},m=async p=>{p==="instagram"?c(!0):await f(p)},h=()=>{c(!1)};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:`fixed inset-0 z-50 overflow-y-auto ${e?"block":"hidden"}`,children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Connect Social Network"}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:u.sort((g,y)=>{const v=C=>C.status==="coming-soon"?1:0,x=v(g),j=v(y);return x!==j?x-j:g.name.localeCompare(y.name)}).map(g=>{const y=g.status==="coming-soon",v=i===g.id,x=g.id==="pinterest"||g.id==="tiktok";return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>!y&&m(g.id),disabled:y||v||i!==null&&i!==g.id,className:`w-full flex items-center gap-2 p-3 rounded-lg border ${y?"border-gray-200 bg-gray-50 opacity-50 cursor-not-allowed":"border-black hover:border-primary-600 hover:bg-primary-50"}`,children:[s.jsx(cr,{platform:g.id,size:24}),s.jsxs("div",{className:"flex flex-col items-start",children:[s.jsx("span",{className:`text-sm ${y?"text-gray-400":"text-gray-700"}`,children:g.name}),g.status==="coming-soon"&&s.jsx("span",{className:"text-xs text-gray-400",children:"Coming soon"}),v&&s.jsx("span",{className:"text-xs text-primary-600",children:"Connecting..."})]})]}),x&&s.jsx("span",{className:"absolute -top-1 -right-1 inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-red-500 text-white",children:"Beta"})]},g.id)})})]})]})}),l&&s.jsx($He,{isOpen:l,onClose:h,onConnectViaFacebook:()=>f("facebook"),onConnectDirectlyInstagram:()=>f("instagram"),isConnecting:i==="facebook"||i==="instagram",connectingPlatform:i})]})},Zi=({src:e,alt:t="",type:r,className:n="",style:a={},controls:i=!1,autoPlay:o=!1,autoPlayOnHover:l=!1,autoPlayOnMount:c=!1,muted:u=!0,loop:d=!1})=>{const[f,m]=b.useState(!1),h=b.useRef(null);U.useEffect(()=>{c&&h.current&&r==="video"&&(h.current.muted=!0,h.current.play().catch(()=>{}))},[c,r]);const p=()=>{l&&h.current&&r==="video"&&(h.current.muted=!0,h.current.play().catch(y=>{h.current&&(h.current.muted=!0,h.current.play().catch(()=>{}))}))},g=()=>{l&&h.current&&r==="video"&&(h.current.pause(),h.current.currentTime=0)};return f?s.jsx("div",{className:`flex flex-col items-center justify-center bg-gray-200 text-gray-500 text-xs p-2 text-center ${n}`,style:a,children:r==="video"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Video available"}),s.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"mt-1 px-2 py-1 bg-primary-600 text-white rounded text-[10px] hover:bg-primary-700",children:"Open video"})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Failed to load image"}),s.jsx("p",{className:"text-xxs mt-1 text-gray-400",children:e.substring(0,20)+(e.length>20?"...":"")})]})}):r==="video"?l?s.jsx("div",{className:n,style:a,onMouseEnter:p,onMouseLeave:g,children:s.jsx("video",{ref:h,src:e,className:"w-full h-full",controls:i,autoPlay:o||c,muted:u,loop:d||l,playsInline:!0,onError:()=>{console.error(`Video load error for: ${e}`),m(!0)}})}):s.jsx("video",{ref:h,src:e,className:n,style:a,controls:i,autoPlay:o||c,muted:u,loop:d,playsInline:!0,onError:()=>{console.error(`Video load error for: ${e}`),m(!0)}}):s.jsx("img",{src:e,alt:t,className:n,style:a,onError:()=>{console.error(`Image load error for: ${e}`),m(!0)}})},Un=({mediaUrl:e,altText:t,type:r,objectFit:n="cover",aspectRatio:a,className:i="",controls:o,autoPlayOnMount:l=!1,autoPlayOnHover:c=!1,muted:u=!0,fullSize:d=!0,loop:f=!1})=>{if(!e)return s.jsx("div",{className:`flex items-center justify-center bg-gray-100 w-full h-full ${i}`,children:s.jsx("span",{className:"text-gray-400 text-xs",children:"No media"})});e.startsWith("blob:");const m=/\.pdf(\?|#|$)/i.test(e),h={objectFit:n,aspectRatio:a};return m?s.jsx("div",{className:`flex items-center justify-center bg-gray-100 text-gray-500 text-xs ${i}`,style:h,children:"PDF"}):s.jsx(Zi,{src:e,alt:t,type:r,className:`${d?"w-full h-full":""} ${i}`.trim(),style:h,controls:o??r==="video",autoPlayOnMount:l,autoPlayOnHover:c,muted:u,loop:f})},tA=({message:e,size:t="md",className:r=""})=>{const n=t==="sm"?16:t==="lg"?32:24,a=t==="sm"?"border":"border-2";return s.jsxs("div",{className:`flex flex-col items-center justify-center ${r}`,role:"status","aria-live":"polite",children:[s.jsx("div",{className:`${a} border-gray-300 border-t-primary-600 rounded-full animate-spin`,style:{width:n,height:n},"aria-label":e||"Loading"}),e&&s.jsx("div",{className:"mt-2 text-xs text-gray-500",children:e})]})},Ef=({src:e,className:t="",frame:r="square"})=>{const[n,a]=U.useState(null),[i,o]=U.useState(!0),[l,c]=U.useState(null),u=U.useCallback(async()=>{const d=window;if(d.pdfjsLib)return d.pdfjsLib;await new Promise((m,h)=>{const p=document.createElement("script");p.src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js",p.async=!0,p.onload=()=>m(),p.onerror=()=>h(new Error("Failed to load pdf.js")),document.head.appendChild(p)});const f=window.pdfjsLib;return f&&(f.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.min.js"),f},[]);return U.useEffect(()=>{let d=!1;async function f(){try{o(!0),c(null);const m=await u(),h=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?`/api/pdf-proxy?url=${encodeURIComponent(e)}`:e,g=await(await fetch(h)).arrayBuffer(),v=await(await m.getDocument({data:g}).promise).getPage(1),x=v.getViewport({scale:1});let j=256,C=256;r==="portrait4x5"&&(j=300,C=375);const N=Math.min(j/x.width,C/x.height),S=v.getViewport({scale:N}),M=document.createElement("canvas"),k=M.getContext("2d");if(!k)throw new Error("No canvas context");M.width=Math.floor(S.width),M.height=Math.floor(S.height),await v.render({canvasContext:k,viewport:S}).promise;const I=document.createElement("canvas"),T=I.getContext("2d");if(!T)throw new Error("No canvas context");I.width=j,I.height=C,T.fillStyle="#ffffff",T.fillRect(0,0,j,C);const L=Math.floor((j-M.width)/2),R=Math.floor((C-M.height)/2);T.drawImage(M,L,R);const _=I.toDataURL("image/png");d||a(_)}catch(m){d||c((m==null?void 0:m.message)||"PDF render failed")}finally{d||o(!1)}}return/\.pdf(\?|#|$)/i.test(e)?f():(a(null),o(!1)),()=>{d=!0}},[e,r,u]),i?s.jsx("div",{className:`flex items-center justify-center ${t}`,children:s.jsx(tA,{size:"sm"})}):l||!n?s.jsx("div",{className:`flex items-center justify-center bg-gray-100 text-gray-500 text-[10px] ${t}`,children:"PDF"}):s.jsx("img",{src:n,alt:"PDF page 1",className:`w-full h-full object-contain ${t}`})};function Xn(e){var t,r,n,a,i,o,l,c,u,d;if(!e)return null;if(Array.isArray(e)){if(e.length===0)return null;const f=e[0];return Xn(f)}if(typeof e=="string")return e==="[object Object]"?(Ie.debug("mediaUtils","Invalid object serialization detected"),null):e.trim()===""?null:{url:e,type:M5(e)};if(typeof e=="object"&&e!==null&&e.mapValue&&e.mapValue.fields){const f=e.mapValue.fields,m=((t=f.url)==null?void 0:t.stringValue)||"",h=((r=f.type)==null?void 0:r.stringValue)||"image",p=OS(h);return{url:m,type:p,fileName:(n=f.fileName)==null?void 0:n.stringValue,uploadedAt:(a=f.uploadedAt)==null?void 0:a.stringValue,fileSize:(i=f.fileSize)!=null&&i.integerValue?parseInt(f.fileSize.integerValue):void 0,thumbnailUrl:(o=f.thumbnailUrl)==null?void 0:o.stringValue,mimeType:(l=f.mimeType)==null?void 0:l.stringValue}}if(typeof e=="object"&&e!==null&&e.url){const f=e.type||"image";let m=OS(f);return M5(e.url)==="video"&&m==="image"&&(m="video"),{url:e.url,type:m,fileName:e.fileName,uploadedAt:e.uploadedAt,fileSize:e.fileSize,thumbnailUrl:e.thumbnailUrl,mimeType:e.mimeType}}return typeof e=="object"&&e!==null&&(u=(c=e.fields)==null?void 0:c.url)!=null&&u.stringValue?{url:e.fields.url.stringValue,type:OS(((d=e.fields.type)==null?void 0:d.stringValue)||"image")}
3843:(Ie.debug("mediaUtils","No matching media structure found"),null)}function OS(e){if(!e)return"image";const t=e.toLowerCase().trim();return t==="video"||e.toUpperCase()==="VIDEO"||t.includes("video")||t.includes("mp4")||t.includes("mov")||t.includes("avi")||t.includes("webm")?"video":"image"}function M5(e){const t=[".mp4",".mov",".avi",".webm",".m4v"],r=[".png",".jpg",".jpeg",".webp",".gif",".bmp",".tif",".tiff",".avif",".svg"],n=e.toLowerCase();for(const a of r)if(n.includes(a))return"image";for(const a of t)if(n.includes(a))return"video";return"image"}function FHe(e){var t;return{originalType:typeof e,structure:Array.isArray(e)?"array":e!=null&&e.mapValue?"firestore-mapValue":typeof e=="string"?"string":e!=null&&e.url?"object-with-url":"unknown",normalized:Xn(e),hasUrl:!!((t=Xn(e))!=null&&t.url),isArray:Array.isArray(e)}}const py={image:{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-100"},document:{bg:"bg-green-50",text:"text-green-700",border:"border-green-100"},video:{bg:"bg-red-50",text:"text-red-700",border:"border-red-100"},multi:{bg:"bg-blue-100",text:"text-blue-800",border:"border-blue-200"},text:{bg:"bg-gray-100",text:"text-gray-700",border:"border-gray-200"},regular:{bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-100"},reel:{bg:"bg-pink-50",text:"text-pink-700",border:"border-pink-100"}},gy={image:"🖼️",document:"📄",video:"🎬",multi:"🎞️",text:"📝",regular:"📸",reel:"📱"};function rA(e){return{image:e("tags.image","Image"),document:e("tags.document","Document"),video:e("tags.video","Video"),multi:e("tags.multi","Multi-images"),text:e("tags.text","Text"),regular:e("tags.regular","Regular"),reel:e("tags.reel","Reel")}}function qG(e,t,r){return!e&&!t?"text":e&&/\.pdf(\?|#|$)/i.test(e)?"document":t==="video"?"video":t==="image"||e?"image":"text"}function Aj(e){if(!e)return;const t=e.trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-");if(t==="image"||t==="photo"||t==="picture")return"image";if(t==="video")return"video";if(t==="document"||t==="pdf"||t==="file")return"document";if(t==="text"||t==="none")return"text";if(t==="multi"||t==="multi-image"||t==="multi-images"||t==="multiimage"||t==="multiimages"||t==="carousel"||t==="carousel-post"||t==="album")return"multi"}const zHe=e=>e.platforms?Array.isArray(e.platforms)?e.platforms.filter(t=>typeof t=="string"):typeof e.platforms=="object"?Object.keys(e.platforms):[]:[],db=({post:e})=>{var l,c,u,d;const{t}=Te(),r=rA(t),n=(f,m="#0B65C2")=>{const h=[],p=(f||"").split(`
3844`),g=/(https?:\/\/[^\s]+|www\.[^\s]+|#[\p{L}\d_]+)/giu;return p.forEach((y,v)=>{v>0&&h.push(s.jsx("br",{},`br-${v}`));let x=0,j;for(;(j=g.exec(y))!==null;){const C=j.index;C>x&&h.push(y.slice(x,C));const N=j[0];if(N.startsWith("#"))h.push(s.jsx("span",{style:{color:m},children:N},`hash-${v}-${C}`));else{const S=N.startsWith("http")?N:`http://${N}`;h.push(s.jsx("a",{href:S,target:"_blank",rel:"noreferrer",className:"hover:underline",style:{color:m},children:N},`link-${v}-${C}`))}x=g.lastIndex}x<y.length&&h.push(y.slice(x))}),h},a=b.useMemo(()=>zHe(e),[e.platforms]),i=f=>{switch(f){case"draft":return s.jsx("span",{className:"px-2 py-1 text-xs bg-gray-100 text-gray-700 rounded-full",children:"📝 Draft"});case"scheduled":return s.jsx("span",{className:"px-2 py-1 text-xs bg-blue-100 text-blue-700 rounded-full",children:"📅 Scheduled"});case"pending":return s.jsx("span",{className:"px-2 py-1 text-xs bg-yellow-100 text-yellow-700 rounded-full",children:"⏳ Pending"});case"ready_to_publish":return s.jsx("span",{className:"px-2 py-1 text-xs bg-green-100 text-green-700 rounded-full",children:"🚀 Ready"});case"published":return s.jsx("span",{className:"px-2 py-1 text-xs bg-green-100 text-green-700 rounded-full",children:"✅ Published"});case"rejected":return s.jsx("span",{className:"px-2 py-1 text-xs bg-red-100 text-red-700 rounded-full",children:"❌ Rejected"});default:return s.jsx("span",{className:"px-2 py-1 text-xs bg-gray-100 text-gray-700 rounded-full",children:f})}},o=()=>{const f=e.scheduledAt||e.createdAt;if(f)try{const m=Xa(f);if(Gn(m))return sr(m,"HH:mm")}catch{try{const m=new Date(f);if(Gn(m))return sr(m,"HH:mm")}catch{return""}}return""};return s.jsxs("div",{className:"w-full sm:w-[640px] md:w-[700px] lg:w-[800px] max-w-full sm:max-w-4xl bg-white border border-black rounded-lg shadow-lg p-4 z-50 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e.brandLogo&&s.jsx("img",{src:e.brandLogo,alt:e.brandName||"Brand logo",className:"w-9 h-9 rounded-full object-cover flex-shrink-0",onError:f=>{f.currentTarget.style.display="none"}}),s.jsxs("div",{className:"flex flex-col",children:[e.brandName&&s.jsx("span",{className:"text-sm font-medium text-gray-800",children:e.brandName}),s.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[s.jsx(ql,{className:"w-3 h-3"}),s.jsx("span",{children:o()||"No time"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-2",children:a.map(f=>s.jsx(cr,{platform:f,size:20},f))}),i(e.status)]})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-3",children:[s.jsxs("div",{className:"flex-shrink-0",children:[(()=>{const f=Xn(e.media);if(!f)return null;const m=/\.pdf(\?|#|$)/i.test(f.url);
3844return s.jsx("div",{className:"w-full md:w-64 h-64 rounded-lg overflow-hidden bg-gray-100 mb-3",children:m?s.jsx(Ef,{src:f.url,className:"w-full h-full",frame:"portrait4x5"}):s.jsx(Un,{mediaUrl:f.url,altText:"Post media",type:f.type,className:"w-full h-full",objectFit:"cover",controls:!1,autoPlayOnMount:f.type==="video",muted:!0})})})(),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex gap-2",children:[(()=>{const f=Aj(e.postMediaType),m=Xn(e.media),h=f??qG(m==null?void 0:m.url,m==null?void 0:m.type),p=py[h];return s.jsxs("div",{className:`text-xs px-2 py-1 rounded-full flex items-center gap-1 border ${p.bg} ${p.text} ${p.border}`,children:[s.jsx("span",{children:gy[h]}),s.jsx("span",{children:r[h]})]})})(),(()=>{const f=e.format==="reel"?"reel":"regular",m=py[f];return s.jsxs("div",{className:`text-xs px-2 py-1 rounded-full flex items-center gap-1 border ${m.bg} ${m.text} ${m.border}`,children:[s.jsx("span",{children:gy[f]}),s.jsx("span",{children:r[f]})]})})()]}),e.status==="published"&&(e.engagement||e.platformResults&&Object.keys(e.platformResults).length>0)&&s.jsxs("div",{className:"flex flex-col gap-1 mt-2",children:[s.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"📊 Engagement Stats"}),e.engagement&&s.jsx("div",{className:"border border-gray-200 rounded-lg p-2 bg-gray-50",children:s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-lg",children:"📈"}),s.jsx("span",{className:"font-medium text-gray-700",children:"Total"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-red-500",children:"❤️"}),s.jsx("span",{children:e.engagement.likes})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-blue-500",children:"💬"}),s.jsx("span",{children:e.engagement.comments})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-green-500",children:"🔗"}),s.jsx("span",{children:e.engagement.shares})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-purple-500",children:"👁️"}),s.jsx("span",{children:e.engagement.views})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{children:"👉"}),s.jsx("span",{children:((l=e.engagement)==null?void 0:l.clicks)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{children:"🔍"}),s.jsx("span",{children:((c=e.engagement)==null?void 0:c.unique_views)||((u=e.engagement)==null?void 0:u.uniqueViews)||((d=e.engagement)==null?void 0:d.uniqueImpressions)||0})]})]})]})}),(()=>{let f=e.platformResults||e.platformData||{};Object.keys(f).length===0&&e.platforms&&typeof e.platforms=="object"&&!Array.isArray(e.platforms)&&(f=e.platforms);const m=Object.entries(f).filter(([h,p])=>{var y;return((p==null?void 0:p.engagement)||((y=p==null?void 0:p.results)==null?void 0:y.engagement))!==void 0});return m.length>0&&m.map(([h,p])=>{var y;const g=(p==null?void 0:p.engagement)||((y=p==null?void 0:p.results)==null?void 0:y.engagement);return s.jsx("div",{className:"border border-gray-200 rounded-lg p-2 bg-white",children:s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("div",{className:"flex items-center gap-1",children:s.jsx(cr,{platform:h,size:12})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-red-500",children:"❤️"}),s.jsx("span",{children:(g==null?void 0:g.likes)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-blue-500",children:"💬"}),s.jsx("span",{children:(g==null?void 0:g.comments)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-green-500",children:"🔗"}),s.jsx("span",{children:(g==null?void 0:g.shares)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-purple-500",children:"👁️"}),s.jsx("span",{children:(g==null?void 0:g.views)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{children:"👉"}),s.jsx("span",{children:(g==null?void 0:g.clicks)||0})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{children:"🔍"}),s.jsx("span",{children:(g==null?void 0:g.unique_views)||(g==null?void 0:g.uniqueViews)||(g==null?void 0:g.uniqueImpressions)||0})]})]})]})},h)})})()]})]})]}),s.jsx("div",{className:"flex-1 flex flex-col",children:s.jsx("div",{className:"flex-1",children:s.jsx("div",{className:"text-sm text-gray-800 leading-relaxed break-words overflow-wrap-anywhere",style:{whiteSpace:"pre-wrap"},children:n(e.content)})})})]})]})},Am=[{id:"advertising-marketing",name:"Advertising & Marketing",emoji:"📢"},{id:"aerospace-defense",name:"Aerospace & Defense",emoji:"🚀"},{id:"agriculture",name:"Agriculture",emoji:"🌾"},{id:"automotive",name:"Automotive",emoji:"🚗"},{id:"banking-financial",name:"Banking & Financial Services",emoji:"🏦"},{id:"blockchain-web3",name:"Blockchain & Web3",emoji:"⛓️"},{id:"construction",name:"Construction",emoji:"🏗️"},{id:"consumer-goods",name:"Consumer Goods",emoji:"🛍️"},{id:"ecommerce",name:"E-commerce",emoji:"🛒"},{id:"education",name:"Education",emoji:"📚"},{id:"energy-utilities",name:"Energy & Utilities",emoji:"⚡"},{id:"entertainment-media",name:"Entertainment & Media",emoji:"🎬"},{id:"fashion-apparel",name:"Fashion & Apparel",emoji:"👕"},{id:"food-beverage",name:"Food & Beverage",emoji:"🍽️"},{id:"gaming",name:"Gaming",emoji:"🎮"},{id:"government",name:"Government",emoji:"🏛️"},{id:"healthcare",name:"Healthcare",emoji:"⚕️"}
3844,{id:"hospitality-tourism",name:"Hospitality & Tourism",emoji:"🏨"},{id:"information-technology",name:"Information Technology",emoji:"💻"},{id:"insurance",name:"Insurance",emoji:"🛡️"},{id:"legal-services",name:"Legal Services",emoji:"⚖️"},{id:"manufacturing",name:"Manufacturing",emoji:"🏭"},{id:"non-profit",name:"Non-Profit",emoji:"🤝"},{id:"pharmaceuticals",name:"Pharmaceuticals",emoji:"💊"},{id:"real-estate",name:"Real Estate",emoji:"🏢"},{id:"retail",name:"Retail",emoji:"🏪"},{id:"saas",name:"SaaS (Software as a Service)",emoji:"💻"},{id:"sports",name:"Sports",emoji:"⚽"},{id:"telecommunications",name:"Telecommunications",emoji:"📡"},{id:"transportation-logistics",name:"Transportation & Logistics",emoji:"🚢"}],BHe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),i=Am.find(o=>o.id===e)||Am[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>a(!n),className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:i.emoji}),s.jsx("span",{className:"text-gray-700",children:i.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20 max-h-[300px] overflow-y-auto",children:s.jsx("div",{className:"py-1",children:Am.map(o=>s.jsxs("button",{onClick:()=>{t(o.id),a(!1)},className:`w-full text-left px-4 py-2 flex items-center gap-2 ${o.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:[s.jsx("span",{className:"text-lg",children:o.emoji}),s.jsx("span",{className:"font-medium",children:o.name})]},o.id))})})]})]})},UHe=({brand:e,onDelete:t,onAcceptInvite:r,onDeclineInvite:n,isFullWidth:a=!1})=>{const{t:i}=Te(),o=pn(),{user:l}=Ps(),[c,u]=b.useState(!1),[d,f]=b.useState(!1),[m,h]=b.useState(!1),[p,g]=b.useState(null),[y,v]=b.useState({x:0,y:0}),[x,j]=b.useState(0),C=b.useRef(null),N=e.members.filter(Q=>Q.status==="active").length,S=e.members.filter(Q=>Q.status==="pending").length,M=e.members.find(Q=>Q.email===(l==null?void 0:l.email)),k=(M==null?void 0:M.status)==="pending",I=(M==null?void 0:M.role)==="admin",T=k?M==null?void 0:M.invitationId:null,L=Q=>{switch(Q){case"admin":return"bg-blue-50 text-blue-700";case"reviewer":return"bg-purple-50 text-purple-700";case"writer":return"bg-green-50 text-green-700";default:return"bg-gray-50 text-gray-700"}},R=()=>{t&&t(e)},_=()=>{o(`/brand-strategy-lab/${e.id}/edit`)},B=()=>{r&&T&&(console.log("Using invitationId from member:",T),r(T))},z=()=>{n&&T&&(console.log("Using invitationId from member:",T),n(T))},D=()=>{u(!1),o("/ai-personas-builder",{state:{selectedBrandId:e.id,createWithAI:!0,returnToBrands:!0}})},A=()=>{u(!1),o("/ai-personas-builder",{state:{selectedBrandId:e.id,createManually:!0,returnToBrands:!0}})},P=()=>{f(!0)},E=()=>{f(!1),o("/content-creation",{state:{selectedBrandId:e.id,createWithAI:!0,returnToBrands:!0}})},F=()=>{f(!1),o("/content-creation",{state:{selectedBrandId:e.id,createManually:!0,returnToBrands:!0}})},$=async Q=>{h(!1)},H=Q=>{o(`/posts/${Q}/edit`)},X=Q=>{let W=null;return Q.postMediaUrl&&Q.postMediaUrl.trim()!==""&&(W={url:Q.postMediaUrl,type:"image"}
3844),{id:Q.postId,brandName:e.name,brandLogo:e.logo,content:Q.postContent,format:"regular",media:W,platforms:[Q.postPlatform],status:Q.postStatus,scheduledAt:Q.postScheduledAt,publishedAt:Q.postStatus==="published"?Q.postCreatedAt:null,createdAt:Q.postCreatedAt,updatedAt:Q.postUpdatedAt,brandId:e.id}};b.useLayoutEffect(()=>{C.current&&j(C.current.getBoundingClientRect().height)},[p]);const ue=()=>{const Q=window.innerWidth,W=window.innerHeight,Y=Math.min(800,Q*.9),q=20;let Z=y.x+10,me=y.y-100;return Z+Y+q>Q&&(Z=y.x-Y-10),Z<q&&(Z=q),me+x+q>W&&(me=W-x-q),me<q&&(me=q),{x:Z,y:me}},le=()=>{var Q,W;return s.jsxs("div",{className:"flex items-start justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("img",{src:e.logo,alt:e.name,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900 line-clamp-2",children:e.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx(Zs,{className:"w-4 h-4 text-gray-400"}),DS(e.website)&&s.jsx("a",{href:(Q=DS(e.website))==null?void 0:Q.href,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary-600 hover:text-primary-700",children:(W=DS(e.website))==null?void 0:W.hostname})]}),(M==null?void 0:M.role)&&s.jsx("div",{className:"mt-2",children:s.jsx("span",{className:`text-xs px-2 py-1 rounded-full capitalize ${L(M.role)}`,children:M.role})})]})]}),s.jsx("div",{className:"flex flex-col items-end gap-2",children:k?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("button",{onClick:B,className:"inline-flex items-center justify-center w-full px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors text-sm",children:[s.jsx(ma,{className:"w-4 h-4 mr-2"}),i("common.accept")]}),s.jsxs("button",{onClick:z,className:"inline-flex items-center justify-center w-full px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors text-sm",children:[s.jsx(_t,{className:"w-4 h-4 mr-2"}),i("common.decline")]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-500 relative group cursor-pointer",children:[s.jsx(Jr,{className:"w-4 h-4"}),s.jsxs("span",{children:[N,S>0&&s.jsxs("span",{className:"text-orange-500",children:["+",S]})]}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[N===1?i("brands.activeMember","{{count}} membre actif",{count:N}):i("brands.activeMembers","{{count}} membres actifs",{count:N}),S>0&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),S===1?i("brands.pendingMember","{{count}} membre en attente",{count:S}):i("brands.pendingMembers","{{count}} membres en attente",{count:S})]}),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("button",{onClick:()=>o(`/brand-strategy-lab/${e.id}/edit`),className:"p-2 rounded-lg hover:bg-purple-100 transition-colors group relative",title:i("common.view","View"),children:[s.jsx(xa,{className:"w-4 h-4 text-primary-600 group-hover:text-primary-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[i("common.view","Voir"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),s.jsxs("button",{onClick:_,className:"p-2 rounded-lg hover:bg-purple-100 transition-colors group relative",title:i("common.modify","Modify"),children:[s.jsx(L7,{className:"w-4 h-4 text-primary-600 group-hover:text-primary-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[i("common.modify","Modifier"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),I&&s.jsxs("button",{onClick:R,className:"p-2 rounded-lg hover:bg-red-100 transition-colors group relative",title:i("common.delete","Delete"),children:[s.jsx(lc,{className:"w-4 h-4 text-red-500 group-hover:text-red-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-red-100 text-red-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[i("common.delete","Supprimer"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-red-100"})]})]})]})]})})]})},ae=()=>{var me,we,he,ie;const Q=((me=e.goToMarketStrategy)==null?void 0:me.marketScope)||e.marketScope,W=((we=e.goToMarketStrategy)==null?void 0:we.distributionType)||e.distributionType,Y=((he=e.goToMarketStrategy)==null?void 0:he.businessModel)||e.businessModel,q=((ie=e.goToMarketStrategy)==null?void 0:ie.priorityMarkets)||e.priorityMarkets,Z=[];if(e.industryId){const ye=Am.find(pe=>pe.id===e.industryId);ye&&Z.push({emoji:ye.emoji,text:ye.name})}return Q&&Z.push({emoji:Q==="local"?"🏠":Q==="national"?"🇱🇺":"🌍",text:Q}),Y&&Z.push({emoji:Y==="B2B"?"🏢":Y==="B2C"?"👥":"💼",text:Y}),W&&Z.push({emoji:W==="physical"?"🏪":W==="digital"?"💻":"🔄",text:W}),q&&q.length>0&&q.forEach(ye=>{Z.push({emoji:"🎯",text:ye})}),Z.length>0?s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-3",children:i("brands.marketingStrategy","Marketing Strategy")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Z.map((ye,pe)=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-green-50 to-emerald-50 text-green-700 rounded-lg text-sm",children:[s.jsx("span",{className:"text-sm",children:ye.emoji}),s.jsx("span",{className:"capitalize",children:ye.text})]},pe))})]}):null},te=()=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:e.personas&&e.personas.length>0?i("brands.personasCount","{{count}} personas",{count:e.personas.length}):i("personas.title","Personas")}),s.jsxs("button",{onClick:()=>u(!0),className:"text-sm text-primary-600 hover:text-primary-700 font-medium transition-colors flex items-center",children:[s.jsx(tn,{className:"w-4 h-4 inline mr-1"}),i("personas.createPersona","Créer un persona")]})]}),e.personas&&e.personas.length>0?s.jsx("div",{className:"flex flex-wrap gap-3",children:e.personas.map(Q=>s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gradient-to-r from-purple-50 to-blue-50 rounded-lg hover:from-purple-100 hover:to-blue-100 transition-colors cursor-pointer",onClick:()=>o("/ai-personas-builder",{state:{selectedBrandId:e.id,editPersonaId:Q.personaId,returnToBrands:!0}}),title:`${i("common.edit")} ${Q.personaName}`,children:[s.jsx("img",{src:Q.personaPicture,alt:Q.personaName,className:"w-8 h-8 rounded-full object-cover border-2 border-white shadow-sm"}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-gray-800",children:Q.personaName}),s.jsx("span",{className:"text-xs text-gray-500 uppercase",children:Q.personaLanguage})]})]},Q.personaId))}):s.jsx("div",{className:"mb-3 text-xs text-gray-500 italic",children:i("personas.noPersona","Aucun persona pour cette marque")})]}),ne=()=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:e.recentPosts&&e.recentPosts.length>0?i("brands.recentPosts","Your {{count}} recent posts",{count:e.recentPosts.length}):i("brands.posts","Posts")}),s.jsxs("button",{onClick:P,className:"text-sm text-primary-600 hover:text-primary-700 font-medium transition-colors flex items-center",children:[s.jsx(tn,{className:"w-4 h-4 inline mr-1"}),i("posts.createPost","Créer un post")]})]}),e.recentPosts&&e.recentPosts.length>0?s.jsx("div",{className:"grid grid-cols-3 gap-2",children:e.recentPosts.slice(0,3).map(Q=>{const W=Q.postMediaUrl?{url:Q.postMediaUrl,type:"image"}:null,Y=Xn(W);return s.jsx("div",{className:"relative group cursor-pointer",title:`${Q.postContent.substring(0,50)}...`,onClick:()=>H(Q.postId),onMouseEnter:q=>{g(Q),v({x:q.clientX,y:q.clientY})},onMouseMove:q=>{v({x:q.clientX,y:q.clientY})},onMouseLeave:()=>g(null),children:s.jsxs("div",{className:"aspect-square rounded-lg overflow-hidden bg-gray-100 border border-gray-200",children:[Y?s.jsx(Zi,{src:Y.url,alt:Q.postTitle,type:Y.type,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",controls:!1}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:s.jsx("span",{className:"text-xs",children:"📝"})}),s.jsx("div",{className:"absolute top-1 right-1",children:s.jsx("div",{className:"bg-white/90 backdrop-blur-sm rounded-full p-1",children:s.jsx(cr,{platform:Q.postPlatform,size:12})})}),Y&&s.jsx("div",{className:"absolute bottom-1 right-1 bg-white text-gray-800 text-xs px-1 py-0.5 rounded-full flex items-center shadow-sm border border-gray-200",children:s.jsx("span",{className:"text-[10px]",children:Y.type==="video"?"🎬":"🖼️"})}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:s.jsx("p",{className:"text-white text-xs font-medium truncate",children:Q.postContent})})]})},Q.postId)})}):s.jsx("div",{className:"mb-3 text-xs text-gray-500 italic",children:i("posts.noPosts","Aucun post pour cette marque")}),p&&s.jsx("div",{ref:C,className:"fixed pointer-events-none z-50",style:{left:ue().x,top:ue().y},children:s.jsx(db,{post:X(p)})})]}),J=()=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:e.social_accounts.length>0?i("brands.connectedAccounts","Connected Accounts"):i("brands.accounts","Accounts")}),s.jsxs("button",{onClick:()=>h(!0),className:"text-sm text-primary-600 hover:text-primary-700 font-medium transition-colors flex items-center",children:[s.jsx(tn,{className:"w-4 h-4 inline mr-1"}),i("brands.connectAccount","Connect an account")]})]}),e.social_accounts.length>0?s.jsx("div",{className:"flex flex-wrap gap-2",children:e.social_accounts.map((Q,W)=>s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-primary-100 text-primary-700 rounded-lg",children:[s.jsx(cr,{platform:Q.platform,size:20}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-primary-700",children:Q.username||Q.platform}),Q.profileImage&&s.jsx("img",{src:Q.profileImage,alt:`${Q.username}'s profile`,className:"w-6 h-6 rounded-full object-cover"})]})]},`${Q.accountId||Q.platform||"acc"}_${W}`))}):s.jsx("div",{className:"mb-3 text-xs text-gray-500 italic",children:i("brands.noAccounts","No accounts connected for this brand")})]}),G=()=>e.members.length>0?s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:i("brands.associatedMembers","Associated members")}),s.jsx("div",{className:"flex flex-wrap gap-4",children:e.members.sort((Q,W)=>Q.status==="active"&&W.status!=="active"?-1:Q.status!=="active"&&W.status==="active"?1:0).map(Q=>Q.status==="active"?s.jsx(k5,{message:Q.email,children:s.jsxs("div",{className:"flex items-center gap-2 bg-green-50 rounded-lg px-3 py-2",children:[Q.photoURL?s.jsx("img",{src:Q.photoURL,alt:Q.firstName,className:"w-7 h-7 rounded-full object-cover"}):s.jsx("span",{className:"w-7 h-7 rounded-full bg-primary-100 text-primary-700 flex items-center justify-center font-bold text-sm",children:Q.firstName?Q.firstName.charAt(0).toUpperCase():"?"}),s.jsx("span",{className:"text-sm font-medium text-green-700",children:Q.firstName})]})},Q.id):Q.status==="pending"?s.jsx(k5,{message:Q.email,children:s.jsx("div",{className:"flex items-center gap-2 bg-orange-50 rounded-lg px-3 py-2",children:s.jsx("span",{className:"text-xs text-orange-700",children:Q.email})})},Q.id):null)})]}):null;return s.jsxs(zG,{children:[le(),a?s.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsx("p",{className:"text-gray-600 text-sm",children:e.description}),ae(),e.values.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:i("brands.values")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.values.map((Q,W)=>s.jsx("span",{className:"px-2 py-1 bg-gray-100 text-gray-700 rounded-lg text-sm",children:Q},W))})]}),e.keywords.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:i("brands.keywords")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.keywords.map((Q,W)=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 rounded-lg text-sm",children:[s.jsx(Sk,{className:"w-3 h-3"}),Q]},W))})]})]}),s.jsxs("div",{className:"space-y-6",children:[te(),s.jsx("div",{className:"flex justify-center",children:s.jsx("hr",{className:"w-4/5 border-t border-gray-200"})}),ne(),s.jsx("div",{className:"flex justify-center",children:s.jsx("hr",{className:"w-4/5 border-t border-gray-200"})}),J(),G()]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-600 text-sm mb-6 line-clamp-2",children:e.description}),ae()&&s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),ae()]}),s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),te()]}),s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),ne()]}),s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),J()]}),G()&&s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),G()]}),e.values.length>0&&s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:i("brands.values")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.values.map((Q,W)=>s.jsx("span",{className:"px-2 py-1 bg-gray-100 text-gray-700 rounded-lg text-sm",children:Q},W))})]})]}),e.keywords.length>0&&s.jsxs("div",{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:i("brands.keywords")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.keywords.map((Q,W)=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 rounded-lg text-sm",children:[s.jsx(Sk,{className:"w-3 h-3"}),Q]},W))})]})]})]}),s.jsx(BG,{isOpen:c,onClose:()=>u(!1),onCreateWithAI:D,onCreateManually:A}),s.jsx(np,{isOpen:d,onClose:()=>f(!1),onCreateWithAI:E,onCreateManually:F}),s.jsx(WG,{isOpen:m,onClose:()=>h(!1),onConnect:$,existingPlatforms:e.social_accounts.map(Q=>Q.platform)})]})},Pj=({isOpen:e,onClose:t,onConfirm:r,title:n,message:a,warning:i})=>{const{t:o}
3844=Te();return e?s.jsx("div",{className:"fixed inset-0 z-[60] overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(qs,{className:"w-5 h-5"}),s.jsx("h2",{className:"text-xl font-semibold",children:n})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-700",dangerouslySetInnerHTML:{__html:a}}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:o("common.cancel")}),s.jsx("button",{onClick:()=>{r(),t()},className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700",children:o("common.confirm")})]})]})]})}):null};var VHe=Object.defineProperty,WHe=(e,t,r)=>t in e?VHe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,RS=(e,t,r)=>(WHe(e,typeof t!="symbol"?t+"":t,r),r);let qHe=class{constructor(){RS(this,"current",this.detect()),RS(this,"handoffState","pending"),RS(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},ec=new qHe,pc=(e,t)=>{ec.isServer?b.useEffect(e,t):b.useLayoutEffect(e,t)};function _j(e){let t=b.useRef(e);return pc(()=>{t.current=e},[e]),t}let gs=function(e){let t=_j(e);return U.useCallback((...r)=>t.current(...r),[t])};function Lj(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Dj(){let e=[],t={addEventListener(r,n,a,i){return r.addEventListener(n,a,i),t.add(()=>r.removeEventListener(n,a,i))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Lj(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,a){let i=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:a}),this.add(()=>{Object.assign(r.style,{[n]:i})})},group(r){let n=Dj();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let a of e.splice(n,1))a()}},dispose(){for(let r of e.splice(0))r()}};return t}function GHe(){let[e]=b.useState(Dj);return b.useEffect(()=>()=>e.dispose(),[e]),e}function HHe(){let e=typeof document>"u";return"useSyncExternalStore"in Wd?(t=>t.useSyncExternalStore)(Wd)(()=>()=>{},()=>!1,()=>!e):!1}function Oj(){let e=HHe(),[t,r]=b.useState(ec.isHandoffComplete);return t&&ec.isHandoffComplete===!1&&r(!1),b.useEffect(()=>{t!==!0&&r(!0)},[t]),b.useEffect(()=>ec.handoff(),[]),e?!1:t}var I5;let Cp=(I5=U.useId)!=null?I5:function(){let e=Oj(),[t,r]=U.useState(e?()=>ec.nextId():null);return pc(()=>{t===null&&r(ec.nextId())},[t]),t!=null?""+t:void 0};function Lu(e,t,...r){if(e in t){let a=t[e];return typeof a=="function"?a(...r):a}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Lu),n}function GG(e){return ec.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let d4=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var fd=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(fd||{}),HG=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(HG||{}),YHe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(YHe||{});function QHe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(d4)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var YG=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(YG||{});function KHe(e,t=0){var r;return e===((r=GG(e))==null?void 0:r.body)?!1:Lu(t,{0(){return e.matches(d4)},1(){let n=e;for(;n!==null;){if(n.matches(d4))return!0;n=n.parentElement}return!1}})}
3844var JHe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(JHe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Bd(e){e==null||e.focus({preventScroll:!0})}let ZHe=["textarea","input"].join(",");function XHe(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ZHe))!=null?r:!1}function eYe(e,t=r=>r){return e.slice().sort((r,n)=>{let a=t(r),i=t(n);if(a===null||i===null)return 0;let o=a.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function tx(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:a=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?eYe(e):e:QHe(e);a.length>0&&o.length>1&&(o=o.filter(h=>!a.includes(h))),n=n??i.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=o.length,m;do{if(d>=f||d+f<=0)return 0;let h=c+d;if(t&16)h=(h+f)%f;else{if(h<0)return 3;if(h>=f)return 1}m=o[h],m==null||m.focus(u),d+=l}while(m!==i.activeElement);return t&6&&XHe(m)&&m.select(),2}function QG(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function tYe(){return/Android/gi.test(window.navigator.userAgent)}function rYe(){return QG()||tYe()}function xv(e,t,r){let n=_j(t);b.useEffect(()=>{function a(i){n.current(i)}return document.addEventListener(e,a,r),()=>document.removeEventListener(e,a,r)},[e,r])}function KG(e,t,r){let n=_j(t);b.useEffect(()=>{function a(i){n.current(i)}return window.addEventListener(e,a,r),()=>window.removeEventListener(e,a,r)},[e,r])}function nYe(e,t,r=!0){let n=b.useRef(!1);b.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function a(o,l){if(!n.current||o.defaultPrevented)return;let c=l(o);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of u){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(c)||o.composed&&o.composedPath().includes(f))return}return!KHe(c,YG.Loose)&&c.tabIndex!==-1&&o.preventDefault(),t(o,c)}let i=b.useRef(null);xv("pointerdown",o=>{var l,c;n.current&&(i.current=((c=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:c[0])||o.target)},!0),xv("mousedown",o=>{var l,c;n.current&&(i.current=((c=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:c[0])||o.target)},!0),xv("click",o=>{rYe()||i.current&&(a(o,()=>i.current),i.current=null)},!0),xv("touchend",o=>a(o,()=>o.target instanceof HTMLElement?o.target:null),!0),KG("blur",o=>a(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function fb(...e){return b.useMemo(()=>GG(...e),[...e])}let JG=Symbol();function aYe(e,t=!0){return Object.assign(e,{[JG]:t})}function Nc(...e){let t=b.useRef(e);b.useEffect(()=>{t.current=e},[e]);let r=gs(n=>{for(let a of t.current)a!=null&&(typeof a=="function"?a(n):a.current=n)});return e.every(n=>n==null||(n==null?void 0:n[JG]))?void 0:r}function nA(e,t){let r=b.useRef([]),n=gs(e);b.useEffect(()=>{let a=[...r.current];for(let[i,o]of t.entries())if(r.current[i]!==o){let l=n(t,a);return r.current=t,l}},[n,...t])}function E5(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var f4=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(f4||{}),sYe=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(sYe||{});function gl({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:a,visible:i=!0,name:o,mergeRefs:l}){l=l??iYe;let c=ZG(t,e);if(i)return wv(c,r,n,o,l);let u=a??0;if(u&2){let{static:d=!1,...f}=c;if(d)return wv(f,r,n,o,l)}if(u&1){let{unmount:d=!0,...f}=c;return Lu(d?0:1,{0(){return null},1(){return wv({...f,hidden:!0,style:{display:"none"}},r,n,o,l)}})}return wv(c,r,n,o,l)}function wv(e,t={},r,n,a){let{as:i=r,children:o,refName:l="ref",...c}=$S(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},d=typeof o=="function"?o(t):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t));let f={};if(t){let m=!1,h=[];for(let[p,g]of Object.entries(t))typeof g=="boolean"&&(m=!0),g===!0&&h.push(p);m&&(f["data-headlessui-state"]=h.join(" "))}if(i===b.Fragment&&Object.keys(T5(c)).length>0){if(!b.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(c).map(g=>`  - ${g}`).join(`
3845`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>`  - ${g}`).join(`
3846`)].join(`
3847`));let m=d.props,h=typeof(m==null?void 0:m.className)=="function"?(...g)=>E5(m==null?void 0:m.className(...g),c.className):E5(m==null?void 0:m.className,c.className),p=h?{className:h}:{};return b.cloneElement(d,Object.assign({},ZG(d.props,T5($S(c,["ref"]))),f,u,{ref:a(d.ref,u.ref)},p))}return b.createElement(i,Object.assign({},$S(c,["ref"]),i!==b.Fragment&&u,i!==b.Fragment&&f),d)}function iYe(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function ZG(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let a in n)a.startsWith("on")&&typeof n[a]=="function"?(r[a]!=null||(r[a]=[]),r[a].push(n[a])):t[a]=n[a];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](a,...i){let o=r[n];for(let l of o){if((a instanceof Event||(a==null?void 0:a.nativeEvent)instanceof Event)&&a.defaultPrevented)return;l(a,...i)}}});return t}function yl(e){var t;return Object.assign(b.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function T5(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function $S(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let oYe="div";var gw=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(gw||{});function lYe(e,t){var r;let{features:n=1,...a}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:(r=a["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return gl({ourProps:i,theirProps:a,slot:{},defaultTag:oYe,name:"Hidden"})}let m4=yl(lYe),XG=b.createContext(null);XG.displayName="OpenClosedContext";var _g=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(_g||{});function cYe(){return b.useContext(XG)}function uYe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Qc=[];uYe(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Qc[0]!==t.target&&(Qc.unshift(t.target),Qc=Qc.filter(r=>r!=null&&r.isConnected),Qc.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function dYe(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&fYe(r)?!1:n}function fYe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var eH=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(eH||{});function tH(e,t,r,n){let a=_j(r);b.useEffect(()=>{e=e??window;function i(o){a.current(o)}return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)},[e,t,n])}function rH(){let e=b.useRef(!1);return pc(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nH(e){let t=gs(e),r=b.useRef(!1);b.useEffect(()=>(r.current=!1,()=>{r.current=!0,Lj(()=>{r.current&&t()})}),[t])}var Lg=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Lg||{});function mYe(){let e=b.useRef(0);return KG("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function aH(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let hYe="div";var sH=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.Re
3847storeFocus=16]="RestoreFocus",e[e.All=30]="All",e))(sH||{});function pYe(e,t){let r=b.useRef(null),n=Nc(r,t),{initialFocus:a,containers:i,features:o=30,...l}=e;Oj()||(o=1);let c=fb(r);bYe({ownerDocument:c},!!(o&16));let u=vYe({ownerDocument:c,container:r,initialFocus:a},!!(o&2));xYe({ownerDocument:c,container:r,containers:i,previousActiveElement:u},!!(o&8));let d=mYe(),f=gs(g=>{let y=r.current;y&&(v=>v())(()=>{Lu(d.current,{[Lg.Forwards]:()=>{tx(y,fd.First,{skipElements:[g.relatedTarget]})},[Lg.Backwards]:()=>{tx(y,fd.Last,{skipElements:[g.relatedTarget]})}})})}),m=GHe(),h=b.useRef(!1),p={ref:n,onKeyDown(g){g.key=="Tab"&&(h.current=!0,m.requestAnimationFrame(()=>{h.current=!1}))},onBlur(g){let y=aH(i);r.current instanceof HTMLElement&&y.add(r.current);let v=g.relatedTarget;v instanceof HTMLElement&&v.dataset.headlessuiFocusGuard!=="true"&&(iH(y,v)||(h.current?tx(r.current,Lu(d.current,{[Lg.Forwards]:()=>fd.Next,[Lg.Backwards]:()=>fd.Previous})|fd.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Bd(g.target)))}};return U.createElement(U.Fragment,null,!!(o&4)&&U.createElement(m4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:gw.Focusable}),gl({ourProps:p,theirProps:l,defaultTag:hYe,name:"FocusTrap"}),!!(o&4)&&U.createElement(m4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:gw.Focusable}))}let gYe=yl(pYe),mg=Object.assign(gYe,{features:sH});function yYe(e=!0){let t=b.useRef(Qc.slice());return nA(([r],[n])=>{n===!0&&r===!1&&Lj(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=Qc.slice())},[e,Qc,t]),gs(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function bYe({ownerDocument:e},t){let r=yYe(t);nA(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Bd(r())},[t]),nH(()=>{t&&Bd(r())})}function vYe({ownerDocument:e,container:t,initialFocus:r},n){let a=b.useRef(null),i=rH();return nA(()=>{if(!n)return;let o=t.current;o&&Lj(()=>{if(!i.current)return;let l=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===l){a.current=l;return}}else if(o.contains(l)){a.current=l;return}r!=null&&r.current?Bd(r.current):tx(o,fd.First)===HG.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),a.current=e==null?void 0:e.activeElement})},[n]),a}function xYe({ownerDocument:e,container:t,containers:r,previousActiveElement:n},a){let i=rH();tH(e==null?void 0:e.defaultView,"focus",o=>{if(!a||!i.current)return;let l=aH(r);t.current instanceof HTMLElement&&l.add(t.current);let c=n.current;if(!c)return;let u=o.target;u&&u instanceof HTMLElement?iH(l,u)?(n.current=u,Bd(u)):(o.preventDefault(),o.stopPropagation(),Bd(c)):Bd(n.current)},!0)}function iH(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let oH=b.createContext(!1);function wYe(){return b.useContext(oH)}function h4(e){return U.createElement(oH.Provider,{value:e.force},e.children)}function jYe(e){let t=wYe(),r=b.useContext(lH),n=fb(e),[a,i]=b.useState(()=>{if(!t&&r!==null||ec.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let l=n.createElement("div");return l.setAttribute("id","headlessui-portal-root"),n.body.appendChild(l)});return b.useEffect(()=>{a!==null&&(n!=null&&n.body.contains(a)||n==null||n.body.appendChild(a))},[a,n]),b.useEffect(()=>{t||r!==null&&i(r.current)},[r,i,t]),a}let NYe=b.Fragment;function SYe(e,t){let r=e,n=b.useRef(null),a=Nc(aYe(d=>{n.current=d}),t),i=fb(n),o=jYe(n),[l]=b.useState(()=>{var d;return ec.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),c=b.useContext(p4),u=Oj();return pc(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),pc(()=>{if(l&&c)return c.register(l)},[c,l]),nH(()=>{var d;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((d=o.parentElement)==null||d.removeChild(o)))}),u?!o||!l?null:Ly.createPortal(gl({ourProps:{ref:a},theirProps:r,defaultTag:NYe,name:"Portal"}),l):null}let CYe=b.Fragment,lH=b.createContext(null);
3847function kYe(e,t){let{target:r,...n}=e,a={ref:Nc(t)};return U.createElement(lH.Provider,{value:r},gl({ourProps:a,theirProps:n,defaultTag:CYe,name:"Popover.Group"}))}let p4=b.createContext(null);function MYe(){let e=b.useContext(p4),t=b.useRef([]),r=gs(i=>(t.current.push(i),e&&e.register(i),()=>n(i))),n=gs(i=>{let o=t.current.indexOf(i);o!==-1&&t.current.splice(o,1),e&&e.unregister(i)}),a=b.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,b.useMemo(()=>function({children:i}){return U.createElement(p4.Provider,{value:a},i)},[a])]}let IYe=yl(SYe),EYe=yl(kYe),g4=Object.assign(IYe,{Group:EYe});function TYe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const AYe=typeof Object.is=="function"?Object.is:TYe,{useState:PYe,useEffect:_Ye,useLayoutEffect:LYe,useDebugValue:DYe}=Wd;function OYe(e,t,r){const n=t(),[{inst:a},i]=PYe({inst:{value:n,getSnapshot:t}});return LYe(()=>{a.value=n,a.getSnapshot=t,FS(a)&&i({inst:a})},[e,n,t]),_Ye(()=>(FS(a)&&i({inst:a}),e(()=>{FS(a)&&i({inst:a})})),[e]),DYe(n),n}function FS(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!AYe(r,n)}catch{return!0}}function RYe(e,t,r){return t()}const $Ye=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FYe=!$Ye,zYe=FYe?RYe:OYe,BYe="useSyncExternalStore"in Wd?(e=>e.useSyncExternalStore)(Wd):zYe;function UYe(e){return BYe(e.subscribe,e.getSnapshot,e.getSnapshot)}function VYe(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(a){return n.add(a),()=>n.delete(a)},dispatch(a,...i){let o=t[a].call(r,...i);o&&(r=o,n.forEach(l=>l()))}}}function WYe(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,a=n.clientWidth-n.offsetWidth,i=e-a;r.style(n,"paddingRight",`${i}px`)}}}function qYe(){return QG()?{before({doc:e,d:t,meta:r}){function n(a){return r.containers.flatMap(i=>i()).some(i=>i.contains(a))}t.microTask(()=>{var a;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Dj();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let i=(a=window.scrollY)!=null?a:window.pageYOffset,o=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let c=l.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!n(d)&&(o=d)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(n(l.target)){let c=l.target;for(;c.parentElement&&n(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement)if(n(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;i!==c&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function GYe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function HYe(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Cd=VYe(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Dj(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:HYe(r)},a=[qYe(),WYe(),GYe()];a.forEach(({before:i})=>i==null?void 0:i(n)),a.forEach(({after:i})=>i==null?void 0:i(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Cd.subscribe(()=>{let e=Cd.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",a=r.count!==0;(a&&!n||!a&&n)&&Cd.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Cd.dispatch("TEARDOWN",r)}});function YYe(e,t,r){let n=UYe(Cd),a=e?n.get(e):void 0,i=a?a.count>0:!1;return pc(()=>
3847{if(!(!e||!t))return Cd.dispatch("PUSH",e,r),()=>Cd.dispatch("POP",e,r)},[t,e]),i}let zS=new Map,hg=new Map;function A5(e,t=!0){pc(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function a(){var o;if(!n)return;let l=(o=hg.get(n))!=null?o:1;if(l===1?hg.delete(n):hg.set(n,l-1),l!==1)return;let c=zS.get(n);c&&(c["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",c["aria-hidden"]),n.inert=c.inert,zS.delete(n))}let i=(r=hg.get(n))!=null?r:0;return hg.set(n,i+1),i!==0||(zS.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),a},[e,t])}function QYe({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let a=b.useRef((n=r==null?void 0:r.current)!=null?n:null),i=fb(a),o=gs(()=>{var l,c,u;let d=[];for(let f of e)f!==null&&(f instanceof HTMLElement?d.push(f):"current"in f&&f.current instanceof HTMLElement&&d.push(f.current));if(t!=null&&t.current)for(let f of t.current)d.push(f);for(let f of(l=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?l:[])f!==document.body&&f!==document.head&&f instanceof HTMLElement&&f.id!=="headlessui-portal-root"&&(f.contains(a.current)||f.contains((u=(c=a.current)==null?void 0:c.getRootNode())==null?void 0:u.host)||d.some(m=>f.contains(m))||d.push(f));return d});
3847return{resolveContainers:o,contains:gs(l=>o().some(c=>c.contains(l))),mainTreeNodeRef:a,MainTreeNode:b.useMemo(()=>function(){return r!=null?null:U.createElement(m4,{features:gw.Hidden,ref:a})},[a,r])}}let aA=b.createContext(()=>{});aA.displayName="StackContext";var y4=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(y4||{});function KYe(){return b.useContext(aA)}function JYe({children:e,onUpdate:t,type:r,element:n,enabled:a}){let i=KYe(),o=gs((...l)=>{t==null||t(...l),i(...l)});return pc(()=>{let l=a===void 0||a===!0;return l&&o(0,r,n),()=>{l&&o(1,r,n)}},[o,r,n,a]),U.createElement(aA.Provider,{value:o},e)}let cH=b.createContext(null);function uH(){let e=b.useContext(cH);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,uH),t}return e}function ZYe(){let[e,t]=b.useState([]);return[e.length>0?e.join(" "):void 0,b.useMemo(()=>function(r){let n=gs(i=>(t(o=>[...o,i]),()=>t(o=>{let l=o.slice(),c=l.indexOf(i);return c!==-1&&l.splice(c,1),l}))),a=b.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return U.createElement(cH.Provider,{value:a},r.children)},[t])]}let XYe="p";function eQe(e,t){let r=Cp(),{id:n=`headlessui-description-${r}`,...a}=e,i=uH(),o=Nc(t);pc(()=>i.register(n),[n,i.register]);let l={ref:o,...i.props,id:n};return gl({ourProps:l,theirProps:a,slot:i.slot||{},defaultTag:XYe,name:i.name||"Description"})}let tQe=yl(eQe),rQe=Object.assign(tQe,{});var nQe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(nQe||{}),aQe=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(aQe||{});let sQe={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},yw=b.createContext(null);yw.displayName="DialogContext";function mb(e){let t=b.useContext(yw);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,mb),r}return t}function iQe(e,t,r=()=>[document.body]){YYe(e,t,n=>{var a;return{containers:[...(a=n.containers)!=null?a:[],r]}})}function oQe(e,t){return Lu(t.type,sQe,e,t)}let lQe="div",cQe=f4.RenderStrategy|f4.Static;function uQe(e,t){let r=Cp(),{id:n=`headlessui-dialog-${r}`,open:a,onClose:i,initialFocus:o,role:l="dialog",__demoMode:c=!1,...u}=e,[d,f]=b.useState(0),m=b.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(m.current||(m.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=cYe();a===void 0&&h!==null&&(a=(h&_g.Open)===_g.Open);let p=b.useRef(null),g=Nc(p,t),y=fb(p),v=e.hasOwnProperty("open")||h!==null,x=e.hasOwnProperty("onClose");if(!v&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof a!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a}`);if(typeof i!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let j=a?0:1,[C,N]=b.useReducer(oQe,{titleId:null,descriptionId:null,panelRef:b.createRef()}),S=gs(()=>i(!1)),M=gs(Q=>N({type:0,id:Q})),k=Oj()?c?!1:j===0:!1,I=d>1,T=b.useContext(yw)!==null,[L,R]=MYe(),_={get current(){var Q;return(Q=C.panelRef.current)!=null?Q:p.current}},{resolveContainers:B,mainTreeNodeRef:z,MainTreeNode:D}=QYe({portals:L,defaultContainers:[_]}),A=I?"parent":"leaf",P=h!==null?(h&_g.Closing)===_g.Closing:!1,E=T||P?!1:k,F=b.useCallback(()=>{var Q,W;return(W=Array.from((Q=y==null?void 0:y.querySelectorAll("body > *"))!=null?Q:[]).find(Y=>Y.id==="headlessui-portal-root"?!1:Y.contains(z.current)&&Y instanceof HTMLElement))!=null?W:null},[z]);A5(F,E);let $=I?!0:k,H=b.useCallback(()=>{var Q,W;return(W=Array.from((Q=y==null?void 0:y.querySelectorAll("[data-headlessui-portal]"))!=null?Q:[]).find(Y=>Y.contains(z.current)&&Y instanceof HTMLElement))!=null?W:null},[z]);A5(H,$),nYe(B,Q=>{Q.preventDefault(),S()},!(!k||I));let ue=!(I||j!==0);tH(y==null?void 0:y.defaultView,"keydown",Q=>{ue&&(Q.defaultPrevented||Q.key===eH.Escape&&(Q.preventDefault(),Q.stopPropagation(),S()))}),iQe(y,!(P||j!==0||T),B),b.useEffect(()=>{if(j!==0||!p.current)return;let Q=new ResizeObserver(W=>{for(let Y of W){let q=Y.target.getBoundingClientRect();q.x===0&&q.y===0&&q.width===0&&q.height===0&&S()}});return Q.observe(p.current),()=>Q.disconnect()},[j,p,S]);let[ae,te]=ZYe(),ne=b.useMemo(()=>[{dialogState:j,close:S,setTitleId:M},C],[j,C,S,M]),J=b.useMemo(()=>({open:j===0}),[j]),G={ref:g,id:n,role:l,"aria-modal":j===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":ae};return U.createElement(JYe,{type:"Dialog",enabled:j===0,element:p,onUpdate:gs((Q,W)=>{W==="Dialog"&&Lu(Q,{[y4.Add]:()=>f(Y=>Y+1),[y4.Remove]:()=>f(Y=>Y-1)})})},U.createElement(h4,{force:!0},U.createElement(g4,null,U.createElement(yw.Provider,{value:ne},U.createElement(g4.Group,{target:p},U.createElement(h4,{force:!1},U.createElement(te,{slot:J,name:"Dialog.Description"},U.createElement(mg,{initialFocus:o,containers:B,features:k?Lu(A,{parent:mg.features.RestoreFocus,leaf:mg.features.All&~mg.features.FocusLock}):mg.features.None},U.createElement(R,null,gl({ourProps:G,theirProps:u,slot:J,defaultTag:lQe,features:cQe,visible:j===0,name:"Dialog"}))))))))),U.createElement(D,null))}let dQe="div";function fQe(e,t){let r=Cp(),{id:n=`headlessui-dialog-overlay-${r}`,...a}=e,[{dialogState:i,close:o}]=mb("Dialog.Overlay"),l=Nc(t),c=gs(d=>{if(d.target===d.currentTarget){if(dYe(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),o()}}),u=b.useMemo(()=>({open:i===0}),[i]);return gl({ourProps:{ref:l,id:n,"aria-hidden":!0,onClick:c},theirProps:a,slot:u,defaultTag:dQe,name:"Dialog.Overlay"})}let mQe="div";function hQe(e,t){let r=Cp(),{id:n=`headlessui-dialog-backdrop-${r}`,...a}=e,[{dialogState:i},o]=mb("Dialog.Backdrop"),l=Nc(t);b.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let c=b.useMemo(()=>({open:i===0}),[i]);return U.createElement(h4,{force:!0},U.createElement(g4,null,gl({ourProps:{ref:l,id:n,"aria-hidden":!0},theirProps:a,slot:c,defaultTag:mQe,name:"Dialog.Backdrop"})))}let pQe="div";function gQe(e,t){let r=Cp(),{id:n=`headlessui-dialog-panel-${r}`,...a}=e,[{dialogState:i},o]=mb("Dialog.Panel"),l=Nc(t,o.panelRef),c=b.useMemo(()=>({open:i===0}),[i]),u=gs(d=>{d.stopPropagation()});return gl({ourProps:{ref:l,id:n,onClick:u},theirProps:a,slot:c,defaultTag:pQe,name:"Dialog.Panel"})}let yQe="h2";function bQe(e,t){let r=Cp(),{id:n=`headlessui-dialog-title-${r}`,...a}=e,[{dialogState:i,setTitleId:o}]=mb("Dialog.Title"),l=Nc(t);b.useEffect(()=>(o(n),()=>o(null)),[n,o]);let c=b.useMemo(()=>({open:i===0}),[i]);return gl({ourProps:{ref:l,id:n},theirProps:a,slot:c,defaultTag:yQe,name:"Dialog.Title"})}let vQe=yl(uQe),xQe=yl(hQe),wQe=yl(gQe),jQe=yl(fQe),NQe=yl(bQe),P5=Object.assign(vQe,{Backdrop:xQe,Panel:wQe,Overlay:jQe,Title:NQe,Description:rQe});function SQe({onSubmit:e,onSkip:t}){const{t:r}=Te(),[n,a]=b.useState(""),i=(o,l)=>{o.preventDefault(),n.trim()&&e(n.trim(),l)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:r("brands.websiteFetchModal.title")}),s.jsx("p",{className:"mt-2 text-sm text-gray-500",children:r("brands.websiteFetchModal.description")})]}),s.jsxs("form",{onSubmit:o=>i(o,!0),className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"website",className:"sr-only",children:r("brands.websiteFetchModal.websiteLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(Zs,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{type:"text",name:"website",id:"website",value:n,onChange:o=>a(o.target.value),className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500",placeholder:r("brands.websiteFetchModal.websitePlaceholder")})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s.jsx("button",{type:"submit",disabled:!n.trim(),className:"flex-1 inline-flex justify-center items-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r("brands.websiteFetchModal.analyze")}),s.jsx("button",{type:"button",onClick:o=>i(o,!1),disabled:!n.trim(),className:"flex-1 inline-flex justify-center items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-lg text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r("brands.websiteFetchModal.skipAnalysis")})]}),s.jsx("div",{className:"text-center",children:s.jsx("button",{type:"button",onClick:t,className:"text-sm text-gray-500 hover:text-gray-700",children:r("brands.websiteFetchModal.skipAndStart")})})]})]})}function Wu({title:e,steps:t,currentStep:r,className:n="",videoSrc:a="/Panda - Riding Unicorn - Horizontal - Small.mp4"}){return s.jsx("div",{className:`fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 ${n}`,children:s.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-4 sm:p-8 mx-4 sm:mx-0 max-w-md w-full text-center",children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900 dark:text-white mb-2",children:e}),r?s.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 animate-pulse mb-4",children:r}):t==null?void 0:t.map((i,o)=>s.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-4",children:i.message},o)),s.jsx("div",{className:"loading",children:s.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInl
3847ine:!0,className:"w-full h-auto rounded-lg",style:{maxHeight:"280px",minHeight:"200px"},children:[s.jsx("source",{src:a,type:"video/mp4"}),s.jsx("img",{src:"https://media.socialness.ai/Panda+-+Riding+Unicorn+-+Small.gif",alt:"Loading...",className:"w-full h-auto rounded-lg"})]})})]})})}function dH({isVisible:e}){const{t}=Te(),[r,n]=b.useState(""),[a,i]=b.useState(0),o=[{message:t("brands.generation.steps.analyzing","Analyzing brand information and target markets..."),duration:2500},{message:t("brands.generation.steps.identifying","Identifying brand values and unique selling points..."),duration:2500},{message:t("brands.generation.steps.exploring","Exploring your brand assets and your brand style..."),duration:2500},{message:t("brands.generation.steps.creating","Creating content strategy and recommendations..."),duration:2500},{message:t("brands.generation.steps.optimizing","Optimizing social media presence and channel recommendations..."),duration:2500},{message:t("brands.generation.steps.finalizing","Finalizing brand strategy profile..."),duration:2500}];return b.useEffect(()=>{if(!e){i(0),n("");return}i(0),n(o[0].message);const l=setInterval(()=>{i(c=>{const u=c+1;return u>=o.length?(clearInterval(l),c):(n(o[u].message),u)})},2500);return()=>clearInterval(l)},[e]),e?s.jsx(Wu,{title:t("brands.generation.title","Creating Your Brand Strategy"),currentStep:r,videoSrc:"/Panda Socialness.ai - Casting a spell.mov"}):null}function b4(e,t){var h,p;const{analysis:r,logo:n,originalUrl:a}=e,i=(r==null?void 0:r.brandIdentity)??{},o=(r==null?void 0:r.contentStrategy)??{},l=(r==null?void 0:r.goToMarketStrategy)??{},c=(r==null?void 0:r.overview)??{},u=a||t||"",d=g=>{if(!g)return"advertising-marketing";const y=g.toLowerCase();return y.includes("automotive")?"automotive":y.includes("education")?"education":y.includes("healthcare")?"healthcare":y.includes("technology")||y.includes("information technology")?"information-technology":y.includes("saas")||y.includes("software as a service")?"saas":y.includes("finance")||y.includes("banking")?"banking-financial":y.includes("retail")?"retail":y.includes("food")||y.includes("beverage")?"food-beverage":y.includes("travel")||y.includes("hospitality")||y.includes("tourism")?"hospitality-tourism":y.includes("real estate")?"real-estate":y.includes("nonprofit")||y.includes("non-profit")?"non-profit":y.includes("government")?"government":y.includes("entertainment")||y.includes("media")?"entertainment-media":y.includes("sports")?"sports":y.includes("fashion")||y.includes("apparel")?"fashion-apparel":y.includes("gaming")?"gaming":y.includes("ecommerce")||y.includes("e-commerce")?"ecommerce":"advertising-marketing"},f=g=>{if(!g)return"professional";const y=g.toLowerCase();return y.includes("informative")||y.includes("informatif")?"informative":y.includes("friendly")||y.includes("amical")?"friendly":y.includes("professional")||y.includes("professionnel")?"professional":y.includes("casual")||y.includes("décontracté")?"casual":y.includes("authoritative")||y.includes("autoritaire")?"authoritative":y.includes("inspiring")||y.includes("inspirant")?"inspiring":y.includes("playful")||y.includes("ludique")?"playful":y.includes("empathetic")||y.includes("empathique")?"empathetic":y.includes("actionable")||y.includes("actionnable")?"actionable":"professional"},m=g=>{if(!g)return"auto";const y=g.toLowerCase();return y.includes("realistic")||y.includes("réaliste")?"realistic":y.includes("design")?"design":y.includes("3d")?"3d":y.includes("artistic")||y.includes("artistique")?"artistic":y.includes("modern")||y.includes("moderne")?"modern":y.includes("ad")||y.includes("advertisement")||y.includes("publicité")?"ad":(y.includes("auto")||y.includes("automatique"),"auto")};return{id:"",name:i.name??"",description:i.bio??"",logo:n||((p=(h=e.visualAnalysis)==null?void 0:h.branding)==null?void 0:p.logo)||"",website:u,industryId:d(i.industry),values:i.values??[],keywords:i.keywords??[],languages:[i.mainLanguage??"en"],contentTone:f(o.toneGuidelines||i.contentTone),imageStyle:m(i.imageStyle),voice:i.voice??"",uniqueSellingPoints:i.uniqueSellingPoints??[],recommendedFormats:o.recommendedFormats??[],socialMedias:(o.recommendedPlatforms??[]).map(g=>({platform:g.platform,frequency:g.postingFrequency||"weekly"})),themes:o.themes??[],contentGaps:o.contentGaps??[],engagementTactics:o.engagementTactics??[],growthOpportunities:o.growthOpportunities??[],summary:{recap:c.summary??"",takeaways:c.takeaways??[]},visualIdentity:i.visualIdentity??{colorPalette:{primary:[],secondary:[],accent:[],neutral:[],recommended:{complementary:[],improvements:""}},typography:{headings:{h1:"",h2:"",h3:""},body:{primary:"",secondary:""},specialty:{buttons:"",captions:"",navigation:""},fallbacks:[],recommendations:{improvements:"",hierarchy:""}}},visualContentStrategy:o.visualContentStrategy??{colorUsage:{socialMediaPosts:"",callToActions:"",backgrounds:"",seasonalAdaptations:""},typographyGuidelines:{socialMediaHeaders:"",bodyText:"",quotesTestimonials:"",hashtagsKeywords:""},visualElementsToEmphasize:[],designConsistencyTips:[],brandExtensions:{socialTemplates:"",logoUsage:"",imageFilters:""}},goToMarketStrategy:{short:l.short??"",targetSegments:l.targetSegments??[],keyPersonaTypes:l.keyPersonaTypes??[],marketScope:l.marketScope??"local",priorityMarkets:l.priorityMarkets??l.targetMarkets??[],businessModel:l.businessModel??"B2C",distributionType:l.distributionType??"digital"}}}function fH({isOpen:e,onClose:t}){const{t:r,i18n:n}=Te(),a=pn(),[i,o]=b.useState(null),[l,c]=b.useState(!1),u=async(d,f)=>{var m;if(/^https?:\/\//i.test(d)||(d=`https://${d}`),f)try{c(!0),o(null);const h=await((m=Qe.currentUser)==null?void 0:m.getIdToken());if(!h)throw new Error("No authentication token available");const p=await fetch("https://api.socialness.ai/ai-coach/brand/analyze?WithVisual=true&fast=true",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${h}`,Origin:"https://socialness.ai"},body:JSON.stringify({url:d,language:n.language.split("-")[0].toLowerCase()})});if(!p.ok){let N=`API returned status ${p.status}`;try{const S=await p.json();N=S.error||S.message||N}catch{try{const M=await p.text();M.includes("<!DOCTYPE")||M.includes("<html")?N="The analysis service is temporarily unavailable. Please try again in a few minutes.":N=M||N}catch{N=`Service temporarily unavailable (${p.status}). Please try again later.`}}throw new Error(N)}const g=await p.json();if(!g.analysis)throw new Error(r("brands.websiteFetchModal.error.invali
3847dResponse"));const y=g.analysis||{},v=y.brandIdentity||{},x=y.contentStrategy||{},j=y.overview||{};console.log("Analysis response:",{data:g,brandIdentity:v,contentStrategy:x,overview:j});const C=b4(g,d);a("/brand-strategy-lab/new",{state:{prefilledData:C}}),t()}catch(h){console.error("Error analyzing website:",h),o(h instanceof Error?h.message:r("brands.websiteFetchModal.error.fetch"))}finally{c(!1)}else a("/brand-strategy-lab/new",{state:{prefilledData:{website:d}}}),t()};return s.jsxs(P5,{open:e,onClose:t,className:"relative z-50",children:[s.jsx("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),s.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:s.jsxs(P5.Panel,{className:"mx-auto max-w-xl w-full rounded-lg bg-white p-6 border border-black shadow-lg",children:[s.jsx("div",{className:"absolute right-0 top-0 pr-4 pt-4",children:s.jsxs("button",{onClick:t,className:"rounded-md bg-white text-gray-400 hover:text-gray-500",children:[s.jsx("span",{className:"sr-only",children:r("brands.websiteFetchModal.ariaLabel.close")}),s.jsx(_t,{className:"h-6 w-6"})]})}),s.jsx("div",{className:"mt-3 text-center sm:mt-0 sm:text-left",children:s.jsx(SQe,{onSubmit:u,onSkip:()=>{a("/brand-strategy-lab/new"),t()}})}),i&&s.jsx("div",{className:"mt-4 p-4 bg-red-50 rounded-lg",children:s.jsx("p",{className:"text-sm text-red-600",children:i})})]})}),l&&s.jsx(dH,{isVisible:l})]})}const CQe=()=>{const e=qr();return mn({mutationFn:async t=>{var a;const r=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`https://api.socialness.ai/management/brands/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to delete brand");return n.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["brands"]})}})};function kQe(e){const{name:t,defaultValue:r,serialize:n=MQe,deserialize:a=IQe,navigateMode:i="push",skipSync:o=!1}=e,[l,c]=ui(),u=pn(),d=vs(),f=l.has(t)&&!o?a(l.get(t)||""):r,[m,h]=b.useState(f);b.useEffect(()=>{if(!o)if(l.has(t)){const g=a(l.get(t)||"");h(g)}else m!==r&&h(r)},[d.search,t,o]);const p=b.useCallback(g=>{h(y=>typeof g=="function"?g(y):g)},[]);return b.useEffect(()=>{if(o)return;const g=new URLSearchParams(l.toString());if(m===r||m===void 0||m===null){if(g.has(t)){g.delete(t);const y=g.toString(),v=y?`?${y}`:"";i==="replace"?u({pathname:d.pathname,search:v},{replace:!0}):c(g)}}else{const y=n(m);if(y){if(g.get(t)!==y){g.set(t,y);const x=g.toString(),j=x?`?${x}`:"";i==="replace"?u({pathname:d.pathname,search:j},{replace:!0}):c(g)}}else if(g.has(t)){g.delete(t);const v=g.toString(),x=v?`?${v}`:"";i==="replace"?u({pathname:d.pathname,search:x},{replace:!0}):c(g)}}},[m,t,l,u,d.pathname,c,o,r,n,i]),[m,p]}function MQe(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.join(","):JSON.stringify(e)}function IQe(e){if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch{}if(e==="true")return!0;if(e==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(e)){const t=Number(e);if(!isNaN(t))return t}return e.includes(",")?e.split(",").map(n=>n.trim()).map(n=>{if(n==="true")return!0;if(n==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(n)){const a=Number(n);if(!isNaN(a))return a}return n}):e}function hb(e,t="",r){return kQe({name:e,defaultValue:t,...r})}const EQe=({isOpen:e,onClose:t,onUpdateLink:r,onCreateShortLink:n,utmResponse:a})=>{const{t:i}=Te(),[o,l]=b.useState({}),[c,u]=b.useState(""),[d,f]=b.useState(!1);b.useEffect(()=>{a&&(l(a.utm_params),u(a.final_url))},[a]),b.useEffect(()=>{if(a&&Object.keys(o).length>0){const v=a.final_url.split("?")[0],x=new URLSearchParams;for(const j in o)Object.prototype.hasOwnProperty.call(o,j)&&o[j]&&x.append(j,o[j]);u(`${v}?${x.toString()}`)}else a&&u(a.final_url)},[o,a]);const m=(v,x)=>{l(j=>({...j,[v]:x}))},h=()=>{navigator.clipboard.writeText(c),f(!0),setTimeout(()=>f(!1),2e3)},p=()=>{r(c),y()},g=()=>{n&&(n(c),y())},y=()=>{t(),l({}),u("")};return!e||!a?null:s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-6 w-full max-w-xl border border-black min-h-[520px]",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[s.jsx(Eu,{className:"w-6 h-6 text-primary-600"}
vendor: 7,668 bytes, line 3847
3847),i("postContent.utmModal.title","Enhanced UTM link generated with AI")]}),s.jsx("button",{onClick:y,className:"text-gray-400 hover:text-gray-600","aria-label":i("common.close","Close"),children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:i("postContent.utmModal.description","This smart link works just like your original one, but now you can track clicks in Google Analytics, for free.")}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:i("postContent.utmModal.finalUrl","New Link with UTM:")}),s.jsxs("div",{className:"relative",children:[s.jsx("textarea",{readOnly:!0,value:c,className:"w-full p-2 border rounded-md text-sm resize-none bg-primary-50 border-primary-600 text-gray-700 pr-10",rows:3}),s.jsx("button",{type:"button",onClick:h,className:"absolute top-2 right-2 p-1 text-primary-600 hover:text-primary-800 focus:outline-none",title:d?i("common.copied","Copied!"):i("common.copy","Copy"),children:d?s.jsx(Ba,{className:"w-5 h-5 text-green-500"}):s.jsx(Iu,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:i("postContent.utmModal.utmParams","UTM Parameters:")}),s.jsx("div",{className:"p-3 border border-gray-300 rounded-md bg-gray-50 space-y-2 max-h-none overflow-y-auto",children:Object.entries(o).map(([v,x])=>s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:`utm-${v}`,className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[v,":"]}),s.jsx("input",{type:"text",id:`utm-${v}`,value:x,onChange:j=>m(v,j.target.value),className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500"})]},v))})]})]}),s.jsxs("div",{className:"mt-6 flex justify-between gap-3",children:[s.jsx("button",{onClick:y,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:i("postContent.utmModal.keepOld","No, keep old link")}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("button",{onClick:p,className:"px-4 py-2 text-sm font-medium text-primary-600 bg-white border border-primary-600 rounded-md hover:bg-primary-50",children:i("postContent.utmModal.updateLink","Yes, update link")}),n&&s.jsxs("button",{onClick:g,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-md hover:bg-primary-700",children:[s.jsx(j0,{className:"w-4 h-4"}),i("postContent.utmModal.createShortLink","Raccourcir le lien")]})]})]})]})})};var mH={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(jg,()=>(()=>{var r={873:(o,l)=>{var c,u,d=function(){var f=function(B,z){var D=B,A=v[z],P=null,E=0,F=null,$=[],H={},X=function(W,Y){P=function(q){for(var Z=new Array(q),me=0;me<q;me+=1){Z[me]=new Array(q);for(var we=0;we<q;we+=1)Z[me][we]=null}return Z}(E=4*D+17),ue(0,0),ue(E-7,0),ue(0,E-7),ae(),le(),ne(W,Y),D>=7&&te(W),F==null&&(F=G(D,A,$)),J(F,Y)},ue=function(W,Y){for(var q=-1;q<=7;q+=1)if(!(W+q<=-1||E<=W+q))for(var Z=-1;Z<=7;Z+=1)Y+Z<=-1||E<=Y+Z||(P[W+q][Y+Z]=0<=q&&q<=6&&(Z==0||Z==6)||0<=Z&&Z<=6&&(q==0||q==6)||2<=q&&q<=4&&2<=Z&&Z<=4)},le=function(){for(var W=8;W<E-8;W+=1)P[W][6]==null&&(P[W][6]=W%2==0);for(var Y=8;Y<E-8;Y+=1)P[6][Y]==null&&(P[6][Y]=Y%2==0)},ae=function(){for(var W=x.getPatternPosition(D),Y=0;Y<W.length;Y+=1)for(var q=0;q<W.length;q+=1){var Z=W[Y],me=W[q];if(P[Z][me]==null)for(var we=-2;we<=2;we+=1)for(var he=-2;he<=2;he+=1)P[Z+we][me+he]=we==-2||we==2||he==-2||he==2||we==0&&he==0}},te=function(W){for(var Y=x.getBCHTypeNumber(D),q=0;q<18;q+=1){var Z=!W&&(Y>>q&1)==1;P[Math.floor(q/3)][q%3+E-8-3]=Z}for(q=0;q<18;q+=1)Z=!W&&(Y>>q&1)==1,P[q%3+E-8-3][Math.floor(q/3)]=Z},ne=function(W,Y){for(var q=A<<3|Y,Z=x.getBCHTypeInfo(q),me=0;me<15;me+=1){var we=!W&&(Z>>me&1)==1;me<6?P[me][8]=we:me<8?P[me+1][8]=we:P[E-15+me][8]=we}for(me=0;me<15;me+=1)we=!W&&(Z>>me&1)==1,me<8?P[8][E-me-1]=we:me<9?P[8][15-me-1+1]=we:P[8][15-me-1]=we;P[E-8][8]=!W},J=function(W,Y){for(var q=-1,Z=E-1,me=7,we=0,he=x.getMaskFunction(Y),ie=E-1;ie>0;ie-=2)for(ie==6&&(ie-=1);;){for(var ye=0;ye<2;ye+=1)if(P[Z][ie-ye]==null){var pe=!1;we<W.length&&(pe=(W[we]>>>me&1)==1),he(Z,ie-ye)&&(pe=!pe),P[Z][ie-ye]=pe,(me-=1)==-1&&(we+=1,me=7)}if((Z+=q)<0||E<=Z){Z-=q,q=-q;break}}},G=function(W,Y,q){for(var Z=N.getRSBlocks(W,Y),me=S(),we=0;we<q.length;we+=1){var he=q[we];me.put(he.getMode(),4),me.put(he.getLength(),x.getLengthInBits(he.getMode(),W)),he.write(me)}var ie=0;for(we=0;we<Z.length;we+=1)ie+=Z[we].dataCount;if(me.getLengthInBits()>8*ie)throw"code length overflow. ("+me.getLengthInBits()+">"+8*ie+")";for(me.getLengthInBits()+4<=8*ie&&me.put(0,4);me.getLengthInBits()%8!=0;)me.putBit(!1);for(;!(me.getLengthInBits()>=8*ie||(me.put(236,8),me.getLengthInBits()>=8*ie));)me.put(17,8);return function(ye,pe){for(var ce=0,xe=0,Ee=0,Ye=new Array(pe.length),fe=new Array(pe.length),je=0;je<pe.length;je+=1){var We=pe[je].dataCount,yt=pe[je].totalCount-We;xe=Math.max(xe,We),Ee=Math.max(Ee,yt),Ye[je]=new Array(We);for(var gt=0;gt<Ye[je].length;gt+=1)Ye[je][gt]=255&ye.getBuffer()[gt+ce];ce+=We;var qe=x.getErrorCorrectPolynomial(yt),ze=C(Ye[je],qe.getLength()-1).mod(qe);for(fe[je]=new Array(qe.getLength()-1),gt=0;gt<fe[je].length;gt+=1){var $e=gt+ze.getLength()-fe[je].length;fe[je][gt]=$e>=0?ze.getAt($e):0}}var ct=0;for(gt=0;gt<pe.length;gt+=1)ct+=pe[gt].totalCount;var oe=new Array(ct),Ne=0;for(gt=0;gt<xe;gt+=1)for(je=0;je<pe.length;je+=1)gt<Ye[je].length&&(oe[Ne]=Ye[je][gt],Ne+=1);for(gt=0;gt<Ee;gt+=1)for(je=0;je<pe.length;je+=1)gt<fe[je].length&&(oe[Ne]=fe[je][gt],Ne+=1);return oe}(me,Z)};H.addData=function(W,Y){var q=null;switch(Y=Y||"Byte"){case"Numeric":q=M(W);break;case"Alphanumeric":q=k(W);break;case"Byte":q=I(W);break;case"Kanji":q=T(W);break;default:throw"mode:"+Y}$.push(q),F=null},H.isDark=function(W,Y){if(W<0||E<=W||Y<0||E<=Y)throw W+","+Y;return P[W][Y]},H.getModuleCount=function(){return E},H.make=function(){if(D<1){for(var W=1;W<40;W++){for(var Y=N.getRSBlocks(W,A),q=S(),Z=0;Z<$.length;Z++){var me=$[Z];q.put(me.getMode(),4),q.put(me.getLength(),x.getLengthInBits(me.getMode(),W)),me.write(q)}var we=0;for(Z=0;Z<Y.length;Z++)we+=Y[Z].dataCount;if(q.getLengthInBits()<=8*we)break}D=W}X(!1,function(){for(var he=0,ie=0,ye=0;ye<8;ye+=1){X(!0,ye);var pe=x.getLostPoint(H);(ye==0||he>pe)&&(he=pe,ie=ye)}return ie}())},H.createTableTag=function(W,Y){W=W||2;var q="";q+='<table style="',q+=" border-width: 0px; border-style: none;",q+=" border-collapse: collapse;",q+=" padding: 0px; margin: "+(Y=Y===void 0?4*W:Y)+"px;",q+='">',q+="<tbody>";for(var Z=0;Z<H.getModuleCount();Z+=1){q+="<tr>";for(var me=0;me<H.getModuleCount();me+=1)q+='<td style="',q+=" border-width: 0px; border-style: none;",q+=" border-collapse: collapse;",q+=" padding: 0px; margin: 0px;",q+=" width: "+W+"px;",q+=" height: "+W+"px;",q+=" background-color: ",q+=H.isDark(Z,me)?"#000000":"#ffffff",q+=";",q+='"/>';q+="</tr>"}return(q+="</tbody>")+"</table>"},H.createSvgTag=function(W,Y,q,Z){var me={};typeof arguments[0]=="object"&&(W=(me=arguments[0]).cellSize,Y=me.margin,q=me.alt,Z=me.title),W=W||2,Y=Y===void 0?4*W:Y,(q=typeof q=="string"?{text:q}:q||{}).text=q.text||null,q.id=q.text?q.id||"qrcode-description":null,(Z=typeof Z=="string"?{text:Z}:Z||{}).text=Z.text||null,Z.id=Z.text?Z.id||"qrcode-title":null;var we,he,ie,ye,pe=H.getModuleCount()*W+2*Y,ce="";for(ye="l"+W+",0 0,"+W+" -"+W+",0 0,-"+W+"z ",ce+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',ce+=me.scalable?"":' width="'+pe+'px" height="'+pe+'px"',ce+=' viewB
3847ox="0 0 '+pe+" "+pe+'" ',ce+=' preserveAspectRatio="xMinYMin meet"',ce+=Z.text||q.text?' role="img" aria-labelledby="'+Q([Z.id,q.id].join(" ").trim())+'"':"",ce+=">",ce+=Z.text?'<title id="'+Q(Z.id)+'">'+Q(Z.text)+"</title>":"",ce+=q.text?'<description id="'+Q(q.id)+'">'+Q(q.text)+"</description>":"",ce+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',ce+='<path d="',he=0;he<H.getModuleCount();he+=1)for(ie=he*W+Y,we=0;we<H.getModuleCount();we+=1)H.isDark(he,we)&&(ce+="M"+(we*W+Y)+","+ie+ye);return(ce+='" stroke="transparent" fill="black"/>')+"</svg>"},H.createDataURL=function(W,Y){W=W||2,Y=Y===void 0?4*W:Y;var q=H.getModuleCount()*W+2*Y,Z=Y,me=q-Y;return _(q,q,function(we,he){if(Z<=we&&we<me&&Z<=he&&he<me){var ie=Math.floor((we-Z)/W),ye=Math.floor((he-Z)/W);return H.isDark(ye,ie)?0:1}return 1})},H.createImgTag=function(W,Y,q){W=W||2,Y=Y===void 0?4*W:Y;var Z=H.getModuleCount()*W+2*Y,me="";return me+="<img",me+=' src="',me+=H.createDataURL(W,Y),me+='"',me+=' width="',me+=Z,me+='"',me+=' height="',me+=Z,me+='"',q&&(me+=' alt="',me+=Q(q),me+='"'),me+"/>"};var Q=function(W){for(var Y="",q=0;q<W.length;q+=1){var Z=W.charAt(q);switch(Z){case"<":Y+="&lt;";break;case">":Y+="&gt;";break;case"&":Y+="&amp;";break;case'"':Y+="&quot;";break;default:Y+=Z}}return Y};return H.createASCII=function(W,Y){if((W=W||1)<2)return function(Ye){Ye=Ye===void 0?2:Ye;var fe,je,We,yt,gt,qe=1*H.getModuleCount()+2*Ye,ze=Ye,$e=qe-Ye,ct={"██":"█","█ ":"▀"," █":"▄","  ":" "},oe={"██":"▀","█ ":"▀"," █":" ","  ":" "},Ne="";for(fe=0;fe<qe;fe+=2){for(We=Math.floor((fe-ze)/1),yt=Math.floor((fe+1-ze)/1),je=0;je<qe;je+=1)gt="█",ze<=je&&je<$e&&ze<=fe&&fe<$e&&H.isDark(We,Math.floor((je-ze)/1))&&(gt=" "),ze<=je&&je<$e&&ze<=fe+1&&fe+1<$e&&H.isDark(yt,Math.floor((je-ze)/1))?gt+=" ":gt+="█",Ne+=Ye<1&&fe+1>=$e?oe[gt]:ct[gt];Ne+=`
3848`}return qe%2&&Ye>0?Ne.substring(0,Ne.length-qe-1)+Array(qe+1).join("▀"):Ne.substring(0,Ne.length-1)}(Y);W-=1,Y=Y===void 0?2*W:Y;var q,Z,me,we,he=H.getModuleCount()*W+2*Y,ie=Y,ye=he-Y,pe=Array(W+1).join("██"),ce=Array(W+1).join("  "),xe="",Ee="";for(q=0;q<he;q+=1){for(me=Math.floor((q-ie)/W),Ee="",Z=0;Z<he;Z+=1)we=1,ie<=Z&&Z<ye&&ie<=q&&q<ye&&H.isDark(me,Math.floor((Z-ie)/W))&&(we=0),Ee+=we?pe:ce;for(me=0;me<W;me+=1)xe+=Ee+`
3849`}return xe.substring(0,xe.length-1)},H.renderTo2dContext=function(W,Y){Y=Y||2;for(var q=H.getModuleCount(),Z=0;Z<q;Z++)for(var me=0;me<q;me++)W.fillStyle=H.isDark(Z,me)?"black":"white",W.fillRect(Z*Y,me*Y,Y,Y)},H};f.stringToBytes=(f.stringToBytesFuncs={default:function(B){for(var z=[],D=0;D<B.length;D+=1){var A=B.charCodeAt(D);z.push(255&A)}return z}}).default,f.createStringToBytes=function(B,z){var D=function(){for(var P=R(B),E=function(){var le=P.read();if(le==-1)throw"eof";return le},F=0,$={};;){var H=P.read();if(H==-1)break;var X=E(),ue=E()<<8|E();$[String.fromCharCode(H<<8|X)]=ue,F+=1}if(F!=z)throw F+" != "+z;return $}(),A=63;return function(P){for(var E=[],F=0;F<P.length;F+=1){var $=P.charCodeAt(F);if($<128)E.push($);else{var H=D[P.charAt(F)];typeof H=="number"?(255&H)==H?E.push(H):(E.push(H>>>8),E.push(255&H)):E.push(A)}}return E}};var m,h,p,g,y,v={L:1,M:0,Q:3,H:2},x=(m=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],h=1335,p=7973,y=function(B){for(var z=0;B!=0;)z+=1,B>>>=1;return z},(g={}).getBCHTypeInfo=function(B){for(var z=B<<10;y(z)-y(h)>=0;)z^=h<<y(z)-y(h);return 21522^(B<<10|z)},g.getBCHTypeNumber=function(B){for(var z=B<<12;y(z)-y(p)>=0;)z^=p<<y(z)-y(p);return B<<12|z},g.getPatternPosition=function(B){return m[B-1]},g.getMaskFunction=function(B){switch(B){case 0:return function(z,D){return(z+D)%2==0};case 1:return function(z,D){return z%2==0};case 2:return function(z,D){return D%3==0};case 3:return function(z,D){return(z+D)%3==0};case 4:return function(z,D){return(Math.floor(z/2)+Math.floor(D/3))%2==0};case 5:return function(z,D){return z*D%2+z*D%3==0};case 6:return function(z,D){return(z*D%2+z*D%3)%2==0};case 7:return function(z,D){return(z*D%3+(z+D)%2)%2==0};default:throw"bad maskPattern:"+B}},g.getErrorCorrectPolynomial=function(B){for(var z=C([1],0),D=0;D<B;D+=1)z=z.multiply(C([1,j.gexp(D)],0));return z},g.getLengthInBits=function(B,z){if(1<=z&&z<10)switch(B){case 1:return 10;case 2:return 9;
vendor: 36,863 bytes, line 3849
3849case 4:case 8:return 8;default:throw"mode:"+B}else if(z<27)switch(B){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+B}else{if(!(z<41))throw"type:"+z;switch(B){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+B}}},g.getLostPoint=function(B){for(var z=B.getModuleCount(),D=0,A=0;A<z;A+=1)for(var P=0;P<z;P+=1){for(var E=0,F=B.isDark(A,P),$=-1;$<=1;$+=1)if(!(A+$<0||z<=A+$))for(var H=-1;H<=1;H+=1)P+H<0||z<=P+H||$==0&&H==0||F==B.isDark(A+$,P+H)&&(E+=1);E>5&&(D+=3+E-5)}for(A=0;A<z-1;A+=1)for(P=0;P<z-1;P+=1){var X=0;B.isDark(A,P)&&(X+=1),B.isDark(A+1,P)&&(X+=1),B.isDark(A,P+1)&&(X+=1),B.isDark(A+1,P+1)&&(X+=1),X!=0&&X!=4||(D+=3)}for(A=0;A<z;A+=1)for(P=0;P<z-6;P+=1)B.isDark(A,P)&&!B.isDark(A,P+1)&&B.isDark(A,P+2)&&B.isDark(A,P+3)&&B.isDark(A,P+4)&&!B.isDark(A,P+5)&&B.isDark(A,P+6)&&(D+=40);for(P=0;P<z;P+=1)for(A=0;A<z-6;A+=1)B.isDark(A,P)&&!B.isDark(A+1,P)&&B.isDark(A+2,P)&&B.isDark(A+3,P)&&B.isDark(A+4,P)&&!B.isDark(A+5,P)&&B.isDark(A+6,P)&&(D+=40);var ue=0;for(P=0;P<z;P+=1)for(A=0;A<z;A+=1)B.isDark(A,P)&&(ue+=1);return D+Math.abs(100*ue/z/z-50)/5*10},g),j=function(){for(var B=new Array(256),z=new Array(256),D=0;D<8;D+=1)B[D]=1<<D;for(D=8;D<256;D+=1)B[D]=B[D-4]^B[D-5]^B[D-6]^B[D-8];for(D=0;D<255;D+=1)z[B[D]]=D;return{glog:function(A){if(A<1)throw"glog("+A+")";return z[A]},gexp:function(A){for(;A<0;)A+=255;for(;A>=256;)A-=255;return B[A]}}}();function C(B,z){if(B.length===void 0)throw B.length+"/"+z;var D=function(){for(var P=0;P<B.length&&B[P]==0;)P+=1;for(var E=new Array(B.length-P+z),F=0;F<B.length-P;F+=1)E[F]=B[F+P];return E}(),A={getAt:function(P){return D[P]},getLength:function(){return D.length},multiply:function(P){for(var E=new Array(A.getLength()+P.getLength()-1),F=0;F<A.getLength();F+=1)for(var $=0;$<P.getLength();$+=1)E[F+$]^=j.gexp(j.glog(A.getAt(F))+j.glog(P.getAt($)));return C(E,0)},mod:function(P){if(A.getLength()-P.getLength()<0)return A;for(var E=j.glog(A.getAt(0))-j.glog(P.getAt(0)),F=new Array(A.getLength()),$=0;$<A.getLength();$+=1)F[$]=A.getAt($);for($=0;$<P.getLength();$+=1)F[$]^=j.gexp(j.glog(P.getAt($))+E);return C(F,0).mod(P)}};return A}var N=function(){var B=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],z=function(A,P){var E={};return E.totalCount=A,E.dataCount=P,E},D={getRSBlocks:function(A,P){var E=function(te,ne){switch(ne){case v.L:return B[4*(te-1)+0];case v.M:return B[4*(te-1)+1];case v.Q:return B[4*(te-1)+2];case v.H:return B[4*(te-1)+3];default:return}}(A,P);if(E===void 0)throw"bad rs block @ typeNumber:"+A+"/errorCorrectionLevel:"+P;for(var F=E.length/3,$=[],H=0;H<F;H+=1)for(var X=E[3*H+0],ue=E[3*H+1],le=E[3*H+2],ae=0;ae<X;ae+=1)$.push(z(ue,le));return $}};return D}(),S=function(){var B=[],z=0,D={getBuffer:function(){return B},getAt:function(A){var P=Math.floor(A/8);return(B[P]>>>7-A%8&1)==1},put:function(A,P){for(var E=0;E<P;E+=1)D.putBit((A>>>P-E-1&1)==1)},getLengthInBits:function(){return z},putBit:function(A){var P=Math.floor(z/8);B.length<=P&&B.push(0),A&&(B[P]|=128>>>z%8),z+=1}};return D},M=function(B){var z=B,D={getMode:function(){return 1},getLength:function(E){return z.length},write:function(E){for(var F=z,$=0;$+2<F.length;)E.put(A(F.substring($,$+3)),10),$+=3;$<F.length&&(F.length-$==1?E.put(A(F.substring($,$+1)),4):F.length-$==2&&E.put(A(F.substring($,$+2)),7))}},A=function(E){for(var F=0,$=0;$<E.length;$+=1)F=10*F+P(E.charAt($));return F},P=function(E){if("0"<=E&&E<="9")return E.charCodeAt(0)-48;throw"illegal char :"+E};return D},k=function(B){var z=B,D={getMode:function(){return 2},getLength:function(P){return z.length},write:function(P){for(var E=z,F=0;F+1<E.length;)P.put(45*A(E.charAt(F))+A(E.charAt(F+1)),11),F+=2;F<E.length&&P.put(A(E.charAt(F)),6)}},A=function(P){if("0"<=P&&P<="9")return P.charCodeAt(0)-48;if("A"<=P&&P<="Z")return P.charCodeAt(0)-65+10;switch(P){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+P}};return D},I=function(B){var z=f.stringToBytes(B);return{getMode:function(){return 4},getLength:function(D){return z.length},write:function(D){for(var A=0;A<z.length;A+=1)D.put(z[A],8)}}},T=function(B){var z=f.stringToBytesFuncs.SJIS;if(!z)throw"sjis not supported.";(function(){var P=z("友");if(P.length!=2||(P[0]<<8|P[1])!=38726)throw"sjis not supported."})();var D=z(B),A={getMode:function(){return 8},getLength:function(P){return~~(D.length/2)},write:function(P){for(var E=D,F=0;F+1<E.length;){var $=(255&E[F])<<8|255&E[F+1];if(33088<=$&&$<=40956)$-=33088;else{if(!(57408<=$&&$<=60351))throw"illegal char at "+(F+1)+"/"+$;$-=49472}$=192*($>>>8&255)+(255&$),P.put($,13),F+=2}if(F<E.length)throw"illegal char at "+(F+1)}};return A},L=function(){var B=[],z={writeByte:function(D){B.push(255&D)},writeShort:function(D){z.writeByte(D),z.writeByte(D>>>8)},writeBytes:function(D,A,P){A=A||0,P=P||D.length;for(var E=0;E<P;E+=1)z.writeByte(D[E+A])},writeString:function(D){for(var A=0;A<D.length;A+=1)z.writeByte(D.charCodeAt(A))},toByteArray:function(){return B},toString:function(){var D="";D+="[";for(var A=0;A<B.length;A+=1)A>0&&(D+=","),D+=B[A];return D+"]"}};return z},R=function(B){var z=B,D=0,A=0,P=0,E={read:function(){for(;P<8;){if(D>=z.length){if(P==0)return-1;throw"unexpected end of file./"+P}var $=z.charAt(D);if(D+=1,$=="=")return P=0,-1;$.match(/^\s$/)||(A=A<<6|F($.charCodeAt(0)),P+=6)}var H=A>>>P-8&255;return P-=8,H}},F=function($){if(65<=$&&$<=90)return $-65;if(97<=$&&$<=122)return $-97+26;if(48<=$&&$<=57)return $-48+52;if($==43)return 62;if($==47)return 63;throw"c:"+$};return E},_=function(B,z,D){for(var A=function(ue,le){var ae=ue,te=le,ne=new Array(ue*le),J={setPixel:function(W,Y,q){ne[Y*ae+W]=q},write:function(W){W.writeString("GIF87a"),W.writeShort(ae),W.writeShort(te),W.writeByte(128),W.writeByte(0),W.writeByte(0),W.writeByte(0),W.writeByte(0),W.writeByte(0),W.writeByte(255),W.writeByte(255),W.writeByte(255),W.writeString(","),W.writeShort(0),W.writeShort(0),W.writeShort(ae),W.writeShort(te),W.writeByte(0);var Y=G(2);W.writeByte(2);for(var q=0;Y.length-q>255;)W.writeByte(255),W.writeBytes(Y,q,255),q+=255;W.writeByte(Y.length-q),W.writeBytes(Y,q,Y.length-q),W.writeByte(0),W.writeString(";")}},G=function(W){for(var Y=1<<W,q=1+(1<<W),Z=W+1,me=Q(),we=0;we<Y;we+=1)me.add(String.fromCharCode(we));me.add(String.fromCharCode(Y)),me.add(String.fromCharCode(q));var he,ie,ye,pe=L(),ce=(he=pe,ie=0,ye=0,{write:function(fe,je){if(fe>>>je)throw"length over";for(;ie+je>=8;)he.writeByte(255&(fe<<ie|ye)),je-=8-ie,fe>>>=8-ie,ye=0,ie=0;ye|=fe<<ie,ie+=je},flush:function(){ie>0&&he.writeByte(ye)}});ce.write(Y,Z);var xe=0,Ee=String.fromCharCode(ne[xe]);for(xe+=1;xe<ne.length;){var Ye=String.fromCharCode(ne[xe]);xe+=1,me.contains(Ee+Ye)?Ee+=Ye:(ce.write(me.indexOf(Ee),Z),me.size()<4095&&(me.size()==1<<Z&&(Z+=1),me.add(Ee+Ye)),Ee=Ye)}return ce.write(me.indexOf(Ee),Z),ce.write(q,Z),ce.flush(),pe.toByteArray()},Q=function(){var W={},Y=0,q={add:function(Z){if(q.contains(Z))throw"dup key:"+Z;W[Z]=Y,Y+=1},size:function(){return Y},indexOf:function(Z){return W[Z]},contains:function(Z){return W[Z]!==void 0}};return q};return J}(B,z),P=0;P<z;P+=1)for(var E=0;E<B;E+=1)A.setPixel(E,P,D(E,P));var F=L();A.write(F);for(var $=function(){var ue=0,le=0,ae=0,te="",ne={},J=function(Q){te+=String.fromCharCode(G(63&Q))},G=function(Q){if(!(Q<0)){if(Q<26)return 65+Q;if(Q<52)return Q-26+97;if(Q<62)return Q-52+48;if(Q==62)return 43;if(Q==63)return 47}throw"n:"+Q};return ne.writeByte=function(Q){for(ue=ue<<8|255&Q,le+=8,ae+=1;le>=6;)J(ue>>>le-6),le-=6},ne.flush=function(){if(le>0&&(J(ue<<6-le),ue=0,le=0),ae%3!=0)for(var Q=3-ae%3,W=0;W<Q;W+=1)te+="="},ne.toString=function(){return te},ne}(),H=F.toByteArray(),X=0;X<H.length;X+=1)$.writeByte(H[X]);return $.flush(),"data:image/gif;base64,"+$};return f}();d.stringToBytesFuncs["UTF-8"]=function(f){return function(m){for(var h=[],p=0;p<m.length;p++){var g=m.charCodeAt(p);g<128?h.push(g):g<2048?h.push(192|g>>6,128|63&g):g<55296||g>=57344?h.push(224|g>>12,128|g>>6&63,128|63&g):(p++,g=65536+((1023&g)<<10|1023&m.charCodeAt(p)),h.push(240|g>>18,128|g>>12&63,128|g>>6&63,128|63&g))}return h}(f)},(u=typeof(c=function(){return d})=="function"?c.apply(l,[]):c)===void 0||(o.exports=u)}},n={};function a(o){var l=n[o];if(l!==void 0)return l.exports;var c=n[o]={exports:{}};return r[o](c,c.exports,a),c.exports}a.n=o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return a.d(l,{a:l}),l},a.d=(o,l)=>{for(var c in l)a.o(l,c)&&!a.o(o,c)&&Object.defineProperty(o,c,{enumerable:!0,get:l[c]})},a.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l);var i={};return(()=>{a.d(i,{default:()=>z});const o=D=>!!D&&typeof D=="object"&&!Array.isArray(D);function l(D,...A){if(!A.length)return D;const P=A.shift();return P!==void 0&&o(D)&&o(P)?(D=Object.assign({},D),Object.keys(P).forEach(E=>{const F=D[E],$=P[E];Array.isArray(F)&&Array.isArray($)?D[E]=$:o(F)&&o($)?D[E]=l(Object.assign({},F),$):D[E]=$}),l(D,...A)):D}function c(D,A){const P=document.createElement("a");P.download=A,P.href=D,document.body.appendChild(P),P.click(),document.body.removeChild(P)}const u={L:.07,M:.15,Q:.25,H:.3};class d{constructor({svg:A,type:P,window:E}){this._svg=A,this._type=P,this._window=E}draw(A,P,E,F){let $;switch(this._type){case"dots":$=this._drawDot;break;case"classy":$=this._drawClassy;break;case"classy-rounded":$=this._drawClassyRounded;break;case"rounded":$=this._drawRounded;break;case"extra-rounded":$=this._drawExtraRounded;break;default:$=this._drawSquare}$.call(this,{x:A,y:P,size:E,getNeighbor:F})}_rotateFigure({x:A,y:P,size:E,rotation:F=0,draw:$}){var H;const X=A+E/2,ue=P+E/2;$(),(H=this._element)===null||H===void 0||H.setAttribute("transform",`rotate(${180*F/Math.PI},${X},${ue})`)}_basicDot(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(E+P/2)),this._element.setAttribute("cy",String(F+P/2)),this._element.setAttribute("r",String(P/2))}}))}_basicSquare(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(E)),this._element.setAttribute("y",String(F)),this._element.setAttribute("width",String(P)),this._element.setAttribute("height",String(P))}}))}_basicSideRounded(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${E} ${F}v ${P}h `+P/2+`a ${P/2} ${P/2}, 0, 0, 0, 0 ${-P}`)}}))}_basicCornerRounded(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${E} ${F}v ${P}h ${P}v `+-P/2+`a ${P/2} ${P/2}, 0, 0, 0, ${-P/2} ${-P/2}`)}}))}_basicCornerExtraRounded(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${E} ${F}v ${P}h ${P}a ${P} ${P}, 0, 0, 0, ${-P} ${-P}`)}}))}_basicCornersRounded(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${E} ${F}v `+P/2+`a ${P/2} ${P/2}, 0, 0, 0, ${P/2} ${P/2}h `+P/2+"v "+-P/2+`a ${P/2} ${P/2}, 0, 0, 0, ${-P/2} ${-P/2}`)}}))}_drawDot({x:A,y:P,size:E}){this._basicDot({x:A,y:P,size:E,rotation:0})}_drawSquare({x:A,y:P,size:E}){this._basicSquare({x:A,y:P,size:E,rotation:0})}_drawRounded({x:A,y:P,size:E,getNeighbor:F}){const $=F?+F(-1,0):0,H=F?+F(1,0):0,X=F?+F(0,-1):0,ue=F?+F(0,1):0,le=$+H+X+ue;if(le!==0)if(le>2||$&&H||X&&ue)this._basicSquare({x:A,y:P,size:E,rotation:0});else{if(le===2){let ae=0;return $&&X?ae=Math.PI/2:X&&H?ae=Math.PI:H&&ue&&(ae=-Math.PI/2),void this._basicCornerRounded({x:A,y:P,size:E,rotation:ae})}if(le===1){let ae=0;return X?ae=Math.PI/2:H?ae=Math.PI:ue&&(ae=-Math.PI/2),void this._basicSideRounded({x:A,y:P,size:E,rotation:ae})}}else this._basicDot({x:A,y:P,size:E,rotation:0})}_drawExtraRounded({x:A,y:P,size:E,getNeighbor:F}){const $=F?+F(-1,0):0,H=F?+F(1,0):0,X=F?+F(0,-1):0,ue=F?+F(0,1):0,le=$+H+X+ue;if(le!==0)if(le>2||$&&H||X&&ue)this._basicSquare({x:A,y:P,size:E,rotation:0});else{if(le===2){let ae=0;return $&&X?ae=Math.PI/2:X&&H?ae=Math.PI:H&&ue&&(ae=-Math.PI/2),void this._basicCornerExtraRounded({x:A,y:P,size:E,rotation:ae})}if(le===1){let ae=0;return X?ae=Math.PI/2:H?ae=Math.PI:ue&&(ae=-Math.PI/2),void this._basicSideRounded({x:A,y:P,size:E,rotation:ae})}}else this._basicDot({x:A,y:P,size:E,rotation:0})}_drawClassy({x:A,y:P,size:E,getNeighbor:F}){const $=F?+F(-1,0):0,H=F?+F(1,0):0,X=F?+F(0,-1):0,ue=F?+F(0,1):0;$+H+X+ue!==0?$||X?H||ue?this._basicSquare({x:A,y:P,size:E,rotation:0}):this._basicCornerRounded({x:A,y:P,size:E,rotation:Math.PI/2}):this._basicCornerRounded({x:A,y:P,size:E,rotation:-Math.PI/2}):this._basicCornersRounded({x:A,y:P,size:E,rotation:Math.PI/2})}_drawClassyRounded({x:A,y:P,size:E,getNeighbor:F}){const $=F?+F(-1,0):0,H=F?+F(1,0):0,X=F?+F(0,-1):0,ue=F?+F(0,1):0;$+H+X+ue!==0?$||X?H||ue?this._basicSquare({x:A,y:P,size:E,rotation:0}):this._basicCornerExtraRounded({x:A,y:P,size:E,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:A,y:P,size:E,rotation:-Math.PI/2}):this._basicCornersRounded({x:A,y:P,size:E,rotation:Math.PI/2})}}const f={dot:"dot",square:"square",extraRounded:"extra-rounded"},m=Object.values(f);class h{constructor({svg:A,type:P,window:E}){this._svg=A,this._type=P,this._window=E}draw(A,P,E,F){let $;switch(this._type){case f.square:$=this._drawSquare;break;case f.extraRounded:$=this._drawExtraRounded;break;default:$=this._drawDot}$.call(this,{x:A,y:P,size:E,rotation:F})}_rotateFigure({x:A,y:P,size:E,rotation:F=0,draw:$}){var H;const X=A+E/2,ue=P+E/2;$(),(H=this._element)===null||H===void 0||H.setAttribute("transform",`rotate(${180*F/Math.PI},${X},${ue})`)}_basicDot(A){const{size:P,x:E,y:F}=A,$=P/7;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${E+P/2} ${F}a ${P/2} ${P/2} 0 1 0 0.1 0zm 0 ${$}a ${P/2-$} ${P/2-$} 0 1 1 -0.1 0Z`)}}))}_basicSquare(A){const{size:P,x:E,y:F}=A,$=P/7;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${E} ${F}v ${P}h ${P}v `+-P+`zM ${E+$} ${F+$}h `+(P-2*$)+"v "+(P-2*$)+"h "+(2*$-P)+"z")}}))}_basicExtraRounded(A){const{size:P,x:E,y:F}=A,$=P/7;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${E} ${F+2.5*$}v `+2*$+`a ${2.5*$} ${2.5*$}, 0, 0, 0, ${2.5*$} ${2.5*$}h `+2*$+`a ${2.5*$} ${2.5*$}, 0, 0, 0, ${2.5*$} ${2.5*-$}v `+-2*$+`a ${2.5*$} ${2.5*$}, 0, 0, 0, ${2.5*-$} ${2.5*-$}h `+-2*$+`a ${2.5*$} ${2.5*$}, 0, 0, 0, ${2.5*-$} ${2.5*$}M ${E+2.5*$} ${F+$}h `+2*$+`a ${1.5*$} ${1.5*$}, 0, 0, 1, ${1.5*$} ${1.5*$}v `+2*$+`a ${1.5*$} ${1.5*$}, 0, 0, 1, ${1.5*-$} ${1.5*$}h `+-2*$+`a ${1.5*$} ${1.5*$}, 0, 0, 1, ${1.5*-$} ${1.5*-$}v `+-2*$+`a ${1.5*$} ${1.5*$}, 0, 0, 1, ${1.5*$} ${1.5*-$}`)}}))}_drawDot({x:A,y:P,size:E,rotation:F}){this._basicDot({x:A,y:P,size:E,rotation:F})}_drawSquare({x:A,y:P,size:E,rotation:F}){this._basicSquare({x:A,y:P,size:E,rotation:F})}_drawExtraRounded({x:A,y:P,size:E,rotation:F}){this._basicExtraRounded({x:A,y:P,size:E,rotation:F})}}const p={dot:"dot",square:"square"},g=Object.values(p);class y{constructor({svg:A,type:P,window:E}){this._svg=A,this._type=P,this._window=E}draw(A,P,E,F){let $;$=this._type===p.square?this._drawSquare:this._drawDot,$.call(this,{x:A,y:P,size:E,rotation:F})}_rotateFigure({x:A,y:P,size:E,rotation:F=0,draw:$}){var H;const X=A+E/2,ue=P+E/2;$(),(H=this._element)===null||H===void 0||H.setAttribute("transform",`rotate(${180*F/Math.PI},${X},${ue})`)}_basicDot(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(E+P/2)),this._element.setAttribute("cy",String(F+P/2)),this._element.setAttribute("r",String(P/2))}}))}_basicSquare(A){const{size:P,x:E,y:F}=A;this._rotateFigure(Object.assign(Object.assign({},A),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(E)),this._element.setAttribute("y",String(F)),this._element.setAttribute("width",String(P)),this._element.setAttribute("height",String(P))}}))}_drawDot({x:A,y:P,size:E,rotation:F}){this._basicDot({x:A,y:P,size:E,rotation:F})}_drawSquare({x:A,y:P,size:E,rotation:F}){this._basicSquare({x:A,y:P,size:E,rotation:F})}}const v="circle",x=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],j=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class C{constructor(A,P){this._roundSize=E=>this._options.dotsOptions.roundSize?Math.floor(E):E,this._window=P,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(A.width)),this._element.setAttribute("height",String(A.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),A.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${A.width} ${A.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=A.image,this._instanceId=C.instanceCount++,this._options=A}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(A){const P=A.getModuleCount(),E=Math.min(this._options.width,this._options.height)-2*this._options.margin,F=this._options.shape===v?E/Math.sqrt(2):E,$=this._roundSize(F/P);let H={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=A,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:X,qrOptions:ue}=this._options,le=X.imageSize*u[ue.errorCorrectionLevel],ae=Math.floor(le*P*P);H=function({originalHeight:te,originalWidth:ne,maxHiddenDots:J,maxHiddenAxisDots:G,dotSize:Q}){const W={x:0,y:0},Y={x:0,y:0};if(te<=0||ne<=0||J<=0||Q<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const q=te/ne;return W.x=Math.floor(Math.sqrt(J/q)),W.x<=0&&(W.x=1),G&&G<W.x&&(W.x=G),W.x%2==0&&W.x--,Y.x=W.x*Q,W.y=1+2*Math.ceil((W.x*q-1)/2),Y.y=Math.round(Y.x*q),(W.y*W.x>J||G&&G<W.y)&&(G&&G<W.y?(W.y=G,W.y%2==0&&W.x--):W.y-=2,Y.y=W.y*Q,W.x=1+2*Math.ceil((W.y/q-1)/2),Y.x=Math.round(Y.y/q)),{height:Y.y,width:Y.x,hideYDots:W.y,hideXDots:W.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:ae,maxHiddenAxisDots:P-14,dotSize:$})}this.drawBackground(),this.drawDots((X,ue)=>{var le,ae,te,ne,J,G;return!(this._options.imageOptions.hideBackgroundDots&&X>=(P-H.hideYDots)/2&&X<(P+H.hideYDots)/2&&ue>=(P-H.hideXDots)/2&&ue<(P+H.hideXDots)/2||!((le=x[X])===null||le===void 0)&&le[ue]||!((ae=x[X-P+7])===null||ae===void 0)&&ae[ue]||!((te=x[X])===null||te===void 0)&&te[ue-P+7]||!((ne=j[X])===null||ne===void 0)&&ne[ue]||!((J=j[X-P+7])===null||J===void 0)&&J[ue]||!((G=j[X])===null||G===void 0)&&G[ue-P+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:H.width,height:H.height,count:P,dotSize:$})}drawBackground(){var A,P,E;const F=this._element,$=this._options;if(F){const H=(A=$.backgroundOptions)===null||A===void 0?void 0:A.gradient,X=(P=$.backgroundOptions)===null||P===void 0?void 0:P.color;let ue=$.height,le=$.width;if(H||X){const ae=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((E=$.backgroundOptions)===null||E===void 0)&&E.round&&(ue=le=Math.min($.width,$.height),ae.setAttribute("rx",String(ue/2*$.backgroundOptions.round))),ae.setAttribute("x",String(this._roundSize(($.width-le)/2))),ae.setAttribute("y",String(this._roundSize(($.height-ue)/2))),ae.setAttribute("width",String(le)),ae.setAttribute("height",String(ue)),this._backgroundClipPath.appendChild(ae),this._createColor({options:H,color:X,additionalRotation:0,x:0,y:0,height:$.height,width:$.width,name:`background-color-${this._instanceId}`})}}}drawDots(A){var P,E;if(!this._qr)throw"QR code is not defined";const F=this._options,$=this._qr.getModuleCount();if($>F.width||$>F.height)throw"The canvas is too small.";const H=Math.min(F.width,F.height)-2*F.margin,X=F.shape===v?H/Math.sqrt(2):H,ue=this._roundSize(X/$),le=this._roundSize((F.width-$*ue)/2),ae=this._roundSize((F.height-$*ue)/2),te=new d({svg:this._element,type:F.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(P=F.dotsOptions)===null||P===void 0?void 0:P.gradient,color:F.dotsOptions.color,additionalRotation:0,x:0,y:0,height:F.height,width:F.width,name:`dot-color-${this._instanceId}`});for(let ne=0;ne<$;ne++)for(let J=0;J<$;J++)A&&!A(ne,J)||!((E=this._qr)===null||E===void 0)&&E.isDark(ne,J)&&(te.draw(le+J*ue,ae+ne*ue,ue,(G,Q)=>!(J+G<0||ne+Q<0||J+G>=$||ne+Q>=$)&&!(A&&!A(ne+Q,J+G))&&!!this._qr&&this._qr.isDark(ne+Q,J+G)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(F.shape===v){const ne=this._roundSize((H/ue-$)/2),J=$+2*ne,G=le-ne*ue,Q=ae-ne*ue,W=[],Y=this._roundSize(J/2);for(let q=0;q<J;q++){W[q]=[];for(let Z=0;Z<J;Z++)q>=ne-1&&q<=J-ne&&Z>=ne-1&&Z<=J-ne||Math.sqrt((q-Y)*(q-Y)+(Z-Y)*(Z-Y))>Y?W[q][Z]=0:W[q][Z]=this._qr.isDark(Z-2*ne<0?Z:Z>=$?Z-2*ne:Z-ne,q-2*ne<0?q:q>=$?q-2*ne:q-ne)?1:0}for(let q=0;q<J;q++)for(let Z=0;Z<J;Z++)W[q][Z]&&(te.draw(G+Z*ue,Q+q*ue,ue,(me,we)=>{var he;return!!(!((he=W[q+we])===null||he===void 0)&&he[Z+me])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const A=this._element,P=this._options;if(!A)throw"Element code is not defined";const E=this._qr.getModuleCount(),F=Math.min(P.width,P.height)-2*P.margin,$=P.shape===v?F/Math.sqrt(2):F,H=this._roundSize($/E),X=7*H,ue=3*H,le=this._roundSize((P.width-E*H)/2),ae=this._roundSize((P.height-E*H)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,ne,J])=>{var G,Q,W,Y,q,Z,me,we,he,ie,ye,pe,ce,xe;const Ee=le+te*H*(E-7),Ye=ae+ne*H*(E-7);let fe=this._dotsClipPath,je=this._dotsClipPath;if((!((G=P.cornersSquareOptions)===null||G===void 0)&&G.gradient||!((Q=P.cornersSquareOptions)===null||Q===void 0)&&Q.color)&&(fe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),fe.setAttribute("id",`clip-path-corners-square-color-${te}-${ne}-${this._instanceId}`),this._defs.appendChild(fe),this._cornersSquareClipPath=this._cornersDotClipPath=je=fe,this._createColor({options:(W=P.cornersSquareOptions)===null||W===void 0?void 0:W.gradient,color:(Y=P.cornersSquareOptions)===null||Y===void 0?void 0:Y.color,additionalRotation:J,x:Ee,y:Ye,height:X,width:X,name:`corners-square-color-${te}-${ne}-${this._instanceId}`})),((q=P.cornersSquareOptions)===null||q===void 0?void 0:q.type)&&m.includes(P.cornersSquareOptions.type)){const We=new h({svg:this._element,type:P.cornersSquareOptions.type,window:this._window});We.draw(Ee,Ye,X,J),We._element&&fe&&fe.appendChild(We._element)}else{const We=new d({svg:this._element,type:((Z=P.cornersSquareOptions)===null||Z===void 0?void 0:Z.type)||P.dotsOptions.type,window:this._window});for(let yt=0;yt<x.length;yt++)for(let gt=0;gt<x[yt].length;gt++)!((me=x[yt])===null||me===void 0)&&me[gt]&&(We.draw(Ee+gt*H,Ye+yt*H,H,(qe,ze)=>{var $e;return!!(!(($e=x[yt+ze])===null||$e===void 0)&&$e[gt+qe])}),We._element&&fe&&fe.appendChild(We._element))}if((!((we=P.cornersDotOptions)===null||we===void 0)&&we.gradient||!((he=P.cornersDotOptions)===null||he===void 0)&&he.color)&&(je=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),je.setAttribute("id",`clip-path-corners-dot-color-${te}-${ne}-${this._instanceId}`),this._defs.appendChild(je),this._cornersDotClipPath=je,this._createColor({options:(ie=P.cornersDotOptions)===null||ie===void 0?void 0:ie.gradient,color:(ye=P.cornersDotOptions)===null||ye===void 0?void 0:ye.color,additionalRotation:J,x:Ee+2*H,y:Ye+2*H,height:ue,width:ue,name:`corners-dot-color-${te}-${ne}-${this._instanceId}`})),((pe=P.cornersDotOptions)===null||pe===void 0?void 0:pe.type)&&g.includes(P.cornersDotOptions.type)){const We=new y({svg:this._element,type:P.cornersDotOptions.type,window:this._window});We.draw(Ee+2*H,Ye+2*H,ue,J),We._element&&je&&je.appendChild(We._element)}else{const We=new d({svg:this._element,type:((ce=P.cornersDotOptions)===null||ce===void 0?void 0:ce.type)||P.dotsOptions.type,window:this._window});for(let yt=0;yt<j.length;yt++)for(let gt=0;gt<j[yt].length;gt++)!((xe=j[yt])===null||xe===void 0)&&xe[gt]&&(We.draw(Ee+gt*H,Ye+yt*H,H,(qe,ze)=>{var $e;return!!(!(($e=j[yt+ze])===null||$e===void 0)&&$e[gt+qe])}),We._element&&je&&je.appendChild(We._element))}})}loadImage(){return new Promise((A,P)=>{var E;const F=this._options;if(!F.image)return P("Image is not defined");if(!((E=F.nodeCanvas)===null||E===void 0)&&E.loadImage)F.nodeCanvas.loadImage(F.image).then($=>{var H,X;if(this._image=$,this._options.imageOptions.saveAsBlob){const ue=(H=F.nodeCanvas)===null||H===void 0?void 0:H.createCanvas(this._image.width,this._image.height);(X=ue==null?void 0:ue.getContext("2d"))===null||X===void 0||X.drawImage($,0,0),this._imageUri=ue==null?void 0:ue.toDataURL()}A()}).catch(P);else{const $=new this._window.Image;typeof F.imageOptions.crossOrigin=="string"&&($.crossOrigin=F.imageOptions.crossOrigin),this._image=$,$.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(H,X){return new Promise(ue=>{const le=new X.XMLHttpRequest;le.onload=function(){const ae=new X.FileReader;ae.onloadend=function(){ue(ae.result)},ae.readAsDataURL(le.response)},le.open("GET",H),le.responseType="blob",le.send()})}(F.image||"",this._window)),A()},$.src=F.image}})}async drawImage({width:A,height:P,count:E,dotSize:F}){const $=this._options,H=this._roundSize(($.width-E*F)/2),X=this._roundSize(($.height-E*F)/2),ue=H+this._roundSize($.imageOptions.margin+(E*F-A)/2),le=X+this._roundSize($.imageOptions.margin+(E*F-P)/2),ae=A-2*$.imageOptions.margin,te=P-2*$.imageOptions.margin,ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");ne.setAttribute("href",this._imageUri||""),ne.setAttribute("xlink:href",this._imageUri||""),ne.setAttribute("x",String(ue)),ne.setAttribute("y",String(le)),ne.setAttribute("width",`${ae}px`),ne.setAttribute("height",`${te}px`),this._element.appendChild(ne)}_createColor({options:A,color:P,additionalRotation:E,x:F,y:$,height:H,width:X,name:ue}){const le=X>H?X:H,ae=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(ae.setAttribute("x",String(F)),ae.setAttribute("y",String($)),ae.setAttribute("height",String(H)),ae.setAttribute("width",String(X)),ae.setAttribute("clip-path",`url('#clip-path-${ue}')`),A){let te;if(A.type==="radial")te=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),te.setAttribute("id",ue),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("fx",String(F+X/2)),te.setAttribute("fy",String($+H/2)),te.setAttribute("cx",String(F+X/2)),te.setAttribute("cy",String($+H/2)),te.setAttribute("r",String(le/2));else{const ne=((A.rotation||0)+E)%(2*Math.PI),J=(ne+2*Math.PI)%(2*Math.PI);let G=F+X/2,Q=$+H/2,W=F+X/2,Y=$+H/2;J>=0&&J<=.25*Math.PI||J>1.75*Math.PI&&J<=2*Math.PI?(G-=X/2,Q-=H/2*Math.tan(ne),W+=X/2,Y+=H/2*Math.tan(ne)):J>.25*Math.PI&&J<=.75*Math.PI?(Q-=H/2,G-=X/2/Math.tan(ne),Y+=H/2,W+=X/2/Math.tan(ne)):J>.75*Math.PI&&J<=1.25*Math.PI?(G+=X/2,Q+=H/2*Math.tan(ne),W-=X/2,Y-=H/2*Math.tan(ne)):J>1.25*Math.PI&&J<=1.75*Math.PI&&(Q+=H/2,G+=X/2/Math.tan(ne),Y-=H/2,W-=X/2/Math.tan(ne)),te=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),te.setAttribute("id",ue),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("x1",String(Math.round(G))),te.setAttribute("y1",String(Math.round(Q))),te.setAttribute("x2",String(Math.round(W))),te.setAttribute("y2",String(Math.round(Y)))}A.colorStops.forEach(({offset:ne,color:J})=>{const G=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");G.setAttribute("offset",100*ne+"%"),G.setAttribute("stop-color",J),te.appendChild(G)}),ae.setAttribute("fill",`url('#${ue}')`),this._defs.appendChild(te)}else P&&ae.setAttribute("fill",P);this._element.appendChild(ae)}}C.instanceCount=0;const N=C,S="canvas",M={};for(let D=0;D<=40;D++)M[D]=D;const k={type:S,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:M[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function I(D){const A=Object.assign({},D);if(!A.colorStops||!A.colorStops.length)throw"Field 'colorStops' is required in gradient";return A.rotation?A.rotation=Number(A.rotation):A.rotation=0,A.colorStops=A.colorStops.map(P=>Object.assign(Object.assign({},P),{offset:Number(P.offset)})),A}function T(D){const A=Object.assign({},D);return A.width=Number(A.width),A.height=Number(A.height),A.margin=Number(A.margin),A.imageOptions=Object.assign(Object.assign({},A.imageOptions),{hideBackgroundDots:!!A.imageOptions.hideBackgroundDots,imageSize:Number(A.imageOptions.imageSize),margin:Number(A.imageOptions.margin)}),A.margin>Math.min(A.width,A.height)&&(A.margin=Math.min(A.width,A.height)),A.dotsOptions=Object.assign({},A.dotsOptions),A.dotsOptions.gradient&&(A.dotsOptions.gradient=I(A.dotsOptions.gradient)),A.cornersSquareOptions&&(A.cornersSquareOptions=Object.assign({},A.cornersSquareOptions),A.cornersSquareOptions.gradient&&(A.cornersSquareOptions.gradient=I(A.cornersSquareOptions.gradient))),A.cornersDotOptions&&(A.cornersDotOptions=Object.assign({},A.cornersDotOptions),A.cornersDotOptions.gradient&&(A.cornersDotOptions.gradient=I(A.cornersDotOptions.gradient))),A.backgroundOptions&&(A.backgroundOptions=Object.assign({},A.backgroundOptions),A.backgroundOptions.gradient&&(A.backgroundOptions.gradient=I(A.backgroundOptions.gradient))),A}var L=a(873),R=a.n(L);function _(D){if(!D)throw new Error("Extension must be defined");D[0]==="."&&(D=D.substring(1));const A={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[D.toLowerCase()];if(!A)throw new Error(`Extension "${D}" is not supported`);return A}class B{constructor(A){A!=null&&A.jsdom?this._window=new A.jsdom("",{resources:"usable"}).window:this._window=window,this._options=A?T(l(k,A)):k,this.update()}static _clearContainer(A){A&&(A.innerHTML="")}_setupSvg(){if(!this._qr)return;const A=new N(this._options,this._window);this._svg=A.getElement(),this._svgDrawingPromise=A.drawQR(this._qr).then(()=>{var P;this._svg&&((P=this._extension)===null||P===void 0||P.call(this,A.getElement(),this._options))})}_setupCanvas(){var A,P;this._qr&&(!((A=this._options.nodeCanvas)===null||A===void 0)&&A.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(P=this._svgDrawingPromise)===null||P===void 0?void 0:P.then(()=>{var E;if(!this._svg)return;const F=this._svg,$=new this._window.XMLSerializer().serializeToString(F),H=btoa($),X=`data:${_("svg")};base64,${H}`;if(!((E=this._options.nodeCanvas)===null||E===void 0)&&E.loadImage)return this._options.nodeCanvas.loadImage(X).then(ue=>{var le,ae;ue.width=this._options.width,ue.height=this._options.height,(ae=(le=this._nodeCanvas)===null||le===void 0?void 0:le.getContext("2d"))===null||ae===void 0||ae.drawImage(ue,0,0)});{const ue=new this._window.Image;return new Promise(le=>{ue.onload=()=>{var ae,te;(te=(ae=this._domCanvas)===null||ae===void 0?void 0:ae.getContext("2d"))===null||te===void 0||te.drawImage(ue,0,0),le()},ue.src=X})}}))}async _getElement(A="png"){if(!this._qr)throw"QR code is empty";return A.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(A){B._clearContainer(this._container),this._options=A?T(l(this._options,A)):this._options,this._options.data&&(this._qr=
3849R()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(P){switch(!0){case/^[0-9]*$/.test(P):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(P):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===S?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(A){if(A){if(typeof A.appendChild!="function")throw"Container should be a single DOM node";this._options.type===S?this._domCanvas&&A.appendChild(this._domCanvas):this._svg&&A.appendChild(this._svg),this._container=A}}applyExtension(A){if(!A)throw"Extension function should be defined.";this._extension=A,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(A="png"){if(!this._qr)throw"QR code is empty";const P=await this._getElement(A),E=_(A);if(!P)return null;if(A.toLowerCase()==="svg"){const F=`<?xml version="1.0" standalone="no"?>\r
3850${new this._window.XMLSerializer().serializeToString(P)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(F):new Blob([F],{type:E})}return new Promise(F=>{const $=P;if("toBuffer"in $)if(E==="image/png")F($.toBuffer(E));else if(E==="image/jpeg")F($.toBuffer(E));else{if(E!=="application/pdf")throw Error("Unsupported extension");F($.toBuffer(E))}else"toBlob"in $&&$.toBlob(F,E,1)})}async download(A){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let P="png",E="qr";typeof A=="string"?(P=A,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof A=="object"&&A!==null&&(A.name&&(E=A.name),A.extension&&(P=A.extension));const F=await this._getElement(P);if(F)if(P.toLowerCase()==="svg"){let $=new XMLSerializer().serializeToString(F);$=`<?xml version="1.0" standalone="no"?>\r
3851`+$,c(`data:${_(P)};charset=utf-8,${encodeURIComponent($)}`,`${E}.svg`)}else c(F.toDataURL(_(P)),`${E}.${P}`)}}const z=B})(),i.default})())})(mH);var TQe=mH.exports;const AQe=hn(TQe),PQe=["#000000","#B91C1C","#DC2626","#F3B4D1","#FDE047","#22C55E","#3B82F6","#8B5CF6"],_Qe=({isOpen:e,onClose:t,url:r,brandLogo:n,brandName:a})=>{const{t:i}=Te(),[o,l]=b.useState(!0),[c,u]=b.useState("#000000"),[d,f]=b.useState(null),[m,h]=b.useState(!1),p=b.useRef(null),[g,y]=b.useState(void 0);b.useEffect(()=>{if(!e||!n){y(void 0);return}const S=new Image;S.crossOrigin="anonymous",S.onload=()=>{try{const M=document.createElement("canvas");M.width=S.naturalWidth,M.height=S.naturalHeight;const k=M.getContext("2d");k&&(k.drawImage(S,0,0),y(M.toDataURL("image/png")))}catch{console.warn("Failed to convert brand logo to data URL, QR code will render without logo"),y(void 0)}},S.onerror=()=>{console.warn("Brand logo failed to load (CORS), QR code will render without logo"),y(void 0)},S.src=n},[e,n]),b.useEffect(()=>{if(!e)return;const S=new AQe({width:150,height:150,type:"svg",data:r,image:o?g:void 0,dotsOptions:{color:c,type:"rounded"},imageOptions:{crossOrigin:"anonymous",margin:5,imageSize:.4},backgroundOptions:{color:"#ffffff"},cornersSquareOptions:{color:c,type:"extra-rounded"},cornersDotOptions:{color:c,type:"dot"}});f(S)},[e,r,c,o,g]),b.useEffect(()=>{if(!(!d||!p.current||!e)){h(!0),p.current.innerHTML="";try{d.append(p.current),h(!1)}catch(S){console.error("Error rendering QR code:",S),h(!1)}}},[d,e]);const v=()=>{d&&d.download({name:`qr-code-${a||"socialness"}-${Date.now()}`,extension:"png"})},x=async()=>{if(d)try{const S=await d.getRawData("png");if(S instanceof Blob){const M=new ClipboardItem({"image/png":S});await navigator.clipboard.write([M])}}catch(S){console.error("Failed to copy QR code to clipboard:",S)}},j=S=>{u(S)},C=()=>{l(!o)},N=()=>{l(!0),u("#000000"),t()};return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:N,children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25","aria-hidden":"true"}),s.jsxs("div",{className:"relative bg-white rounded-xl border-2 border-black shadow-xl w-full max-w-lg p-6",onClick:S=>S.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-gray-900",children:[s.jsx(D7,{className:"w-5 h-5 text-primary-600"}),i("qrCode.title","QR Code")]}),s.jsx("button",{onClick:N,className:"text-gray-400 hover:text-gray-600 p-1 rounded-lg hover:bg-gray-100 transition-colors",children:s.jsx(_t,{size:20})})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"flex items-center justify-between mb-2",children:s.jsxs("h3",{className:"text-sm font-medium text-gray-700 flex items-center gap-1",children:[i("qrCode.preview","QR Code Preview"),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:s.jsx("svg",{className:"w-4 h-4",fill:"
3851currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})})]})}),s.jsxs("div",{className:"relative bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 p-8 flex items-center justify-center min-h-[175px]",children:[m&&s.jsx("div",{className:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center z-10 rounded-lg",children:s.jsxs("div",{className:"flex items-center gap-3 text-gray-600",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-gray-600 border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-sm font-medium",children:i("qrCode.generating","Generating...")})]})}),s.jsx("div",{ref:p,className:"flex items-center justify-center"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4",children:[s.jsxs("button",{onClick:v,disabled:m,className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[s.jsx(yd,{className:"w-4 h-4"}),i("common.download","Download")]}),s.jsxs("button",{onClick:x,disabled:m,className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[s.jsx(Iu,{className:"w-4 h-4"}),i("common.copy","Copy")]})]})]}),s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-1",children:[i("qrCode.logo","Logo"),s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:s.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})})]}),s.jsx("button",{onClick:C,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${o?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${o?"translate-x-6":"translate-x-1"}`})})]})}),s.jsxs("div",{className:"mb-8",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:i("qrCode.color","QR Code Color")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center border border-gray-300 rounded-lg overflow-hidden",children:[s.jsx("div",{className:"w-8 h-8 flex-shrink-0",style:{backgroundColor:c}}),s.jsx("input",{type:"text",value:c,onChange:S=>j(S.target.value),className:"px-3 py-2 text-sm font-mono border-none focus:outline-none focus:ring-0 w-24",placeholder:"#000000"})]}),s.jsx("div",{className:"flex items-center gap-2",children:PQe.map(S=>s.jsx("button",{onClick:()=>j(S),className:`w-8 h-8 rounded-full border-2 transition-all hover:scale-110 ${c===S?"border-gray-900 ring-2 ring-gray-300":"border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:S},title:S},S))})]})]}),s.jsxs("div",{className:"flex justify-end items-center gap-3 pt-5 border-t border-gray-200",children:[s.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500",children:i("common.cancel","Cancel")}),s.jsx("button",{onClick:v,disabled:m,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 border border-transparent rounded-lg hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:i("qrCode.saveChanges","Save changes")})]})]})]})}):null};function LQe({value:e,onChange:t,options:r,className:n="",placeholder:a="Select...",minWidth:i="min-w-[180px]"}){const[o,l]=b.useState(!1),c=b.useRef(null),[u,d]=b.useState({top:0,left:0,width:0}),f=()=>{const p=c.current;
3851if(!p)return;const g=p.getBoundingClientRect(),y=8,v=Math.max(g.width,288);let x=g.left;const j=x+v-window.innerWidth;j>0&&(x=Math.max(8,x-j-8));const C=g.bottom+y;d({top:C,left:x,width:v})};b.useLayoutEffect(()=>{o&&f()},[o]),b.useEffect(()=>{if(!o)return;const p=()=>f(),g=()=>f(),y=v=>{v.key==="Escape"&&l(!1)};return window.addEventListener("resize",p),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("keydown",y),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",g),window.removeEventListener("keydown",y)}},[o]),b.useEffect(()=>{if(!o)return;const p=document.body.style.overflow,g=document.body.style.paddingRight,y=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",y>0&&(document.body.style.paddingRight=`${y}px`),()=>{document.body.style.overflow=p,document.body.style.paddingRight=g}},[o]);const m=r.find(p=>p.id===e)||r[0],h=p=>{t(p),l(!1)};return s.jsxs("div",{className:`relative ${i} ${n}`,children:[s.jsxs("button",{ref:c,"aria-haspopup":"listbox","aria-expanded":o,onClick:()=>l(p=>!p),className:"flex items-center justify-between w-full px-4 py-2 text-sm bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{children:m==null?void 0:m.emoji}),s.jsx("span",{className:"text-gray-700",children:(m==null?void 0:m.label)||a})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-400"})]}),o&&Ly.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-[60] overflow-hidden overscroll-contain",onClick:()=>l(!1)}),s.jsx("div",{className:"fixed z-[70] bg-white border border-gray-200 rounded-lg shadow-lg overflow-y-auto max-h-96",style:{top:u.top,left:u.left,width:`${u.width}px`},role:"listbox",children:s.jsx("div",{className:"py-1",children:r.map(p=>s.jsxs("button",{onClick:()=>h(p.id),className:`group w-full flex flex-col items-start gap-0.5 px-4 py-2.5 text-sm text-left transition-colors ${p.id===e?"bg-primary-50":"hover:bg-primary-25"}`,role:"option","aria-selected":p.id===e,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:p.emoji}),s.jsx("span",{className:`$
3852                        ${p.id===e?"text-primary-600 font-semibold":"text-gray-800 font-medium group-hover:text-primary-600"}
3853                      `,children:p.label})]}),s.jsx("p",{className:`text-xs pl-6 ${p.id===e?"text-primary-500":"text-gray-500 group-hover:text-primary-400"}`,children:p.description})]}
3853,p.id))})})]}),document.body)]})}const DQe=({value:e,onChange:t,className:r=""})=>{const{t:n,i18n:a}=Te(),i=b.useMemo(()=>[{id:"all",label:n("statusDropdown.all","All Statuses"),emoji:"📊",description:n("statusDropdown.allDesc","View posts across all their current states.")},{id:"idea",label:n("statusDropdown.idea","Idea"),emoji:"💡",description:n("statusDropdown.ideaDesc","A post idea saved for later with an optional reminder date.")},{id:"draft",label:n("statusDropdown.draft","Draft"),emoji:"📝",description:n("statusDropdown.draftDesc","Post is in progress, not yet submitted for review or scheduling.")},{id:"scheduled",label:n("statusDropdown.scheduled","Scheduled"),emoji:"📆",description:n("statusDropdown.scheduledDesc","Post is approved and set for automatic publishing at a future time.")},{id:"ready_to_publish",label:n("statusDropdown.ready_to_publish","Ready to Publish"),emoji:"🚀",description:n("statusDropdown.ready_to_publishDesc","Post is complete, approved, and awaiting its scheduled time or manual publishing.")},{id:"waiting_for_approval",label:n("statusDropdown.waiting_for_approval","Waiting for approval"),emoji:"⏳",description:n("statusDropdown.waiting_for_approvalDesc","Post has been submitted and is awaiting review by an approver.")},{id:"published",label:n("statusDropdown.published","Published"),emoji:"✅",description:n("statusDropdown.publishedDesc","Post has been successfully shared on the selected platforms.")},{id:"rejected",label:n("statusDropdown.rejected","Rejected"),emoji:"❌",description:n("statusDropdown.rejectedDesc","Post was reviewed but not approved for publishing by an approver.")},{id:"error",label:n("statusDropdown.error","Error"),emoji:"⚠️",description:n("statusDropdown.errorDesc","An error occurred while trying to publish or process the post.")},{id:"processing",label:n("statusDropdown.processing","Processing"),emoji:"⚙️",description:n("statusDropdown.processingDesc","Post is currently being processed by the system (e.g., media upload, API submission).")},{id:"pending",label:n("statusDropdown.pending","Pending"),emoji:"🚧",description:n("statusDropdown.pendingDesc","Post is awaiting system action or external confirmation before proceeding.")}],[n,a.language]);return s.jsx(LQe,{value:e,onChange:o=>t(o),options:i,className:r})},OQe=["facebook","instagram","linkedin","twitter","tiktok","youtube","pinterest","google-business"],RQe=({isOpen:e,onClose:t,onConfirm:r,selectedPostsCount:n,brands:a,isLoading:i=!1})=>{var h;const{t:o}=Te(),[l,c]=b.useState({}),[u,d]=b.useState({status:!1,brand:!1,platforms:!1});b.useEffect(()=>{e&&(c({}),d({status:!1,brand:!1,platforms:!1}))},[e]);const f=p=>{p.preventDefault(),console.log("🚀 BulkEditModal: Form submitted - THIS IS THE ONLY TIME UPDATE SHOULD HAPPEN");const g={};if(u.status&&l.status&&(g.status=l.status),u.brand&&l.brandId&&(g.brandId=l.brandId),u.platforms&&l.platforms&&l.platforms.length>0&&(g.platforms=l.platforms),!(Object.keys(g).length>0)){alert(o("bulkEdit.noFieldsSelected","Please select at least one field to update."));return}console.log("📤 BulkEditModal: Calling onConfirm with data:",g),r(g)},m=p=>{const g=l.platforms||[],y=g.includes(p)?g.filter(v=>v!==p):[...g,p];c(v=>({...v,platforms:y}))};return e?s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[60] p-4",children:s.jsxs("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto relative z-[61]",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:s.jsx(no,{className:"w-6 h-6 text-blue-600"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-gray-900",children:o("bulkEdit.title","Bulk Edit Posts")}),s.jsx("p",{className:"text-sm text-gray-500",children:o("bulkEdit.subtitle","Update {{count}} selected posts",{count:n})})]})]}),s.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",type:"button",children:s.jsx(_t,{className:"w-5 h-5 text-gray-500"})})]}),s.jsxs("form",{onSubmit:f,className:"p-6",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(bs,{className:"w-5 h-5 text-blue-600 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"text-sm text-blue-800",children:[s.jsx("p",{className:"font-medium mb-1",children:o("bulkEdit.infoTitle","Bulk Update Information")}),s.jsx("p",{children:o("bulkEdit.infoMessage","Select which fields you want to update and their new values. O
3853nly enabled fields will be modified for the selected posts.")})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"checkbox",id:"enable-status",checked:u.status,onChange:p=>{const g=p.target.checked;d(y=>({...y,status:g})),g&&!l.status&&c(y=>({...y,status:"draft"}))},className:"h-4 w-4 text-primary-600 border-gray-300 rounded focus:ring-primary-500"}),s.jsx("label",{htmlFor:"enable-status",className:"text-sm font-medium text-gray-700",children:o("bulkEdit.updateStatus","Update Status")})]}),u.status&&s.jsx("div",{className:"ml-7",children:s.jsx(DQe,{value:l.status||"draft",onChange:p=>{console.log("📝 MODAL STATUS DROPDOWN: Status changed to",p),c(g=>({...g,status:p}))}})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"checkbox",id:"enable-brand",checked:u.brand,onChange:p=>{const g=p.target.checked;d(y=>({...y,brand:g}))},className:"h-4 w-4 text-primary-600 border-gray-300 rounded focus:ring-primary-500"}),s.jsx("label",{htmlFor:"enable-brand",className:"text-sm font-medium text-gray-700",children:o("bulkEdit.updateBrand","Update Brand")})]}),u.brand&&s.jsx("div",{className:"ml-7",children:s.jsx(hl,{brands:a.filter(p=>p.id!=="all"),selectedBrandId:l.brandId||"",onBrandSelect:p=>c(g=>({...g,brandId:p}))})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"checkbox",id:"enable-platforms",checked:u.platforms,onChange:p=>{const g=p.target.checked;d(y=>({...y,platforms:g})),g&&!l.platforms&&c(y=>({...y,platforms:[]}))},className:"h-4 w-4 text-primary-600 border-gray-300 rounded focus:ring-primary-500"}),s.jsx("label",{htmlFor:"enable-platforms",className:"text-sm font-medium text-gray-700",children:o("bulkEdit.updatePlatforms","Update Platforms")})]}),u.platforms&&s.jsxs("div",{className:"ml-7",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:o("bulkEdit.selectPlatforms","Select platforms for publishing:")}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:OQe.map(p=>{var g;return s.jsxs("button",{type:"button",onClick:()=>m(p),className:`flex items-center gap-2 p-3 rounded-lg border-2 transition-all ${(g=l.platforms)!=null&&g.includes(p)?"border-primary-500 bg-primary-50":"border-gray-200 bg-white hover:border-gray-300"}`,children:[s.jsx(cr,{platform:p,size:20}),s.jsx("span",{className:"text-sm font-medium capitalize",children:p.replace("_"," ")})]},p)})}),((h=l.platforms)==null?void 0:h.length)===0&&s.jsx("p",{className:"text-sm text-gray-500 mt-2",children:o("bulkEdit.selectAtLeastOnePlatform","Select at least one platform")})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-4 mt-8 pt-6 border-t border-gray-200",children:[s.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",disabled:i,children:o("common.cancel","Cancel")}),s.jsx("button",{type:"submit",disabled:i||!u.status&&!u.brand&&!u.platforms,className:"flex items-center gap-2 px-6 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:i?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),o("bulkEdit.updating","Updating...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{className:"w-4 h-4"}),o("bulkEdit.updatePosts","Update {{count}} Posts",{count:n})]})})]})]})]})}):null},$Qe=({isOpen:e,items:t,onClose:r,onApply:n})=>{const{t:a}=Te(),i=b.useMemo(()=>{const u={};for(const d of t)u[d.platform]="new";return u},[t]),[o,l]=b.useState(i);if(U.useEffect(()=>{l(i)},[i]),!e)return null;const c=u=>{const d={};for(const f of t)d[f.platform]=u;l(d)};return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4 text-center sm:p-0",children:[s.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:r}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl w-full max-w-4xl p-6 sm:my-8 sm:p-8 text-left",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-primary-600",children:[s.jsx(zme,{className:"h-6 w-6"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:a("contentCreation.modals.compareText.title","Compare and choose your text")})]}),s.jsxs("button",{type:"button",onClick:r,className:"p-1 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500",children:[s.jsx(_t,{className:"h-5 w-5"}),s.jsx("span",{className:"sr-only",children:a("common.close","Close")})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 mb-4",children:[s.jsx("button",{type:"button",onClick:()=>c("old"),className:"inline-flex items-center gap-2 px-3 py-1.5 border border-gray-300 rounded-md text-sm text-gray-700 bg-white hover:bg-gray-50",children:a("contentCreation.modals.compareText.keepOldAll","Keep all old")}),s.jsx("button",{type:"button",onClick:()=>c("new"),className:"inline-flex items-center gap-2 px-3 py-1.5 border border-primary-600 rounded-md text-sm text-primary-600 bg-white hover:bg-primary-50",children:a("contentCreation.modals.compareText.useNewAll","Use all new")})]}),s.jsx("div",{className:"space-y-6",children:t.map(u=>s.jsxs("div",{className:"border border-gray-200 rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-gray-200",children:[s.jsx("div",{className:"text-sm font-medium text-gray-700",children:u.platform.toUpperCase()}),s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("label",{className:"inline-flex items-center gap-1 cursor-pointer",children:[s.jsx("input",{type:"radio",name:`sel-${u.platform}`,className:"text-primary-600 focus:ring-primary-500",checked:o[u.platform]==="old",onChange:()=>l(d=>({...d,[u.platform]:"old"}))}),s.jsx("span",{className:"text-gray-600",children:a("contentCreation.modals.compareText.keepOld","Keep old")})]}),s.jsxs("label",{className:"inline-flex items-center gap-1 cursor-pointer",children:[s.jsx("input",{type:"radio",name:`sel-${u.platform}`,className:"text-primary-600 focus:ring-primary-500",checked:o[u.platform]==="new",onChange:()=>l(d=>({...d,[u.platform]:"new"}))}),s.jsx("span",{className:"text-primary-700",children:a("contentCreation.modals.compareText.useNew","Use new")})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-0",children:[s.jsxs("div",{className:"p-4 border-r md:border-r border-gray-200",children:[s.jsx("div",{className:"text-xs font-semibold text-gray-500 mb-2",children:a("contentCreation.modals.compareText.oldLabel","Current")}),s.jsx("div",{className:"text-sm text-gray-800 whitespace-pre-wrap leading-relaxed max-h-64 overflow-auto",children:u.oldContent})]}),s.jsxs("div",{className:"p-4",children:[s.jsx("div",{className:"text-xs font-semibold text-gray-500 mb-2",children:a("contentCreation.modals.compareText.newLabel","Generated")}),s.jsx("div",{className:"text-sm text-gray-800 whitespace-pre-wrap leading-relaxed max-h-64 overflow-auto",children:u.newContent})]})]})]},u.platform))}),s.jsxs("div",{className:"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3 gap-3",children:[s.jsx("button",{type:"button",onClick:r,className:"w-full sm:w-auto inline-flex justify-center rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:a("common.cancel","Cancel")}),s.jsxs("button",{type:"button",onClick:()=>n(o),className:"w-full sm:w-auto inline-flex justify-center items-center rounded-lg border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:[s.jsx(ma,{className:"w-4 h-4 mr-2"}),a("contentCreation.modals.compareText.apply","Apply selection")]})]})]})]})})},sA=({isOpen:e,onClose:t,onUpgrade:r,resourceKey:n="brands"})=>{const{t:a}
3853=Te();if(!e)return null;const i=a(`billing.features.${n}`,{count:1}),o=a(`billing.features.${n}`,{count:2});return s.jsxs("div",{className:"fixed inset-0 z-[70]",children:[s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-60",onClick:t}),s.jsx("div",{className:"relative z-[71] min-h-screen flex items-center justify-center p-4",children:s.jsxs("div",{className:"relative bg-white rounded-2xl border-[3px] border-black shadow-2xl w-full max-w-xl p-6",children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600","aria-label":"Close",children:s.jsx(_t,{className:"w-5 h-5"})}),s.jsxs("div",{className:"mb-4",children:[s.jsx("h2",{className:"text-2xl font-extrabold text-gray-900",children:a("upgradeModal.title","Congrats, you have reached your limit 🥳")}),s.jsx("p",{className:"text-gray-800 text-sm mt-2",children:a("upgradeModal.description",{singular:i,plural:o,defaultValue:"You want to get more you can delete a {{singular}} or upgrade now to get more {{plural}}."})})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{onClick:r,className:"inline-flex items-center px-5 py-2.5 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:a("upgradeModal.cta","Upgrade now")})})]})})]})},FQe=()=>{var T;const{t:e}=Te(),t=pn(),[r,n]=b.useState(""),[a,i]=b.useState(null),[o,l]=hb("modal",""),c=o==="analyze",u=o==="upgrade";b.useEffect(()=>{document.title=e("brands.title","Brands")},[e]);const{data:d,isLoading:f,error:m,refetch:h}=oa(),p=CQe(),g=(d==null?void 0:d.brands)||[],y=((T=d==null?void 0:d.pagination)==null?void 0:T.total)??g.length,v=(d==null?void 0:d.brandsLimit)??(d==null?void 0:d.brandLimits)??void 0,j=e("billing.features.brands",{count:typeof v=="number"?v:y}),C=b.useMemo(()=>g.filter(L=>{const R=r.toLowerCase();return L.name.toLowerCase().includes(R)||L.description.toLowerCase().includes(R)||L.keywords.some(_=>_.toLowerCase().includes(R))}),[g,r]),N=async L=>{var R;try{const _=await((R=Qe.currentUser)==null?void 0:R.getIdToken());if(!_)throw new Error("Authentication token is missing.");console.log("Accepting invitation with ID:",L);const B=await fetch("https://api.socialness.ai/management/teams/invitations/accept",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_}`},body:JSON.stringify({invitationId:L})});if(!B.ok){let D=`Failed to accept invitation (status: ${B.status})`;try{const A=await B.json();D=A.message||JSON.stringify(A)||D}catch{}throw new Error(D)}const z=await B.json();console.log("Invitation accepted successfully:",z),await h()}catch(_){console.error("Error accepting invitation:",_),alert(_ instanceof Error?_.message:"Failed to accept invitation.")}},S=async L=>{var R;try{const _=await((R=Qe.currentUser)==null?void 0:R.getIdToken());if(!_)throw new Error("Authentication token is missing.");console.log("Declining invitation with ID:",L);const B=await fetch(`https://api.socialness.ai/management/teams/invitations/${L}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_}`}});if(!B.ok){let z=`Failed to decline invitation (status: ${B.status})`;try{const D=await B.json();z=D.message||JSON.stringify(D)||z}catch{}throw new Error(z)}console.log("Invitation declined successfully"),await h()}catch(_){console.error("Error declining invitation:",_),alert(_ instanceof Error?_.message:"Failed to decline invitation.")}},M=async L=>{try{await p.mutateAsync(L),await h(),i(null)}catch(R){console.error("Error deleting brand:",R),alert("Failed to delete brand. Please try again.")}},k=()=>{if(typeof v=="number"&&y>=v){l("upgrade");return}l("analyze")},I=()=>{l("")};return s.jsxs(rs,{title:e("brands.title"),subtitle:e("brands.subtitle"),actions:s.jsxs("button",{onClick:k,className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("brands.addBrand")]}),children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsx("div",{className:"text-black text-base font-semibold",children:typeof v=="number"?s.jsxs(s.Fragment,{children:[y,"/",v," ",j]}):s.jsxs(s.Fragment,{children:[y," ",j]})})}),s.jsxs("div",{className:"mb-6 relative",children:[s.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:s.jsx($i,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{type:"text",value:r,onChange:L=>n(L.target.value),placeholder:e("brands.search"),className:"block w-full rounded-lg border border-gray-200 bg-white py-2 pl-10 pr-3 text-sm placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{className:`grid grid-cols-1 gap-6 pb-8 ${C.length===1?"lg:grid-cols-1":C.length===2?"lg:grid-cols-2":"lg:grid-cols-2 xl:grid-cols-3"}`,children:[f&&s.jsx(s.Fragment,{children:[1,2,3].map(L=>s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 animate-pulse",children:[s.jsxs("div",{className:"flex items-start justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-12 h-12 bg-gray-200 rounded-lg"}),s.jsxs("div",{children:[s.jsx("div",{className:"h-6 w-32 bg-gray-200 rounded mb-2"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-4 h-4 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-4 w-24 bg-gray-200 rounded"})]})]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-4 h-4 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-4 w-8 bg-gray-200 rounded"})]}),s.jsx("div",{className:"h-5 w-16 bg-gray-200 rounded-full"})]})]}),s.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded mb-6"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:[1,2,3].map(R=>s.jsx("div",{className:"h-6 w-24 bg-gray-200 rounded-lg"},R))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:[1,2].map(R=>s.jsx("div",{className:"h-6 w-32 bg-gray-200 rounded-lg"},R))})]})]})]},L))}),m&&s.jsx("div",{className:"col-span-full text-center py-12",children:s.jsx("p",{className:"text-red-500",children:"Failed to load brands. Please try again later."})}),C.length>0?C.map(L=>s.jsx(UHe,{brand:L,onDelete:()=>i(L),onAcceptInvite:N,onDeclineInvite:S,isFullWidth:C.length===1},L.id)):!f&&g.length===0?s.jsxs("div",{className:"col-span-full flex flex-col items-center justify-center py-16",children:[s.jsx("p",{className:"text-gray-500 text-center mb-6",children:e("brands.noBrands","Aucune marque créée pour l'instant. Créez votre première marque pour commencer.")}),s.jsxs("button",{onClick:k,className:"inline-flex items-center px-6 py-3 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors font-medium",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("brands.createFirst","Créer votre première Marque")]})]}):s.jsx("div",{className:"col-span-full text-center py-12",children:s.jsx("p",{className:"text-gray-500",children:e("brands.noResults")})})]}),s.jsx(Pj,{isOpen:a!==null,onClose:()=>i(null),onConfirm:()=>{a&&M(a.id)},title:e("brands.delete.title"),message:`Êtes-vous sûr de vouloir supprimer la marque "<strong><em>${(a==null?void 0:a.name)||""}</em></strong>" ? Cette action ne peut pas être annulée.`,warning:e("brands.delete.warning")}),s.jsx(fH,{isOpen:c,onClose:I}),s.jsx(sA,{isOpen:u,onClose:I,onUpgrade:()=>t("/billing"),resourceKey:"brands"})]})},hH=e=>Wa({queryKey:["brand",e],queryFn:async()=>{var a;const t=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!t)throw new Error("No authentication token available");const r=await fetch(`https://api.socialness.ai/management/brands?brandId=${e}`,{headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Failed to fetch brand");const n=await r.json();if(n.brand)return n.brand;if(n.brands&&Array.isArray(n.brands)){const i=n.brands.find(o=>o.id===e);
3853if(!i)throw new Error("Brand not found in response");return i}else throw new Error("Invalid response structure from API")},enabled:!!e}),zQe=()=>{const e=qr();return mn({mutationFn:async t=>{const r=async(i=!1)=>{console.log(`Getting auth token${i?" (forced refresh)":""}`);try{if(!Qe.currentUser)throw console.error("No authenticated user found"),new Error("Authentication required. Please log in again.");const o=await Qe.currentUser.getIdToken(i);if(!o)throw new Error("Failed to obtain authentication token");return o}catch(o){throw console.error("Error getting auth token:",o),o}},n=Am.find(i=>i.id===t.industryId),a={name:t.name,description:t.description,logo:t.logo,website:t.website,industryId:t.industryId,industry:(n==null?void 0:n.name)||t.industryId,values:t.values,keywords:t.keywords,languages:t.languages,contentTone:t.contentTone,voice:t.voice,uniqueSellingPoints:t.uniqueSellingPoints,socialMedias:t.socialMedias||[],themes:t.themes||[],contentGaps:t.contentGaps||[],engagementTactics:t.engagementTactics||[],growthOpportunities:t.growthOpportunities||[],recommendedFormats:t.recommendedFormats||[],summary:t.summary||{recap:"",takeaways:[]},...t.visualIdentity&&{visualIdentity:t.visualIdentity},...t.visualContentStrategy&&{visualContentStrategy:t.visualContentStrategy},...t.goToMarketStrategy&&{goToMarketStrategy:t.goToMarketStrategy},contentStrategy:{themes:t.themes||[],contentGaps:t.contentGaps||[],engagementTactics:t.engagementTactics||[],growthOpportunities:t.growthOpportunities||[],recommendedFormats:t.recommendedFormats||[],recommendedPlatforms:t.socialMedias.map(i=>({platform:i.platform,postingFrequency:i.frequency}))},overview:t.summary?{summary:t.summary.recap||"",takeaways:t.summary.takeaways||[]}:void 0};console.log("Creating brand with data:",JSON.stringify(a,null,2));try{const i=await r(!1);console.log("Token available, length:",i.length);const o=await fetch("https://api.socialness.ai/management/brands",{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(a)});console.log("API response status:",o.status);const l=await o.text();if(console.log("API response text:",l),o.status===401||o.status===500&&l.includes("user_fetch_error")){console.log("Authentication issue detected. Attempting with forced token refresh...");try{const c=await r(!0);console.log("Refreshed token available, length:",c.length);const u=await fetch("https://api.socialness.ai/management/brands",{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"},body:JSON.stringify(a)});console.log("Retry API response status:",u.status);const d=await u.text();if(console.log("Retry API response text:",d),!u.ok){let f=`Failed to create brand (Status: ${u.status})`;try{const m=JSON.parse(d);f=m.message||m.error||f,console.error("API error response data after token refresh:",m)}catch{console.error("Could not parse error response as JSON:",d)}throw new Error(f)}try{return d?JSON.parse(d):{success:!0}}catch(f){return console.error("Failed to parse successful response:",f),{success:!0}}}catch(c){throw console.error("Error during retry with refreshed token:",c),c}}if(!o.ok){let c=`Failed to create brand (Status: ${o.status})`;try{const u=JSON.parse(l);c=u.message||u.error||c,console.error("API error response data:",u)}catch{console.error("Could not parse error response as JSON:",l)}throw new Error(c)}try{return l?JSON.parse(l):{}}catch(c){return console.error("Failed to parse successful response:",c),{success:!0}}}catch(i){throw console.error("Network or parsing error:",i),i}},onSuccess:()=>{e.invalidateQueries({queryKey:["brands"]})}})},Ud=b.forwardRef(({tags:e=[],onTagsChange:t,placeholder:r="Type and press Enter",icon:n,tagClassName:a="bg-primary-50 text-primary-700",renderTag:i,inputValue:o,onInputChange:l,onInputKeyDown:c},u)=>{const d=typeof o=="string"&&typeof l=="function",[f,m]=b.useState(""),h=d?o:f,p=v=>{d?l==null||l(v):m(v)},g=v=>{c&&c(v)},y=v=>{t(e.filter(x=>x!==v))};return s.jsxs("div",{className:"space-y-2",children:[s.jsx("input",{ref:u,type:"text",value:h,onChange:v=>p(v.target.value),onKeyDown:g,placeholder:r,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Array.isArray(e)&&e.map((v,x)=>s.jsxs("span",{className:`inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm ${a}`,children:[i?i(v):s.jsxs(s.Fragment,{children:[n,v]}),s.jsx("button",{type:"button",onClick:()=>y(v),className:"ml-1 hover:text-red-600",children:s.jsx(_t,{className:"w-3 h-3"})})]},x))})]})});Ud.displayName="TagInput";const rx=[{code:"en",name:"English",emoji:"🇬🇧"},{code:"fr",name:"French",emoji:"🇫🇷"},{code:"de",name:"German",emoji:"🇩🇪"},{code:"es",name:"Spanish",emoji:"🇪🇸"},{code:"it",name:"Italian",emoji:"🇮🇹"},{code:"pt",name:"Portuguese",emoji:"🇵🇹"},{code:"nl",name:"Dutch",emoji:"🇳🇱"},{code:"ru",name:"Russian",emoji:"🇷🇺"},{code:"ar",name:"Arabic",emoji:"🇸🇦"},{code:"zh",name:"Mandarin Chinese",emoji:"🇨🇳"},{code:"ja",name:"Japanese",emoji:"🇯🇵"},{code:"ko",name:"Korean",emoji:"🇰🇷"},{code:"hi",name:"Hindi",emoji:"🇮🇳"},{code:"bn",name:"Bengali",emoji:"🇧🇩"},{code:"tr",name:"Turkish",emoji:"🇹🇷"},{code:"vi",name:"Vietnamese",emoji:"🇻🇳"},{code:"tl",name:"Tagalog / Filipino",emoji:"🇵🇭"},{code:"fa",name:"Persian (Farsi)",emoji:"🇮🇷"},{code:"pl",name:"Polish",emoji:"🇵🇱"},{code:"th",name:"Thai",emoji:"🇹🇭"},{code:"sv",name:"Swedish",emoji:"🇸🇪"},{code:"ro",name:"Romanian",emoji:"🇷🇴"},{code:"uk",name:"Ukrainian",emoji:"🇺🇦"},{code:"cs",name:"Czech",emoji:"🇨🇿"},{code:"lb",name:"Luxembourgish",emoji:"🇱🇺"},{code:"da",name:"Danish",emoji:"🇩🇰"},{code:"fi",name:"Finnish",emoji:"🇫🇮"},{code:"no",name:"Norwegian",emoji:"🇳🇴"}],BQe=e=>{const t=e.split("-")[0].toLowerCase(),r=rx.find(n=>n.code===t);return r?{code:r.code,name:r.name,emoji:r.emoji,display:`${r.emoji} ${r.name}`}:{code:t,name:e.toUpperCase(),emoji:"🌐",display:`🌐 ${e.toUpperCase()}`}},pH=({languages:e,onLanguagesChange:t})=>{const{t:r}=Te(),[n,a]=b.useState(""),[i,o]=b.useState(!1),[l,c]=b.useState(rx),u=b.useRef(null),d=b.useRef(null);b.useEffect(()=>{if(n){const g=n.toLowerCase();c(rx.filter(y=>y.name.toLowerCase().includes(g)||y.code.toLowerCase().includes(g)))}else c(rx.filter(g=>!e.includes(g.code)))},[n,e]),b.useEffect(()=>{const g=y=>{u.current&&!u.current.contains(y.target)&&d.current&&!d.current.contains(y.target)&&o(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const f=g=>{e.includes(g)||t([...e,g]),a(""),o(!1)},m=g=>{a(g),o(!0)},h=g=>{const y=BQe(g);return s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mr-1",children:y.emoji}),y.name]})},p=g=>{if(g.key==="Enter"&&n.trim()&&l.length>0){g.preventDefault();const y=l[0];e.includes(y.code)||f(y.code)}};return s.jsxs("div",{className:"relative w-full",ref:u,children:[s.jsx(Ud,{tags:e,onTagsChange:t,placeholder:r("common.languageSearchPlaceholder","Type to search or select..."),tagClassName:"bg-blue-50 text-blue-700",renderTag:h,inputValue:n,onInputChange:m,onInputKeyDown:p,ref:d}),i&&l.length>0&&s.jsx("div",{className:"absolute left-0 right-0 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-10",children:l.map(g=>s.jsxs("button",{className:"relative w-full cursor-default select-none py-2 pl-3 pr-9 text-gray-900 hover:bg-primary-100 hover:text-primary-900 flex items-center gap-2",onClick:()=>f(g.code),type:"button",children:[s.jsx("span",{className:"text-lg",children:g.emoji}),s.jsx("span",{className:"block truncate",children:g.name})]},g.code))})]})}
3853,gH=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i,i18n:o}=Te(),l=U.useMemo(()=>[{id:"inspirational",name:i("contentCreation.form.tones.inspirational","Inspirational"),emoji:"✨",description:i("contentCreation.form.toneDescriptions.inspirational","Uplifting and motivational content that inspires action and positive change")},{id:"professional",name:i("contentCreation.form.tones.professional","Professional"),emoji:"👔",description:i("contentCreation.form.toneDescriptions.professional","Formal and business-oriented content that establishes expertise and authority")},{id:"casual",name:i("contentCreation.form.tones.casual","Casual"),emoji:"😊",description:i("contentCreation.form.toneDescriptions.casual","Relaxed and friendly content that creates a comfortable, approachable atmosphere")},{id:"educational",name:i("contentCreation.form.tones.educational","Educational"),emoji:"📚",description:i("contentCreation.form.toneDescriptions.educational","Informative content focused on teaching and sharing knowledge")},{id:"friendly",name:i("contentCreation.form.tones.friendly","Friendly"),emoji:"🤝",description:i("contentCreation.form.toneDescriptions.friendly","Warm and welcoming content that builds personal connections")},{id:"funny",name:i("contentCreation.form.tones.funny","Funny"),emoji:"😂",description:i("contentCreation.form.toneDescriptions.funny","Humorous and entertaining content that makes people laugh and engages through comedy")}],[i,o.language]),c=l.find(u=>u.id===e)||l[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),a(!n)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsx("span",{className:"text-gray-700",children:c.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:u=>{u.stopPropagation(),a(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:l.map(u=>s.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),t(u.id),a(!1)},className:`w-full text-left px-4 py-2 ${u.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:u.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:u.name}),s.jsx("div",{className:"text-xs text-gray-500",children:u.description})]})]})},u.id))})})]})]})},UQe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i}=Te(),o=[{id:"local",name:i("brands.edit.marketingStrategy.marketScope.local","Local"),emoji:"🏪",description:i("brands.edit.marketingStrategy.marketScope.localDescription","Physical businesses serving specific cities/regions")},{id:"regional",name:i("brands.edit.marketingStrategy.marketScope.regional","Regional"),emoji:"🗺️",description:i("brands.edit.marketingStrategy.marketScope.regionalDescription","Businesses serving multiple cities/regions within a country")},{id:"national",name:i("brands.edit.marketingStrategy.marketScope.national","National"),emoji:"🏛️",description:i("brands.edit.marketingStrategy.marketScope.nationalDescription","Businesses serving an entire country")},{id:"international",name:i("brands.edit.marketingStrategy.marketScope.international","International"),emoji:"🌍",description:i("brands.edit.marketingStrategy.marketScope.internationalDescription","Businesses serving multiple countries but not globally")},{id:"global",name:i("brands.edit.marketingStrategy.marketScope.global","Global"),emoji:"🌐",description:i("brands.edit.marketingStrategy.marketScope.globalDescription","Businesses that can serve customers worldwide")}],l=o.find(c=>c.id===e)||o[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),a(!n)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:l.emoji}),s.jsx("span",{className:"text-gray-700",children:l.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:c=>{c.stopPropagation(),a(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:o.map(c=>s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),t(c.id),a(!1)},className:`w-full text-left px-4 py-2 ${c.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:c.name}),s.jsx("div",{className:"text-xs text-gray-500",children:c.description})]})]})},c.id))})})]})]})}
3853,VQe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i}=Te(),o=[{id:"B2B",name:i("brands.edit.marketingStrategy.businessModel.b2b","B2B"),emoji:"🏢",description:i("brands.edit.marketingStrategy.businessModel.b2bDescription","Business-to-business (selling to other companies)")},{id:"B2C",name:i("brands.edit.marketingStrategy.businessModel.b2c","B2C"),emoji:"👥",description:i("brands.edit.marketingStrategy.businessModel.b2cDescription","Business-to-consumer (selling directly to end consumers)")},{id:"B2B2C",name:i("brands.edit.marketingStrategy.businessModel.b2b2c","B2B2C"),emoji:"🔗",description:i("brands.edit.marketingStrategy.businessModel.b2b2cDescription","Business-to-business-to-consumer (selling through partners to consumers)")},{id:"B2G",name:i("brands.edit.marketingStrategy.businessModel.b2g","B2G"),emoji:"🏛️",description:i("brands.edit.marketingStrategy.businessModel.b2gDescription","Business-to-government (selling to government entities)")},{id:"Other",name:i("brands.edit.marketingStrategy.businessModel.other","Other"),emoji:"🔄",description:i("brands.edit.marketingStrategy.businessModel.otherDescription","Other business model not listed above")}],l=o.find(c=>c.id===e)||o[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),a(!n)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:l.emoji}),s.jsx("span",{className:"text-gray-700",children:l.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:c=>{c.stopPropagation(),a(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:o.map(c=>s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),t(c.id),a(!1)},className:`w-full text-left px-4 py-2 ${c.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:c.name}),s.jsx("div",{className:"text-xs text-gray-500",children:c.description})]})]})},c.id))})})]})]})},WQe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i}=Te(),o=[{id:"digital",name:i("brands.edit.marketingStrategy.distributionType.digital","Digital"),emoji:"💻",description:i("brands.edit.marketingStrategy.distributionType.digitalDescription","Primarily online services, digital products, remote delivery")},{id:"physical",name:i("brands.edit.marketingStrategy.distributionType.physical","Physical"),emoji:"🏪",description:i("brands.edit.marketingStrategy.distributionType.physicalDescription","Primarily physical locations, in-person services, physical products")},{id:"hybrid",name:i("brands.edit.marketingStrategy.distributionType.hybrid","Hybrid"),emoji:"🔄",description:i("brands.edit.marketingStrategy.distributionType.hybridDescription","Combination of physical and digital touchpoints")}],l=o.find(c=>c.id===e)||o[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),a(!n)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:l.emoji}),s.jsx("span",{className:"text-gray-700",children:l.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:c=>{c.stopPropagation(),a(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:o.map(c=>s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),t(c.id),a(!1)},className:`w-full text-left px-4 py-2 ${c.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:c.name}),s.jsx("div",{className:"text-xs text-gray-500",children:c.description})]})]})},c.id))})})]})]})}
3853,iA=({value:e,onChange:t,className:r=""})=>{const{t:n}=Te(),[a,i]=b.useState(!1);b.useEffect(()=>{},[a]);const o=[{id:"auto",name:n("contentCreation.form.imageStyles.auto"),emoji:"🤖",description:n("contentCreation.form.imageStyleDescriptions.auto")},{id:"realistic",name:n("contentCreation.form.imageStyles.realistic"),emoji:"📷",description:n("contentCreation.form.imageStyleDescriptions.realistic")},{id:"design",name:n("contentCreation.form.imageStyles.design"),emoji:"✏️",description:n("contentCreation.form.imageStyleDescriptions.design")},{id:"3d",name:n("contentCreation.form.imageStyles.3d"),emoji:"🎯",description:n("contentCreation.form.imageStyleDescriptions.3d")},{id:"artistic",name:n("contentCreation.form.imageStyles.artistic"),emoji:"🎨",description:n("contentCreation.form.imageStyleDescriptions.artistic")},{id:"modern",name:n("contentCreation.form.imageStyles.modern"),emoji:"✨",description:n("contentCreation.form.imageStyleDescriptions.modern")},{id:"ad",name:n("contentCreation.form.imageStyles.ad"),emoji:"📢",description:n("contentCreation.form.imageStyleDescriptions.ad")}],l=o.find(c=>c.id===e)||o[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),i(!a)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:l.emoji}),s.jsx("span",{className:"text-gray-700",children:l.name})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),a&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:c=>{c.stopPropagation(),i(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:o.map(c=>s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),t(c.id),i(!1)},className:`w-full text-left px-4 py-2 ${c.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:c.name}),s.jsx("div",{className:"text-xs text-gray-500",children:c.description})]})]})},c.id))})})]})]})},qQe=e=>{const t=e.toLowerCase().trim();return{linkedin:"linkedin",facebook:"facebook",instagram:"instagram",twitter:"twitter",youtube:"youtube",tiktok:"tiktok",pinterest:"pinterest","google business":"google-business","google-business":"google-business",googlebusiness:"google-business"}[t]||null},oA=({networks:e=[],onAddNetwork:t,onDeleteNetwork:r,showAddButton:n=!0,isPersonaForm:a=!1})=>{const{t:i}=Te(),o=l=>{switch(l){case"daily":return"Quotidien";case"weekly":return"Hebdomadaire";case"bi-weekly":return"Bi-hebdomadaire";case"monthly":return"Mensuel";default:return l}};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700",children:i(a?"personas.form.socialNetworks":"brands.edit.brandGuidelines.recommendedSocialNetworks")}),n&&t&&s.jsxs("button",{onClick:t,className:"inline-flex items-center text-sm text-primary-600 hover:text-primary-700",children:[s.jsx(tn,{className:"w-4 h-4 mr-1"}),i("common.add")]})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:Array.isArray(e)&&e.map((l,c)=>{const u=qQe(l.platform);return u?s.jsxs("div",{className:"flex flex-col items-center p-4 bg-white rounded-lg relative group",children:[r&&s.jsx("button",{onClick:()=>r(l.platform),className:"absolute -top-2 -right-2 p-1 bg-white rounded-full border border-gray-200 shadow-sm opacity-0 group-hover:opacity-100 transition-opacity hover:border-red-300",children:s.jsx(_t,{className:"w-3 h-3 text-red-500"})}),s.jsx(cr,{platform:u,size:24}),s.jsx("span",{className:"mt-2 text-xs text-gray-600",children:o(l.frequency)})]},c):null})})]})},GQe=[{id:"linkedin",name:"LinkedIn",icon:"/linkedin.svg"},{id:"twitter",name:"Twitter",icon:"/twitter.svg"},{id:"instagram",name:"Instagram",icon:"/instagram.svg"},{id:"facebook",name:"Facebook",icon:"/facebook.svg"},{id:"youtube",name:"YouTube",icon:"/youtube.svg"}
3853,{id:"tiktok",name:"TikTok",icon:"/tiktok.svg"},{id:"pinterest",name:"Pinterest",icon:"/pinterest.svg"},{id:"google-business",name:"Google Business",icon:"/google-business.svg"}],HQe=["daily","weekly","bi-weekly","monthly"],yH=({isOpen:e,onClose:t,onAdd:r,existingPlatforms:n=[]})=>{const[a,i]=b.useState(""),[o,l]=b.useState("");if(U.useEffect(()=>{e&&(i(""),l(""))},[e]),!e)return null;const c=(m,h)=>{h||i(a===m?"":m)},u=m=>{l(o===m?"":m)},d=()=>{a&&o&&(r(a,o),t())},f=m=>{switch(m){case"daily":return"Daily";case"weekly":return"Weekly";case"bi-weekly":return"Twice per week";case"monthly":return"Monthly"}};return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Add Social Network"}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-3",children:"Select Platform"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:GQe.map(m=>{const h=n.includes(m.id);return s.jsxs("button",{onClick:()=>c(m.id,h),disabled:h,className:`flex items-center gap-2 p-3 rounded-lg border ${a===m.id?"border-primary-600 bg-primary-50":h?"border-gray-200 bg-gray-50 opacity-50 cursor-not-allowed":"border-gray-200 hover:border-primary-600"}`,children:[s.jsx("img",{src:m.icon,alt:m.name,className:"w-6 h-6"}),s.jsx("span",{className:`text-sm ${h?"text-gray-400":"text-gray-700"}`,children:m.name}),h&&s.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:"Already added"})]},m.id)})})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-3",children:"Posting Frequency"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:HQe.map(m=>s.jsx("button",{onClick:()=>u(m),className:`p-3 rounded-lg border ${o===m?"border-primary-600 bg-primary-50":"border-gray-200 hover:border-primary-600"}`,children:s.jsx("span",{className:"text-sm text-gray-700",children:f(m)})},m))})]})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:"Cancel"}),s.jsx("button",{onClick:d,disabled:!a||!o,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Add Network"})]})]})]})})},bH=({tabs:e,activeTab:t,onTabChange:r})=>s.jsx("div",{className:"border-b border-gray-200",children:s.jsx("div",{className:"flex space-x-4",children:e.map(n=>s.jsxs("button",{onClick:()=>r(n.id),className:`flex items-center gap-2 py-2 px-1 border-b-2 text-sm font-medium ${t===n.id?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[n.icon,n.label]},n.id))})}),Sl=({placeholder:e,onAdd:t,icon:r,useLargeButton:n=!0,existingItems:a=[],showEnterHint:i=!1})=>{const{t:o}=Te(),[l,c]=b.useState(""),u=b.useRef(null),[d,f]=b.useState(!1),m=()=>{const p=l.trim();p&&!a.includes(p)&&(t(p),c(""))},h=p=>{p.key==="Enter"&&(p.preventDefault(),m())};return s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:`flex ${n?"gap-2 items-start":"gap-1 items-center"}`,children:[s.jsx("input",{ref:u,type:"text",value:l,onChange:p=>c(p.target.value),onKeyDown:h,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:e,className:"flex-1 rounded-lg border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),s.jsx("button",{type:"button",onClick:m,"aria-label":o("common.add","Add"),className:`flex items-center justify-center rounded-lg text-white transition-colors
3854                      ${n?"p-2 bg-primary-600 hover:bg-primary-700 mt-0":"p-1.5 bg-primary-600 hover:bg-primary-700"}`,children:s.jsx(tn,{className:`${n?"w-5 h-5":"w-4 h-4"}`})})]}),i&&(d||l.length>0)&&s.jsxs("div",{className:"mt-1 text-xs text-gray-500",children:[o("addItemInput.hint.prefix","Remember to tap")," ",s.jsx("strong",{children:"Enter"})," ",o("addItemInput.hint.suffix","when you finish in order to add it below")]})]})},YQe=({isOpen:e,onClose:t,onSave:r,initialColor:n,initialType:a,isEditing:i})=>{const[o,l]=b.useState(n),[c,u]=b.useState(a);b.useEffect(()=>{e&&(l(n),u(a))},[e,n,a]);const d=()=>{r(o,c)};return e?s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-xl shadow-xl max-w-md w-full mx-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:i?"Edit Color":"Add New Color"}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-20 h-20 rounded-xl border border-gray-200 shadow-sm mx-auto mb-4",style:{backgroundColor:o}}),s.jsx("div",{className:"text-sm font-mono text-gray-600",children:o.toUpperCase()})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Choose Color"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("input",{type:"color",value:o,onChange:f=>l(f.target.value),className:"w-full h-12 rounded-lg border border-gray-300 cursor-pointer"}),s.jsx("input",{type:"text",value:o,onChange:f=>{const m=f.target.value;m.match(/^#[0-9A-Fa-f]{0,6}$/)&&l(m)},placeholder:"#000000",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Color Type"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{value:"primary",label:"Primary",color:"bg-blue-100 text-blue-700"},{value:"secondary",label:"Secondary",color:"bg-purple-100 text-purple-700"},{value:"accent",label:"Accent",color:"bg-green-100 text-green-700"},{value:"neutral",label:"Neutral",color:"bg-gray-100 text-gray-700"}].map(f=>s.jsxs("button",{onClick:()=>u(f.value),className:`p-3 rounded-lg border-2 transition-all ${c===f.value?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"}`,children:[s.jsx("div",{className:`inline-block px-2 py-1 rounded-full text-xs font-medium ${f.color} mb-2`,children:f.label.toUpperCase()}),s.jsx("div",{className:"text-sm text-gray-600",children:f.label})]},f.value))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Popular Colors"}),s.jsx("div",{className:"grid grid-cols-8 gap-2",children:["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF","#800000","#008000","#000080","#808000","#800080","#008080","#C0C0C0","#808080","#FF6B6B","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F"].map(f=>s.jsx("button",{onClick:()=>l(f),className:`w-8 h-8 rounded-lg border border-black transition-all ${o===f?"border-2 border-primary-500":"hover:border-gray-600"}`,style:{backgroundColor:f}},f))})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-gray-200",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:"Cancel"}),s.jsx("button",{onClick:d,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:i?"Update Color":"Add Color"})]})]})}):null},_5="brand-fonts",QQe="/fonts/brand-fonts.css",vH=()=>
3854{if(typeof document>"u"||document.getElementById(_5))return;const e=document.createElement("link");e.id=_5,e.rel="stylesheet",e.href=QQe,document.head.appendChild(e)},KQe=[{name:"Inter",category:"Sans-serif",styles:18},{name:"Roboto",category:"Sans-serif",styles:12},{name:"Open Sans",category:"Sans-serif",styles:10},{name:"Lato",category:"Sans-serif",styles:9},{name:"Montserrat",category:"Sans-serif",styles:18},{name:"Source Sans Pro",category:"Sans-serif",styles:12},{name:"Oswald",category:"Sans-serif",styles:6},{name:"Raleway",category:"Sans-serif",styles:18},{name:"Poppins",category:"Sans-serif",styles:18},{name:"Nunito",category:"Sans-serif",styles:12},{name:"Work Sans",category:"Sans-serif",styles:9},{name:"Fira Sans",category:"Sans-serif",styles:10},{name:"PT Sans",category:"Sans-serif",styles:4},{name:"Ubuntu",category:"Sans-serif",styles:8},{name:"Noto Sans",category:"Sans-serif",styles:12},{name:"Bricolage Grotesque",category:"Sans-serif",styles:4},{name:"Albert Sans",category:"Sans-serif",styles:18},{name:"DM Sans",category:"Sans-serif",styles:11},{name:"Plus Jakarta Sans",category:"Sans-serif",styles:14},{name:"Outfit",category:"Sans-serif",styles:9},{name:"Manrope",category:"Sans-serif",styles:8},{name:"Space Grotesk",category:"Sans-serif",styles:7},{name:"Lexend",category:"Sans-serif",styles:9},{name:"Satoshi",category:"Sans-serif",styles:10},{name:"Figtree",category:"Sans-serif",styles:9},{name:"Playfair Display",category:"Serif",styles:9},{name:"Montagu Slab",category:"Serif",styles:7},{name:"Merriweather",category:"Serif",styles:8},{name:"Crimson Text",category:"Serif",styles:6},{name:"Libre Baskerville",category:"Serif",styles:3},{name:"Dancing Script",category:"Handwriting",styles:2},{name:"Pacifico",category:"Handwriting",styles:1},{name:"Great Vibes",category:"Handwriting",styles:1},{name:"Bebas Neue",category:"Display",styles:1},{name:"Righteous",category:"Display",styles:1},{name:"Fredoka One",category:"Display",styles:1}],JQe=["All","Sans-serif","Serif","Display","Handwriting"],ZQe=({isOpen:e,onClose:t,onSave:r,initialFont:n="",fontType:a,fontSubtype:i})=>{const[o,l]=b.useState(n),[c,u]=b.useState(""),[d,f]=b.useState("All"),[m,h]=b.useState(a),[p,g]=b.useState(i);if(b.useEffect(()=>{e&&(vH(),l(n),h(a),g(i),u(""),f("All"))},[e,n,a,i]),!e)return null;const y=KQe.filter(x=>{const j=x.name.toLowerCase().includes(c.toLowerCase()),C=d==="All"||x.category===d;return j&&C}),v=()=>{o&&m&&r(o,m,p)};return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:s.jsxs("div",{className:"bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Hn,{className:"w-5 h-5 text-primary-500"}),s.jsx("h2",{className:"text-xl font-semibold",children:n?"Edit Font":"Select Font"})]}),s.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(_t,{className:"w-5 h-5"})})]})}),s.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto max-h-[calc(90vh-200px)]",children:[o&&s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsx("div",{className:"text-sm text-gray-600 mb-2",children:"Preview:"}),s.jsx("div",{className:"text-3xl font-bold mb-2",style:{fontFamily:`"${o}", serif`},children:o}),s.jsx("div",{className:"text-lg text-gray-600",style:{fontFamily:`"${o}", serif`},children:"The quick brown fox jumps over the lazy dog"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Font Usage"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("select",{value:m,onChange:x=>h(x.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2",children:[s.jsx("option",{value:"heading",children:"Heading"}),s.jsx("option",{value:"body",children:"Body Text"}),s.jsx("option",{value:"buttons",children:"Buttons"}),s.jsx("option",{value:"captions",children:"Captions"}),s.jsx("option",{value:"navigation",children:"Navigation"})]}),(m==="heading"||m==="body")&&s.jsx("select",{value:p||"",onChange:x=>g(x.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2",children:m==="heading"?s.jsxs(s.Fragment,{children:[s.jsx("option",{value:"h1",children:"H1 (Main Headlines)"}),s.jsx("option",{value:"h2",children:"H2 (Section Headers)"}),s.jsx("option",{value:"h3",children:"H3 (Sub-headers)"})]}):s.jsxs(s.Fragment,{children:[s.jsx("option",{value:"primary",children:"Primary Body Text"}),s.jsx("option",{value:"secondary",children:"Secondary Body Text"})]})})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx($i,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx("input",{type:"text",placeholder:"Search fonts...",value:c,onChange:x=>u(x.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:JQe.map(x=>s.jsx("button",{onClick:()=>f(x),className:`px-3 py-1 rounded-full text-sm transition-colors ${d===x?"bg-primary-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:x},x))})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:y.map(x=>s.jsxs("button",{onClick:()=>l(x.name),className:`p-4 rounded-lg border-2 text-left transition-all hover:border-primary-300 ${o===x.name?"border-primary-500 bg-primary-50":"border-gray-200 hover:bg-gray-50"}`,children:[s.jsx("div",{className:"text-xl font-semibold mb-2",style:{fontFamily:`"${x.name}", serif`},children:x.name}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("img",{src:"https://www.gstatic.
3854com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"w-3 h-3"}),s.jsx("span",{children:"Google"})]}),s.jsxs("span",{children:[x.styles," styles"]}),s.jsx("span",{children:"Free"}),s.jsx("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs",children:x.category})]})]},x.name))})]}),s.jsxs("div",{className:"p-6 border-t border-gray-200 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors",children:"Cancel"}),s.jsx("button",{onClick:v,disabled:!o,className:`px-4 py-2 rounded-lg transition-colors ${o?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-300 text-gray-500 cursor-not-allowed"}`,children:"Save Font"})]})]})})},XQe=()=>{const e=qr();return mn({mutationFn:async({brandId:t,data:r})=>{var o,l,c;const n=await((o=Qe.currentUser)==null?void 0:o.getIdToken());if(!n)throw new Error("No authentication token available");console.log(`Updating brand ${t} with data:`,r);const a={...r};if(r.industryId){const u=Am.find(d=>d.id===r.industryId);a.industry=(u==null?void 0:u.name)||r.industryId}if(Array.isArray(r.socialMedias)){const u=r.socialMedias.filter(d=>d&&d.platform&&d.frequency).map(d=>({platform:d.platform,postingFrequency:d.frequency}));u.length>0&&(a.contentStrategy={...a.contentStrategy||{},recommendedPlatforms:u})}if(typeof r.themes<"u"||typeof r.contentGaps<"u"||typeof r.engagementTactics<"u"||typeof r.growthOpportunities<"u"||typeof r.recommendedFormats<"u"){const u=r.contentStrategy||{},d={};(typeof u.themes<"u"||typeof r.themes<"u")&&(d.themes=u.themes??r.themes),(typeof u.contentGaps<"u"||typeof r.contentGaps<"u")&&(d.contentGaps=u.contentGaps??r.contentGaps),(typeof u.engagementTactics<"u"||typeof r.engagementTactics<"u")&&(d.engagementTactics=u.engagementTactics??r.engagementTactics),(typeof u.growthOpportunities<"u"||typeof r.growthOpportunities<"u")&&(d.growthOpportunities=u.growthOpportunities??r.growthOpportunities),(typeof u.recommendedFormats<"u"||typeof r.recommendedFormats<"u")&&(d.recommendedFormats=u.recommendedFormats??r.recommendedFormats),typeof u.recommendedPlatforms<"u"&&(d.recommendedPlatforms=u.recommendedPlatforms),a.contentStrategy=d,delete a.themes,delete a.contentGaps,delete a.engagementTactics,delete a.growthOpportunities,delete a.recommendedFormats}typeof r.summary<"u"&&(a.overview={...r.overview||{},summary:((l=r.summary)==null?void 0:l.recap)??"",takeaways:((c=r.summary)==null?void 0:c.takeaways)??[]},delete a.summary),a.visualIdentity&&(a.visualIdentity.colorPalette&&a.visualIdentity.colorPalette.recommended&&delete a.visualIdentity.colorPalette.recommended,a.visualIdentity.typography&&a.visualIdentity.typography.recommendations&&delete a.visualIdentity.typography.recommendations),Object.keys(a).forEach(u=>{a[u]===void 0&&delete a[u]}),a.contentStrategy&&Object.keys(a.contentStrategy).length===0&&delete a.contentStrategy,a.overview&&Object.keys(a.overview).length===0&&delete a.overview,console.log("Update brand payload shaped for API:",JSON.stringify(a));try{const u=await fetch(`https://api.socialness.ai/management/brands/${t}`,{method:"PUT",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(console.log("PUT response status:",u.status),!u.ok){const f=await u.text();console.error("Error response from API:",f);try{const m=JSON.parse(f),h=m.message||m.error||u.statusText;throw new Error(`Failed to update brand (${u.status}): ${h}`)}catch{throw new Error(`Failed to update brand (${u.status}): ${f}`)}}const d=await u.json();return console.log("Brand updated successfully:",d),d}catch(u){throw console.error("Error in brand mutation:",u),u}},onSuccess:()=>{e.invalidateQueries({queryKey:["brands"]})}})};class eKe extends U.Component{constructor(r){super(r);vt(this,"handleRetry",()=>{this.setState({hasError:!1,error:void 0})});this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("BrandForm Error Boundary caught an error:",r,n),(r.message.includes("insertBefore")||r.message.includes("removeChild")||r.message.includes("Node"))&&console.error("DOM manipulation error detected in BrandForm")}render(){return this.state.hasError?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8",children:s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-xl p-8 text-center",children:[s.jsx(qs,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}
3854),s.jsx("h2",{className:"text-xl font-semibold text-red-800 mb-2",children:"Something went wrong"}),s.jsx("p",{className:"text-red-600 mb-4",children:"There was an error loading the brand form. This might be due to a temporary issue."}),s.jsxs("button",{onClick:this.handleRetry,className:"inline-flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors",children:[s.jsx(ai,{className:"w-4 h-4 mr-2"}),"Try Again"]}),!1]})})}):this.props.children}}const ed={id:"",name:"",description:"",logo:"",website:"",industryId:"advertising-marketing",values:[],keywords:[],languages:["en"],contentTone:"professional",imageStyle:"realistic",voice:"",uniqueSellingPoints:[],recommendedFormats:[],socialMedias:[],themes:[],contentGaps:[],engagementTactics:[],growthOpportunities:[],summary:{recap:"",takeaways:[]},visualIdentity:{colorPalette:{primary:[],secondary:[],accent:[],neutral:[],recommended:{complementary:[],improvements:""}},typography:{headings:{h1:"",h2:"",h3:""},body:{primary:"",secondary:""},specialty:{buttons:"",captions:"",navigation:""},fallbacks:[],recommendations:{improvements:"",hierarchy:""}}},visualContentStrategy:{colorUsage:{socialMediaPosts:"",callToActions:"",backgrounds:"",seasonalAdaptations:""},typographyGuidelines:{socialMediaHeaders:"",bodyText:"",quotesTestimonials:"",hashtagsKeywords:""},visualElementsToEmphasize:[],designConsistencyTips:[],brandExtensions:{socialTemplates:"",logoUsage:"",imageFilters:""}},goToMarketStrategy:{short:"",targetSegments:[],keyPersonaTypes:[],marketScope:"local",priorityMarkets:[],businessModel:"B2C",distributionType:"digital"}},L5=e=>{const t={Inter:18,Roboto:12,"Open Sans":10,Lato:9,Montserrat:18,"Source Sans Pro":12,Oswald:6,Raleway:18,Poppins:18,Nunito:12,"Playfair Display":9,"Montagu Slab":7,Merriweather:8,"Crimson Text":6,"PT Sans":4,Ubuntu:8,"Libre Baskerville":3,"Work Sans":9,"Fira Sans":10,"Noto Sans":12,"Bricolage Grotesque":4,"Albert Sans":18,"DM Sans":11,"Plus Jakarta Sans":14,Outfit:9,Manrope:8,"Space Grotesk":7,Lexend:9,Satoshi:10,Figtree:9},r=t[e]||1,n=!!t[e];return{styles:r,isGoogleFont:n}},jv=(e,t)=>{const n={"#FFFFFF":"Pure White","#000000":"Pure Black","#FF0000":"Pure Red","#00FF00":"Pure Green","#0000FF":"Pure Blue","#FFFF00":"Pure Yellow","#FF00FF":"Pure Magenta","#00FFFF":"Pure Cyan","#808080":"Gray","#6428E3":"Bright Purple","#5622C6":"Purple","#CFBFF7":"Light Purple","#333333":"Dark Gray","#333":"Dark Gray","#666666":"Gray","#666":"Gray","#999999":"Light Gray","#999":"Light Gray","#CCCCCC":"Light Gray","#CCC":"Light Gray"}[e.toUpperCase()];if(n)return n;const a=e.replace("#",""),i=parseInt(a.substring(0,2),16),o=parseInt(a.substring(2,4),16),l=parseInt(a.substring(4,6),16),c=(.299*i+.587*o+.114*l)/255;if(Math.abs(i-o)<8&&Math.abs(o-l)<8&&Math.abs(i-l)<8)return c>.9?"Pure White":c>.7?"Light Gray":c>.5?"Gray":c>.3?"Dark Gray":c>.1?"Charcoal":"Pure Black";const d=Math.max(i,o,l),f=Math.min(i,o,l);if((d===0?0:(d-f)/d)<.2)return c>.7?"Light Gray":c>.3?"Gray":"Dark Gray";let h=0;d===i?h=(o-l)/(d-f)*60:d===o?h=(2+(l-i)/(d-f))*60:h=(4+(i-o)/(d-f))*60,h<0&&(h+=360);const p=c>.7?"Bright ":c<.3?"Dark ":"";return h>=345||h<15?p+"Red":h<45?p+"Orange":h<75?p+"Yellow":h<105?p+"Yellow Green":h<135?p+"Green":h<165?p+"Teal":h<195?p+"Cyan":h<225||h<255?p+"Blue":h<285?p+"Purple":h<315?p+"Magenta":p+"Pink"},tKe=()=>{var je,We,yt,gt,qe,ze,$e,ct,oe,Ne,Ae,lt,Mt,jt,Xe,Bt,ve,Fe,nt,At,Wt,In,ir,Qt,Sn,nn,Lt,_e,et,ft,pt,$t,Pt,Ft,Dr,K,ke,Ze,bt,Re,dt,Et,xt,qt,Gr,la,$n,Rt,rr,se,Be,at,Ke,ee,de,Se,Ue,Pe,tt,kt,or,Nr,Fr,Sr,Zt,kr,Ce,Ge,Je,Xt,pr,ot,Ut,mr,en,er,qn,En,Mr,Hr,ca,ss;const{brandId:e}=U4(),t=pn(),r=vs(),{t:n,i18n:a}=Te(),[i,o]=b.useState("branding"),[l,c]=b.useState(!1),[u,d]=b.useState(!0),[f,m]=b.useState(!1),[h,p]=b.useState(!1),[g,y]=b.useState(null),[v,x]=b.useState(!1),[j,C]=b.useState(null),[N,S]=b.useState(!1),[M,k]=b.useState(!1),[I,T]=b.useState(!1),[L,R]=b.useState(!1),[_,B]=b.useState(!1),[z,D]=b.useState(""),[A,P]=b.useState(!1),[E,F]=b.useState(()=>{var Oe;const ge=(Oe=r.state)==null?void 0:Oe.prefilledData;return Ie.debug("BrandForm","Prefilled data loaded"),ge?{...ed,...ge}:ed}),[$,H]=b.useState(ed),X=!!e,ue=XQe(),le=zQe(),{data:ae,isLoading:te,error:ne}=hH(e||"");b.useRef(null),b.useEffect(()=>{vH()},[]),b.useEffect(()=>{var ge,Oe,Nt,wt,Ir,an,ta,nr,gr,gn,Na,Hs,it,Co,Cc,sn,Rf,Ys,Gi,kc,Yu,bl,Mc,xs,Ic,Qu,Hi,Yi,vl,Yr,_s,ar,yn,Ls,is,$f,xl,Qi,Ec,Op,Ku,Rp,$p,ko,Fp,zp,Bp,Up,Ju,os,Vp,Wp,wl,w,O,V,re,Me,Le,mt,on,ya,Or,Sa,Ca,jl,Ds,Zu,Ff,cP,uP,dP,fP,mP,hP,pP,gP,yP,bP;if(!X){d(!1);return}if(ae){Ie.debug("BrandForm","Brand data received from API");let vN=[];ae.socialMedias&&ae.socialMedias.length>
38540?vN=[...ae.socialMedias]:(ge=ae.contentStrategy)!=null&&ge.recommendedPlatforms&&ae.contentStrategy.recommendedPlatforms.length>0&&(vN=ae.contentStrategy.recommendedPlatforms.map(xP=>({platform:xP.platform||"",frequency:xP.postingFrequency||"weekly"})));const iJ={short:((Oe=ae.goToMarketStrategy)==null?void 0:Oe.short)||"",targetSegments:((Nt=ae.goToMarketStrategy)==null?void 0:Nt.targetSegments)||ae.targetSegments||[],keyPersonaTypes:((wt=ae.goToMarketStrategy)==null?void 0:wt.keyPersonaTypes)||ae.keyPersonaTypes||[],marketScope:((Ir=ae.goToMarketStrategy)==null?void 0:Ir.marketScope)||ae.marketScope||"local",priorityMarkets:((an=ae.goToMarketStrategy)==null?void 0:an.priorityMarkets)||ae.priorityMarkets||[],businessModel:((ta=ae.goToMarketStrategy)==null?void 0:ta.businessModel)||ae.businessModel||"B2C",distributionType:((nr=ae.goToMarketStrategy)==null?void 0:nr.distributionType)||ae.distributionType||"digital"},oJ={colorPalette:{primary:((gn=(gr=ae.visualIdentity)==null?void 0:gr.colorPalette)==null?void 0:gn.primary)||[],secondary:((Hs=(Na=ae.visualIdentity)==null?void 0:Na.colorPalette)==null?void 0:Hs.secondary)||[],accent:((Co=(it=ae.visualIdentity)==null?void 0:it.colorPalette)==null?void 0:Co.accent)||[],neutral:((sn=(Cc=ae.visualIdentity)==null?void 0:Cc.colorPalette)==null?void 0:sn.neutral)||[],recommended:((Ys=(Rf=ae.visualIdentity)==null?void 0:Rf.colorPalette)==null?void 0:Ys.recommended)||{complementary:[],improvements:""}},typography:{headings:{h1:((Yu=(kc=(Gi=ae.visualIdentity)==null?void 0:Gi.typography)==null?void 0:kc.headings)==null?void 0:Yu.h1)||"",h2:((xs=(Mc=(bl=ae.visualIdentity)==null?void 0:bl.typography)==null?void 0:Mc.headings)==null?void 0:xs.h2)||"",h3:((Hi=(Qu=(Ic=ae.visualIdentity)==null?void 0:Ic.typography)==null?void 0:Qu.headings)==null?void 0:Hi.h3)||""},body:{primary:((Yr=(vl=(Yi=ae.visualIdentity)==null?void 0:Yi.typography)==null?void 0:vl.body)==null?void 0:Yr.primary)||"",secondary:((yn=(ar=(_s=ae.visualIdentity)==null?void 0:_s.typography)==null?void 0:ar.body)==null?void 0:yn.secondary)||""},specialty:{buttons:(($f=(is=(Ls=ae.visualIdentity)==null?void 0:Ls.typography)==null?void 0:is.specialty)==null?void 0:$f.buttons)||"",captions:((Ec=(Qi=(xl=ae.visualIdentity)==null?void 0:xl.typography)==null?void 0:Qi.specialty)==null?void 0:Ec.captions)||"",navigation:((Rp=(Ku=(Op=ae.visualIdentity)==null?void 0:Op.typography)==null?void 0:Ku.specialty)==null?void 0:Rp.navigation)||""},fallbacks:((ko=($p=ae.visualIdentity)==null?void 0:$p.typography)==null?void 0:ko.fallbacks)||[],recommendations:((zp=(Fp=ae.visualIdentity)==null?void 0:Fp.typography)==null?void 0:zp.recommendations)||{improvements:"",hierarchy:""}}},lJ={colorUsage:{socialMediaPosts:((Up=(Bp=ae.visualContentStrategy)==null?void 0:Bp.colorUsage)==null?void 0:Up.socialMediaPosts)||"",callToActions:((os=(Ju=ae.visualContentStrategy)==null?void 0:Ju.colorUsage)==null?void 0:os.callToActions)||"",backgrounds:((Wp=(Vp=ae.visualContentStrategy)==null?void 0:Vp.colorUsage)==null?void 0:Wp.backgrounds)||"",seasonalAdaptations:((w=(wl=ae.visualContentStrategy)==null?void 0:wl.colorUsage)==null?void 0:w.seasonalAdaptations)||""},typographyGuidelines:{socialMediaHeaders:((V=(O=ae.visualContentStrategy)==null?void 0:O.typographyGuidelines)==null?void 0:V.socialMediaHeaders)||"",bodyText:((Me=(re=ae.visualContentStrategy)==null?void 0:re.typographyGuidelines)==null?void 0:Me.bodyText)||"",quotesTestimonials:((mt=(Le=ae.visualContentStrategy)==null?void 0:Le.typographyGuidelines)==null?void 0:mt.quotesTestimonials)||"",hashtagsKeywords:((ya=(on=ae.visualContentStrategy)==null?void 0:on.typographyGuidelines)==null?void 0:ya.hashtagsKeywords)||""},visualElementsToEmphasize:((Or=ae.visualContentStrategy)==null?void 0:Or.visualElementsToEmphasize)||ae.visualElementsToEmphasize||[],designConsistencyTips:((Sa=ae.visualContentStrategy)==null?void 0:Sa.designConsistencyTips)||ae.designConsistencyTips||[],brandExtensions:{socialTemplates:((jl=(Ca=ae.visualContentStrategy)==null?void 0:Ca.brandExtensions)==null?void 0:jl.socialTemplates)||"",logoUsage:((Zu=(Ds=ae.visualContentStrategy)==null?void 0:Ds.brandExtensions)==null?void 0:Zu.logoUsage)||"",imageFilters:((cP=(Ff=ae.visualContentStrategy)==null?void 0:Ff.brandExtensions)==null?void 0:cP.imageFilters)||""}},vP={...ae,socialMedias:vN,values:ae.values||[],keywords:ae.keywords||[],languages:ae.languages||["en"],imageStyle:ae.imageStyle||"realistic",uniqueSellingPoints:ae.uniqueSellingPoints||[],recommendedFormats:((uP=ae.contentStrategy)==null?void 0:uP.recommendedFormats)||ae.recommendedFormats||[],themes:((dP=ae.contentStrategy)==null?void 0:dP.themes)||ae.themes||[],contentGaps:((fP=ae.contentStrategy)==null?void 0:fP.contentGaps)||ae.contentGaps||[],engagementTactics:((mP=ae.contentStrategy)==null?void 0:mP.engagementTactics)||ae.engagementTactics||[],growthOpportunities:((hP=ae.contentStrategy)==null?void 0:hP.growthOpportunities)||ae.growthOpportunities||[],summary:{recap:((pP=ae.overview)==null?void 0:pP.summary)||((gP=ae.summary)==null?void 0:gP.recap)||"",takeaways:((yP=ae.overview)==null?void 0:yP.takeaways)||((bP=ae.summary)==null?void 0:bP.takeaways)||[]},goToMarketStrategy:iJ,visualIdentity:oJ,visualContentStrategy:lJ};Ie.debug("BrandForm","Brand data formatted for display"),F(vP),H(vP),d(!1)}},[ae,X]);const J=async()=>{var ge,Oe,Nt;try{const wt=[];if((ge=E.name)!=null&&ge.trim()||wt.push(n("brands.edit.brandIdentity.name","Brand Name")),wt.length>0){alert(n("brands.validation.requiredFields","Les champs suivants sont obligatoires : ")+wt.join(", "));return}Ie.info("BrandForm",`Saving brand: ${E.name}`),m(!0);const Ir=E.socialMedias.map(nr=>({platform:nr.platform,postingFrequency:nr.frequency})),an={themes:E.themes||[],contentGaps:E.contentGaps||[],engagementTactics:E.engagementTactics||[],growthOpportunities:E.growthOpportunities||[],recommendedFormats:E.recommendedFormats||[],recommendedPlatforms:Ir},ta={summary:((Oe=E.summary)==null?void 0:Oe.recap)||"",takeaways:((Nt=E.summary)==null?void 0:Nt.takeaways)||[]};if(X){const nr={};
3854if(Object.entries(E).forEach(([gr,gn])=>{const Na=$[gr],Hs=JSON.stringify(gn),it=JSON.stringify(Na);Hs!==it&&(nr[gr]=gn,Ie.debug("BrandForm",`Field '${gr}' changed`,{original:Na,current:gn}))}),Ie.info("BrandForm",`Detected ${Object.keys(nr).length} changed fields: ${Object.keys(nr).join(", ")}`),Object.keys(nr).length===0&&!A){Ie.warn("BrandForm","No changes detected, skipping save"),t("/brand-strategy-lab");return}Object.keys(nr).length===0&&A&&(Ie.info("BrandForm","No changes detected but brand was filled with AI - forcing update"),Object.entries(E).forEach(([gr,gn])=>{gr!=="id"&&(nr[gr]=gn)})),Ie.debug("BrandForm",`Updating ${Object.keys(nr).length} changed fields`);try{const gr=await ue.mutateAsync({brandId:e,data:nr});Ie.info("BrandForm",`Brand updated successfully: ${E.name}`),P(!1),t("/brand-strategy-lab")}catch(gr){if(Ie.error("Failed to update brand:",JSON.stringify(gr)),nr.name||nr.description){Ie.info("Attempting minimal update with only name and description","BRAND_UPDATE");const gn={};nr.name&&(gn.name=nr.name),nr.description&&(gn.description=nr.description);try{const Na=await ue.mutateAsync({brandId:e,data:gn});Ie.info("BrandForm",`Minimal brand update successful: ${E.name}`),P(!1),t("/brand-strategy-lab");return}catch(Na){throw Ie.error("Even minimal update failed:",JSON.stringify(Na)),new Error(n("brands.edit.updateErrorMinimal","Could not update brand even with minimal fields"))}}else throw gr}}else{Ie.info("Creating new brand with minimal data first","BRAND_CREATE");try{const nr={name:E.name,description:E.description||"",logo:E.logo||"",website:E.website||"",industryId:E.industryId||"advertising-marketing",languages:E.languages||["en"],values:E.values||[],keywords:E.keywords||[],contentTone:E.contentTone||"professional",imageStyle:E.imageStyle||"realistic",voice:E.voice||"",uniqueSellingPoints:E.uniqueSellingPoints||[],recommendedFormats:E.recommendedFormats||[],socialMedias:E.socialMedias||[],themes:E.themes||[],contentGaps:E.contentGaps||[],engagementTactics:E.engagementTactics||[],growthOpportunities:E.growthOpportunities||[],summary:E.summary||{recap:"",takeaways:[]},visualIdentity:E.visualIdentity||{colorPalette:{primary:[],secondary:[],accent:[],neutral:[]},typography:{headings:{h1:"",h2:"",h3:""},body:{primary:"",secondary:""},specialty:{buttons:"",captions:"",navigation:""},fallbacks:[]}},visualContentStrategy:E.visualContentStrategy||{colorUsage:{socialMediaPosts:"",callToActions:"",backgrounds:"",seasonalAdaptations:""},typographyGuidelines:{socialMediaHeaders:"",bodyText:"",quotesTestimonials:"",hashtagsKeywords:""},visualElementsToEmphasize:[],designConsistencyTips:[],brandExtensions:{socialTemplates:"",logoUsage:"",imageFilters:""}},goToMarketStrategy:E.goToMarketStrategy||{short:"",targetSegments:[],keyPersonaTypes:[],marketScope:"local",priorityMarkets:[],businessModel:"B2C",distributionType:"digital"}};Ie.debug("BrandForm","Creating brand with minimal required fields");const gr=await le.mutateAsync(nr);Ie.info("BrandForm",`Brand created successfully: ${E.name}`),P(!1),t("/brand-strategy-lab")}catch(nr){Ie.error("Failed to create brand with minimal data:",JSON.stringify(nr)),nr.response&&Ie.error("Error response:",JSON.stringify({status:nr.response.status,data:nr.response.data}));try{Ie.info("Attempting with full data as fallback","BRAND_CREATE");const gr={name:E.name,description:E.description,logo:E.logo,website:E.website,industryId:E.industryId,values:E.values,keywords:E.keywords,languages:E.languages,contentTone:E.contentTone,imageStyle:E.imageStyle,voice:E.voice,uniqueSellingPoints:E.uniqueSellingPoints,recommendedFormats:E.recommendedFormats,socialMedias:E.socialMedias,themes:E.themes,contentGaps:E.contentGaps,engagementTactics:E.engagementTactics,growthOpportunities:E.growthOpportunities,summary:E.summary,visualIdentity:E.visualIdentity,visualContentStrategy:E.visualContentStrategy,goToMarketStrategy:E.goToMarketStrategy,contentStrategy:an,overview:ta};await le.mutateAsync(gr),P(!1),t("/brand-strategy-lab")}catch(gr){throw Ie.error("Failed to create brand with full data:",JSON.stringify(gr)),gr}}}}catch(wt){Ie.error("Error saving brand:",JSON.stringify(wt)),wt instanceof Error?alert(n("brands.edit.saveErrorDetailed",`Failed to save brand: ${wt.message}`)):alert(n("brands.edit.saveErrorGeneric","Failed to save brand. Please try again."))}finally{m(!1)}},G=U.useCallback((ge,Oe)=>{F(Nt=>{const wt={...Nt,[ge]:Oe};return wt.goToMarketStrategy||(wt.goToMarketStrategy={short:"",targetSegments:[],keyPersonaTypes:[],marketScope:"local",priorityMarkets:[],businessModel:"B2C",distributionType:"digital"}),wt})},[]),Q=(ge,Oe)=>{G("socialMedias",[...E.socialMedias,{platform:ge,frequency:Oe}])},W=(ge,Oe)=>{var wt;if(["targetSegments","keyPersonaTypes","priorityMarkets"].includes(ge)){const Ir=((wt=E.goToMarketStrategy)==null?void 0:wt[ge])||[];Oe&&!Ir.includes(Oe)&&G("goToMarketStrategy",{...E.goToMarketStrategy,[ge]:[...Ir,Oe]});return}const Nt=E[ge];Oe&&!Nt.includes(Oe)&&G(ge,[...Nt,Oe])},Y=(ge,Oe)=>{var wt;if(["targetSegments","keyPersonaTypes","priorityMarkets"].includes(ge)){const Ir=((wt=E.goToMarketStrategy)==null?void 0:wt[ge])||[];G("goToMarketStrategy",{...E.goToMarketStrategy,[ge]:Ir.filter((an,ta)=>ta!==Oe)});return}const Nt=E[ge];G(ge,Nt.filter((Ir,an)=>an!==Oe))},q=(ge,Oe)=>{const Nt=E[ge];G(ge,Nt.filter(wt=>wt!==Oe))},Z=(ge,Oe,Nt)=>{y({color:ge,type:Oe,index:Nt}),p(!0)},me=()=>{y(null),p(!0)},we=(ge,Oe)=>{var wt;const Nt={...(wt=E.visualIdentity)==null?void 0:wt.colorPalette};if(g){const Ir=g.type,an=g.index;Nt[Ir]&&(Nt[Ir]=Nt[Ir].filter((ta,nr)=>nr!==an))}Nt[Oe]||(Nt[Oe]=[]),Nt[Oe].push(ge),G("visualIdentity",{...E.visualIdentity,colorPalette:Nt}),p(!1),y(null)},he=(ge,Oe)=>{var wt,Ir,an,ta;if(console.log("Deleting color:",{type:ge,index:Oe,currentColors:(Ir=(wt=E.visualIdentity)==null?void 0:wt.colorPalette)==null?void 0:Ir[ge]}),!((ta=(an=E.visualIdentity)==null?void 0:an.colorPalette)!=null&&ta[ge])){console.warn("No colors found for type:",ge);return}const Nt={...E.visualIdentity.colorPalette,primary:[...E.visualIdentity.colorPalette.primary||[]],secondary:[...E.visualIdentity.colorPalette.secondary||[]],accent:[...E.visualIdentity.colorPalette.accent||[]],neutral:[...E.visualIdentity.colorPalette.neutral||[]]};Nt[ge]=Nt[ge].filter((nr,gr)=>gr!==Oe),console.log("New color palette:",Nt),G("visualIdentity",{...E.visualIdentity,colorPalette:Nt})},ie=(ge,Oe,Nt)=>{C({font:ge,type:Oe,subtype:Nt}),x(!0)},ye=()=>{C(null),x(!0)},pe=(ge,Oe,Nt)=>{var Ir;const wt={...(Ir=E.visualIdentity)==null?void 0:Ir.typography};
3854Oe==="heading"&&Nt?wt.headings={...wt.headings,[Nt]:ge}:Oe==="body"&&Nt?wt.body={...wt.body,[Nt]:ge}:Oe==="buttons"?wt.specialty={...wt.specialty,buttons:ge}:Oe==="captions"?wt.specialty={...wt.specialty,captions:ge}:Oe==="navigation"&&(wt.specialty={...wt.specialty,navigation:ge}),G("visualIdentity",{...E.visualIdentity,typography:wt}),x(!1),C(null)},ce=(ge,Oe)=>{var wt;const Nt={...(wt=E.visualIdentity)==null?void 0:wt.typography};ge==="heading"&&Oe?Nt.headings={...Nt.headings,[Oe]:""}:ge==="body"&&Oe?Nt.body={...Nt.body,[Oe]:""}:ge==="buttons"?Nt.specialty={...Nt.specialty,buttons:""}:ge==="captions"?Nt.specialty={...Nt.specialty,captions:""}:ge==="navigation"&&(Nt.specialty={...Nt.specialty,navigation:""}),G("visualIdentity",{...E.visualIdentity,typography:Nt})},xe=async()=>{var ge;if(!E.website){alert(n("brands.edit.refresh.noWebsite","No website URL found to analyze."));return}try{k(!0),S(!1);const Oe=await((ge=Qe.currentUser)==null?void 0:ge.getIdToken());if(!Oe)throw new Error("No authentication token available");let Nt=E.website;/^https?:\/\//i.test(Nt)||(Nt=`https://${Nt}`);const wt=await fetch("https://api.socialness.ai/ai-coach/brand/analyze?WithVisual=true&fast=true",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Oe}`,Origin:"https://socialness.ai"},body:JSON.stringify({url:Nt,language:a.language.split("-")[0].toLowerCase()})});if(!wt.ok){let nr=`API returned status ${wt.status}`;try{const gr=await wt.json();nr=gr.error||gr.message||nr}catch{try{const gn=await wt.text();gn.includes("<!DOCTYPE")||gn.includes("<html")?nr=n("brands.edit.refresh.serviceUnavailable","The analysis service is temporarily unavailable. Please try again in a few minutes."):nr=gn||nr}catch{nr=n("brands.edit.refresh.temporaryError","Service temporarily unavailable ({status}). Please try again later.").replace("{status}",wt.status.toString())}}throw new Error(nr)}const Ir=await wt.json();if(!Ir.analysis)throw new Error(n("brands.edit.refresh.invalidResponse","Invalid response from analysis"));const ta={...b4(Ir,Nt),id:E.id,name:E.name};Ie.info("BrandForm",`Brand data refreshed for: ${ta.name}`),F(ta),T(!0)}catch(Oe){console.error("Error refreshing brand data:",Oe),alert(Oe instanceof Error?Oe.message:n("brands.edit.refresh.genericError","Failed to refresh brand data. Please try again."))}finally{k(!1)}},Ee=async ge=>{var Oe;try{k(!0),B(!1);const Nt=await((Oe=Qe.currentUser)==null?void 0:Oe.getIdToken());if(!Nt)throw new Error("No authentication token available");let wt=ge;/^https?:\/\//i.test(wt)||(wt=`https://${wt}`);const Ir=await fetch("https://api.socialness.ai/ai-coach/brand/analyze?WithVisual=true&fast=true",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Nt}`,Origin:"https://socialness.ai"},body:JSON.stringify({url:wt,language:a.language.split("-")[0].toLowerCase()})});if(!Ir.ok){let gr=`API returned status ${Ir.status}`;try{const gn=await Ir.json();gr=gn.error||gn.message||gr}catch{try{const Na=await Ir.text();Na.includes("<!DOCTYPE")||Na.includes("<html")?gr=n("brands.edit.fillWithAI.serviceUnavailable","The analysis service is temporarily unavailable. Please try again in a few minutes."):gr=Na||gr}catch{gr=n("brands.edit.fillWithAI.temporaryError","Service temporarily unavailable ({status}). Please try again later.").replace("{status}",Ir.status.toString())}}throw new Error(gr)}const an=await Ir.json();if(!an.analysis)throw new Error(n("brands.edit.fillWithAI.invalidResponse","Invalid response from analysis"));const nr={...b4(an,wt),id:E.id,name:E.name,website:wt};Ie.info("BrandForm",`Brand data filled with AI for: ${nr.name}`),F(nr),P(!0),Ie.debug("BrandForm","Brand state updated after AI fill - originalBrand left unchanged for change detection"),T(!0)}catch(Nt){console.error("Error filling brand data with AI:",Nt),alert(Nt instanceof Error?Nt.message:n("brands.edit.fillWithAI.genericError","Failed to analyze website. Please try again."))}finally{k(!1)}},Ye=ge=>{var Nt;const Oe=(Nt=ge.target.files)==null?void 0:Nt[0];if(Oe){if(!Oe.type.startsWith("image/")){alert(n("brands.edit.brandIdentity.logo.invalidType","Please select a valid image file"));return}if(Oe.size>5*1024*1024){alert(n("brands.edit.brandIdentity.logo.tooLarge","File size must be less than 5MB"));return}const wt=new FileReader;wt.onload=Ir=>{var ta;const an=(ta=Ir.target)==null?void 0:ta.result;G("logo",an)}
3854,wt.readAsDataURL(Oe)}ge.target.value=""},fe=U.useMemo(()=>[{id:"branding",label:n("brands.sections.branding","Branding"),icon:U.createElement(VN,{className:"w-4 h-4"})},{id:"marketing",label:n("brands.sections.marketingStrategy","Marketing Strategy"),icon:U.createElement(dL,{className:"w-4 h-4"})},{id:"content",label:n("brands.sections.contentStrategy","Content Strategy"),icon:U.createElement(Fs,{className:"w-4 h-4"})},{id:"summary",label:n("brands.sections.recap","Summary"),icon:U.createElement(da,{className:"w-4 h-4"})}],[n]);return u?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8",children:s.jsxs("div",{className:"animate-pulse",children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-4"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-8"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"h-40 bg-gray-200 rounded"}),s.jsx("div",{className:"h-40 bg-gray-200 rounded"})]})]})})}):ne?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8",children:s.jsx("div",{className:"text-center text-red-600",children:n("brands.edit.loadError","Failed to load brand. Please try again later.")})})}):s.jsxs("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0 pb-8",children:[s.jsx("div",{className:"w-[95%] mx-auto",children:s.jsxs("div",{className:"py-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("button",{onClick:()=>t("/brand-strategy-lab"),className:"p-2 rounded-lg hover:text-primary-600 transition-colors",children:s.jsx(lh,{className:"w-6 h-6"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-semibold text-gray-900 font-title",children:X?E.name:n("brands.create.title","Create Brand")}),s.jsx("p",{className:"text-sm text-gray-500",children:X?n("brands.edit.subtitle","Update brand information and strategy"):n("brands.create.subtitle","Set up a new brand and its social media strategy")})]})]}),s.jsxs("div",{className:"flex gap-3",children:[X&&E.website&&s.jsx("button",{onClick:()=>S(!0),disabled:M||f,className:`inline-flex items-center px-4 py-2 rounded-lg transition-colors border ${M||f?"bg-gray-100 text-gray-400 border-gray-300 cursor-not-allowed":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50 hover:border-gray-400"}`,children:M?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"}),n("brands.edit.refresh.refreshing","Refreshing...")]}):s.jsxs(s.Fragment,{children:[s.jsx(ai,{className:"w-5 h-5 mr-2"}),n("brands.edit.refresh.button","Refresh Data")]})}),(!E.website||E.website.trim()==="")&&s.jsx("button",{onClick:()=>R(!0),disabled:M||f,className:`inline-flex items-center px-4 py-2 rounded-lg transition-colors border ${M||f?"bg-gray-100 text-gray-400 border-gray-300 cursor-not-allowed":"bg-purple-50 text-purple-700 border-purple-300 hover:bg-purple-100 hover:border-purple-400"}`,children:M?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"}),n("brands.edit.fillWithAI.analyzing","Analyzing...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-5 h-5 mr-2"}),n("brands.edit.fillWithAI.button","Fill with AI")]})}),s.jsx("button",{onClick:J,disabled:f||M,className:`inline-flex items-center px-4 py-2 rounded-lg transition-colors ${f||M?"bg-gray-400 cursor-not-allowed":"bg-primary-600 text-white hover:bg-primary-700"}`,children:f?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"}),n("common.savingInProgress","Saving...")]}):s.jsxs(s.Fragment,{children:[s.jsx(il,{className:"w-5 h-5 mr-2"}),X?n("common.save","Save"):n("brands.create.submit","Save Brand")]})})]})]}),s.jsx("div",{className:"mb-6",children:s.jsx(bH,{tabs:fe,activeTab:i,onTabChange:o})}),i==="branding"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[s.jsxs("div",{className:"col-span-1 lg:col-span-2 bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold mb-6",children:n("brands.edit.brandIdentity.title","Brand Identity")}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-6",children:[s.jsxs("div",{className:"w-20 h-20",children:[s.jsx("img",{src:E.logo||"https://via.placeholder.com/80",alt:E.name,className:"w-full h-full object-contain rounded-lg"}),s.jsxs("label",{htmlFor:"file-upload",className:"mt-2 flex justify-center text-xs text-primary-600 hover:text-primary-500 cursor-pointer",children:[s.jsx(Zy,{className:"w-3 h-3 mr-1"}),n("brands.edit.brandIdentity.logo.change","Change Logo"),s.jsx("input",{id:"file-upload",name:"file-upload",type:"file",accept:"image/*",className:"sr-only",onChange:Ye})]})]}),s.jsxs("div",{className:"flex-1 space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[n("brands.edit.brandIdentity.name","Brand Name")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("input",{type:"text",value:E.name,onChange:ge=>G("name",ge.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandIdentity.website","Website URL")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"w-5 h-5 text-gray-400"}),s.jsx("input",{type:"url",value:E.website,onChange:ge=>G("website",ge.target.value),className:"flex-1 rounded-lg border border-gray-300 px-3 py-2"})]})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandIdentity.description","Brand Description")}),s.jsx("textarea",{value:E.description,onChange:ge=>G("description",ge.target.value),rows:4,className:"w-full rounded-lg border border-gray-300 px-3 py-2"})]})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold mb-6",children:n("brands.edit.brandTone.title","Brand Tone")}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandTone.contentTone","Content Tone")}),s.jsx(gH,{value:E.contentTone,onChange:ge=>G("contentTone",ge)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandTone.languages","Languages")}),s.jsx(pH,{languages:E.languages,onLanguagesChange:ge=>G("languages",ge)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandTone.imageStyle","Image Style")}),s.jsx(iA,{value:E.imageStyle,onChange:ge=>G("imageStyle",ge)})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold mb-6",children:n("brands.edit.brandGuidelines.title","Brand Guidelines")}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandGuidelines.values","Brand Values")}),s.jsx(Ud,{tags:E.values,onTagsChange:ge=>G("values",ge),placeholder:n("brands.edit.brandGuidelines.values","Add a brand value"),tagClassName:"bg-primary-50 text-primary-700",onInputKeyDown:ge=>{if(ge.key==="Enter"){const Oe=ge.target.value.trim();Oe&&!E.values.includes(Oe)&&(G("values",[...E.values,Oe]),ge.target.value="",ge.preventDefault())}}})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandGuidelines.voiceDescription","Brand Voice Description")}),s.jsx("textarea",{value:E.voice,onChange:ge=>G("voice",ge.target.value),rows:4,className:"w-full rounded-lg border border-gray-300 px-3 py-2"})]}),s.jsx("div",{children:s.jsx(oA,{networks:E.socialMedias,onAddNetwork:()=>c(!0),isPersonaForm:!1})})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold mb-6",children:n("brands.edit.brandStrategy.title","Brand Strategy")}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandStrategy.industry","Industry")}),s.jsx(BHe,{value:E.industryId,onChange:ge=>G("industryId",ge)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandStrategy.usp","Unique Selling Points")}),s.jsx(Ud,{tags:E.uniqueSellingPoints,onTagsChange:ge=>G("uniqueSellingPoints",ge),icon:s.jsx(dL,{className:"w-3 h-3"}),placeholder:n("brands.edit.brandStrategy.usp","Add a unique selling point"),tagClassName:"bg-primary-50 text-primary-700",onInputKeyDown:ge=>{if(ge.key==="Enter"){const Oe=ge.target.value.trim();Oe&&!E.uniqueSellingPoints.includes(Oe)&&(G("uniqueSellingPoints",[...E.uniqueSellingPoints,Oe]),ge.target.value="",ge.preventDefault())}}})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.brandStrategy.contentFormats","Content Formats")}),s.jsx(Ud,{tags:E.recommendedFormats,onTagsChange:ge=>G("recommendedFormats",ge),icon:s.jsx(jf,{className:"w-3 h-3"}),placeholder:n("brands.edit.brandStrategy.contentFormats","Add a content format"),tagClassName:"bg-primary-50 text-primary-700",onInputKeyDown:ge=>{if(ge.key==="Enter"){const Oe=ge.target.value.trim();Oe&&!E.recommendedFormats.includes(Oe)&&(G("recommendedFormats",[...E.recommendedFormats,Oe]),ge.target.value="",ge.preventDefault())}}})]})]})]})]})]}):i==="marketing"?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Fc,{className:"w-5 h-5 text-blue-500"}),n("brands.edit.marketingStrategy.gtm.title","Go-To-Market Strategy")]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.marketingStrategy.gtm.short","Short Description")}),s.jsx("textarea",{value:((je=E.goToMarketStrategy)==null?void 0:je.short)||"",onChange:ge=>G("goToMarketStrategy",{...E.goToMarketStrategy||ed.goToMarketStrategy,short:ge.target.value}),rows:4,className:"w-full rounded-lg border border-gray-300 px-3 py-2"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-sm font-medium text-gray-700 mb-2 flex items-center gap-2",children:[s.jsx(Fc,{className:"w-4 h-4 text-blue-500"}),n("brands.edit.marketingStrategy.gtm.targetSegments","Target Segments")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Sl,{placeholder:n("brands.edit.marketingStrategy.gtm.targetSegmentsPlaceholder","Add target segment"),onAdd:ge=>W("targetSegments",ge),useLargeButton:!0,existingItems:((We=E.goToMarketStrategy)==null?void 0:We.targetSegments)||[]}),Array.isArray((yt=E.goToMarketStrategy)==null?void 0:yt.targetSegments)&&E.goToMarketStrategy.targetSegments.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.goToMarketStrategy.targetSegments.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Fc,{className:"w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("targetSegments",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`targetSegment-${ge}-${Oe}`))})]}),s.jsxs("div",{children:[s.jsxs("h3",{className:"text-sm font-medium text-gray-700 mb-2 flex items-center gap-2",children:[s.jsx(Jr,{className:"w-4 h-4 text-purple-500"}),n("brands.edit.marketingStrategy.personas.types","Persona Types")]}),s.jsx(Sl,{placeholder:n("brands.edit.marketingStrategy.personas.typesPlaceholder","Add persona type"),onAdd:ge=>W("keyPersonaTypes",ge),useLargeButton:!0,existingItems:((gt=E.goToMarketStrategy)==null?void 0:gt.keyPersonaTypes)||[]}),Array.isArray((qe=E.goToMarketStrategy)==null?void 0:qe.keyPersonaTypes)&&E.goToMarketStrategy.keyPersonaTypes.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.goToMarketStrategy.keyPersonaTypes.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Jr,{className:"w-4 h-4 text-purple-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("keyPersonaTypes",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`personaType-${ge}-${Oe}`))})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[n("brands.edit.marketingStrategy.businessModel","Business Model")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(VQe,{value:((ze=E.goToMarketStrategy)==null?void 0:ze.businessModel)||"B2C",onChange:ge=>G("goToMarketStrategy",{...E.goToMarketStrategy||ed.goToMarketStrategy,businessModel:ge})})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[s.jsx(Zs,{className:"w-5 h-5 text-green-500"}),n("brands.edit.marketingStrategy.marketScope.title","Market Scope")]}),s.jsxs("div",{className:"space-y-6 mb-6",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[n("brands.edit.marketingStrategy.marketScope.scope","Market Scope")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(UQe,{value:(($e=E.goToMarketStrategy)==null?void 0:$e.marketScope)||"local",onChange:ge=>G("goToMarketStrategy",{...E.goToMarketStrategy||ed.goToMarketStrategy,marketScope:ge})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:n("brands.edit.marketingStrategy.distributionType","Distribution Type")}),s.jsx(WQe,{value:((ct=E.goToMarketStrategy)==null?void 0:ct.distributionType)||"digital",onChange:ge=>G("goToMarketStrategy",{...E.goToMarketStrategy||ed.goToMarketStrategy,distributionType:ge})})]})]}),s.jsxs("div",{children:[s.jsxs("h3",{className:"text-sm font-medium text-gray-700 mb-2 flex items-center gap-2",children:[s.jsx(Zs,{className:"w-4 h-4 text-green-500"}),n("brands.edit.marketingStrategy.marketScope.priorityMarkets","Priority Markets")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Sl,{placeholder:n("brands.edit.marketingStrategy.marketScope.priorityMarketsPlaceholder","Add priority market"),onAdd:ge=>W("priorityMarkets",ge),useLargeButton:!0,existingItems:((oe=E.goToMarketStrategy)==null?void 0:oe.priorityMarkets)||[]}
3854),Array.isArray((Ne=E.goToMarketStrategy)==null?void 0:Ne.priorityMarkets)&&E.goToMarketStrategy.priorityMarkets.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.goToMarketStrategy.priorityMarkets.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Zs,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("priorityMarkets",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`priorityMarket-${ge}-${Oe}`))})]})]})]}):i==="content"?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[" ",s.jsx(Fs,{className:"w-5 h-5 text-yellow-500"}),n("brands.edit.contentStrategy.themes.title","Content Themes")]}),s.jsx(Sl,{placeholder:n("brands.edit.contentStrategy.themes.placeholder","Add a content theme"),onAdd:ge=>W("themes",ge),useLargeButton:!0,existingItems:E.themes,showEnterHint:!0}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Array.isArray(E.themes)&&E.themes.map((ge,Oe)=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm bg-yellow-50 text-yellow-700",children:[s.jsx(Fs,{className:"w-4 h-4 mr-1"})," ",ge,s.jsx("button",{type:"button",onClick:()=>q("themes",ge),className:"ml-1 hover:text-red-600",children:s.jsx(_t,{className:"w-3 h-3"})})]},`theme-${ge}-${Oe}`))})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Fc,{className:"w-5 h-5 text-red-500"}),n("brands.edit.contentStrategy.gaps.title","Content Gaps")]}),s.jsx(Sl,{placeholder:n("brands.edit.contentStrategy.gaps.placeholder","Add a content gap to fill"),onAdd:ge=>W("contentGaps",ge),useLargeButton:!0,existingItems:E.contentGaps,showEnterHint:!0}),Array.isArray(E.contentGaps)&&E.contentGaps.length>0&&s.jsxs("ul",{className:"space-y-2 pt-2",children:[" ",E.contentGaps.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Fc,{className:"w-4 h-4 text-red-500 flex-shrink-0 mt-0.5"})," ",s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("contentGaps",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`contentGap-${ge}-${Oe}`))]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Jr,{className:"w-5 h-5 text-blue-500"}),n("brands.edit.contentStrategy.engagement.title","Engagement Strategy")]}),s.jsx(Sl,{placeholder:n("brands.edit.contentStrategy.engagement.placeholder","Add an engagement tactic"),onAdd:ge=>W("engagementTactics",ge),useLargeButton:!0,existingItems:E.engagementTactics,showEnterHint:!0}),Array.isArray(E.engagementTactics)&&E.engagementTactics.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.engagementTactics.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Jr,{className:"w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("engagementTactics",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`engagementTactic-${ge}-${Oe}`))})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[s.jsx(C0,{className:"w-5 h-5 text-green-500"}),n("brands.edit.contentStrategy.growth.title","Growth Opportunities")]}),s.jsx(Sl,{placeholder:n("brands.edit.contentStrategy.growthOpportunities.placeholder","Add a growth opportunity"),onAdd:ge=>W("growthOpportunities",ge),useLargeButton:!0,existingItems:E.growthOpportunities,showEnterHint:!0}),Array.isArray(E.growthOpportunities)&&E.growthOpportunities.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.growthOpportunities.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(C0,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>Y("growthOpportunities",Oe),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`growthOpportunity-${ge}-${Oe}`))})]})]}):i==="styles"?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[s.jsx(VN,{className:"w-5 h-5 text-primary-600"}),n("brands.edit.brandStyles.colors.title","Brand Colors")]}),s.jsxs("button",{onClick:me,className:"inline-flex items-center px-3 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors text-sm",children:[s.jsx(tn,{className:"w-4 h-4 mr-1"}),n("brands.edit.brandStyles.colors.addColor","Add Color")]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 ga
3854p-4",children:[(Mt=(lt=(Ae=E.visualIdentity)==null?void 0:Ae.colorPalette)==null?void 0:lt.primary)==null?void 0:Mt.map((ge,Oe)=>{const Nt=jv(ge);return s.jsxs("div",{className:"text-center group",children:[s.jsxs("div",{className:"w-full aspect-square rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-200 cursor-pointer mb-2 relative",style:{backgroundColor:ge},onClick:()=>Z(ge,"primary",Oe),children:[s.jsx("div",{className:"absolute top-2 right-2",children:s.jsx("span",{className:"inline-block px-2 py-1 bg-white/20 backdrop-blur-sm rounded-full text-xs text-white/80 font-medium",children:"Main"})}),s.jsx("div",{className:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:wt=>{console.log("Delete button clicked!",{type:"primary",index:Oe}),wt.preventDefault(),wt.stopPropagation(),he("primary",Oe)},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette couleur",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center",children:s.jsx(no,{className:"w-5 h-5 text-white"})})]}),s.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wide mb-1",children:"PRIMARY"}),s.jsx("div",{className:"text-sm font-semibold text-gray-800 mb-1",children:Nt}),s.jsx("div",{className:"text-xs font-mono font-medium text-gray-600",children:ge.toUpperCase()})]},`primary-${ge}-${Oe}`)}),(Bt=(Xe=(jt=E.visualIdentity)==null?void 0:jt.colorPalette)==null?void 0:Xe.secondary)==null?void 0:Bt.map((ge,Oe)=>{const Nt=jv(ge);return s.jsxs("div",{className:"text-center group",children:[s.jsxs("div",{className:"w-full aspect-square rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-200 cursor-pointer mb-2 relative",style:{backgroundColor:ge},onClick:()=>Z(ge,"secondary",Oe),children:[s.jsx("div",{className:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:wt=>{console.log("Delete button clicked!",{type:"secondary",index:Oe}),wt.preventDefault(),wt.stopPropagation(),he("secondary",Oe)},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette couleur",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center",children:s.jsx(no,{className:"w-5 h-5 text-white"})})]}),s.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wide mb-1",children:"SECONDARY"}),s.jsx("div",{className:"text-sm font-semibold text-gray-800 mb-1",children:Nt}),s.jsx("div",{className:"text-xs font-mono font-medium text-gray-600",children:ge.toUpperCase()})]},`secondary-${ge}-${Oe}`)}),(nt=(Fe=(ve=E.visualIdentity)==null?void 0:ve.colorPalette)==null?void 0:Fe.accent)==null?void 0:nt.map((ge,Oe)=>{const Nt=jv(ge);return s.jsxs("div",{className:"text-center group",children:[s.jsxs("div",{className:"w-full aspect-square rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-200 cursor-pointer mb-2 relative",style:{backgroundColor:ge},onClick:()=>Z(ge,"accent",Oe),children:[s.jsx("div",{className:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:wt=>{console.log("Delete button clicked!",{type:"accent",index:Oe}),wt.preventDefault(),wt.stopPropagation(),he("accent",Oe)},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette couleur",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center",children:s.jsx(no,{className:"w-5 h-5 text-white"})})]}),s.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wide mb-1",children:"ACCENT"}),s.jsx("div",{className:"text-sm font-semibold text-gray-800 mb
3854-1",children:Nt}),s.jsx("div",{className:"text-xs font-mono font-medium text-gray-600",children:ge.toUpperCase()})]},`accent-${ge}-${Oe}`)}),(In=(Wt=(At=E.visualIdentity)==null?void 0:At.colorPalette)==null?void 0:Wt.neutral)==null?void 0:In.map((ge,Oe)=>{const Nt=jv(ge);return s.jsxs("div",{className:"text-center group",children:[s.jsxs("div",{className:"w-full aspect-square rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-200 cursor-pointer mb-2 relative",style:{backgroundColor:ge},onClick:()=>Z(ge,"neutral",Oe),children:[s.jsx("div",{className:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:wt=>{console.log("Delete button clicked!",{type:"neutral",index:Oe}),wt.preventDefault(),wt.stopPropagation(),he("neutral",Oe)},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette couleur",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center",children:s.jsx(no,{className:"w-5 h-5 text-white"})})]}),s.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wide mb-1",children:"NEUTRAL"}),s.jsx("div",{className:"text-sm font-semibold text-gray-800 mb-1",children:Nt}),s.jsx("div",{className:"text-xs font-mono font-medium text-gray-600",children:ge.toUpperCase()})]},`neutral-${ge}-${Oe}`)})]}),(!((Qt=(ir=E.visualIdentity)==null?void 0:ir.colorPalette)!=null&&Qt.primary)||E.visualIdentity.colorPalette.primary.length===0)&&(!((nn=(Sn=E.visualIdentity)==null?void 0:Sn.colorPalette)!=null&&nn.secondary)||E.visualIdentity.colorPalette.secondary.length===0)&&(!((_e=(Lt=E.visualIdentity)==null?void 0:Lt.colorPalette)!=null&&_e.accent)||E.visualIdentity.colorPalette.accent.length===0)&&s.jsxs("div",{className:"text-center py-8 text-gray-500",children:[s.jsx(VN,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),s.jsx("p",{className:"text-sm",children:"Aucune couleur définie"})]}),((pt=(ft=(et=E.visualIdentity)==null?void 0:et.colorPalette)==null?void 0:ft.recommended)==null?void 0:pt.improvements)&&s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2 flex items-center gap-2",children:[s.jsx(Hn,{className:"w-4 h-4 text-purple-500"}),n("brands.edit.brandStyles.colors.recommendations","Color Recommendations")]}),s.jsx("div",{className:"text-xs text-gray-600 bg-purple-50 p-3 rounded-lg",children:E.visualIdentity.colorPalette.recommended.improvements})]})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[s.jsx(da,{className:"w-5 h-5 text-primary-600"}),n("brands.edit.brandStyles.fonts.title","Brand Fonts")]}),s.jsxs("button",{onClick:ye,className:"inline-flex items-center px-3 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors text-sm",children:[s.jsx(tn,{className:"w-4 h-4 mr-1"}),n("brands.edit.brandStyles.fonts.addFont","Add Font")]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[((Ft=(Pt=($t=E.visualIdentity)==null?void 0:$t.typography)==null?void 0:Pt.headings)==null?void 0:Ft.h1)&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"text-sm font-medium text-gray-700",children:"Heading"}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg relative group cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>ie(E.visualIdentity.typography.headings.h1,"heading","h1"),children:[s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),ce("heading","h1")},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette police",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 rounded-lg flex items-center justify-center transition-all",children:s.jsx("div",{className:"opacity-0 group-hover:opacity-100 bg-white rounded-full p-2 shadow-md transition-opacity",children:s.jsx(no,{className:"w-4 h-4 text-gray-600"})})}),s.jsx("div",{className:"text-2xl font-bold mb-3 relative z-0",style:{fontFamily:`"${E.visualIdentity.typography.headings.h1}", serif`},children:E.visualIdentity.typography.headings.h1}),s.jsx("div",{className:"flex items-center gap-2 relative z-0",children:(()=>{const ge=L5(E.visualIdentity.typography.headings.h1);return ge.isGoogleFont?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("img",{src:"https://www.gstatic.
3854com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"w-4 h-4"}),s.jsx("span",{className:"text-xs text-gray-500",children:"Google"})]}),s.jsxs("span",{className:"text-xs text-gray-500",children:[ge.styles," styles"]}),s.jsx("span",{className:"text-xs text-gray-500",children:"Free"})]}):s.jsx("span",{className:"text-xs text-gray-500",children:"System Font"})})()})]})]}),((ke=(K=(Dr=E.visualIdentity)==null?void 0:Dr.typography)==null?void 0:K.body)==null?void 0:ke.primary)&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"text-sm font-medium text-gray-700",children:"Body"}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg relative group cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>ie(E.visualIdentity.typography.body.primary,"body","primary"),children:[s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:s.jsx("button",{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),ce("body","primary")},className:"w-6 h-6 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-colors hover:scale-110",title:"Supprimer cette police",children:s.jsx(_t,{className:"w-3 h-3"})})}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 rounded-lg flex items-center justify-center transition-all",children:s.jsx("div",{className:"opacity-0 group-hover:opacity-100 bg-white rounded-full p-2 shadow-md transition-opacity",children:s.jsx(no,{className:"w-4 h-4 text-gray-600"})})}),s.jsx("div",{className:"text-2xl font-normal mb-3 relative z-0",style:{fontFamily:`"${E.visualIdentity.typography.body.primary}", sans-serif`},children:E.visualIdentity.typography.body.primary}),s.jsx("div",{className:"flex items-center gap-2 relative z-0",children:(()=>{const ge=L5(E.visualIdentity.typography.body.primary);return ge.isGoogleFont?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"w-4 h-4"}),s.jsx("span",{className:"text-xs text-gray-500",children:"Google"})]}),s.jsxs("span",{className:"text-xs text-gray-500",children:[ge.styles," styles"]}),s.jsx("span",{className:"text-xs text-gray-500",children:"Free"})]}):s.jsx("span",{className:"text-xs text-gray-500",children:"System Font"})})()})]})]})]}),!((Re=(bt=(Ze=E.visualIdentity)==null?void 0:Ze.typography)==null?void 0:bt.headings)!=null&&Re.h1)&&
3854!((xt=(Et=(dt=E.visualIdentity)==null?void 0:dt.typography)==null?void 0:Et.body)!=null&&xt.primary)&&s.jsxs("div",{className:"text-center py-8 text-gray-500",children:[s.jsx(da,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),s.jsx("p",{className:"text-sm",children:n("brands.edit.brandStyles.fonts.noFonts","Aucune police définie")})]}),(((la=(Gr=(qt=E.visualIdentity)==null?void 0:qt.typography)==null?void 0:Gr.headings)==null?void 0:la.h2)||((rr=(Rt=($n=E.visualIdentity)==null?void 0:$n.typography)==null?void 0:Rt.headings)==null?void 0:rr.h3)||((at=(Be=(se=E.visualIdentity)==null?void 0:se.typography)==null?void 0:Be.body)==null?void 0:at.secondary)||((de=(ee=(Ke=E.visualIdentity)==null?void 0:Ke.typography)==null?void 0:ee.specialty)==null?void 0:de.buttons))&&s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"text-sm font-medium text-gray-700",children:"Additional Typography"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[((Pe=(Ue=(Se=E.visualIdentity)==null?void 0:Se.typography)==null?void 0:Ue.headings)==null?void 0:Pe.h2)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"H2:"})," ",E.visualIdentity.typography.headings.h2]}),((or=(kt=(tt=E.visualIdentity)==null?void 0:tt.typography)==null?void 0:kt.headings)==null?void 0:or.h3)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"H3:"})," ",E.visualIdentity.typography.headings.h3]}),((Sr=(Fr=(Nr=E.visualIdentity)==null?void 0:Nr.typography)==null?void 0:Fr.body)==null?void 0:Sr.secondary)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"Secondary:"})," ",E.visualIdentity.typography.body.secondary]}),((Ce=(kr=(Zt=E.visualIdentity)==null?void 0:Zt.typography)==null?void 0:kr.specialty)==null?void 0:Ce.buttons)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"Buttons:"})," ",E.visualIdentity.typography.specialty.buttons]}),((Xt=(Je=(Ge=E.visualIdentity)==null?void 0:Ge.typography)==null?void 0:Je.specialty)==null?void 0:Xt.captions)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"Captions:"})," ",E.visualIdentity.typography.specialty.captions]}),((Ut=(ot=(pr=E.visualIdentity)==null?void 0:pr.typography)==null?void 0:ot.specialty)==null?void 0:Ut.navigation)&&s.jsxs("div",{className:"text-sm p-3 bg-gray-50 rounded-lg",children:[s.jsx("span",{className:"font-medium text-gray-600",children:"Navigation:"})," ",E.visualIdentity.typography.specialty.navigation]})]})]}),((er=(en=(mr=E.visualIdentity)==null?void 0:mr.typography)==null?void 0:en.recommendations)==null?void 0:er.improvements)&&s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2 flex items-center gap-2",children:[s.jsx(Hn,{className:"w-4 h-4 text-purple-500"}),n("brands.edit.brandStyles.fonts.recommendations","Typography Recommendations")]}),s.jsx("div",{className:"text-xs text-gray-600 bg-purple-50 p-3 rounded-lg",children:E.visualIdentity.typography.recommendations.improvements})]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[s.jsx(Fc,{className:"w-5 h-5 text-green-600"}),n("brands.edit.brandStyles.visual.title","Visual Strategy")]}),s.jsxs("div",{className:"space-y-4",children:[((qn=E.visualContentStrategy)==null?void 0:qn.colorUsage)&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("brands.edit.brandStyles.visual.colorUsage","Color Usage Guidelines")}),s.jsxs("div",{className:"space-y-2",children:[E.visualContentStrategy.colorUsage.socialMediaPosts&&s.jsxs("div",{className:"text-xs text-gray-600",children:[s.jsx("span",{className:"font-medium",children:"Social Media:"})," ",E.visualContentStrategy.colorUsage.socialMediaPosts]}),E.visualContentStrategy.colorUsage.callToActions&&s.jsxs("div",{className:"text-xs text-gray-600",children:[s.jsx("span",{className:"font-medium",children:"CTAs:"})," ",E.visualContentStrategy.colorUsage.callToActions]})]})]}),((En=E.visualContentStrategy)==null?void 0:En.typographyGuidelines)&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("brands.edit.brandStyles.visual.typography","Typography Guidelines")}),s.jsxs("div",{className:"space-y-2",children:[E.visualContentStrategy.typographyGuidelines.socialMediaHeaders&&s.jsxs("div",{className:"text-xs text-gray-600",children:[s.jsx("span",{className:"font-medium",children:"Headers:"})," ",E.visualContentStrategy.typographyGuidelines.socialMediaHeaders]}),E.visualContentStrategy.typographyGuidelines.bodyText&&s.jsxs("div",{className:"text-xs text-gray-600",children:[s.jsx("span",{className:"font-medium",children:"Body:"})," ",E.visualContentStrategy.typographyGuidelines.bodyText]})]})]}),((Mr=E.visualContentStrategy)==null?void 0:Mr.visualElementsToEmphasize)&&E.visualContentStrategy.visualElementsToEmphasize.length>0&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("brands.edit.brandStyles.visual.elements","Visual Elements to Emphasize")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:E.visualContentStrategy.visualElementsToEmphasize.map((ge,Oe)=>s.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs bg-green-50 text-green-700",children:ge},`visualElement-${ge}-${Oe}`))})]}),((Hr=E.visualContentStrategy)==null?void 0:Hr.designConsistencyTips)&&E.visualContentStrategy.designConsistencyTips.length>0&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("brands.edit.brandStyles.visual.consistency","Design Consistency Tips")}),s.jsx("ul",{className:"space-y-1",children:E.visualContentStrategy.designConsistencyTips.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"w-1 h-1 bg-gray-400 rounded-full mt-2 flex-shrink-0"}),s.jsx("span",{className:"text-xs text-gray-600",children:ge})]},`designTip-${ge}-${Oe}`))})]})]})]})]}):s.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[s.jsx(da,{className:"w-5 h-5 text-primary-600"}),n("brands.edit.recap","Overview")]}),(ca=E.summary)!=null&&ca.recap?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-500",children:n("brands.edit.recapDescription","AI-generated summary of your website")}),s.jsx("textarea",{value:E.summary.recap,onChange:ge=>G("summary",{...E.summary,recap:ge.target.value}),rows:8,className:"w-full rounded-lg border border-gray-300 px-3 py-2"})]}):s.jsx("div",{className:"text-center py-8 text-gray-500",children:s.jsx("p",{children:n("brands.edit.summary.noData","No website analysis data available. Try anal
3854yzing your website to get insights.")})})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 space-y-3",children:[s.jsxs("h2",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Fs,{className:"w-5 h-5 text-yellow-500"}),n("brands.edit.keyInsights","Key Insights")]}),(ss=E.summary)!=null&&ss.takeaways&&E.summary.takeaways.length>0?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:[" ",n("brands.edit.keyInsightsDescription","Important observations about your website")]}),s.jsx(Sl,{placeholder:n("brands.edit.summary.takeaways","Add a key takeaway"),onAdd:ge=>G("summary",{...E.summary,takeaways:[...E.summary.takeaways,ge]}),useLargeButton:!0,existingItems:E.summary.takeaways}),Array.isArray(E.summary.takeaways)&&E.summary.takeaways.length>0&&s.jsx("ul",{className:"space-y-2 pt-2",children:E.summary.takeaways.map((ge,Oe)=>s.jsxs("li",{className:"flex items-start gap-2 group",children:[s.jsx(Fs,{className:"w-4 h-4 text-yellow-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 text-sm text-gray-700",children:ge}),s.jsx("button",{type:"button",onClick:()=>G("summary",{...E.summary,takeaways:E.summary.takeaways.filter((Nt,wt)=>wt!==Oe)}),className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-600 transition-opacity","aria-label":`${n("common.delete","Delete")} ${ge}`,children:s.jsx(_t,{className:"w-4 h-4"})})]},`takeaway-${ge}-${Oe}`))})]}):s.jsxs(s.Fragment,{children:[" ",s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:n("brands.edit.keyInsightsDescription","Important observations about your website")}),s.jsx(Sl,{placeholder:n("brands.edit.summary.takeaways","Add a key takeaway"),onAdd:ge=>G("summary",{...E.summary,takeaways:[ge]}),useLargeButton:!0}),s.jsxs("div",{className:"text-center py-4 text-gray-500",children:[s.jsx("p",{children:n("brands.edit.summary.noDataYet","No website analysis data available yet. Add takeaways manually or analyze your website.")})," "]})]})]})]})]})}),s.jsx(yH,{isOpen:l,onClose:()=>c(!1),onAdd:Q,existingPlatforms:(E.socialMedias||[]).map(ge=>ge.platform)}),h&&s.jsx(YQe,{isOpen:h,onClose:()=>{p(!1),y(null)},onSave:we,initialColor:(g==null?void 0:g.color)||"#000000",initialType:(g==null?void 0:g.type)||"primary",isEditing:g!==null}),v&&s.jsx(ZQe,{isOpen:v,onClose:()=>{x(!1),C(null)},onSave:pe,initialFont:(j==null?void 0:j.font)||"",fontType:(j==null?void 0:j.type)||"heading",fontSubtype:j==null?void 0:j.subtype}),N&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4 border border-black shadow-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 bg-orange-100 rounded-full flex items-center justify-center",children:s.jsx(ai,{className:"w-5 h-5 text-orange-600"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n("brands.edit.refresh.modal.title","Refresh Brand Data")})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:n("brands.edit.refresh.modal.description","This will re-analyze your website and update all brand data including:")}),s.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 ml-4",children:[s.jsxs("li",{children:["• ",n("brands.edit.refresh.modal.items.colors","Colors and visual identity")]}),s.jsxs("li",{children:["• ",n("brands.edit.refresh.modal.items.fonts","Typography and fonts")]}),s.jsxs("li",{children:["• ",n("brands.edit.refresh.modal.items.content","Content strategy")]}),s.jsxs("li",{children:["• ",n("brands.edit.refresh.modal.items.description","Brand description and values")]})]}),s.jsx("div",{className:"mt-4 p-3 bg-orange-50 border border-orange-200 rounded-lg",children:s.jsxs("p",{className:"text-sm text-orange-800 font-medium",children:["⚠️ ",n("brands.edit.refresh.modal.warning","Warning: All current data will be overwritten and cannot be undone.")]})})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:()=>S(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:n("common.cancel","Cancel")}),s.jsx("button",{onClick:xe,className:"px-4 py-2 text-sm font-medium text-white bg-orange-600 rounded-lg hover:bg-orange-700 transition-colors",children:n("brands.edit.refresh.modal.confirm","Yes, Refresh Data")})]})]})}),I&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-md w-full mx-4 border border-black shadow-lg text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(ai,{className:"w-8 h-8 text-green-600"})}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:n("brands.edit.refresh.modal.successTitle","Data Refreshed!")}),s.jsx("p",{className:"text-gray-600 mb-6",children:n("brands.edit.refresh.success","Brand data refreshed successfully!")}),s.jsx("button",{onClick:()=>T(!1),className:"w-full px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:n("common.ok","OK")})]})}),L&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4 border border-black shadow-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center",children:s.jsx(Hn,{className:"w-5 h-5 text-purple-600"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n("brands.edit.fillWithAI.modal.title","Fill Brand with AI")})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:n("brands.edit.fillWithAI.modal.description","This will analyze a website and populate all brand data including:")}),s.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 ml-4",children:[s.jsxs("li",{children:["• ",n("brands.edit.fillWithAI.modal.items.colors","Colors and visual identity")]}),s.jsxs("li",{children:["• ",n("brands.edit.fillWithAI.modal.items.fonts","Typography and fonts")]}),s.jsxs("li",{children:["• ",n("brands.edit.fillWithAI.modal.items.content","Content strategy")]}),s.jsxs("li",{children:["• ",n("brands.edit.fillWithAI.modal.items.description","Brand description and values")]})]}),s.jsx("div",{className:"mt-4 p-3 bg-purple-50 border border-purple-200 rounded-lg",children:s.jsxs("p",{className:"text-sm text-purple-800 font-medium",children:["⚠️ ",n("brands.edit.fillWithAI.modal.warning","Warning: All current data will be overwritten and cannot be undone.")]})})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:()=>R(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:n("common.cancel","Cancel")}),s.jsx("button",{onClick:()=>{R(!1),B(!0)},className:"px-4 py-2 text-sm font-medium text-white bg-purple-600 rounded-lg hover:bg-purple-700 transition-colors",children:n("brands.edit.fillWithAI.modal.confirm","Continue")})]})]})}),_&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4 border border-black shadow-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center",children:s.jsx(Zs,{className:"w-5 h-5 text-blue-600"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n("brands.edit.fillWithAI.urlModal.title","Enter Website URL")})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:n("brands.edit.fillWithAI.urlModal.description","Please enter the website URL you want to analyze:")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"w-5 h-5 text-gray-400"}),s.jsx("input",{type:"url",value:z,onChange:ge=>D(ge.target.value),placeholder:n("brands.edit.fillWithAI.urlModal.placeholder","https://example.com"),className:"flex-1 rounded-lg border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500",autoFocus:!0})]})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:()=>{B(!1),D("")},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:n("common.cancel","Cancel")}),s.jsx("button",{onClick:()=>{z.trim()&&(Ee(z.trim()),D(""))},disabled:!z.trim(),className:`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${z.trim()?"text-white bg-purple-600 hover:bg-purple-700":"text-gray-400 bg-gray-200 cursor-not-allowed"}`,children:n("brands.edit.fillWithAI.urlModal.analyze","Analyze Website")})]})]})}),s.jsx(dH,{isVisible:M})]})},D5=()=>s.jsx(eKe,{children:s.jsx(tKe,{})}),rKe=()=>mn({mutationFn:async({priceId:e,successUrl:t,cancelUrl:r})=>{var l;
3854const n=await((l=Qe.currentUser)==null?void 0:l.getIdToken());if(!n)throw new Error("No authentication token available");let a;try{if(a=(typeof localStorage<"u"&&localStorage.getItem("fp_ref")||void 0)??void 0,!a&&typeof document<"u"){const c=document.cookie.match(/(?:^|; )fp_ref=([^;]+)/);a=c?decodeURIComponent(c[1]):void 0}}catch{}const i=await fetch("https://api.socialness.ai/stripe/create-checkout-session",{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({items:[{price:e,quantity:1}],mode:"subscription",successUrl:t||`${window.location.origin}/payment/success`,cancelUrl:r||`${window.location.origin}/payment/cancel`,metadata:a?{fp_ref:a}:void 0})});if(!i.ok)throw new Error("Failed to create checkout session");return await i.json()},onSuccess:e=>{window.location.href=e.url}});function xH(e,t){return function(){return e.apply(t,arguments)}}const{toString:nKe}=Object.prototype,{getPrototypeOf:lA}=Object,{iterator:Rj,toStringTag:wH}=Symbol,$j=(e=>t=>{const r=nKe.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),No=e=>(e=e.toLowerCase(),t=>$j(t)===e),Fj=e=>t=>typeof t===e,{isArray:kp}=Array,yy=Fj("undefined");function pb(e){return e!==null&&!yy(e)&&e.constructor!==null&&!yy(e.constructor)&&Vs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const jH=No("ArrayBuffer");function aKe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&jH(e.buffer),t}const sKe=Fj("string"),Vs=Fj("function"),NH=Fj("number"),gb=e=>e!==null&&typeof e=="object",iKe=e=>e===!0||e===!1,nx=e=>{if($j(e)!=="object")return!1;const t=lA(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wH in e)&&!(Rj in e)},oKe=e=>{if(!gb(e)||pb(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lKe=No("Date"),cKe=No("File"),uKe=No("Blob"),dKe=No("FileList"),fKe=e=>gb(e)&&Vs(e.pipe),mKe=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vs(e.append)&&((t=$j(e))==="formdata"||t==="object"&&Vs(e.toString)&&e.toString()==="[object FormData]"))},hKe=No("URLSearchParams"),[pKe,gKe,yKe,bKe]=["ReadableStream","Request","Response","Headers"].map(No),vKe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yb(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),kp(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(pb(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(n=0;n<o;n++)l=i[n],t.call(null,e[l],l,e)}}function SH(e,t){if(pb(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}const kd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,CH=e=>!yy(e)&&e!==kd;function v4(){const{caseless:e}=CH(this)&&this||{},t={},r=(n,a)=>{const i=e&&SH(t,a)||a;nx(t[i])&&nx(n)?t[i]=v4(t[i],n):nx(n)?t[i]=v4({},n):kp(n)?t[i]=n.slice():t[i]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&yb(arguments[n],r);return t}const xKe=(e,t,r,{allOwnKeys:n}={})=>(yb(t,(a,i)=>{r&&Vs(a)?e[i]=xH(a,r):e[i]=a},{allOwnKeys:n}),e),wKe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jKe=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},NKe=(e,t,r,n)=>{let a,i,o;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],(!n||n(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=r!==!1&&lA(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},SKe=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},CKe=e=>{if(!e)return null;if(kp(e))return e;let t=e.length;if(!NH(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},kKe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&lA(Uint8Array)),MKe=(e,t)=>
vendor: 11,039 bytes, lines 3854-3855
3854{const n=(e&&e[Rj]).call(e);let a;for(;(a=n.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},IKe=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},EKe=No("HTMLFormElement"),TKe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),O5=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),AKe=No("RegExp"),kH=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};yb(r,(a,i)=>{let o;(o=t(a,i,e))!==!1&&(n[i]=o||a)}),Object.defineProperties(e,n)},PKe=e=>{kH(e,(t,r)=>{if(Vs(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Vs(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_Ke=(e,t)=>{const r={},n=a=>{a.forEach(i=>{r[i]=!0})};return kp(e)?n(e):n(String(e).split(t)),r},LKe=()=>{},DKe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function OKe(e){return!!(e&&Vs(e.append)&&e[wH]==="FormData"&&e[Rj])}const RKe=e=>{const t=new Array(10),r=(n,a)=>{if(gb(n)){if(t.indexOf(n)>=0)return;if(pb(n))return n;if(!("toJSON"in n)){t[a]=n;const i=kp(n)?[]:{};return yb(n,(o,l)=>{const c=r(o,a+1);!yy(c)&&(i[l]=c)}),t[a]=void 0,i}}return n};return r(e,0)},$Ke=No("AsyncFunction"),FKe=e=>e&&(gb(e)||Vs(e))&&Vs(e.then)&&Vs(e.catch),MH=((e,t)=>e?setImmediate:t?((r,n)=>(kd.addEventListener("message",({source:a,data:i})=>{a===kd&&i===r&&n.length&&n.shift()()},!1),a=>{n.push(a),kd.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Vs(kd.postMessage)),zKe=typeof queueMicrotask<"u"?queueMicrotask.bind(kd):typeof process<"u"&&process.nextTick||MH,BKe=e=>e!=null&&Vs(e[Rj]),De={isArray:kp,isArrayBuffer:jH,isBuffer:pb,isFormData:mKe,isArrayBufferView:aKe,isString:sKe,isNumber:NH,isBoolean:iKe,isObject:gb,isPlainObject:nx,isEmptyObject:oKe,isReadableStream:pKe,isRequest:gKe,isResponse:yKe,isHeaders:bKe,isUndefined:yy,isDate:lKe,isFile:cKe,isBlob:uKe,isRegExp:AKe,isFunction:Vs,isStream:fKe,isURLSearchParams:hKe,isTypedArray:kKe,isFileList:dKe,forEach:yb,merge:v4,extend:xKe,trim:vKe,stripBOM:wKe,inherits:jKe,toFlatObject:NKe,kindOf:$j,kindOfTest:No,endsWith:SKe,toArray:CKe,forEachEntry:MKe,matchAll:IKe,isHTMLForm:EKe,hasOwnProperty:O5,hasOwnProp:O5,reduceDescriptors:kH,freezeMethods:PKe,toObjectSet:_Ke,toCamelCase:TKe,noop:LKe,toFiniteNumber:DKe,findKey:SH,global:kd,isContextDefined:CH,isSpecCompliantForm:OKe,toJSONObject:RKe,isAsyncFn:$Ke,isThenable:FKe,setImmediate:MH,asap:zKe,isIterable:BKe};function hr(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}De.inherits(hr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:De.toJSONObject(this.config),code:this.code,status:this.status}}});const IH=hr.prototype,EH={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{EH[e]={value:e}});Object.defineProperties(hr,EH);Object.defineProperty(IH,"isAxiosError",{value:!0});hr.from=(e,t,r,n,a,i)=>{const o=Object.create(IH);return De.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),hr.call(o,e.message,t,r,n,a),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const UKe=null;function x4(e){return De.isPlainObject(e)||De.isArray(e)}function TH(e){return De.endsWith(e,"[]")?e.slice(0,-2):e}function R5(e,t,r){return e?e.concat(t).map(function(a,i){return a=TH(a),!r&&i?"["+a+"]":a}).join(r?".":""):t}function VKe(e){return De.isArray(e)&&!e.some(x4)}const WKe=De.toFlatObject(De,{},null,function(t){return/^is[A-Z]/.test(t)});function zj(e,t,r){if(!De.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=De.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!De.isUndefined(y[g])});const n=r.metaTokens,a=r.visitor||d,i=r.dots,o=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&De.isSpecCompliantForm(t);if(!De.isFunction(a))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(De.isDate(p))return p.toISOString();if(De.isBoolean(p))return p.toString();if(!c&&De.isBlob(p))throw new hr("Blob is not supported. Use a Buffer instead.");return De.isArrayBuffer(p)||De.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,g,y){let v=p;if(p&&!y&&typeof p=="object"){if(De.endsWith(g,"{}"))g=n?g:g.slice(0,-2),p=JSON.stringify(p);else if(De.isArray(p)&&VKe(p)||(De.isFileList(p)||De.endsWith(g,"[]"))&&(v=De.toArray(p)))return g=TH(g),v.forEach(function(j,C){!(De.isUndefined(j)||j===null)&&t.append(o===!0?R5([g],C,i):o===null?g:g+"[]",u(j))}),!1}return x4(p)?!0:(t.append(R5(y,g,i),u(p)),!1)}const f=[],m=Object.assign(WKe,{defaultVisitor:d,convertValue:u,isVisitable:x4});function h(p,g){if(!De.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(p),De.forEach(p,function(v,x){(!(De.isUndefined(v)||v===null)&&a.call(t,v,De.isString(x)?x.trim():x,g,m))===!0&&h(v,g?g.concat(x):[x])}),f.pop()}}if(!De.isObject(e))throw new TypeError("data must be an object");return h(e),t}function $5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function cA(e,t){this._pairs=[],e&&zj(e,this,t)}const AH=cA.prototype;AH.append=function(t,r){this._pairs.push([t,r])};AH.toString=function(t){const r=t?function(n){return t.call(this,n,$5)}:$5;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function qKe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PH(e,t,r){if(!t)return e;const n=r&&r.encode||qKe;De.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let i;if(a?i=a(t,r):i=De.isURLSearchParams(t)?t.toString():new cA(t,r).toString(n),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class F5{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){De.forEach(this.handlers,function(n){n!==null&&t(n)})}}const _H={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},GKe=typeof URLSearchParams<"u"?URLSearchParams:cA,HKe=typeof FormData<"u"?FormData:null,YKe=typeof Blob<"u"?Blob:null,QKe={isBrowser:!0,classes:{URLSearchParams:GKe,FormData:HKe,Blob:YKe},protocols:["http","https","file","blob","url","data"]},uA=typeof window<"u"&&typeof document<"u",w4=typeof navigator=="object"&&navigator||void 0,KKe=uA&&(!w4||["ReactNative","NativeScript","NS"].indexOf(w4.product)<0),JKe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ZKe=uA&&window.location.href||"http://localhost",XKe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:uA,hasStandardBrowserEnv:KKe,hasStandardBrowserWebWorkerEnv:JKe,navigator:w4,origin:ZKe},Symbol.toStringTag,{value:"Module"})),ps={...XKe,...QKe};function eJe(e,t){return zj(e,new ps.classes.URLSearchParams,{visitor:function(r,n,a,i){return ps.isNode&&De.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function tJe(e){return De.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rJe(e){const t={},r=Object.keys(e);let n;const a=r.length;let i;for(n=0;n<a;n++)i=r[n],t[i]=e[i];return t}function LH(e){function t(r,n,a,i){let o=r[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=i>=r.length;return o=!o&&De.isArray(a)?a.length:o,c?(De.hasOwnProp(a,o)?a[o]=[a[o],n]:a[o]=n,!l):((!a[o]||!De.isObject(a[o]))&&(a[o]=[]),t(r,n,a[o],i)&&De.isArray(a[o])&&(a[o]=rJe(a[o])),!l)}if(De.isFormData(e)&&De.isFunction(e.entries)){const r={};return De.forEachEntry(e,(n,a)=>{t(tJe(n),a,r,0)}),r}return null}function nJe(e,t,r){if(De.isString(e))try{return(t||JSON.parse)(e),De.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const bb={transitional:_H,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,i=De.isObject(t);if(i&&De.isHTMLForm(t)&&(t=new FormData(t)),De.isFormData(t))return a?JSON.stringify(LH(t)):t;if(De.isArrayBuffer(t)||De.isBuffer(t)||De.isStream(t)||De.isFile(t)||De.isBlob(t)||De.isReadableStream(t))return t;if(De.isArrayBufferView(t))return t.buffer;if(De.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return eJe(t,this.formSerializer).toString();if((l=De.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return zj(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),nJe(t)):t}],transformResponse:[function(t){const r=this.transitional||bb.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(De.isResponse(t)||De.isReadableStream(t))return t;if(t&&De.isString(t)&&(n&&!this.responseType||a)){const o=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?hr.from(l,hr.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ps.classes.FormData,Blob:ps.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};De.forEach(["delete","get","head","post","put","patch"],e=>{bb.headers[e]={}});const aJe=De.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sJe=e=>{const t={};let r,n,a;return e&&e.split(`
3855`).forEach(function(o){a=o.indexOf(":"),r=o.substring(0,a).trim().toLowerCase(),n=o.substring(a+1).trim(),!(!r||t[r]&&aJe[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},z5=Symbol("internals");function pg(e){return e&&String(e).trim().toLowerCase()}function ax(e){return e===!1||e==null?e:De.isArray(e)?e.map(ax):String(e)}function iJe(e){const t=Object.create(null),r=/([^\s,;
3855=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const oJe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function BS(e,t,r,n,a){if(De.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!De.isString(t)){if(De.isString(n))return t.indexOf(n)!==-1;if(De.isRegExp(n))return n.test(t)}}function lJe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function cJe(e,t){const r=De.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(a,i,o){return this[n].call(this,t,a,i,o)},configurable:!0})})}let Ws=class{constructor(t){t&&this.set(t)}set(t,r,n){const a=this;function i(l,c,u){const d=pg(c);if(!d)throw new Error("header name must be a non-empty string");const f=De.findKey(a,d);(!f||a[f]===void 0||u===!0||u===void 0&&a[f]!==!1)&&(a[f||c]=ax(l))}const o=(l,c)=>De.forEach(l,(u,d)=>i(u,d,c));if(De.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(De.isString(t)&&(t=t.trim())&&!oJe(t))o(sJe(t),r);else if(De.isObject(t)&&De.isIterable(t)){let l={},c,u;for(const d of t){if(!De.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?De.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=pg(t),t){const n=De.findKey(this,t);if(n){const a=this[n];if(!r)return a;
vendor: 9,843 bytes, lines 3855-3856
3855if(r===!0)return iJe(a);if(De.isFunction(r))return r.call(this,a,n);if(De.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=pg(t),t){const n=De.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||BS(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let a=!1;function i(o){if(o=pg(o),o){const l=De.findKey(n,o);l&&(!r||BS(n,n[l],l,r))&&(delete n[l],a=!0)}}return De.isArray(t)?t.forEach(i):i(t),a}clear(t){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const i=r[n];(!t||BS(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const r=this,n={};return De.forEach(this,(a,i)=>{const o=De.findKey(n,i);if(o){r[o]=ax(a),delete r[i];return}const l=t?lJe(i):String(i).trim();l!==i&&delete r[i],r[l]=ax(a),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return De.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&De.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3856`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[z5]=this[z5]={accessors:{}}).accessors,a=this.prototype;function i(o){const l=pg(o);n[l]||(cJe(a,o),n[l]=!0)}return De.isArray(t)?t.forEach(i):i(t),this}};Ws.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);De.reduceDescriptors(Ws.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});De.freezeMethods(Ws);function US(e,t){const r=this||bb,n=t||r,a=Ws.from(n.headers);let i=n.data;return De.forEach(e,function(l){i=l.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function DH(e){return!!(e&&e.__CANCEL__)}function Mp(e,t,r){hr.call(this,e??"canceled",hr.ERR_CANCELED,t,r),this.name="CanceledError"}De.inherits(Mp,hr,{__CANCEL__:!0});function OH(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new hr("Request failed with status code "+r.status,[hr.ERR_BAD_REQUEST,hr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function uJe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dJe(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];o||(o=u),r[a]=c,n[a]=u;let f=i,m=0;for(;f!==a;)m+=r[f++],f=f%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),u-o<t)return;const h=d&&u-d;return h?Math.round(m*1e3/h):void 0}}function fJe(e,t){let r=0,n=1e3/t,a,i;const o=(u,d=Date.now())=>{r=d,a=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?o(u,d):(a=u,i||(i=setTimeout(()=>{i=null,o(a)},n-f)))},()=>a&&o(a)]}const bw=(e,t,r=3)=>{let n=0;const a=dJe(50,250);return fJe(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,c=o-n,u=a(c),d=o<=l;n=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},r)},B5=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},U5=e=>(...t)=>De.asap(()=>e(...t)),mJe=ps.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ps.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ps.origin),ps.navigator&&/(msie|trident)/i.test(ps.navigator.userAgent)):()=>!0,hJe=ps.hasStandardBrowserEnv?{write(e,t,r,n,a,i){const o=[e+"="+encodeURIComponent(t)];De.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),De.isString(n)&&o.push("path="+n),De.isString(a)&&o.push("domain="+a),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pJe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gJe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function RH(e,t,r){let n=!pJe(t);return e&&(n||r==!1)?gJe(e,t):t}const V5=e=>e instanceof Ws?{...e}:e;function ff(e,t){t=t||{};const r={};function n(u,d,f,m){return De.isPlainObject(u)&&De.isPlainObject(d)?De.merge.call({caseless:m},u,d):De.isPlainObject(d)?De.merge({},d):De.isArray(d)?d.slice():d}function a(u,d,f,m){if(De.isUndefined(d)){if(!De.isUndefined(u))return n(void 0,u,f,m)}else return n(u,d,f,m)}function i(u,d){if(!De.isUndefined(d))return n(void 0,d)}function o(u,d){if(De.isUndefined(d)){if(!De.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,f){if(f in t)return n(u,d);if(f in e)return n(void 0,u)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>a(V5(u),V5(d),f,!0)};return De.forEach(Object.keys({...e,...t}),function(d){const f=c[d]||a,m=f(e[d],t[d],d);De.isUndefined(m)&&f!==l||(r[d]=m)}),r}const $H=e=>{const t=ff({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:l}=t;t.headers=o=Ws.from(o),t.url=PH(RH(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(De.isFormData(r)){if(ps.hasStandardBrowserEnv||ps.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(ps.hasStandardBrowserEnv&&(n&&De.isFunction(n)&&(n=n(t)),n||n!==!1&&mJe(t.url))){const u=a&&i&&hJe.read(i);u&&o.set(a,u)}return t},yJe=typeof XMLHttpRequest<"u",bJe=yJe&&function(e){return new Promise(function(r,n){const a=$H(e);let i=a.data;const o=Ws.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=a,d,f,m,h,p;function g(){h&&h(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function v(){if(!y)return;const j=Ws.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),N={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:j,config:e,request:y};OH(function(M){r(M),g()},function(M){n(M),g()},N),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(v)},y.onabort=function(){y&&(n(new hr("Request aborted",hr.ECONNABORTED,e,y)),y=null)},y.onerror=function(){n(new hr("Network Error",hr.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||_H;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),n(new hr(C,N.clarifyTimeoutError?hr.ETIMEDOUT:hr.ECONNABORTED,e,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&De.forEach(o.toJSON(),function(C,N){y.setRequestHeader(N,C)}),De.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),l&&l!=="json"&&(y.responseType=a.responseType),u&&([m,p]=bw(u,!0),y.addEventListener("progress",m)),c&&y.upload&&([f,h]=bw(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(d=j=>{y&&(n(!j||j.type?new Mp(null,e,y):j),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const x=uJe(a.url);if(x&&ps.protocols.indexOf(x)===-1){n(new hr("Unsupported protocol "+x+":",hr.ERR_BAD_REQUEST,e));return}y.send(i||null)})},vJe=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a;const i=function(u){if(!a){a=!0,l();const d=u instanceof Error?u:this.reason;n.abort(d instanceof hr?d:new Mp(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,i(new hr(`timeout ${t} of ms exceeded`,hr.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>De.asap(l),c}},xJe=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},wJe=async function*(e,t){for await(const r of jJe(e))yield*xJe(r,t)},jJe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},W5=(e,t,r,n)=>{const a=wJe(e,t);let i=0,o,l=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await a.next();if(u){l(),c.close();return}let f=d.byteLength;if(r){let m=i+=f;r(m)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},Bj=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",FH=Bj&&typeof ReadableStream=="function",NJe=Bj&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),zH=(e,...t)=>{try{return!!e(...t)}catch{return!1}},SJe=FH&&zH(()=>{let e=!1;
vendor: 4,662 bytes, lines 3856-3858
3856const t=new Request(ps.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),q5=64*1024,j4=FH&&zH(()=>De.isReadableStream(new Response("").body)),vw={stream:j4&&(e=>e.body)};Bj&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!vw[t]&&(vw[t]=De.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new hr(`Response type '${t}' is not supported`,hr.ERR_NOT_SUPPORT,n)})})})(new Response);const CJe=async e=>{if(e==null)return 0;if(De.isBlob(e))return e.size;if(De.isSpecCompliantForm(e))return(await new Request(ps.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(De.isArrayBufferView(e)||De.isArrayBuffer(e))return e.byteLength;if(De.isURLSearchParams(e)&&(e=e+""),De.isString(e))return(await NJe(e)).byteLength},kJe=async(e,t)=>{const r=De.toFiniteNumber(e.getContentLength());return r??CJe(t)},MJe=Bj&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:i,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:m}=$H(e);u=u?(u+"").toLowerCase():"text";let h=vJe([a,i&&i.toAbortSignal()],o),p;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let y;try{if(c&&SJe&&r!=="get"&&r!=="head"&&(y=await kJe(d,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),S;if(De.isFormData(n)&&(S=N.headers.get("content-type"))&&d.setContentType(S),N.body){const[M,k]=B5(y,bw(U5(c)));n=W5(N.body,q5,M,k)}}De.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;p=new Request(t,{...m,signal:h,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:v?f:void 0});let x=await fetch(p,m);const j=j4&&(u==="stream"||u==="response");if(j4&&(l||j&&g)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const S=De.toFiniteNumber(x.headers.get("content-length")),[M,k]=l&&B5(S,bw(U5(l),!0))||[];x=new Response(W5(x.body,q5,M,()=>{k&&k(),g&&g()}),N)}u=u||"text";let C=await vw[De.findKey(vw,u)||"text"](x,e);return!j&&g&&g(),await new Promise((N,S)=>{OH(N,S,{data:C,headers:Ws.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:p})})}catch(v){throw g&&g(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new hr("Network Error",hr.ERR_NETWORK,e,p),{cause:v.cause||v}):hr.from(v,v&&v.code,e,p)}}),N4={http:UKe,xhr:bJe,fetch:MJe};De.forEach(N4,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const G5=e=>`- ${e}`,IJe=e=>De.isFunction(e)||e===null||e===!1,BH={getAdapter:e=>{e=De.isArray(e)?e:[e];const{length:t}=e;let r,n;const a={};for(let i=0;i<t;i++){r=e[i];let o;if(n=r,!IJe(r)&&(n=N4[(o=String(r)).toLowerCase()],n===void 0))throw new hr(`Unknown adapter '${o}'`);if(n)break;a[o||"#"+i]=n}if(!n){const i=Object.entries(a).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
3857`+i.map(G5).join(`
3858`):" "+G5(i[0]):"as no adapter specified";throw new hr("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:N4};function VS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Mp(null,e)}function H5(e){return VS(e),e.headers=Ws.from(e.headers),e.data=US.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),BH.getAdapter(e.adapter||bb.adapter)(e).then(function(n){return VS(e),n.data=US.call(e,e.transformResponse,n),n.headers=Ws.from(n.headers),n},function(n){return DH(n)||(VS(e),n&&n.response&&(n.response.data=US.call(e,e.transformResponse,n.response),n.response.headers=Ws.from(n.response.headers))),Promise.reject(n)})}const UH="1.11.0",Uj={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Uj[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Y5={};Uj.transitional=function(t,r,n){function a(i,o){return"[Axios v"+UH+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,l)=>{if(t===!1)throw new hr(a(o," has been removed"+(r?" in "+r:"")),hr.ERR_DEPRECATED);return r&&!Y5[o]&&(Y5[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,l):!0}};Uj.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function EJe(e,t,r){if(typeof e!="object")throw new hr("options must be an object",hr.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const i=n[a],o=t[i];if(o){const l=e[i],c=l===void 0||o(l,i,e);
vendor: 3,945 bytes, lines 3858-3859
3858if(c!==!0)throw new hr("option "+i+" must be "+c,hr.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new hr("Unknown option "+i,hr.ERR_BAD_OPTION)}}const sx={assertOptions:EJe,validators:Uj},Eo=sx.validators;let Vd=class{constructor(t){this.defaults=t||{},this.interceptors={request:new F5,response:new F5}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
3859`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ff(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&sx.assertOptions(n,{silentJSONParsing:Eo.transitional(Eo.boolean),forcedJSONParsing:Eo.transitional(Eo.boolean),clarifyTimeoutError:Eo.transitional(Eo.boolean)},!1),a!=null&&(De.isFunction(a)?r.paramsSerializer={serialize:a}:sx.assertOptions(a,{encode:Eo.function,serialize:Eo.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),sx.assertOptions(r,{baseUrl:Eo.spelling("baseURL"),withXsrfToken:Eo.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&De.merge(i.common,i[r.method]);i&&De.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=Ws.concat(o,i);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,f=0,m;if(!c){const p=[H5.bind(this),void 0];for(p.unshift(...l),p.push(...u),m=p.length,d=Promise.resolve(r);f<m;)d=d.then(p[f++],p[f++]);return d}m=l.length;let h=r;for(f=0;f<m;){const p=l[f++],g=l[f++];try{h=p(h)}catch(y){g.call(this,y);break}}try{d=H5.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,m=u.length;f<m;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=ff(this.defaults,t);const r=RH(t.baseURL,t.url,t.allowAbsoluteUrls);return PH(r,t.params,t.paramsSerializer)}};De.forEach(["delete","get","head","options"],function(t){Vd.prototype[t]=function(r,n){return this.request(ff(n||{},{method:t,url:r,data:(n||{}).data}))}});De.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,l){return this.request(ff(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Vd.prototype[t]=r(),Vd.prototype[t+"Form"]=r(!0)});let TJe=class VH{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{n.subscribe(l),i=l}).then(a);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,l){n.reason||(n.reason=new Mp(i,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new VH(function(a){t=a}),cancel:t}}};function AJe(e){return function(r){return e.apply(null,r)}}function PJe(e){return De.isObject(e)&&e.isAxiosError===!0}const S4={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
3859alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(S4).forEach(([e,t])=>{S4[t]=e});function WH(e){const t=new Vd(e),r=xH(Vd.prototype.request,t);return De.extend(r,Vd.prototype,t,{allOwnKeys:!0}),De.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return WH(ff(e,a))},r}const ga=WH(bb);ga.Axios=Vd;ga.CanceledError=Mp;ga.CancelToken=TJe;ga.isCancel=DH;ga.VERSION=UH;ga.toFormData=zj;ga.AxiosError=hr;ga.Cancel=ga.CanceledError;ga.all=function(t){return Promise.all(t)};ga.spread=AJe;ga.isAxiosError=PJe;ga.mergeConfig=ff;ga.AxiosHeaders=Ws;ga.formToJSON=e=>LH(De.isHTMLForm(e)?new FormData(e):e);ga.getAdapter=BH.getAdapter;ga.HttpStatusCode=S4;ga.default=ga;const{Axios:jdt,AxiosError:Ndt,CanceledError:Sdt,isCancel:Cdt,CancelToken:kdt,VERSION:Mdt,all:Idt,Cancel:Edt,isAxiosError:Tdt,spread:Adt,toFormData:Pdt,AxiosHeaders:_dt,HttpStatusCode:Ldt,formToJSON:Ddt,getAdapter:Odt,mergeConfig:Rdt}=ga,_Je="https://api.socialness.ai",ul=ga.create({baseURL:_Je,headers:{"Content-Type":"application/json"}});ul.interceptors.request.use(async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());r&&(e.headers.Authorization=`Bearer ${r}`)}catch(r){console.error("Error getting Firebase token:",r)}return e});ul.interceptors.response.use(e=>e,e=>{var t;return((t=e.response)==null?void 0:t.status)===401&&(console.error("Unauthorized access - redirecting to login"),window.location.href="/login"),Promise.reject(e)});const LJe=async(e=window.location.origin+"/billing")=>(await ul.post("/stripe/create-portal-session",{returnUrl:e})).data,DJe=()=>mn({mutationFn:async e=>await LJe(e),onSuccess:e=>{e.url&&(window.location.href=e.url)},onError:e=>{console.error("Error creating portal session:",e)}}),vb="https://api.socialness.ai",OJe=async(e,t=!1,r)=>{var a;let n="";try{const i=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!i)throw new Error("No authentication token available");n=`${vb}/management/personas?`;const o=new URLSearchParams;o.append("withAnalysis",t?"true":"false"),r&&o.append("appLanguage",r),n+=o.toString();const l=await fetch(n,{headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"}}),c=await l.text();if(!l.ok)throw console.error("API error response:",c),new Error(`Failed to fetch personas: ${l.status} ${l.statusText}`);const u=c?JSON.parse(c):{};return u.personas?(u.personas&&Array.isArray(u.personas)&&(u.personas=u.personas.map(d=>{const f={...d};return f.avatarURL&&!f.avatarUrl&&(f.avatarUrl=f.avatarURL),f})),u):(console.warn("API response does not contain personas array:",u),{success:!0,personas:[],totalPersonas:"0",averageCompleteness:"0",personasPerBrand:{}})}catch(i){throw console.error("Error fetching personas:",i),console.error("Error details:",{message:(i==null?void 0:i.message)||"Unknown error",stack:i==null?void 0:i.stack,url:n,brandId:e,withAnalysis:t,appLanguage:r}),new Error(`Failed to fetch personas: ${(i==null?void 0:i.message)||"Unknown error"}`)}},RJe=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`${vb}/management/personas/${e}`,{headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!n.ok){const i=await n.json().catch(()=>({}));throw new Error(i.message||`Failed to fetch persona: ${n.status}`)}const a=await n.json();return a.persona&&a.persona.avatarURL&&!a.persona.avatarUrl&&(a.persona.avatarUrl=a.persona.avatarURL),a}catch(r){throw console.error(`Error fetching persona ${e}:`,r),r}},$Je=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const n={name:e.name,brandId:e.brandId,age:typeof e.age=="number"?e.age:28,gender:e.gender||"Other",location:e.location||"",language:Array.isArray(e.languages)&&e.languages.length>0?e.languages[0]:"en",jobTitle:e.jobTitle||"",income:e.income||"",education:e.education||"",relationship:e.relationship||"",...e.avatarURL||e.avatarUrl?{avatarURL:e.avatarURL||e.avatarUrl}:{},bio:e.bio||"",tags:Array.isArray(e.tags)?e.tags:[],ageRange:e.ageRange||"25-34",languages:Array.isArray(e.languages)?e.languages:["en"],socialNetworks:Array.isArray(e.socialNetworks)?e.socialNetworks.map(o=>({platform:o.platform,pertinence:o.pertinence,frequency:o.frequency})):[],formatLength:Array.isArray(e.formatLength)?e.formatLength:[],problems:typeof e.problems=="string"?e.problems:Array.isArray(e.problems)?e.problems.join(`
3860`):"",goals:typeof e.goals=="string"?e.goals:Array.isArray(e.goals)?e.goals.join(`
3861`):"",motivations:typeof e.motivations=="string"?e.motivations:Array.isArray(e.motivations)?e.motivations.join(`
3862`):"",challenges:typeof e.challenges=="string"?e.challenges:Array.isArray(e.challenges)?e.challenges.join(`
3863`):"",brand_affinity:e.brand_affinity||"",quote:e.quote||"",buying_behavior:e.buying_behavior||""};console.log("Creating persona with data:",JSON.stringify(n,null,2));const a=await fetch(`${vb}/management/personas`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const o=await a.text();throw console.error(`API error (${a.status}):`,o),new Error(`Failed to create persona: ${a.status}`)}return await a.json()}catch(r){throw console.error("Error creating persona:",r),r}},FJe=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const{id:n,...a}=e;if(!n)throw new Error("Cannot update persona: missing persona ID");const i={};a.name!==void 0&&(i.name=a.name),a.jobTitle!==void 0&&(i.jobTitle=a.jobTitle),a.bio!==void 0&&(i.bio=a.bio),a.tags!==void 0&&(i.tags=a.tags),a.age!==void 0&&(i.age=a.age),a.ageRange!==void 0&&(i.ageRange=a.ageRange),a.location!==void 0&&(i.location=a.location),a.income!==void 0&&(i.income=a.income),a.education!==void 0&&(i.education=a.education),a.relationship!==void 0&&(i.relationship=a.relationship
3863),a.brandId!==void 0&&(i.brandId=a.brandId),a.languages!==void 0&&(i.languages=a.languages),a.formatLength!==void 0&&(i.formatLength=a.formatLength),a.avatarURL!==void 0?i.avatarURL=a.avatarURL:a.avatarUrl!==void 0&&(i.avatarURL=a.avatarUrl),a.socialNetworks!==void 0&&(i.socialNetworks=a.socialNetworks),a.problems!==void 0&&(i.problems=a.problems),a.goals!==void 0&&(i.goals=a.goals),a.motivations!==void 0&&(i.motivations=a.motivations),a.challenges!==void 0&&(i.challenges=a.challenges),a.brand_affinity!==void 0&&(i.brand_affinity=a.brand_affinity),a.quote!==void 0&&(i.quote=a.quote),a.buying_behavior!==void 0&&(i.buying_behavior=a.buying_behavior),console.log("Updating persona with ID:",n),console.log("Update data:",JSON.stringify(i,null,2));const o=await fetch(`${vb}/management/personas/${n}`,{method:"PUT",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(i)});let l="";try{l=await o.text()}catch(u){console.error("Failed to read response text:",u)}if(!o.ok)throw console.error("API error response:",l),new Error(`Failed to update persona: ${o.status}`);let c={};try{c=l?JSON.parse(l):{}}catch(u){return console.error("Failed to parse response JSON:",u),{success:!0,persona:{id:n,...a}}}return c}catch(r){throw console.error("Error updating persona:",r),r}},zJe=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`${vb}/management/personas/${e}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!n.ok){const a=await n.json().catch(()=>({}));throw new Error(a.message||`Failed to delete persona: ${n.status}`)}return n.json()}catch(r){throw console.error(`Error deleting persona ${e}:`,r),r}},qH=[{id:"0qo14Kwxd3fp5bVQvY5g",name:"Jane Doe",jobTitle:"Social Media Manager",bio:"Jane is a creative social media manager with 5 years of experience in digital marketing.",tags:["innovative","trendsetter","creative"],ageRange:"25-34",languages:["en","fr"],socialNetworks:[{platform:"linkedin",frequency:"daily",pertinence:"Primary"},{platform:"instagram",frequency:"weekly",pertinence:"Secondary"},{platform:"twitter",frequency:"bi-weekly",pertinence:"Secondary"}],problems:"Struggles with maintaining a consistent brand voice across multiple platforms while keeping up with platform algorithm changes.",goals:"Increase audience engagement by 20% and drive traffic to the website to improve conversion rates.",motivations:"Passionate about digital innovation and building authentic connections with audiences.",challenges:"Managing cross-platform content and scheduling while maintaining quality and creativity.",formatLength:["Short/Reel","Long/Classic"],brandId:"ZhbGmZGGNWmvhptEpVxQ",userId:"M5P2Nn2W4veLe6FcY9FktrbzxHi1",createdBy:"M5P2Nn2W4veLe6FcY9FktrbzxHi1",createdAt:"2024-12-23T12:40:42.585Z",updatedAt:"2024-12-23T12:40:42.585Z",analysis:{strengths:"Jane has a well-defined professional persona with clear goals around social media engagement. Her experience with multiple platforms provides a solid foundation for diversified content strategies. Her bilingual skills (English and French) also open opportunities for multilingual content that can reach broader audiences.",weaknesses:"Could benefit from more specific platform strategies. There's also a risk of burnout without better content planning systems.",contentSuggestions:["Behind-the-scenes content showing the content creation process to humanize the brand","Platform-specific trend analysis in short-form video to demonstrate expertise","Bilingual content series addressing common social media challenges faced by your target audience","Day-in-the-life content that showcases efficient workflows for multi-platform management","Before/after case studies of successful engagement strategies"],platformRecommendations:{linkedin:"Focus on visual storytelling with carousel posts for higher engagement. Use Stories for time-sensitive updates and Reels for trend participation. Consider a consistent aesthetic that aligns with brand values.",twitter:"Leverage trending topics and threads for broader reach while maintaining brand voice. Focus on authentic, engaging content that feels native to the platform.",facebook:"Consider adding Facebook to your platform mix for community building and engagement with a broader audience."},audienceInsights:"This persona represents digital-savvy professionals ages 25-34 who value efficiency, innovation, and authenticity. They're likely to engage with content that solves real problems they face daily, offers actionable tips, and maintains a consistent posting schedule they can rely on. They appreciate both quick, consumable content and more detailed tutorials or guides."}},{id:"1qo14Kwxd3fp5bVQvY5h",name:"Alex Johnson",jobTitle:"Content Creator",bio:"Alex is a versatile content creator specializing in video production and storytelling for brands.",tags:["creative","video","storyteller"],ageRange:"18-24",languages:["en"],socialNetworks:[{platform:"youtube",frequency:"weekly",pertinence:"Primary"},{platform:"tiktok",frequency:"daily",pertinence:"Primary"},{platform:"instagram",frequency:"daily",pertinence:"Secondary"}],problems:"Finding the right balance between trending content and authentic brand messaging. Keeping up with rapidly changing platform algorithms.",goals:"Build a loyal community around the brand and increase video engagement metrics by 30% quarter over quarter.",motivations:"Creating content that resonates emotionally with viewers and drives meaningful conversations.",challenges:"Producing high-quality video content consistently while adapting to each platform's unique requirements.",formatLength:["Short/Reel","Video"],brandId:"ZhbGmZGGNWmvhptEpVxQ",userId:"M5P2Nn2W4veLe6FcY9FktrbzxHi1",createdBy:"M5P2Nn2W4veLe6FcY9FktrbzxHi1",createdAt:"2024-12-22T10:30:15.123Z",updatedAt:"2024-12-22T10:30:15.123Z",analysis:{strengths:"Strong focus on video-first platforms that are growing rapidly. Alex's youth perspective helps brands connect with Gen Z audiences authentically.",weaknesses:"Limited language capabilities may restrict global reach. Could benefit from more strategic planning rather than reactive content creation.",contentSuggestions:["Behind-the-scenes of video production to showcase the creative process","Platform-specific video series tailored to each audience demographic","Collaborative content with other creators to expand reach","Tutorial content that showcases your expertise while providing value","Day-in-the-life content that humanizes the brand"],platformRecommendations:{youtube:"Focus on longer-form, value-driven content that establishes expertise. Consistency in posting schedule is key for algorithm performance.",tiktok:"Leverage trending sounds and formats while maintaining brand voice. Quick, authentic moments perform best.",instagram:"Use Stories for day-to-day engagement and Reels for broader reach. Maintain visual consistency across posts."},audienceInsights:"This persona connects with younger audiences (18-24) who prioritize authenticity and entertainment value. They have shorter attention spans but higher engagement when content resonates. They're looking for content that feels native to each platform rather than cross-posted material."}}],Vj=(e,t=!1,r=!1,n)=>{const{i18n:a}=Te();return Wa({queryKey:["personas",{brandId:e,withAnalysis:r,appLanguage:n}],queryFn:async()=>
3863{if(t){console.log("Using mock personas data");const i=qH;return{success:!0,personas:i,pagination:{limit:10,offset:0,total:i.length}}}try{const i=n||a.language||"en";return await OJe(e,r,i)}catch(i){throw console.error("Error in usePersonas hook:",i),i}},staleTime:60*1e3,gcTime:5*60*1e3,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:2,select:i=>({...i,personas:[...i.personas||[]].sort((o,l)=>new Date(l.updatedAt).getTime()-new Date(o.updatedAt).getTime())})})},BJe=(e,t=!1)=>Wa({queryKey:["persona",e],queryFn:async()=>{if(t){console.log("Using mock persona data for ID:",e);const r=qH.find(n=>n.id===e);if(!r)throw new Error(`Persona with ID ${e} not found`);return{success:!0,persona:r}}return RJe(e)},staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!0,enabled:!!e,retry:2}),UJe=({productName:e,description:t,price:r,monthlyPrice:n,buttonText:a,features:i,onSubscribe:o,isLoading:l=!1,billingPeriod:c,isCurrentPlan:u=!1,buttonType:d="subscribe",yearlyAmount:f,monthlyAmount:m,currency:h,isPopular:p=!1})=>{const{t:g}=Te(),y=()=>{switch(d){case"current":return g("billing.manage","Manage");case"upgrade":return g("billing.upgrade");case"downgrade":return g("billing.downgrade");case"saveWithYearly":return g("billing.saveWithYearly");default:return a}},v=()=>{switch(d){case"current":return"bg-green-600 text-white hover:bg-green-700";case"upgrade":return"bg-primary-600 text-white hover:bg-primary-700";case"downgrade":return"bg-gray-500 text-white hover:bg-gray-600";case"saveWithYearly":return"bg-green-600 text-white hover:bg-green-700";default:return"bg-primary-600 text-white hover:bg-primary-700"}},j=(()=>{if(c!=="yearly")return null;const C=R=>{if(!R)return;const _=R.replace(/[^0-9,\.]/g,"").replace(/\s/g,"");if(!_)return;const B=_.lastIndexOf(","),z=_.lastIndexOf(".");let D=_;B>-1&&z>-1?B>z?D=_.replace(/\./g,"").replace(",","."):D=_.replace(/,/g,""):B>-1?D=_.replace(",","."):D=_;const A=Number.parseFloat(D);if(!Number.isNaN(A))return Math.round(A*100)},N=(h||"EUR").toUpperCase(),S=f??C(r),M=m??C(n);if(!S||!M)return null;const k=M*12,I=k-S,T=I>0?I:0,L=R=>new Intl.NumberFormat("fr-FR",{style:"currency",currency:N,minimumFractionDigits:0}).format(R/100);return{savingsAmount:L(T),monthlyYearlyTotal:L(k)}})();return s.jsxs("div",{className:`relative rounded-2xl border p-6 ${d==="current"?"bg-green-50 border-green-500 border-2":p?"bg-primary-50 border-primary-500 border-2":"bg-white border-black"}`,children:[p&&s.jsx("div",{className:"absolute -top-3 right-4",children:s.jsx("span",{className:"inline-block px-3 py-1 bg-primary-600 text-white text-xs font-medium rounded-full",children:g("billing.mostPopular","Most Popular")})}),s.jsx("div",{className:"absolute -top-3 left-4",children:s.jsx("span",{className:`inline-block px-4 py-1 text-xs font-medium rounded-full font-title uppercase tracking-wide ${d==="current"?"bg-purple-100 text-purple-700":"bg-orange-100 text-orange-700"}`,children:e})}),d==="current"&&s.jsx("div",{className:"absolute -top-3 right-4",children:s.jsx("span",{className:"inline-block px-3 py-1 bg-green-600 text-white text-xs font-medium rounded-full",children:g("billing.currentPlanBadge")})}),s.jsx("div",{className:"mb-6",children:c==="yearly"?s.jsx(s.Fragment,{children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-baseline gap-1",children:[s.jsx("span",{className:"text-4xl font-bold",children:n}),s.jsx("span",{className:"text-gray-500",children:g("billing.perMonth",{defaultValue:"/mo"})})]}),s.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[g("billing.billedAnnually",{defaultValue:"Billed annually at"})," ",r]}),j&&s.jsx("div",{className:"mt-3 inline-flex items-center px-4 py-1.5 rounded-lg font-bold text-white whitespace-nowrap",style:{backgroundColor:"#17a34a"},children:d==="current"?g("billing.savedAmount","{{amount}} saved",{amount:j.savingsAmount.replace(/\s/g,"").replace(",00","")}):g("billing.saveAmount","Save {{amount}}",{amount:j.savingsAmount.replace(/\s/g,"").replace(",00","")})})]})}):s.jsxs("div",{className:"flex items-baseline gap-1",children:[s.jsx("span",{className:"text-4xl font-bold",children:r}),s.jsx("span",{className:"text-gray-500",children:g("billing.perMonth",{defaultValue:"/mo"})})]})}),s.jsx("h3",{className:"text-xl font-semibold mb-2 font-title uppercase tracking-wide",children:e}),s.jsx("p",{className:"text-sm text-gray-600 mb-6",children:t}),s.jsx("button",{onClick:o,disabled:l,className:`w-full py-2 px-4 roun
3863ded-lg transition-colors mb-6 disabled:opacity-50 disabled:cursor-not-allowed ${v()}`,children:l?g("common.loading","Loading..."):y()}),s.jsx("ul",{className:"space-y-4",children:(i==null?void 0:i.map((C,N)=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(ma,{className:"w-5 h-5 text-green-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"text-gray-600",children:typeof C=="string"?C:C.name})]},N)))||[]})]})},Ip=(e="Socialness.ai")=>{const t=vs(),{t:r}=Te();b.useEffect(()=>{const n=t.pathname;let a=e;return n.startsWith("/analytics")?a=`${r("analytics.title")} | Socialness.ai`:n.startsWith("/brands/new")?a=`${r("brands.create")} | Socialness.ai`:n.startsWith("/brands")&&n.includes("/edit")?a=`${r("brands.edit")} | Socialness.ai`:n.startsWith("/brands")?a=`${r("brands.title")} | Socialness.ai`:n.startsWith("/social-media-hub")?a=`${r("accounts.title")} | Socialness.ai`:n.startsWith("/team")?a=`${r("teamMembers.title")} | Socialness.ai`:n.startsWith("/billing")?a=`${r("billing.title")} | Socialness.ai`:n.startsWith("/settings")?a=`${r("settings.title")} | Socialness.ai`:n.startsWith("/ai-personas-builder")?a=`${r("personas.title")} - Socialness.ai`:n.startsWith("/calendar")?a=`${r("calendar.title")} | Socialness.ai`:n.startsWith("/auth/login")?a=`${r("auth.login.title")} | Socialness.ai`:n.startsWith("/auth/signup")&&(a=`${r("auth.signup.title")} | Socialness.ai`),document.title=a,()=>{document.title=e}},[t.pathname,r,e])},VJe={en:uc,fr:of,es:A0},lu=(e,t,r)=>{if(!e)return"N/A";try{let n=typeof e=="number"?new Date(e):typeof e=="string"?Xa(e):e;if(!(n instanceof Date)||isNaN(n.getTime())){const o=new Date(e);if(!(o instanceof Date)||isNaN(o.getTime()))return console.warn("Invalid date input received:",e),"Invalid Date";n=o}const a=VJe[t]||uc;let i;if(r!=null&&r.combinedFormat)i=r.combinedFormat;else{const o=(r==null?void 0:r.dateFormat)??"PP",l=(r==null?void 0:r.timeFormat)??"p";i=typeof e=="string"&&e.includes("T")||n instanceof Date?`${o} ${l}`:o}return sr(n,i,{locale:a})}catch(n){return console.error("Error formatting date:",e,n),"Error"}},Q5=(e,t,r)=>{const n=r==="fr"?"fr-FR":r==="es"?"es-ES":"en-US";try{return new Intl.NumberFormat(n,{style:"currency",currency:t.toUpperCase(),minimumFractionDigits:2}).format(e/100)}catch(a){return console.error("Error formatting currency:",{amount:e,currency:t,language:r},a),`${(e/100).toFixed(2)} ${t.toUpperCase()}`}},WJe=({isOpen:e,onClose:t,onUpgrade:r,brandsCount:n=0,personasCount:a=0,accountsCount:i=0,draftsCount:o=0})=>{const{t:l}=Te(),{user:c}=Ps();if(!e)return null;const u=(p,g,y)=>{const v=y<=1;return l(v?p:g)},d=u("trialExpired.words.brand_singular","trialExpired.words.brand_plural",n),f=u("trialExpired.words.persona_singular","trialExpired.words.persona_plural",a),m=u("trialExpired.words.account_singular","trialExpired.words.account_plural",i),h=u("trialExpired.words.draft_singular","trialExpired.words.draft_plural",o);return s.jsxs("div",{className:"fixed inset-0 z-[70]",children:[s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-60",onClick:t}),s.jsx("div",{className:"relative z-[71] min-h-screen flex items-center justify-center p-4",children:s.jsxs("div",{className:"relative bg-white rounded-2xl border-[3px] border-black shadow-2xl w-full max-w-2xl p-6",children:[s.jsx("button",{onClick:t,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600","aria-label":"Close",children:s.jsx(_t,{className:"w-5 h-5"})}),s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"text-3xl font-extrabold text-gray-900",children:l("trialExpired.title","Your trial has expired…")}),c!=null&&c.name||c!=null&&c.firstName?s.jsx("p",{className:"text-gray-900 text-sm mt-1",children:l("trialExpired.greeting","Hi {{name}},",{name:(c==null?void 0:c.firstName)||(c==null?void 0:c.name)})}):null,s.jsx("p",{className:"text-gray-800 text-sm mt-2",children:s.jsx(k0,{i18nKey:"trialExpired.progress",values:{brands:n,personas:a,accounts:i,drafts:o,brandsWord:d,personasWord:f,accountsWord:m,draftsWord:h},components:{b:s.jsx("strong",{}),i:s.jsx("em",{})}})}),s.jsx("p",{className:"text-gray-700 mt-3",children:s.jsxs(k0,{i18nKey:"trialExpired.description",children:["To continue enjoying your ",s.jsx("strong",{className:"font-semibold text-black",children:"own AI Social Media assistant"}),", you'll need to upgrade to Solo, Team or Agency Pro"]})})]}),s.jsxs("ul",{className:"space-y-2 mb-6",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"🚀"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.unlimitedPosts","Publish unlimited posts across all platforms")})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"🎨"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.unlimitedAiContent","Generate unlimited AI content (posts, captions, images)")})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"📊"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.analytics","Access advanced analytics & AI-powered insights")})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"🧠"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.algorithms","Unlock our proprietary AI algorithm suite")})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"⚡"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.support","Priority support & faster processing")})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-sm leading-tight",children:"✅"}),s.jsx("p",{className:"text-black text-sm leading-tight",children:l("trialExpired.features.more","And much more!")})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{onClick:r,className:"inline-flex items-center px-5 py-2.5 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:l("trialExpired.upgradeCta","Upgrade")})})]})})]})},qJe=()=>{var z,D,A,P,E,F,$,H,X,ue,le,ae,te,ne,J,G,Q,W,Y,q,Z,me,we;const{t:e,i18n:t}=Te(),[r]=ui(),n=pn(),a=r.get("period"),i=a==="yearly"||a==="monthly"?a:"yearly",[o,l]=b.useState(i),{data:c,isLoading:u,error:d}=T2(),f=rKe(),m=DJe(),{data:h}=oa(),{data:p}=Vj(void 0,!1,!1,t.language),{data:g}=qE(),y=c==null?void 0:c.hasSubscription;Ip(),b.useEffect(()=>{n(`/billing?period=${o}`,{replace:!0})},[o,n]);const v=he=>{l(he)},x=he=>{var Ee;if(!y||!((Ee=c.currentSubscription)!=null&&Ee.currentPlan))return"subscribe";const ie=c.currentSubscription.currentPlan;if(ie.priceId===he.priceId)return"current";const ye=o==="yearly"?"year":"month";if(he.productId===ie.productId&&ye===ie.interval)return"current";if(he.productId===ie.productId&&ie.interval==="month"&&o==="yearly")return"saveWithYearly";const pe=Ye=>
3863{const je=Ye.replace(/[€$£,\s]/g,"").match(/\d+\.?\d*/);return je?parseFloat(je[0]):0},ce=ie.amount||pe(ie.formattedPrice||"0"),xe=he.amount||pe(he.formattedPrice||"0");return xe>ce?"upgrade":xe<ce?"downgrade":"subscribe"},j=he=>{switch(he.toLowerCase()){case"active":return"bg-green-100 text-green-700";case"paid":return"bg-green-100 text-green-700";case"past_due":return"bg-yellow-100 text-yellow-700";case"canceled":return"bg-red-100 text-red-700";default:return"bg-gray-100 text-gray-700"}},N=(()=>{var Ee,Ye;const he=(Ye=(Ee=Qe.currentUser)==null?void 0:Ee.metadata)==null?void 0:Ye.creationTime;if(!he)return null;const ie=new Date(he);if(Number.isNaN(ie.getTime()))return null;const ce=(new Date().getTime()-ie.getTime())/(1e3*60*60*24);return Math.max(0,Math.min(7,7-Math.floor(ce-1)))})(),S=(((z=c==null?void 0:c.currentSubscription)==null?void 0:z.status)||"").toLowerCase(),k=!!(c!=null&&c.hasSubscription&&((D=c==null?void 0:c.currentSubscription)!=null&&D.isActive||S==="active"||S==="trialing")&&(!((A=c==null?void 0:c.currentSubscription)!=null&&A.currentPlan)||(((P=c.currentSubscription.currentPlan)==null?void 0:P.productName)||"").toLowerCase()!=="free")),I=S==="past_due",T=typeof N=="number"&&N<=0&&!k,L=b.useRef(!1),[R,_]=b.useState(!1),B=Wa({queryKey:["billing-posts-summary"],enabled:R,queryFn:async()=>{var xe;const he=await((xe=Qe.currentUser)==null?void 0:xe.getIdToken());if(!he)return 0;const ie=await fetch("https://api.socialness.ai/management/posts?sort=creation-date&order=desc",{headers:{Authorization:`Bearer ${he}`,"Content-Type":"application/json"}});if(!ie.ok)return 0;const ye=await ie.json();return(Array.isArray(ye==null?void 0:ye.brandSummary)?ye.brandSummary:[]).reduce((Ee,Ye)=>{const fe=Ye&&Ye.byStatus?Ye.byStatus:{},je=Object.values(fe).reduce((We,yt)=>We+(typeof yt=="number"?yt:0),0);return Ee+je},0)}});return b.useEffect(()=>{T&&!L.current&&_(!0)},[T]),s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsxs("div",{className:"w-[95%] mx-auto",children:[s.jsx(WJe,{isOpen:R,onClose:()=>{_(!1),L.current=!0},onUpgrade:()=>{_(!1),L.current=!0;const he=document.getElementById("pricing");he&&he.scrollIntoView({behavior:"smooth",block:"start"})},brandsCount:Array.isArray(h==null?void 0:h.brands)?h.brands.length:0,personasCount:Array.isArray(p==null?void 0:p.personas)?p.personas.length:0,accountsCount:Array.isArray(g==null?void 0:g.connected_pages)?g.connected_pages.length:0,draftsCount:B.data||0}),u?s.jsxs("div",{className:"py-12 animate-pulse",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/2 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8",children:[s.jsx("div",{className:"lg:col-span-2 bg-gray-100 rounded-xl border border-gray-200 p-6 h-48"}),s.jsx("div",{className:"bg-gray-100 rounded-xl border border-gray-200 p-6 h-48"})]}),s.jsx("div",{className:"flex justify-center mb-8",children:s.jsx("div",{className:"h-10 w-64 bg-gray-200 rounded-lg"})}),s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 mb-12",children:[1,2,3].map(he=>s.jsx("div",{className:"bg-gray-100 rounded-xl border border-gray-200 p-6 h-96"},he))}),s.jsx("div",{className:"bg-gray-100 rounded-xl border border-gray-200 p-6 h-64"})]}):d?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("p",{className:"text-red-600",children:e("billing.loadingError")})}):c?s.jsxs(rs,{title:e("billing.title"),subtitle:e("billing.subtitle"),children:[k?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8",children:[s.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(mL,{className:"w-5 h-5 text-primary-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("billing.currentPlan")})]}),((E=c.currentSubscription)==null?void 0:E.status)&&s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${j(c.currentSubscription.status)}`,children:c.currentSubscription.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx(Nm,{className:"w-3 h-3 mr-1"}),e("billing.active")]}):s.jsxs(s.Fragment,{children:[s.jsx(ql,{className:"w-3 h-3 mr-1"}),c.currentSubscription.status]})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-gray-600",children:[e("billing.planName","Plan")," :"]}),s.jsx("span",{className:"text-xl font-semibold text-gray-900 font-title uppercase tracking-wide",children:(($=(F=c.currentSubscription)==null?void 0:F.currentPlan)==null?void 0:$.productName)||e("billing.planUnknown","Current plan")})]}),s.jsxs("div",{className:"flex items-baseline gap-2 mt-1",children:[s.jsx("span",{className:"text-3xl font-bold text-gray-900",children:(X=(H=c.currentSubscription)==null?void 0:H.currentPlan)!=null&&X.amount&&((le=(ue=c.currentSubscription)==null?void 0:ue.currentPlan)!=null&&le.currency)?Q5(c.currentSubscription.currentPlan.amount,c.currentSubscription.currentPlan.
3863currency,t.language):((te=(ae=c.currentSubscription)==null?void 0:ae.currentPlan)==null?void 0:te.formattedPrice)||""}),s.jsxs("span",{className:"text-gray-500",children:["/ ",e(`billing.intervals.${((J=(ne=c.currentSubscription)==null?void 0:ne.currentPlan)==null?void 0:J.interval)||(((G=c.currentSubscription)==null?void 0:G.plan)==="yearly"?"year":"month")}`)]})]}),(()=>{var ie;const he=((ie=c.currentSubscription)==null?void 0:ie.organisationName)||(c==null?void 0:c.organisationName)||(c==null?void 0:c.OrganisationName)||"";return he?s.jsxs("div",{className:"mt-2 text-sm text-gray-700",children:[s.jsxs("span",{className:"text-gray-600 mr-1",children:[e("billing.organization","Organization"),":"]}),s.jsx("span",{className:"font-medium",children:he})]}):null})()]}),s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.jsxs("button",{onClick:()=>m.mutate(window.location.origin+"/billing"),disabled:m.isPending,className:"inline-flex items-center px-3 py-1.5 bg-primary-600 text-white text-sm rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(qg,{className:"w-3 h-3 mr-1.5"}),m.isPending?e("common.loading"):e("billing.manageSubscription")]}),s.jsxs("button",{onClick:()=>m.mutate(window.location.origin+"/billing"),disabled:m.isPending,className:"inline-flex items-center px-3 py-1.5 text-primary-600 bg-white border border-primary-600 text-sm rounded-lg hover:bg-primary-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(da,{className:"w-3 h-3 mr-1.5"}),m.isPending?e("common.loading"):e("billing.getInvoices","Get my invoices")]})]})]}),(()=>{var ye,pe,ce;const he=((pe=(ye=c.currentSubscription)==null?void 0:ye.currentPlan)==null?void 0:pe.renewalDate)||((ce=c.currentSubscription)==null?void 0:ce.endDate);if(!he)return null;const ie=new Date(he);return s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[s.jsx(vo,{className:"w-4 h-4"}),s.jsxs("span",{children:[e("billing.validUntil","Your current subscription is valid until")," ",lu(ie,t.language,{combinedFormat:"PP"})]})]})})()]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(qg,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("billing.paymentMethod")})]}),((Q=c.currentSubscription)==null?void 0:Q.paymentMethod)&&s.jsx("button",{onClick:()=>m.mutate(window.location.origin+"/billing"),disabled:m.isPending,className:"text-sm text-primary-600 hover:text-primary-700 font-medium transition-colors disabled:opacity-50",children:m.isPending?e("common.loading"):e("billing.edit")})]}),(W=c.currentSubscription)!=null&&W.paymentMethod?s.jsxs("div",{className:"relative w-full h-36 rounded-2xl overflow-hidden shadow-xl mb-4",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-600 via-blue-700 to-blue-800",children:s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-500/10 to-blue-900/10"})}),s.jsxs("div",{className:"relative h-full p-4 flex flex-col justify-between text-white",children:[s.jsx("div",{className:"flex-1 flex items-center",children:s.jsxs("div",{className:"text-xl font-mono tracking-wider font-medium",children:["•••• •••• •••• ",c.currentSubscription.paymentMethod.last4]})}),s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"text-xs opacity-75 mb-1",children:e("billing.expires")}),s.jsxs("div",{className:"text-sm font-mono",children:[String(c.currentSubscription.paymentMethod.expMonth).padStart(2,"0"),"/",String(c.currentSubscription.paymentMethod.expYear).slice(-2)]})]}),s.jsx("div",{className:"flex-shrink-0",children:((Y=c.currentSubscription.paymentMethod.brand)==null?void 0:Y.toLowerCase())==="visa"?s.jsx("img",{src:"/assets/visa-2021.svg",alt:"Visa",className:"h-6 w-auto object-contain filter brightness-0 invert"}):((q=c.currentSubscription.paymentMethod.brand)==null?void 0:q.toLowerCase())==="mastercard"?s.jsx("img",{src:"/assets/mastercard-2019.svg",alt:"MasterCard",className:"h-6 w-auto object-contain"}):((Z=c.currentSubscription.paymentMethod.brand)==null?void 0:Z.toLowerCase())==="amex"||((me=c.currentSubscription.paymentMethod.brand)==null?void 0:me.toLowerCase())==="american express"?s.jsx("div",{className:"text-white text-sm font-bold bg-white/10 px-2 py-1 rounded",children:"AMEX"}):c.currentSubscription.paymentMethod.brand?s.jsx("div",{className:"bg-white/20 backdrop-blur-sm rounded px-2 py-1 text-xs font-bold text-white",children:c.currentSubscription.paymentMethod.brand.toUpperCase()}):s.jsx("div",{className:"bg-white/20 backdrop-blur-sm rounded px-2 py-1 text-xs font-bold text-white",children:"CARD"})})]})]})]}):s.jsxs("div",{className:"flex items-center gap-4 p-4 border border-gray-200 rounded-lg mb-4 text-gray-500",children:[s.jsx(qg,{className:"w-6 h-6"}),s.jsx("div",{children:s.jsx("p",{className:"text-sm",children:e("billing.noPaymentMethod")})})]})]})]}):I?s.jsxs("div",{className:"bg-white rounded-xl border border-yellow-400 shadow-lg p-6 mb-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-yellow-700",children:[s.jsx(qs,{className:"w-5 h-5"}),s.jsx("h2",{className:"text-lg font-semibold",children:e("billing.pastDueTitle","Payment issue: subscription past due")})]}),s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${j("past_due")}`,children:"past_due"})]}),s.jsx("p",{className:"text-gray-700 mb-4",children:e("billing.pastDueMessage","Your payment is past due. Please update your payment method to restore access.")}),s.jsxs("button",{onClick:()=>m.mutate(window.location.origin+"/billing"),disabled:m.isPending,className:"inline-flex items-center px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 transition-colors disabled:opacity-50",children:[m.isPending?e("common.loading"):e("billing.updatePaymentMethod","Update payment method"),s.jsx(Jy,{
3863className:"w-4 h-4 ml-2"})]})]}):s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 mb-8",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx(mL,{className:"w-5 h-5 text-primary-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("billing.noActiveSubscription")})]}),s.jsx("p",{className:"text-gray-600 mb-4",children:e("billing.noActiveSubscriptionMessage")})]}),s.jsx("div",{className:"flex justify-center items-center gap-8 mb-8",children:s.jsxs("div",{className:"flex items-center gap-8 bg-primary-600 p-1 rounded-lg",children:[s.jsx("button",{onClick:()=>v("monthly"),className:`px-6 py-2 rounded-md text-sm font-medium transition-colors ${o==="monthly"?"bg-white text-primary-600":"bg-primary-600 text-white"}`,children:e("billing.monthly")}),s.jsxs("button",{onClick:()=>v("yearly"),className:`px-6 py-2 rounded-md text-sm font-medium transition-colors ${o==="yearly"?"bg-white text-primary-600":"bg-primary-600 text-white"}`,children:[e("billing.yearly"),s.jsx("span",{className:"ml-2 inline-block px-2 py-0.5 text-white text-xs rounded-full",style:{backgroundColor:"#17a34a"},children:"Save 50%"})]})]})}),s.jsx("div",{id:"pricing",className:"grid grid-cols-1 lg:grid-cols-4 gap-8 mb-12",children:c==null?void 0:c.planOptions[o].map(he=>{var yt,gt;const ie=(yt=c.currentSubscription)==null?void 0:yt.currentPlan,ye=o==="yearly"?"year":"month",pe=!!(ie!=null&&ie.priceId&&ie.priceId===he.priceId||ie&&he.productId===ie.productId&&ye===ie.interval),ce=x(he),xe=()=>{var $e;const qe=he.productName,ze=($e=c.availableProducts)==null?void 0:$e.find(ct=>ct.name===qe);if(ze!=null&&ze.metadata){const oe=`description_${t.language||"en"}`;if(ze.metadata[oe])return ze.metadata[oe];if(ze.metadata.description_en)return ze.metadata.description_en}return he.description},Ee=()=>{var $e;const qe=he.productName,ze=($e=c.availableProducts)==null?void 0:$e.find(ct=>ct.name===qe);return ze!=null&&ze.metadata?(oe=>{const Ne=[],Ae=["brands","personas","socials","links / QR Codes","ideas","posts","users"],lt=e("billing.features.unlimited","Unlimited"),Mt=e("billing.features.upTo","Up to");return Ae.forEach(jt=>{const Xe=oe[jt];if(Xe)switch(jt){case"brands":const Bt=e("billing.features.brands","brand"),ve=e("billing.features.brands_plural","brands");Ne.push(`${Xe==="1000"?lt:Xe} ${parseInt(Xe)>1?ve:Bt}`);break;case"personas":const Fe=e("billing.features.personas","persona"),nt=e("billing.features.personas_plural","personas");Ne.push(`${Xe==="1000"?lt:Xe} ${parseInt(Xe)>1?nt:Fe}`);break;case"socials":const At=e("billing.features.socials","social platform"),Wt=e("billing.features.socials_plural","social platforms");Ne.push(`${Xe} ${parseInt(Xe)>1?Wt:At}`);break;case"links / QR Codes":const In=e("billing.features.links","links / QR codes");Ne.push(`${Xe} ${In}`);break;case"ideas":const ir=e("billing.features.ideas","content ideas");Ne.push(`${Xe==="Unlimited"?lt:Xe} ${ir}`);break;case"posts":const Qt=e("billing.features.posts","posts per month");Ne.push(`${Xe==="Unlimited"?lt:Xe} ${Qt}`);break;case"users":const Sn=e("billing.features.users","team member"),nn=e("billing.features.users_plural","team members");Ne.push(`${Mt} ${Xe} ${parseInt(Xe)>1?nn:Sn}`);break}}),Ne})(ze.metadata):he.features},fe=(()=>{var Ne;if(o!=="yearly")return{yearlyAmount:void 0,monthlyAmount:void 0,currency:void 0};const ze=(((Ne=c==null?void 0:c.planOptions)==null?void 0:Ne.monthly)||[]).find(Ae=>he.productId&&Ae.productId?Ae.productId===he.productId:Ae.productName===he.productName),$e=he.amount,ct=ze==null?void 0:ze.amount,oe=he.currency;return console.log("getPricingData details:",{productName:he.productName,yearlyAmount:$e,monthlyAmount:ct,currency:oe,correspondingMonthlyPlan:ze?{productName:ze.productName,amount:ze.amount}:null}),{yearlyAmount:$e,monthlyAmount:ct,currency:oe}})(),je=async qe=>{var ze,$e;try{if(!y||!((ze=c.currentSubscription)!=null&&ze.currentPlan)||qe==="subscribe"){f.mutate({priceId:he.priceId});return}if(qe==="upgrade"||qe==="downgrade"){const ct=await(($e=Qe.currentUser)==null?void 0:$e.getIdToken());if(!ct){alert("Authentication required");return}const oe=await fetch("https://api.socialness.ai/stripe/change-subscription",{method:"POST",headers:{Authorization:`Bearer ${ct}`,"Content-Type":"application/json"},body:JSON.stringify({returnUrl:`${window.location.origin}/billing`})});if(!oe.ok)throw new Error(`HTTP ${oe.status}`);const Ne=await oe.json();if(Ne!=null&&Ne.url){window.location.href=Ne.url;return}}m.mutate(window.location.origin+"/billing")}catch(ct){console.error("Failed to start plan change flow:",ct),m.mutate(window.location.origin+"/billing")}},We=(gt=he.productName)==null?void 0:gt.toLowerCase().includes("business");return s.jsx(UJe,{productName:he.productName,description:xe(),price:he.formattedPrice,monthlyPrice:he.formattedMonthlyPrice,buttonText:e("billing.subscribe","Subscribe"),features:Ee(),onSubscribe:()=>je(ce),isLoading:f.isPending||m.isPending,billingPeriod:o,isCurrentPlan:pe,buttonType:ce,yearlyAmount:fe.yearlyAmount,monthlyAmount:fe.monthlyAmount,currency:fe.currency,isPopular:We},he.priceId)})}),(c==null?void 0:c.invoices)&&c.invoices.length>0&&s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg overflow-hidden",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",children:s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("billing.billingHistory")})}),y?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("billing.invoiceNumber")}),s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("billing.amount")}),s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("billing.date")}),s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("billing.status")}),s.jsx("th",{scope:"col",className:"relative px-6 py-3",children:s.jsx("span",{className:"sr-only",children:e("billing.actions")})})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:(we=c==null?void 0:c.invoices)==null?void 0:we.map(he=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:he.number}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:Q5(he.amount_paid,he.currency,t.language)}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:lu(he.created*1e3,t.language)}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${j(he.status)}`,children:he.status})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:s.jsxs("div",{className:"flex items-center justify-end gap-3",children:[s.jsx("a",{href:he.invoice_pdf,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700",children:s.jsx(yd,{className:"w-4 h-4"})}),s.jsx("a",{href:he.hosted_invoice_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700",children:s.jsx(C2,{className:"w-4 h-4"})})]})})]},he.id))})]})}):s.jsx("div",{className:"p-6 text-center text-gray-500",children:e("billing.noBillingHistory")})]})]}):s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})})]})})},GH=({isOpen:e,onClose:t,onSelect:r,brands:n,accountName:a,platform:i,isLoading:o=!1,loadingBrandId:l=null})=>{const{t:c}=Te();pn();const[u,d]=b.useState(null);return U.useEffect(()=>{(!e||!o)&&d(null)},[e,o]),e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl border border-black max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("h2",{className:"text-lg font-semibold",children:["Link @",a]}),s.jsx(cr,{platform:i,size:20}),s.jsx("span",{className:"text-lg font-semibold",children:"to:"})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-3",children:[n.map((f,m)=>{const p=(l||u)===f.id,g=p,y=o||p;return s.jsxs("button",{onClick:()=>{d(f.id),r(f.id)},disabled:y,className:`flex items-center gap-2 w-full p-3 rounded-lg border border-black transition-colors ${y?"bg-gray-50 cursor-not-allowed":"hover:border-primary-600"}`,children:[g?s.jsx(Rn,{className:"w-6 h-6 animate-spin text-primary-600"}):s.jsx("img",{src:f.logo,alt:f.name,className:"w-6 h-6 rounded-full"}),s.jsx("span",{className:`text-sm ${y?"text-gray-400":"text-gray-700"}`,children:f.name}),g&&s.jsx("span",{className:"text-xs text-primary-600 ml-auto",children:c("common.linking","Linking...")})]},f.id)}),s.jsxs("button",{onClick:()=>{window.location.href="https://app.socialness.ai/brand-strategy-lab?modal=analyze"},disabled:o,className:"flex items-center gap-2 w-full p-3 rounded-lg border border-dashed border-black hover:border-primary-600 text-gray-500 hover:text-primary-600 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:"Create new brand"})]})]})]})]})}):null},Du=({pictureUrl:e,username:t,platform:r,size:n="md"})=>{const[a,i]=U.useState(!1);U.useEffect(()=>{i(!1)},[e,r]);const o={sm:{container:"w-8 h-8",badge:"w-3 h-3 translate-y-1/2 bottom-0 -right-0.5 p-0.5",icon:10},md:{container:"w-10 h-10",badge:"w-4 h-4 translate-y-1/2 bottom-0 -right-1 p-0.5",icon:14},lg:{container:"w-12 h-12",badge:"w-5 h-5 translate-y-1/2 bottom-0 -right-1 p-0.5",icon:16}},{container:l,badge:c,icon:u}=o[n],d=()=>{console.log(`Failed to load ${r} profile image for ${t}:`,e),i(!0)},f=()=>{},m=()=>r==="tiktok"?s.jsx("div",{className:`absolute ${c} bg-white rounded-lg border border-black flex items-center justify-center`,children:s.jsx("img",{src:V8,alt:"TikTok",className:"w-full h-full"})}):s.jsx("div",{className:`absolute ${c} bg-white rounded-lg border border-black flex items-center justify-center`,children:s.jsx(cr,{platform:r,size:u})});return s.jsxs("div",{className:"relative",children:[e&&!a?s.jsx("img",{src:e,alt:t,className:`${l} rounded-lg object-cover border border-black`,onError:d,onLoad:f}):s.jsx("div",{className:`${l} bg-gray-100 rounded-lg flex items-center justify-center border border-black`,children:s.jsx(Fi,{className:"w-3/4 h-3/4 text-gray-400"})}),m()]})},GJe=({isOpen:e,onClose:t,onConfirm:r,accountName:n,username:a,pictureUrl:i,platformName:o,platformId:l})=>{const{t:c}=Te();if(!e)return null;const u=a||n;return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(qs,{className:"w-5 h-5"}),s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[c("accounts.disconnectMod
3863al.title","Disconnect Account"),s.jsx(cr,{platform:l,size:22})]})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-700",children:c("accounts.disconnectModal.messagePart1",`Are you sure you want to disconnect the ${o} account?`)}),s.jsxs("div",{className:"flex items-center gap-2 my-3",children:[s.jsx(Du,{pictureUrl:i,username:u,platform:l,size:"lg"}),s.jsxs("p",{className:"text-gray-700 font-semibold",children:["@",u]})]}),s.jsx("p",{className:"text-sm text-red-600",children:c("accounts.disconnectModal.warning","This action cannot be undone. You will need to reconnect it to use its features.")})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:c("common.cancel","Cancel")}),s.jsx("button",{onClick:()=>{r(),t()},className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700",children:c("common.confirm","Confirm")})]})]})]})})},HJe=({id:e,name:t,username:r,platform:n,pictureUrl:a,followersCount:i,isVerified:o,brandId:l,brandName:c,brandLogo:u,onDisconnect:d,onLinkToBrand:f,onUnlinkFromBrand:m,availableBrands:h=[]})=>{const{t:p}=Te(),g=qr(),[y,v]=b.useState(!1),[x,j]=b.useState(!1),[C,N]=b.useState(!1),[S,M]=b.useState(!1),[k,I]=b.useState(!1),T=()=>{const A=n==="linkedin"?"https://linkedin.com/company":n==="facebook"?"https://facebook.com":n==="twitter"?"https://twitter.com":n==="instagram"?"https://instagram.com":n==="tiktok"?"https://tiktok.com/@":"https://"+n+".com";window.open(`${A}/${r||e}`,"_blank"),v(!1)},L=async()=>{v(!1),I(!0);try{await VG(),g.removeQueries({queryKey:["accounts"]}),g.invalidateQueries({queryKey:["accounts"]}),await UG(n)}catch(A){console.error("Error reconnecting account:",A);let P="Failed to reconnect account. Please try again.";A instanceof Error&&(P=A.message),alert(P)}finally{I(!1)}},R=()=>{v(!1),N(!0)},_=()=>{d(e)},B=()=>{j(!0),v(!1)},z=()=>{m==null||m(e),v(!1)},D=A=>A.length>25?A.substring(0,25)+"...":A;return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 hover:shadow-xl transition-shadow",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(Du,{pictureUrl:a,username:r||t,platform:n,size:"lg"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 line-clamp-1",children:t}),s.jsx("div",{className:"flex flex-col gap-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:["@",D(r||t)]}),o&&s.jsx("span",{className:"text-blue-500",children:"✓"})]})})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx("button",{onClick:()=>v(!y),className:"p-1 rounded-lg hover:text-primary-600 transition-colors",children:s.jsx(M2,{className:"w-5 h-5 text-gray-500"})}),y&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>v(!1)}),s.jsx("div",{className:"absolute right-0 mt-2 w-48 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsxs("div",{className:"py-1",children:[s.jsxs("button",{onClick:T,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:text-primary-600",children:[s.jsx(C2,{className:"w-4 h-4 mr-2"}),p("accounts.viewProfile")]}),l?s.jsxs("button",{onClick:z,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:text-primary-600",children:[s.jsx(Jx,{className:"w-4 h-4 mr-2"}),p("accounts.unlinkBrand")]}):s.jsxs("button",{onClick:B,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:text-primary-600",children:[s.jsx(Ti,{className:"w-4 h-4 mr-2"}),p("accounts.linkToBrand")]}),s.jsxs("button",{onClick:L,disabled:k,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:text-primary-600 disabled:opacity-50",children:[s.jsx(ai,{className:`w-4 h-4 mr-2 ${k?"animate-spin":""}`}),p(k?"accounts.reconnecting":"accounts.reconnect")]}),s.jsxs("button",{onClick:R,className:"flex items-center w-full px-4 py-2 text-sm text-red-600 hover:bg-red-50",children:[s.jsx(Jx,{className:"w-4 h-4 mr-2"}),p("accounts.disconnect")]})]})})]})]})]}),s.jsxs("div",{className:"pt-4 border-t border-gray-100",children:[s.jsx("h4",{className:"text-xs font-medium text-gray-500 mb-2",children:"Related brand"}),l&&c?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:u,alt:c,className:"w-5 h-5 rounded-full"}),s.jsx("span",{className:"text-sm text-gray-600",children:c})]}):s.jsxs("button",{onClick:()=>j(!0),className:"w-full flex items-center justify-center gap-1 px-3 py-1.5 text-xs bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(Ti,{className:"w-3 h-3"}),p("accounts.linkToBrand")]})]}),s.jsx(GH,{isOpen:x,onClose:()=>j(!1),onSelect:async A=>{M(!0);try{await(f==null?void 0:f(e,A)),j(!1)}catch{}finally{M(!1)}},brands:h,accountName:r||t,platform:n,isLoading:S}),s.jsx(GJe,{isOpen:C,onClose:()=>N(!1),onConfirm:_,accountName:t,username:r,pictureUrl:a,platformName:n,platformId:n})]})},HH="https://api.socialness.ai",YJe=async()=>{var e;try{const t=await((e=Qe.currentUser)==null?void 0:e.getIdToken());if(!t)throw new Error("No authentication token available");console.log("Fetching LinkedIn temp organizations...");const r=await fetch(`${HH}/management/accounts/linkedin/temp-orgs`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok){const a=await r.text().catch(()=>"Unknown error");throw console.error(`Failed to fetch temp organizations: ${r.status} - ${a}`),new Error(`Failed to fetch LinkedIn organizations: ${r.statusText}`)}const n=await r.json();if(console.log("LinkedIn temp organizations response:",n),!n.success)throw new Error(n.message||"Failed to fetch LinkedIn organizations");return n}catch(t){throw console.error("Error fetching LinkedIn temp organizations:",t),t}},QJe=async e=>{var t;try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw new Error("No authentication token available");console.log("Connecting LinkedIn pages:",e);const n=await fetch(`${HH}/management/accounts/linkedin/connect-pages`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({selectedPageIds:e})});if(!n.ok){const i=await n.text().catch(()=>"Unknown error");throw console.error(`Failed to connect organizations: ${n.status} - ${i}`),new Error(`Failed to connect LinkedIn pages: ${n.statusText}`)}const a=await n.json();return console.log("Connect organizations response:",a),a}catch(r){throw console.error("Error connecting LinkedIn pages:",r),r}},KJe=(e=!0)=>Wa({queryKey:["linkedin-temp-organizations"],queryFn:YJe,staleTime:5*60*1e3,gcTime:10*60*1e3,retry:2,refetchOnWindowFocus:!1,enabled:e}),JJe=()=>{const e=qr();return mn({mutationFn:({selectedPageIds:t})=>QJe(t),onSuccess:()=>
3863{e.invalidateQueries({queryKey:["accounts"]}),e.invalidateQueries({queryKey:["linkedin-temp-organizations"]}),e.invalidateQueries({queryKey:["brands"]})},onError:t=>{console.error("Failed to connect LinkedIn pages:",t)}})},ZJe=e=>{if(!e||e.length!==2)return"🌍";const t=e.toUpperCase();return{AD:"🇦🇩",AE:"🇦🇪",AF:"🇦🇫",AG:"🇦🇬",AI:"🇦🇮",AL:"🇦🇱",AM:"🇦🇲",AO:"🇦🇴",AQ:"🇦🇶",AR:"🇦🇷",AS:"🇦🇸",AT:"🇦🇹",AU:"🇦🇺",AW:"🇦🇼",AX:"🇦🇽",AZ:"🇦🇿",BA:"🇧🇦",BB:"🇧🇧",BD:"🇧🇩",BE:"🇧🇪",BF:"🇧🇫",BG:"🇧🇬",BH:"🇧🇭",BI:"🇧🇮",BJ:"🇧🇯",BL:"🇧🇱",BM:"🇧🇲",BN:"🇧🇳",BO:"🇧🇴",BQ:"🇧🇶",BR:"🇧🇷",BS:"🇧🇸",BT:"🇧🇹",BV:"🇧🇻",BW:"🇧🇼",BY:"🇧🇾",BZ:"🇧🇿",CA:"🇨🇦",CC:"🇨🇨",CD:"🇨🇩",CF:"🇨🇫",CG:"🇨🇬",CH:"🇨🇭",CI:"🇨🇮",CK:"🇨🇰",CL:"🇨🇱",CM:"🇨🇲",CN:"🇨🇳",CO:"🇨🇴",CR:"🇨🇷",CU:"🇨🇺",CV:"🇨🇻",CW:"🇨🇼",CX:"🇨🇽",CY:"🇨🇾",CZ:"🇨🇿",DE:"🇩🇪",DJ:"🇩🇯",DK:"🇩🇰",DM:"🇩🇲",DO:"🇩🇴",DZ:"🇩🇿",EC:"🇪🇨",EE:"🇪🇪",EG:"🇪🇬",EH:"🇪🇭",ER:"🇪🇷",ES:"🇪🇸",ET:"🇪🇹",FI:"🇫🇮",FJ:"🇫🇯",FK:"🇫🇰",FM:"🇫🇲",FO:"🇫🇴",FR:"🇫🇷",GA:"🇬🇦",GB:"🇬🇧",GD:"🇬🇩",GE:"🇬🇪",GF:"🇬🇫",GG:"🇬🇬",GH:"🇬🇭",GI:"🇬🇮",GL:"🇬🇱",GM:"🇬🇲",GN:"🇬🇳",GP:"🇬🇵",GQ:"🇬🇶",GR:"🇬🇷",GS:"🇬🇸",GT:"🇬🇹",GU:"🇬🇺",GW:"🇬🇼",GY:"🇬🇾",HK:"🇭🇰",HM:"🇭🇲",HN:"🇭🇳",HR:"🇭🇷",HT:"🇭🇹",HU:"🇭🇺",ID:"🇮🇩",IE:"🇮🇪",IL:"🇮🇱",IM:"🇮🇲",IN:"🇮🇳",IO:"🇮🇴",IQ:"🇮🇶",IR:"🇮🇷",IS:"🇮🇸",IT:"🇮🇹",JE:"🇯🇪",JM:"🇯🇲",JO:"🇯🇴",JP:"🇯🇵",KE:"🇰🇪",KG:"🇰🇬",KH:"🇰🇭",KI:"🇰🇮",KM:"🇰🇲",KN:"🇰🇳",KP:"🇰🇵",KR:"🇰🇷",KW:"🇰🇼",KY:"🇰🇾",KZ:"🇰🇿",LA:"🇱🇦",LB:"🇱🇧",LC:"🇱🇨",LI:"🇱🇮",LK:"🇱🇰",LR:"🇱🇷",LS:"🇱🇸",LT:"🇱🇹",LU:"🇱🇺",LV:"🇱🇻",LY:"🇱🇾",MA:"🇲🇦",MC:"🇲🇨",MD:"🇲🇩",ME:"🇲🇪",MF:"🇲🇫",MG:"🇲🇬",MH:"🇲🇭",MK:"🇲🇰",ML:"🇲🇱",MM:"🇲🇲",MN:"🇲🇳",MO:"🇲🇴",MP:"🇲🇵",MQ:"🇲🇶",MR:"🇲🇷",MS:"🇲🇸",MT:"🇲🇹",MU:"🇲🇺",MV:"🇲🇻",MW:"🇲🇼",MX:"🇲🇽",MY:"🇲🇾",MZ:"🇲🇿",NA:"🇳🇦",NC:"🇳🇨",NE:"🇳🇪",NF:"🇳🇫",NG:"🇳🇬",NI:"🇳🇮",NL:"🇳🇱",NO:"🇳🇴",NP:"🇳🇵",NR:"🇳🇷",NU:"🇳🇺",NZ:"🇳🇿",OM:"🇴🇲",PA:"🇵🇦",PE:"🇵🇪",PF:"🇵🇫",PG:"🇵🇬",PH:"🇵🇭",PK:"🇵🇰",PL:"🇵🇱",PM:"🇵🇲",PN:"🇵🇳",PR:"🇵🇷",PS:"🇵🇸",PT:"🇵🇹",PW:"🇵🇼",PY:"🇵🇾",QA:"🇶🇦",RE:"🇷🇪",RO:"🇷🇴",RS:"🇷🇸",RU:"🇷🇺",RW:"🇷🇼",SA:"🇸🇦",SB:"🇸🇧",SC:"🇸🇨",SD:"🇸🇩",SE:"🇸🇪",SG:"🇸🇬",SH:"🇸🇭",SI:"🇸🇮",SJ:"🇸🇯",SK:"🇸🇰",SL:"🇸🇱",SM:"🇸🇲",SN:"🇸🇳",SO:"🇸🇴",SR:"🇸🇷",SS:"🇸🇸",ST:"🇸🇹",SV:"🇸🇻",SX:"🇸🇽",SY:"🇸🇾",SZ:"🇸🇿",TC:"🇹🇨",TD:"🇹🇩",TF:"🇹🇫",TG:"🇹🇬",TH:"🇹🇭",TJ:"🇹🇯",TK:"🇹🇰",TL:"🇹🇱",TM:"🇹🇲",TN:"🇹🇳",TO:"🇹🇴",TR:"🇹🇷",TT:"🇹🇹",TV:"🇹🇻",TW:"🇹🇼",TZ:"🇹🇿",UA:"🇺🇦",UG:"🇺🇬",UM:"🇺🇲",US:"🇺🇸",UY:"🇺🇾",UZ:"🇺🇿",VA:"🇻🇦",VC:"🇻🇨",VE:"🇻🇪",VG:"🇻🇬",VI:"🇻🇮",VN:"🇻🇳",VU:"🇻🇺",WF:"🇼🇫",WS:"🇼🇸",YE:"🇾🇪",YT:"🇾🇹",ZA:"🇿🇦",ZM:"🇿🇲",ZW:"🇿🇼"}[t]||"🌍"},XJe=({isOpen:e,onClose:t,onComplete:r,onError:n})=>{const{t:a}=Te(),[i,o]=b.useState([]),{data:l,isLoading:c,error:u}=KJe(e),d=JJe(),f=(l==null?void 0:l.organizations)||[];if(b.useEffect(()=>{e||o([])},[e]),!e)return null;const m=x=>{d.isPending||o(j=>j.includes(x)?j.filter(C=>C!==x):[...j,x])},h=()=>{d.isPending||o(f.map(x=>x.id))},p=()=>{d.isPending||o([])},g=async()=>
3863{if(i.length===0){n==null||n(a("accounts.linkedin.selectAtLeastOne"));return}try{await d.mutateAsync({selectedPageIds:i}),r()}catch(x){const j=x instanceof Error?x.message:a("accounts.linkedin.connectionFailed");n==null||n(j)}},y=x=>{let j="";if(x.localizedName&&x.localizedName!==`Organization ${x.id}`?j=x.localizedName:j=a("accounts.linkedin.linkedInPageFallback",{id:x.id}),x.locations&&x.locations.length>0){const C=x.locations[0],N=ZJe(C.country);j+=` ${N}`}return j},v=x=>{const C={EDUCATIONAL:{emoji:"📚",labelKey:"accounts.linkedin.organizationType.educational",bgColor:"bg-purple-100",textColor:"text-purple-700"},PUBLIC_COMPANY:{emoji:"📈",labelKey:"accounts.linkedin.organizationType.publicCompany",bgColor:"bg-blue-100",textColor:"text-blue-700"},PRIVATELY_HELD:{emoji:"🏢",labelKey:"accounts.linkedin.organizationType.privatelyHeld",bgColor:"bg-indigo-100",textColor:"text-indigo-700"},SELF_EMPLOYED:{emoji:"🤓",labelKey:"accounts.linkedin.organizationType.selfEmployed",bgColor:"bg-blue-50",textColor:"text-blue-600"},SELF_OWNED:{emoji:"💼",labelKey:"accounts.linkedin.organizationType.selfOwned",bgColor:"bg-teal-100",textColor:"text-teal-700"},PARTNERSHIP:{emoji:"🤝",labelKey:"accounts.linkedin.organizationType.partnership",bgColor:"bg-orange-100",textColor:"text-orange-700"},NON_PROFIT:{emoji:"❤️",labelKey:"accounts.linkedin.organizationType.nonProfit",bgColor:"bg-red-100",textColor:"text-red-700"},GOVERNMENT_AGENCY:{emoji:"🏛️",labelKey:"accounts.linkedin.organizationType.governmentAgency",bgColor:"bg-green-100",textColor:"text-green-700"}}[x]||{emoji:"🏢",labelKey:"accounts.linkedin.organizationType.unknown",bgColor:"bg-gray-100",textColor:"text-gray-700"};return{emoji:C.emoji,label:a(C.labelKey),bgColor:C.bgColor,textColor:C.textColor}};return s.jsx("div",{className:"fixed inset-0 z-[60] overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-hidden border-2 border-black",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(x0,{className:"w-6 h-6 text-primary-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:a("accounts.linkedin.organizationSelectionTitle")})]}),s.jsx("button",{onClick:t,disabled:d.isPending,className:"text-gray-400 hover:text-gray-500 disabled:opacity-50",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-140px)]",children:[c&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Rn,{className:"w-8 h-8 animate-spin mx-auto mb-4 text-primary-600"}),s.jsx("p",{className:"text-gray-600",children:a("accounts.linkedin.loadingOrganizations")})]})}),u&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx(E2,{className:"w-8 h-8 mx-auto mb-4 text-red-500"}),s.jsx("p",{className:"text-red-600 mb-2",children:a("accounts.linkedin.loadFailed")}),s.jsx("p",{className:"text-gray-500 text-sm",children:u.message})]})}),!c&&!u&&f.length===0&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx(bs,{className:"w-8 h-8 mx-auto mb-4 text-yellow-500"}),s.jsx("p",{className:"text-gray-600",children:a("accounts.linkedin.noOrganizationsFound")}),s.jsx("p",{className:"text-gray-500 text-sm",children:a("accounts.linkedin.noOrganizationsFoundSubtext")})]})}),!c&&!u&&f.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-gray-600 mb-4",children:a("accounts.linkedin.selectionDescription")}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:h,disabled:d.isPending,className:"px-3 py-1.5 text-sm border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50",children:a("accounts.linkedin.selectAll")}),s.jsx("button",{onClick:p,disabled:d.isPending,className:"px-3 py-1.5 text-sm border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50",children:a("accounts.linkedin.deselectAll")})]}),s.jsx("p",{className:"text-sm text-gray-500",children:a("accounts.linkedin.organizationsSelected",{count:i.length,total:f.length})})]})]}),s.jsx("div",{className:"space-y-3",children:f.map(x=>{const j=i.includes(x.id),C=d.isPending,N=v(x.organizationType);return s.jsx("div",{onClick:()=>!C&&m(x.id),className:`p-4 border rounded-xl cursor-pointer transition-all ${j?"border-primary-600 bg-primary-50":"border-black hover:border-gray-300"} ${C?"opacity-50 cursor-not-allowed":""}`,children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex-shrink-0",children:j?s.jsx(Ba,{className:"w-5 h-5 text-primary-600"}):s.jsx("div",{className:"w-5 h-5 border-2 border-gray-300 rounded-full"})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[s.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center flex-shrink-0",children:s.jsx(x0,{className:"w-5 h-5 text-blue-600"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"font-medium text-gray-900 truncate",children:y(x)}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 mt-1",children:[s.jsx("span",{className:"px-2 py-0.5 bg-green-100 text-green-700 rounded text-xs",children:a("accounts.linkedin.companyPage")}),s.jsxs("span",{className:`px-2 py-0.5 ${N.bgColor} ${N.textColor} rounded text-xs flex items-center gap-1`,children:[s.jsx("span",{children:N.emoji}),s.jsx("span",{children:N.label})]})]})]})]})]})},x.id)})})]})]}),!c&&!u&&f.length>0&&s.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-gray-200 bg-gray-50",children:[s.jsx("p",{className:"text-sm text-gray-500",children:(l==null?void 0:l.expiresAt)&&a("accounts.linkedin.organizationsExpire",{date:new Date(l.expiresAt).toLocaleDateString()})}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("button",{onClick:t,disabled:d.isPending,className:"px-4 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50",children:a("common.cancel")}),s.jsxs("button",{onClick:g,disabled:i.length===0||d.isPending,className:"px-6 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[d.isPending&&s.jsx(Rn,{className:"w-4 h-4 animate-spin"}),d.isPending?a("accounts.linkedin.connecting"):a("accounts.linkedin.connectButton",{count:i.length})]})]})]})]})]})})}
3863,eZe=()=>{const e=qr();return mn({mutationFn:async t=>{var a;const r=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`https://api.socialness.ai/management/accounts/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to disconnect account");return n.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["accounts"]})}})},tZe=()=>{const e=qr();return mn({mutationFn:async({accountId:t,pageId:r})=>{var i;const n=await((i=Qe.currentUser)==null?void 0:i.getIdToken());if(!n)throw new Error("No authentication token available");const a=await fetch("https://api.socialness.ai/management/accounts/unlink",{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({accountId:t,pageId:r})});if(!a.ok)throw new Error("Failed to unlink account from brand");return a.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["accounts"]})}})},rZe=()=>{const e=qr();return mn({mutationFn:async({accountId:t,pageId:r,brandId:n})=>{var o;const a=await((o=Qe.currentUser)==null?void 0:o.getIdToken());if(!a)throw new Error("No authentication token available");const i=await fetch("https://api.socialness.ai/management/accounts/link",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({accountId:t,pageId:r,brandId:n})});if(!i.ok)throw new Error("Failed to link account to brand");return i.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["accounts"]})}})},nZe=wf((e,t)=>({selectedBrand:"all",activeTab:"all",setSelectedBrand:r=>e(n=>n.selectedBrand===r?n:{selectedBrand:r}),setActiveTab:r=>e(n=>n.activeTab===r?n:{activeTab:r})}));function aZe(){const e=nZe(),[t,r]=ui(),n=b.useRef(!0),a=b.useRef(!1),i=b.useRef(e);b.useEffect(()=>{i.current=e},[e]),b.useEffect(()=>{let p=!1;const g=new URLSearchParams(t);g.has("platform")&&(g.delete("platform"),p=!0),g.has("view")&&(g.delete("view"),p=!0),g.has("status")&&(g.delete("status"),p=!0),g.has("dateRange")&&(g.delete("dateRange"),p=!0),p&&r(g)},[t,r]);const o=b.useRef({skipSync:!1}).current,l=b.useRef({skipSync:!1}).current,[c,u]=fa("tab",e.activeTab,o),[d,f]=fa("brand",e.selectedBrand,l);b.useEffect(()=>{if(n.current){const p=i.current;c!==p.activeTab&&p.setActiveTab(c),d!==p.selectedBrand&&p.setSelectedBrand(d),n.current=!1}},[]);const m=b.useCallback(p=>{p!==c&&(u(p),a.current=!0,i.current.setActiveTab(p),a.current=!1)},[c,u]),h=b.useCallback(p=>{p!==d&&(f(p),a.current=!0,i.current.setSelectedBrand(p),a.current=!1)},[d,f]);return b.useEffect(()=>{!n.current&&!a.current&&c!==i.current.activeTab&&i.current.setActiveTab(c)},[c]),b.useEffect(()=>{!n.current&&!a.current&&d!==i.current.selectedBrand&&i.current.setSelectedBrand(d)},[d]),{activeTab:c,selectedBrand:d,setActiveTab:m,setSelectedBrand:h}}const sZe="https://api.socialness.ai",Nv=(e,t="/social-media-hub")=>{const r=sessionStorage.getItem("oauth_redirect_after_auth");r?(sessionStorage.removeItem("oauth_redirect_after_auth"),sessionStorage.removeItem("oauth_redirect_timestamp"),console.log("Redirecting to custom path:",r),e(r,{replace:!0})):e(t,{replace:!0})},iZe=()=>{var J;const{t:e}=Te(),t=vs(),r=pn(),n=qr(),{selectedBrand:a,setSelectedBrand:i,activeTab:o,setActiveTab:l}=aZe(),[c,u]=hb("modal",""),d=c==="connect",[f,m]=b.useState(!1),[h,p]=b.useState(!1),[g,y]=b.useState(!1),[v,x]=b.useState(null),[j,C]=b.useState([]),S=new URLSearchParams(t.search).get("needsSelection")==="true",{data:M,isLoading:k,error:I,refetch:T}=qE(),{data:L}=oa(),R=eZe(),_=rZe(),B=tZe(),z=(M==null?void 0:M.connected_pages)||[],D=L?((J=L.brands)==null?void 0:J.map(G=>({id:G.id,name:G.name,logo:G.logo})))||[]:[],A={id:"all",name:"All Brands",logo:"/logo.svg"},P=b.useMemo(()=>{if(!z.length)return D;const G=[...new Set(z.map(Q=>Q.brandId).filter(Boolean))];return D.filter(Q=>G.includes(Q.id))},[D,z]),E=b.useCallback(async()=>{var G;try{const Q=await((G=Qe.currentUser)==null?void 0:G.getIdToken());if(!Q){console.error("No authentication token available");return}console.log("Invalidating accounts cache via API");const W=await fetch(`${sZe}/management/accounts/invalidate-cache`,{method:"POST",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"}});
3863if(!W.ok){console.error("Failed to invalidate cache:",W.status,W.statusText);return}const Y=await W.json();console.log("Cache invalidation response:",Y)}catch(Q){console.error("Error invalidating accounts cache:",Q)}},[]),F=b.useCallback(async()=>{console.log("Forcing accounts refetch with cache flush"),m(!0);try{await E(),await n.resetQueries({queryKey:["accounts"]}),await new Promise(G=>setTimeout(G,100)),await T(),console.log("Accounts data refetched successfully.")}catch(G){console.error("Error refreshing accounts:",G)}finally{m(!1)}},[E,n,T]),$=b.useRef(null);b.useEffect(()=>{const G=t.search;if(G===""||G===$.current){G!==""&&G===$.current&&console.log("Already processed this callback URL, skipping duplicate action:",G);return}$.current=G,console.log("Processing URL search params:",G);const Q=new URLSearchParams(G),W=Q.get("status"),Y=Q.get("platform"),q=Q.get("accountId"),Z=Q.has("code"),me=Q.has("oauth_token"),we=Q.has("denied"),he=Q.get("error"),ie=localStorage.getItem("socialness_oauth_pending")==="true",ye=localStorage.getItem("socialness_oauth_timestamp"),pe=ye&&Date.now()-parseInt(ye)<5*60*1e3;if(W==="success"&&Y&&q||(Z||me)&&!we&&!he&&ie&&pe){const Ee=Y||localStorage.getItem("socialness_oauth_platform");console.log(`OAuth success detected for ${Ee}. Forcing refresh and cleaning URL.`),ie&&(localStorage.removeItem("socialness_oauth_pending"),localStorage.removeItem("socialness_oauth_platform"),localStorage.removeItem("socialness_oauth_timestamp")),F().then(()=>{console.log("Accounts refresh completed after OAuth success."),Ee==="linkedin"?(console.log("LinkedIn OAuth success - redirecting to needsSelection=true"),Nv(r,"/social-media-hub?needsSelection=true")):Nv(r,t.pathname)});return}else if(W==="error"||we||he){const Ee=Y||localStorage.getItem("socialness_oauth_platform");console.warn(`OAuth error or denial detected for ${Ee}. Cleaning URL.`),W==="error"&&console.error(`Backend error message: ${Q.get("message")}`),we&&console.warn(`User denied access for ${Ee}.`),he&&console.error(`OAuth error parameter for ${Ee}: ${he}`),ie&&(localStorage.removeItem("socialness_oauth_pending"),localStorage.removeItem("socialness_oauth_platform"),localStorage.removeItem("socialness_oauth_timestamp")),r(t.pathname,{replace:!0})}},[t.search,t.pathname,F,r]);const H=a==="all"?o==="all"?z:z.filter(G=>G.platform===o):o==="all"?z.filter(G=>G.brandId===a):z.filter(G=>G.brandId===a&&G.platform===o),X=async G=>{console.log("Platform selected for connection:",G);try{await E(),u("")}catch(Q){console.error("Error preparing for OAuth connection:",Q)}},ue=async G=>{try{await R.mutateAsync(G),await F()}catch(Q){console.error("Error disconnecting account:",Q),alert(e("accounts.errors.disconnectFailed","Failed to disconnect account. Please try again."))}},le=async(G,Q)=>{try{const W=z.find(Y=>Y.id===G);if(!W){console.error("Page not found for linking:",G),alert(e("accounts.errors.linkFailed","Failed to link account. Page not found."));return}await _.mutateAsync({accountId:W.parentAccountId,pageId:G,brandId:Q}),await F()}catch(W){console.error("Error linking account to brand:",W),alert(e("accounts.errors.linkFailed","Failed to link account to brand. Please try again."))}},ae=async G=>{try{const Q=z.find(W=>W.id===G);if(!Q){console.error("Page not found for unlinking:",G),alert(e("accounts.errors.unlinkFailed","Failed to unlink account. Page not found."));return}await B.mutateAsync({accountId:Q.parentAccountId,pageId:G}),await F()}catch(Q){console.error("Error unlinking account from brand:",Q),alert(e("accounts.errors.unlinkFailed","Failed to unlink account from brand. Please try again."))}},te=G=>D.find(Q=>Q.id===G),ne=b.useCallback(G=>{if(console.log("🔍 DEBUG: Checking for newly connected accounts..."),console.log("🔍 DEBUG: Current pages count:",G.length),console.log("🔍 DEBUG: Previous account IDs:",j),console.log("🔍 DEBUG: Current pages:",G.map(Y=>({id:Y.id,name:Y.name,platform:Y.platform,brandId:Y.brandId}))),j.length===0){console.log("🔍 DEBUG: First load, storing current IDs"),C(G.map(Y=>Y.id));return}const Q=G.filter(Y=>!j.includes(Y.id)&&!Y.brandId),W=G.filter(Y=>!j.includes(Y.id));if(console.log("🔍 DEBUG: All new accounts found:",W.length>0?W.map(Y=>({name:Y.name,platform:Y.platform,brandId:Y.brandId||"NO_BRAND"})):"None"),console.log("🔍 DEBUG: New unlinked accounts found:",Q.length>0?Q.map(Y=>({name:Y.name,platform:Y.platform})):"None"),console.log("🔍 DEBUG: Available brands:",D.map(Y=>({id:Y.id,name:Y.name}))),Q.length>0){const Y=Q[0];console.log("🔍 DEBUG: Processing new account:",Y.name);const q=D.filter(Z=>Z.id&&Z.id!=="all");console.log("🔍 DEBUG: Available brands for linking:",q.length,q.map(Z=>Z.name)),q.length===1?(console.log("🔍 DEBUG: Auto-linking to single brand:",q[0].name),(async()=>{try{await _.mutateAsync({accountId:Y.parentAccountId,pageId:Y.id,brandId:q[0].id}),await F()}catch(me){console.error("Error auto-linking account to brand:",me)}})()):q.length>1?(console.log("🔍 DEBUG: Opening LinkBrandModal for brand selection"),x(Y),y(!0)):console.log("🔍 DEBUG: No brands available for linking")}else W.length>0&&console.log("🔍 DEBUG: New accounts were found but they are already linked to brands");C(G.map(Y=>Y.id))},[j,D,_,F]);return b.useEffect(()=>{z.length>0&&!k&&ne(z)},[z,k,ne]),U.useEffect(()=>{S&&p(!0)},[S]),s.jsxs(s.Fragment,{children:[s.jsxs(rs,{title:e("accounts.title"),subtitle:e("accounts.subtitle"),actions:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:F,className:"inline-flex items-center p-2 border border-gray-300 rounded-lg text-gray-600 hover:bg-gray-50 transition-colors disabled:opacity-50",disabled:f,children:f?s.jsx(Rn,{className:"w-5 h-5 animate-spin"}):s.jsx(ai,{className:"w-5 h-5"})}),s.jsxs("button",{onClick:()=>u("connect"),className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("accounts.connect")]})]}),children:[s.jsx("div",{className:"mb-4 flex justify-end",children:s.jsx(hl,{brands:[A,...P],selectedBrandId:a,onBrandSelect:i,className:"w-40"})}),s.jsx("div",{className:"mb-8",children:s.jsx(aV,{activeTab:o,onTabChange:l,showSummary:!1,showAllTab:!0})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[k&&s.jsx(s.Fragment,{children:[1,2,3,4].map(G=>s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 animate-pulse",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-12 h-12 bg-gray-200 rounded-lg"}),s.jsx("div",{className:"absolute -bottom-1 -right-1 bg-white rounded-lg p-0.5 border border-black",children:s.jsx("div",{className:"w-3.5 h-3.5 bg-gray-200 rounded"})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"h-5 w-32 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"h-4 w-24 bg-gray-200 rounded"})]})]}),s.jsx("div",{className:"w-5 h-5 bg-gray-200 rounded"})]}),s.jsxs("div",{className:"pt-4 border-t border-gray-100",children:[s.jsx("div",{className:"h-4 w-24 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"h-8 w-full bg-gray-200 rounded"})]})]},G))}),I&&s.jsx("div",{className:"col-span-full text-center py-12",children:s.jsx("p",{className:"text-red-500",children:e("accounts.errors.loadFailed","Failed to load accounts. Please try again later.")})}),!k&&!I&&H.length===0&&s.jsxs("div",{className:"col-span-full text-center py-12",children:[s.jsx("p",{className:"text-gray-500",children:e("accounts.noAccounts","No accounts found for the selected filter.")}),s.jsxs("button",{onClick:()=>u("connect"),className:"mt-4 inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("accounts.connectFirst")]})]}),H.map(G=>{const Q=te(G.brandId);return s.jsx(HJe,{id:G.id,name:G.name,username:G.username,platform:G.platform,pictureUrl:G.picture_url,followersCount:G.followers_count,isVerified:G.is_verified,brandId:G.brandId,brandName:Q==null?void 0:Q.name,brandLogo:Q==null?void 0:Q.logo,onDisconnect:ue,onLinkToBrand:le,onUnlinkFromBrand:ae,availableBrands:D},G.id)})]})]}),s.jsx(WG,{isOpen:d,onClose:()=>u(""),onConnect:X,existingPlatforms:z.map(G=>G.platform)}),s.jsx(XJe,{isOpen:h,onClose:()=>{p(!1),Nv(r,"/social-media-hub")},onComplete:()=>{p(!1),Nv(r,"/social-media-hub"),F()},onError:G=>{console.error("LinkedIn pages connection error:",G)}}),v&&s.jsx(GH,{isOpen:g,onClose:()=>{y(!1),x(null)},onSelect:async G=>{try{console.log("Linking account to selected brand:",G),await _.mutateAsync({accountId:v.parentAccountId,pageId:v.id,brandId:G}),await F(),y(!1),x(null)}catch(Q){console.error("Error linking account to selected brand:",Q),alert(e("accounts.errors.linkFailed","Failed to link account to brand. Please try again."))}},brands:D.filter(G=>G.id&&G.id!=="all"),accountName:v.name,platform:v.platform,isLoading:_.isPending})]})},oZe=({name:e,email:t,avatarUrl:r,size:n=40})=>{const a=()=>
3863{if(e&&e.trim()!==""){const o=e.split(" ");return o.length>=2?`${o[0].charAt(0)}${o[1].charAt(0)}`.toUpperCase():e.charAt(0).toUpperCase()}return t.charAt(0).toUpperCase()},i=o=>{const l=["bg-blue-500","bg-indigo-500","bg-purple-500","bg-pink-500","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500"],c=o.split("").reduce((u,d)=>u+d.charCodeAt(0),0);return l[c%l.length]};return r?s.jsx("img",{className:"rounded-full object-cover w-full h-full",src:r,alt:e||t}):s.jsx("div",{className:`rounded-full flex items-center justify-center text-white w-full h-full ${i(t)}`,children:s.jsx("span",{className:"text-xs font-medium",children:a()})})},lZe=e=>{switch(e==null?void 0:e.toLowerCase()){case"admin":return{bgColor:"bg-[#EFFDF4]",borderColor:"border-green-700",emoji:"👑"};case"manager":return{bgColor:"bg-blue-100",borderColor:"border-blue-700",emoji:"💼"};case"reviewer":return{bgColor:"bg-[#FEFCE8]",borderColor:"border-yellow-700",emoji:"👀"};case"writer":return{bgColor:"bg-indigo-100",borderColor:"border-indigo-700",emoji:"✍️"};default:return{bgColor:"bg-gray-100",borderColor:"border-gray-400",emoji:"👤"}}},cZe=e=>{switch(e==null?void 0:e.toLowerCase()){case"active":return"bg-green-500";case"pending":return"bg-yellow-500";case"declined":return"bg-red-500";default:return"bg-gray-400"}},uZe=({brand:e,role:t,status:r})=>{const{t:n}=Te(),a=lZe(t),i=cZe(r),o=`px-3 py-1 rounded-full text-xs inline-flex items-center border ${a.bgColor} ${a.borderColor} text-gray-900`,l=`${n(`teamMembers.status.${r}`,r)} ${n(`teamMembers.roles.${t}`,t).toLowerCase()}`;return s.jsxs("div",{className:"group relative",children:[s.jsxs("div",{className:o,children:[s.jsx("span",{className:`w-2 h-2 rounded-full mr-2 ${i}`}),e.logoUrl?s.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-4 h-4 rounded-full mr-1.5 object-contain"}):s.jsx("div",{className:"w-4 h-4 rounded-full mr-1.5 bg-gray-300 flex items-center justify-center text-xs text-gray-600",children:e.name.charAt(0)}),s.jsx("span",{className:"font-medium mr-1.5",children:e.name}),s.jsx("span",{children:a.emoji})]}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-10",children:[s.jsx("div",{className:"capitalize",children:l}),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-900"})]})]})},K5=[{id:"admin",emoji:"👑"},{id:"reviewer",emoji:"👀"},{id:"writer",emoji:"✍️"}],dZe={id:"all",emoji:"👥"},YH=({value:e,onChange:t,className:r="",isFilter:n=!1})=>{const[a,i]=b.useState(!1),{t:o}=Te(),l=n?[dZe,...K5]:K5,c=l.find(u=>u.id===e)||l[0];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>i(!a),className:`inline-flex items-center justify-between w-full px-4 py-2 text-sm bg-white border border-gray-300 rounded-lg hover:bg-gray-50 ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{children:c.emoji}),s.jsx("span",{className:"text-gray-700",children:o(`teamMembers.roles.${c.id}`)})]}),s.jsx(Vr,{className:"w-4 h-4 ml-2 text-gray-400"})]}),a&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),s.jsx("div",{className:"absolute right-0 z-20 w-full mt-2 bg-white border border-gray-200 rounded-lg shadow-lg",children:s.jsx("div",{className:"py-1",children:l.map(u=>s.jsx("button",{onClick:()=>{t(u.id),i(!1)},className:`w-full text-left px-4 py-2 text-sm ${u.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:u.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:o(`teamMembers.roles.${u.id}`)}),s.jsx("div",{className:"text-xs text-gray-500",children:o(`teamMembers.roles.descriptions.${u.id}`)})]})]})},u.id))})})]})]})},WS=[{id:"owner",emoji:"🛡️"},{id:"billing_admin",emoji:"💳"},{id:"admin",emoji:"🧩"},{id:"member",emoji:"👤"},{id:"guest",emoji:"👁️"}
3863],fZe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i}=Te(),o=WS.find(l=>l.id===e)||WS[3];return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>a(!n),className:`inline-flex items-center justify-between w-full px-4 py-2 text-sm bg-white border border-gray-300 rounded-lg hover:bg-gray-50 ${r}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{children:o.emoji}),s.jsx("span",{className:"text-gray-700",children:i(`teamMembers.orgRoles.${o.id}`)})]}),s.jsx(Vr,{className:"w-4 h-4 ml-2 text-gray-400"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),s.jsx("div",{className:"absolute right-0 z-20 w-full mt-2 bg-white border border-gray-200 rounded-lg shadow-lg",children:s.jsx("div",{className:"py-1",children:WS.map(l=>s.jsx("button",{onClick:()=>{t(l.id),a(!1)},className:`w-full text-left px-4 py-2 text-sm ${l.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:l.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:i(`teamMembers.orgRoles.${l.id}`)}),s.jsx("div",{className:"text-xs text-gray-500",children:i(`teamMembers.orgRoles.descriptions.${l.id}`)})]})]})},l.id))})})]})]})},mZe=({brands:e,selectedBrandIds:t,onBrandSelect:r,className:n="",singleSelection:a=!1})=>{const{t:i}=Te(),o=l=>{a?r([l]):t.includes(l)?r(t.filter(c=>c!==l)):r([...t,l])};return s.jsxs("div",{className:n,children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:i("teamMembers.selectBrand")}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(l=>s.jsxs("button",{onClick:()=>o(l.id),className:`flex items-center gap-2 p-3 rounded-lg border relative ${t.includes(l.id)?"border-primary-600 bg-primary-50":"border-gray-200 hover:border-primary-600"}`,children:[s.jsx("img",{src:l.logo,alt:l.name,className:"w-6 h-6 rounded-full"}),s.jsx("span",{className:"text-sm text-gray-700",children:l.name}),t.includes(l.id)&&s.jsx("div",{className:"absolute top-1 right-1 w-4 h-4 bg-primary-600 rounded-full flex items-center justify-center",children:s.jsx(ma,{className:"w-3 h-3 text-white"})})]},l.id))})]})},qS=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),J5=({isOpen:e,onClose:t,onSubmit:r,brands:n,mode:a,initialData:i})=>{const{t:o}=Te(),[l,c]=b.useState(""),[u,d]=b.useState(i!=null&&i.email?[i.email]:[]),[f,m]=b.useState((i==null?void 0:i.brandIds)||[]),[h,p]=b.useState((i==null?void 0:i.role)||"writer"),[g,y]=b.useState("member"),[v,x]=b.useState(!1);b.useEffect(()=>{e&&(m((i==null?void 0:i.brandIds)||[]),p((i==null?void 0:i.role)||"writer"),d(i!=null&&i.email?[i.email]:[]),y("member"),x(!1),c(""))},[e,i]);const j=b.useMemo(()=>{if(a!=="modify")return!0;const I=((i==null?void 0:i.brandIds)||[]).slice().sort(),T=f.slice().sort(),L=I.length!==T.length||I.some((B,z)=>B!==T[z]),R=((i==null?void 0:i.role)||"writer")!==h;return L||R||g!=="member"},[a,i,f,h,g]);if(!e)return null;const C=I=>{if(a==="modify")return;const T=I.trim();T&&qS(T)&&!u.includes(T)?(d([...u,T]),c("")):T&&!qS(T)?console.warn("Invalid email format:",T):T&&u.includes(T)&&console.warn("Duplicate email:",T)},N=I=>{a!=="modify"&&(I.key==="Enter"||I.key===","?(I.preventDefault(),C(l)):I.key==="Backspace"&&!l&&u.length>0&&d(u.slice(0,-1)))},S=I=>{a!=="modify"&&C(I.target.value)},M=I=>{a!=="modify"&&d(u.filter(T=>T!==I))},k=()=>{const I=l.trim(),L=a==="add"&&I&&qS(I)&&!u.includes(I)?[...u,I]:u,R=a==="add"&&L.length>0&&f.length===1&&h,_=a==="modify"&&f.length>0&&h;if(R||_){const B={...a==="add"&&{emails:L},...a==="add"?{brandId:f[0]}:{brandIds:f},role:h,orgRole:g};r(B),t()}else console.warn("Submit validation failed",{emails:u,selectedBrandIds:f,selectedRole:h,mode:a})};return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:a==="add"?o("teamMembers.addMember"):s.jsxs("span",{children:[o("teamMembers.modifyAccesses")," ",s.jsx("span",{className:"italic text-gray-600",children:i==null?void 0:i.email})]})}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-6",children:[a==="add"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o("teamMembers.emails")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(rp,{className:"h-5 w-5 text-gray-400"})}
3863),s.jsx("input",{type:"email",value:l,onChange:I=>c(I.target.value),onKeyDown:N,onBlur:S,placeholder:o("teamMembers.emailsPlaceholder"),className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500"})]}),s.jsx("p",{className:"mt-2 text-sm text-gray-500",children:o("teamMembers.emailsHint")}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:u.map((I,T)=>s.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-primary-50 text-primary-700",children:[I,s.jsx("button",{type:"button",onClick:()=>M(I),className:"ml-2 text-primary-600 hover:text-primary-800",children:s.jsx(_t,{className:"h-4 w-4"})})]},T))})]}),s.jsx(mZe,{brands:n,selectedBrandIds:f,onBrandSelect:m,singleSelection:a==="add"}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:o("teamMembers.selectRole")}),s.jsx(YH,{value:h,onChange:p})]}),s.jsxs("div",{className:"border-t border-gray-200 pt-4",children:[s.jsxs("button",{type:"button",onClick:()=>x(!v),className:"text-sm font-medium text-gray-700 hover:text-gray-900",children:[v?"▼":"▶"," ",o("teamMembers.advancedSettings.title","Advanced settings")]}),v&&s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsx("p",{className:"text-xs text-gray-500",children:o("teamMembers.advancedSettings.orgRoleHint","Choose the role you want to give to this new user. By default, he will be a member")}),s.jsx(fZe,{value:g,onChange:y})]})]})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:o("common.cancel")}),s.jsx("button",{onClick:k,disabled:a==="add"?u.length===0||f.length!==1||!h:!j||f.length===0||!h,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed",children:o(a==="add"?"teamMembers.invite":"common.save")})]})]})]})})},hZe=({isOpen:e,onClose:t,onRemoveFromBrand:r,onRemoveFromOrganisation:n,email:a,brandName:i})=>{const{t:o}=Te();return e?s.jsx("div",{className:"fixed inset-0 z-[60] overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(qs,{className:"w-5 h-5"}),s.jsx("h2",{className:"text-xl font-semibold",children:o("teamMembers.removeMember.title")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-700",children:o("teamMembers.removeMember.description")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"rounded-lg border border-gray-200 p-3",children:[s.jsx("div",{className:"font-medium",children:o("teamMembers.removeMember.brand.title")}),s.jsx("p",{className:"text-sm text-gray-600 mt-1",children:o("teamMembers.removeMember.brand.desc")}),s.jsx("button",{onClick:r,className:"mt-3 w-full px-4 py-2 text-sm font-medium bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:o("teamMembers.removeMember.brand.cta")})]}),s.jsxs("div",{className:"rounded-lg border border-red-200 p-3 bg-red-50",children:[s.jsx("div",{className:"font-medium text-red-700",children:o("teamMembers.removeMember.org.title")}),s.jsx("p",{className:"text-sm text-red-700 mt-1",children:o("teamMembers.removeMember.org.desc")}),s.jsx("button",{onClick:n,className:"mt-3 w-full px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700",children:o("teamMembers.removeMember.org.cta")})]})]}),s.jsxs("div",{className:"text-xs text-gray-500",children:[a," ",i?`• ${i}`:""]})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:o("common.close")})})]})]})}):null},pZe=()=>Wa({queryKey:["teamMembers"],staleTime:5*60*1e3,gcTime:30*60*1e3,refetchOnWindowFocus:!1,queryFn:async()=>{var n;const e=await((n=Qe.currentUser)==null?void 0:n.getIdToken());if(!e)throw new Error("Authentication token is missing.");const t=await fetch("https://api.socialness.ai/management/teams",{method:"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!t.ok){let a="Failed to fetch team members.";try{const i=await t.json();a=i.message||JSON.stringify(i)||a}catch{}throw new Error(`HTTP error ${t.status}: ${a}`)}const r=await t.json();if(!r.success||!Array.isArray(r.members))throw new Error("Invalid API response structure received.");return r}}),gZe=async e=>{var o;const t=await((o=Qe.currentUser)==null?void 0:o.getIdToken());if(!t)throw new Error("Authentication token is missing.");const r=ns.language||"en",n={...e,language:r},a=await fetch("https://api.socialness.ai/management/teams/invitations/create",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(n)});let i=null;try{i=await a.json()}catch{const c=await a.text();if(!a.ok)throw new Error(c||`Failed to send invitations (status: ${a.status})`);return{success:!0,message:c}}if(!a.ok||i&&i.success===!1){const l=i&&(i.message||i.error)||`Failed to send invitations (status: ${a.status})`;throw new Error(l)}return i},yZe=()=>{const e=qr();return mn({mutationFn:gZe,onSuccess:t=>
3863{console.log("Invitations sent successfully:",t),e.invalidateQueries({queryKey:["teamMembers"]})},onError:t=>{console.error("Error sending invitations:",t)}})},bZe=e=>{switch(e==null?void 0:e.toLowerCase()){case"active":return"bg-green-100 text-green-700";case"pending":return"bg-orange-100 text-orange-700";case"declined":return"bg-red-100 text-red-700";default:return"bg-gray-100 text-gray-700"}},vZe=({status:e})=>{const{t}=Te(),r=t(`teamMembers.status.${e==null?void 0:e.toLowerCase()}`,(e==null?void 0:e.charAt(0).toUpperCase())+(e==null?void 0:e.slice(1)));return s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${bZe(e)}`,children:r})},xZe=e=>{switch(e==null?void 0:e.toLowerCase()){case"admin":return{bgColor:"bg-[#EFFDF4]",textColor:"text-green-700",emoji:"👑"};case"manager":return{bgColor:"bg-blue-100",textColor:"text-blue-700",emoji:"💼"};case"reviewer":return{bgColor:"bg-[#FEFCE8]",textColor:"text-yellow-700",emoji:"👀"};case"writer":return{bgColor:"bg-indigo-100",textColor:"text-indigo-700",emoji:"✍️"};default:return{bgColor:"bg-gray-100",textColor:"text-gray-700",emoji:""}}},wZe=({role:e})=>{const{t}=Te(),r=xZe(e),n=t(`teamMembers.roles.${e==null?void 0:e.toLowerCase()}`,(e==null?void 0:e.charAt(0).toUpperCase())+(e==null?void 0:e.slice(1)));return s.jsxs("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${r.bgColor} ${r.textColor}`,children:[r.emoji&&s.jsx("span",{className:"mr-1.5",children:r.emoji}),n]})},jZe=()=>{var me,we,he,ie,ye,pe;const{t:e}=Te(),t=qr(),r=yZe(),[n,a]=b.useState("all"),[i,o]=b.useState(""),[l,c]=b.useState("all"),[u,d]=b.useState({}),[f,m]=hb("modal",""),h=f==="invite",p=f==="upgrade",[g,y]=b.useState(!1),[v,x]=b.useState(!1),[j,C]=b.useState(null),[N,S]=b.useState(!1),[M,k]=b.useState(null),[I,T]=b.useState(!1),[L,R]=b.useState(null),[_,B]=b.useState({}),[z,D]=b.useState({});Ip(e("teamMembers.title","Team Members"));const{data:A,isLoading:P,error:E}=pZe(),{data:F,isLoading:$,error:H}=oa(),X=(A==null?void 0:A.members)||[],ue=((me=A==null?void 0:A.pagination)==null?void 0:me.total)??X.length,le=(A==null?void 0:A.userLimits)??(A==null?void 0:A.usersLimit)??void 0,ae=U.useMemo(()=>F!=null&&F.brands?F.brands.map(ce=>({id:ce.id,name:ce.name,role:"writer",status:"active",logo:ce.logo,logoUrl:ce.logo})):[],[F]),te=U.useMemo(()=>{const ce=new Map;return X.forEach(xe=>{xe.brands.forEach(Ee=>{ce.has(Ee.id)||ce.set(Ee.id,{...Ee})})}),Array.from(ce.values())},[X]),ne=ce=>ce.name&&ce.name.trim()!==""?ce.name:ce.email.split("@")[0].split(".").map(Ee=>Ee.charAt(0).toUpperCase()+Ee.slice(1)).join(" "),J=U.useMemo(()=>X.filter(ce=>{const xe=i.toLowerCase();return!(!i||ce.email.toLowerCase().includes(xe)||ne(ce).toLowerCase().includes(xe))||!(l==="all"||ce.brands.some(fe=>fe.role===l))?!1:n==="all"||ce.status&&ce.status===n?!0:ce.brands.some(fe=>fe.status===n)}),[X,i,n,l]),G=ce=>{if(ce.brands.some(Ee=>Ee.role==="admin")){k(e("teamMembers.errors.cannotDeleteAdmin","Cannot delete an admin member. Please change their role first."));return}C(ce),x(!0),k(null)},Q=async()=>{var xe;if(!j)return;k(null);let ce=null;try{if(ce=await((xe=Qe.currentUser)==null?void 0:xe.getIdToken()),!ce)throw new Error("Authentication token is missing.")}catch(Ee){console.error("Error getting auth token:",Ee),k(Ee instanceof Error?Ee.message:"Failed to get auth token");return}try{let Ee="";if(j.invitationId)Ee=`https://api.socialness.ai/management/teams/invitations/${j.invitationId}`,console.log("Attempting to delete invitation:",j.invitationId);else{const je=j.brands.length>0?j.brands[0].id:"";Ee=`https://api.socialness.ai/management/teams/members/${j.id}?brandId=${je}`,console.log("Attempting to delete member:",j.id,"from brand:",je)}const Ye=await fetch(Ee,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ce}`}});if(!Ye.ok){let je=`Failed to delete ${j.invitationId?"invitation":"member"} (status: ${Ye.status})`;try{const We=await Ye.json();je=We.message||JSON.stringify(We)||je}catch{}throw new Error(je)}console.log(`${j.invitationId?"Invitation":"Member"} deleted successfully:`,j.invitationId||j.id);const fe=j.brands.length>0?j.brands[0].name:"Team";R({emails:[j.email],brandName:fe,action:"delete"}),T(!0),y(!1),C(null),setTimeout(()=>{T(!1)},4e3),await t.invalidateQueries({queryKey:["teamMembers"]})}catch(Ee){console.error("Error deleting:",Ee),k(Ee instanceof Error?Ee.message:"An unknown error occurred during deleti
3863on.")}},W=ce=>{C(ce),S(!0),k(null)},Y=async ce=>{var xe;if(ce.invitationId){k(null),B(Ee=>({...Ee,[ce.id]:!0}));try{const Ee=await((xe=Qe.currentUser)==null?void 0:xe.getIdToken());if(!Ee)throw new Error("Authentication token is missing.");console.log("Resending invitation for:",ce.email,"invitationId:",ce.invitationId);const Ye=await fetch("https://api.socialness.ai/management/teams/invitations/resend",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Ee}`},body:JSON.stringify({invitationId:ce.invitationId})});if(!Ye.ok){let We=`Failed to resend invitation (status: ${Ye.status})`;try{const yt=await Ye.json();We=yt.message||JSON.stringify(yt)||We}catch{}throw new Error(We)}const fe=await Ye.json();console.log("Invitation resent successfully:",fe);const je=ce.brands.length>0?ce.brands[0].name:"Team";R({emails:[ce.email],brandName:je,action:"invite"}),T(!0),setTimeout(()=>{T(!1)},4e3)}catch(Ee){console.error("Error resending invitation:",Ee),k(Ee instanceof Error?Ee.message:"Failed to resend invitation.")}finally{B(Ee=>({...Ee,[ce.id]:!1}))}}},q=()=>{m("invite"),k(null)},Z=()=>{m(""),r.isPending||r.reset()};if(P||$)return s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsxs("div",{className:"w-[95%] mx-auto py-8",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/3 mb-2 animate-pulse"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 animate-pulse"})]}),s.jsxs("div",{className:"mb-6 flex flex-col md:flex-row gap-4 animate-pulse",children:[s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg md:flex-1"}),s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-full md:w-64"})]}),s.jsx("div",{className:"mb-6 h-12 bg-gray-200 rounded animate-pulse"}),s.jsx("div",{className:"bg-white shadow-lg border border-gray-200 rounded-xl overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsx("tr",{children:[1,2,3,4].map(ce=>s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2 animate-pulse"})},ce))})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:[1,2,3,4,5].map(ce=>s.jsxs("tr",{className:"animate-pulse",children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"h-10 w-10 bg-gray-200 rounded-full mr-4"}),s.jsxs("div",{children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-24 mb-1"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-32"})]})]})}),s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("div",{className:"h-6 w-28 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-6 w-24 bg-gray-200 rounded-full"})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap hidden sm:table-cell",children:s.jsx("div",{className:"h-4 bg-gray-200 rounded w-20"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx("div",{className:"h-5 w-5 bg-gray-200 rounded"}),s.jsx("div",{className:"h-5 w-5 bg-gray-200 rounded"})]})})]},ce))})]})})})]})});if(E||H){const ce=E||H;return s.jsxs("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0 flex flex-col items-center justify-center text-center px-4",children:[s.jsx("p",{className:"text-red-600 font-semibold",children:"Error loading data:"}),s.jsx("p",{className:"text-red-500 mt-2",children:ce==null?void 0:ce.message}),s.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:"Try Again"})]})}return s.jsxs(s.Fragment,{children:[s.jsxs(rs,{title:e("teamMembers.title"),subtitle:e("teamMembers.subtitle"),actions:s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[M&&!h&&s.jsx("div",{className:"text-red-600 text-sm bg-red-50 px-3 py-2 rounded-lg",children:M}),s.jsxs("button",{onClick:()=>{typeof le=="number"&&ue>=le?m("upgrade"):q()},className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",disabled:r.isPending,children:[s.jsx(kk,{className:"w-5 h-5 mr-2"}),r.isPending?e("common.loading","Loading..."):e("teamMembers.addMember")]})]}),children:[s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx($i,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",placeholder:e("teamMembers.searchPlaceholder"),value:i,onChange:ce=>o(ce.target.value)})]}),s.jsxs("div",{className:"relative flex-shrink-0 w-44 md:w-64",children:[s.jsx("div",{className:"absolute -top-5 right-0 text-black text-xs md:text-sm font-semibold leading-none whitespace-nowrap",children:typeof le=="number"?`${ue}/${le} ${e("billing.features.users_plural","team members")}`:`${ue} ${e("billing.features.users_plural","team members")}`}
3863),s.jsx(YH,{value:l,onChange:c,isFilter:!0,className:"w-full"})]})]})}),s.jsx("div",{className:"mb-6 overflow-x-auto",children:s.jsx("nav",{className:"flex space-x-3 sm:space-x-4 md:space-x-6 border-b border-gray-200","aria-label":"Tabs",children:["all","active","pending"].map(ce=>s.jsxs("button",{onClick:()=>a(ce),className:`${n===ce?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-2 sm:py-3 md:py-4 px-1 border-b-2 font-medium text-xs md:text-sm flex items-center gap-1 sm:gap-2`,children:[ce==="active"&&s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full bg-green-500"}),ce==="pending"&&s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full bg-orange-500"}),e(`teamMembers.tabs.${ce}`)]},ce))})}),s.jsx("div",{className:"space-y-4 pb-8",children:s.jsxs("div",{className:"bg-white shadow-lg border border-black rounded-xl overflow-hidden",children:[s.jsx("style",{children:`
3864                @media (max-width: 639px) {
3865                  .team-table th:nth-child(1), .team-table td:nth-child(1) { width: 50% !important; }
3866                  .team-table th:nth-child(2), .team-table td:nth-child(2) { width: 35% !important; }
3867                  /* Actions column is the 5th cell when hidden columns exist on mobile */
3868                  .team-table th:nth-child(5), .team-table td:nth-child(5) { width: 15% !important; }
3869                }
3870                @media (min-width: 640px) {
3871                  /* Desktop/tablet widths now that Org Role column is present */
3872                  .team-table th:nth-child(1), .team-table td:nth-child(1) { width: 35% !important; }
3873                  .team-table th:nth-child(2), .team-table td:nth-child(2) { width: 30% !important; }
3874                  .team-table th:nth-child(3), .team-table td:nth-child(3) { width: 15% !important; }
3875                  .team-table th:nth-child(4), .team-table td:nth-child(4) { width: 10% !important; }
3876                  .team-table th:nth-child(5), .team-table td:nth-child(5) { width: 10% !important; }
3877                }
3878              `}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full divide-y divide-gray-200 team-table",style:{tableLayout:"fixed"},children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("teamMembers.table.member")}),s.jsx("th",{scope:"col",className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("teamMembers.table.brands")}),s.jsx("th",{scope:"col",className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden sm:table-cell",children:e("teamMembers.table.orgRole","Org. Role")}),s.jsx("th",{scope:"col",className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden sm:table-cell",children:e("teamMembers.table.joined")}),s.jsx("th",{scope:"col",className:"relative px-2 sm:px-3 md:px-6 py-2 sm:py-3",children:s.jsx("span",{className:"sr-only",children:e("teamMembers.table.actions")})})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:J.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"px-6 py-8 text-center text-gray-500",children:e(i||l!=="all"||n!=="all"?"teamMembers.noResults":"teamMembers.noMembers")})}):J.map(ce=>s.jsxs(U.Fragment,{children:[s.jsxs("tr",{className:`hover:bg-gray-50 ${u[ce.id]?"bg-gray-50":""}`,children:[s.jsx("td",{className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("button",{onClick:()=>d(xe=>({...xe,[ce.id]:!xe[ce.id]})),className:"mr-1 text-gray-400 hover:text-gray-600 p-1 flex-shrink-0","aria-label":u[ce.id]?"Collapse details":"Expand details",children:s.jsx(Vr,{size:12,className:`transform transition-transform ${u[ce.id]?"rotate-180":""}`})}),s.jsx("div",{className:"flex-shrink-0 h-7 w-7 sm:h-8 sm:w-8 md:h-10 md:w-10 mr-3",children:s.jsx(oZe,{name:ce.name,email:ce.email,avatarUrl:ce.avatarUrl})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-xs md:text-sm font-medium text-gray-900 truncate",children:ne(ce)}),s.jsx("div",{className:"text-xs md:text-sm text-gray-500 truncate",children:ce.email})]})]})}),s.jsx("td",{className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4",children:s.jsx("div",{className:"flex flex-wrap gap-1",children:ce.brands.map((xe,Ee)=>s.jsx(uZe,{brand:xe,role:xe.role,status:xe.status},Ee))})}),s.jsx("td",{className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4 whitespace-nowrap text-xs md:text-sm text-gray-700 hidden sm:table-cell",children:ce.orgRole?ce.orgRole.replace("_"," ").replace(/^./,xe=>xe.toUpperCase()):"-"}),s.jsx("td",{className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4 whitespace-nowrap text-xs md:text-sm text-gray-500 hidden sm:table-cell",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(vo,{className:"flex-shrink-0 mr-1 sm:mr-1.5 h-3 w-3 sm:h-4 sm:w-4 text-gray-400"}),ce.addedAt?new Date(ce.addedAt).toLocaleDateString():"N/A"]})}),s.jsx("td",{className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4 whitespace-nowrap text-right text-xs md:text-sm font-medium",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[ce.status==="pending"&&ce.invitationId&&s.jsxs("button",{onClick:()=>Y(ce),disabled:_[ce.id],className:"p-1.5 sm:p-2 rounded-lg hover:bg-blue-100 transition-colors group relative disabled:opacity-50 disabled:cursor-not-allowed","aria-label":e("teamMembers.actions.resendInvitationAriaLabel",{email:ce.email}),children:[s.jsx(rp,{className:`w-3.5 h-3.5 sm:w-4 sm:h-4 text-blue-600 group-hover:text-blue-700 ${_[ce.id]?"animate-pulse":""}`}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[e("teamMembers.actions.resendInvitation","Resend invitation"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-blue-100"})]})]}),s.jsxs("button",{onClick:()=>W(ce),className:"p-1.5 sm:p-2 rounded-lg hover:bg-purple-100 transition-colors group relative","aria-label":e("teamMembers.actions.editAriaLabel",{email:ce.email}),children:[s.jsx(S0,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-primary-600 group-hover:text-primary-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[e("common.modify","Modifier"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),s.jsxs("button",{onClick:()=>G(ce),className:"p-1.5 sm:p-2 rounded-lg hover:bg-red-100 transition-colors group relative","aria-label":e("teamMembers.actions.deleteAriaLabel",{email:ce.email}),children:[s.jsx(lc,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-red-500 group-hover:text-red-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-red-100 text-red-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[e("common.delete","Supprimer"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-red-100"})]})]})]})})]}),u[ce.id]&&s.jsx("tr",{className:"bg-gray-50",children:s.jsx("td",{colSpan:4,className:"px-2 sm:px-3 md:px-6 py-2 sm:py-3 md:py-4",children:s.jsxs("div",{className:"w-full",children:[s.jsx("h4",{className:"text-xs md:text-sm font-medium text-gray-900 mb-2 md:mb-3",children:e("teamMembers.brandAccess.title")}),s.jsx("div",{className:"space-y-2 md:space-y-3 max-w-full overflow-x-auto",children:te.map(xe=>{const Ee=ce.brands.find(Ye=>Ye.id===xe.id);return Ee?s.jsxs("div",{className:"flex items-center justify-between bg-white p-3 rounded-lg border border-gray-200",children:[s.jsxs("div",{className:"flex items-center flex-1 min-w-0 mr-4",children:[xe.logoUrl?s.jsx("img",{src:xe.logoUrl,alt:xe.name,className:"w-8 h-8 rounded-full object-contain mr-3 flex-shrink-0"}):s.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center mr-3 flex-shrink-0 text-xs font-bold",children:xe.name.charAt(0)}),s.jsx("span",{className:"font-medium text-sm truncate",title:xe.name,children:xe.name})]}),s.jsxs("div",{className:"flex items-center space-x-3 flex-shrink-0",children:[s.jsx(wZe,{role:Ee.role}),s.jsx(vZe,{status:Ee.status}),s.jsx("button",{className:"p-1 text-red-600 hover:text-red-800",onClick:async()=>{console.log("Remove access requested:",ce.id,xe.id)},"aria-label":`Remove access to ${xe.name}`,children:s.jsx(lc,{size:20})})]})]},xe.id):null})})]})})})]},ce.id))})]})})]})})]}),s.jsx(J5,{isOpen:h,onClose:Z,onSubmit:ce=>{if(console.log("Add member modal submitted:",ce),k(null),ce.emails&&ce.emails.length>
38780&&ce.brandId&&ce.role){const xe=ae.find(Ee=>Ee.id===ce.brandId);r.mutate({emails:ce.emails,brandId:ce.brandId,role:ce.role,orgRole:ce.orgRole},{onSuccess:()=>{R({emails:ce.emails||[],brandName:(xe==null?void 0:xe.name)||"Unknown Brand",action:"invite"}),T(!0),Z(),t.invalidateQueries({queryKey:["teamMembers"]}),setTimeout(()=>{T(!1)},4e3)},onError:Ee=>{k(Ee.message||"Failed to send invitations"),console.error("Invitation error:",Ee)}})}else console.error("Missing data required for invitation:",ce),k("Missing email, brand, or role.")},brands:ae,mode:"add"}),s.jsx(J5,{isOpen:N,onClose:()=>S(!1),onSubmit:async ce=>{var Ee;if(console.log("Modify member data:",j==null?void 0:j.id,ce),!j)return;let xe=null;try{if(xe=await((Ee=Qe.currentUser)==null?void 0:Ee.getIdToken()),!xe)throw new Error("Authentication token is missing.");const Ye=(j.brands||[]).map(oe=>oe.id),fe=ce.brandIds||[],je=fe.filter(oe=>!Ye.includes(oe)),We=Ye.filter(oe=>!fe.includes(oe)),yt=Object.fromEntries((j.brands||[]).map(oe=>[oe.id,oe.role])),gt=fe.filter(oe=>Ye.includes(oe)).filter(oe=>(yt[oe]||"writer")!==(ce.role||yt[oe])),qe=new Set([...je,...gt]),ze=Array.from(qe).map(oe=>({brandId:oe,role:ce.role||yt[oe]||"writer",status:"active"}));if(ze.length===0&&We.length===0){console.log("No changes detected. Skipping update."),S(!1);return}const $e={"Content-Type":"application/json",Authorization:`Bearer ${xe}`},ct=await fetch(`https://api.socialness.ai/management/teams/members/${j.id}/brands`,{method:"PATCH",headers:$e,body:JSON.stringify({add:ze.length?ze:void 0,remove:We.length?We:void 0,email:ze.length?j.email:void 0})});if(!ct.ok){let oe=`Failed to update member brands (status: ${ct.status})`;try{oe=(await ct.json()).message||oe}catch{}throw new Error(oe)}S(!1),await t.invalidateQueries({queryKey:["teamMembers"]})}catch(Ye){console.error("Error modifying member:",Ye),k(Ye instanceof Error?Ye.message:"Failed to modify member.")}},brands:ae,mode:"modify",initialData:{email:(j==null?void 0:j.email)||"",brandIds:(j==null?void 0:j.brands.map(ce=>ce.id))||[],role:((we=j==null?void 0:j.brands[0])==null?void 0:we.role)||"writer"}}),s.jsx(hZe,{isOpen:v,onClose:()=>x(!1),onRemoveFromBrand:()=>{x(!1),y(!0)},onRemoveFromOrganisation:async()=>{var ce;if(j)try{const xe=await((ce=Qe.currentUser)==null?void 0:ce.getIdToken());if(!xe)throw new Error("Authentication token is missing.");const Ee=await fetch(`https://api.socialness.ai/management/organisations/members/${j.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${xe}`}});if(!Ee.ok){const Ye=await Ee.text();throw new Error(Ye||`Failed to remove from organisation (status: ${Ee.status})`)}R({emails:[j.email],brandName:"Organisation",action:"delete"}),T(!0),C(null),x(!1),await t.invalidateQueries({queryKey:["teamMembers"]}),setTimeout(()=>T(!1),4e3)}catch(xe){k(xe instanceof Error?xe.message:"Failed to remove from organisation")}},email:(j==null?void 0:j.email)||"",brandName:(ie=(he=j==null?void 0:j.brands)==null?void 0:he[0])==null?void 0:ie.name}),s.jsx(Pj,{isOpen:g,onClose:()=>y(!1),onConfirm:Q,title:e("teamMembers.deleteConfirmation.title"),message:e("teamMembers.deleteConfirmation.message",{email:(j==null?void 0:j.email)||"",brandName:((pe=(ye=j==null?void 0:j.brands)==null?void 0:ye[0])==null?void 0:pe.name)||"Unknown Brand"}),warning:e("teamMembers.deleteConfirmation.warning")}),s.jsx(sA,{isOpen:p,onClose:()=>m(""),onUpgrade:()=>window.location.assign("/billing"),resourceKey:"users"}),I&&L&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:s.jsxs("div",{className:"bg-white rounded-xl shadow-2xl p-12 flex flex-col items-center justify-center transform transition-all duration-500",children:[s.jsx("div",{className:"relative mb-4",children:s.jsx("div",{className:"w-20 h-20 rounded-full bg-green-100 flex items-center justify-center",children:s.jsx(Ba,{className:"w-12 h-12 text-green-600"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Success!"}),s.jsx("div",{className:"text-center text-gray-600 mb-4",children:L.action==="delete"?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"font-medium",children:["Successfully removed the following member from your brand ",s.jsx("span",{className:"font-bold text-gray-900",children:L.brandName}),":"]}),s.jsx("div",{className:"mt-3 text-base",children:L.emails.map((ce,xe)=>s.jsxs("div",{className:"font-bold text-gray-800",children:["• ",ce]},xe))})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"font-medium",children:["Congrats! You invited the following people to join your brand ",s.jsx("span",{className:"font-bold text-gray-900",children:L.brandName}),":"]}),s.jsx("div",{className:"mt-3 text-base",children:L.emails.map((ce,xe)=>s.jsxs("div",{className:"font-bold text-gray-800",children:["• ",ce]},xe))})]})})]})})]})},Qf="https://api.socialness.ai",Wj=({userId:e,brandId:t}={})=>{const r=qr(),n=async()=>{var p,g;const d=await((p=Qe.currentUser)==null?void 0:p.getIdToken());if(!d)throw new Error("Not authenticated");const f=await fetch(`${Qf}/storage/list`,{method:"GET",headers:{Authorization:`Bearer ${d}`}});if(!f.ok)throw new Error("Failed to fetch media files");const m=await f.json(),h=((g=m.files)==null?void 0:g.map(y=>({key:y.key,size:y.size,lastModified:y.lastModified,mediaType:y.mediaType,url:y.publicUrl,name:y.fileName,format:y.format,formattedSize:y.formattedSize})))||[];return{files:h,prefix:m.userPath||"",totalFiles:m.totalCount||h.length}},a=(d={})=>Wa({queryKey:["media",{userId:e,brandId:t}],queryFn:n,...d}),i=mn({mutationFn:async({file:d,brandId:f})=>{var g;const m=await((g=Qe.currentUser)==null?void 0:g.getIdToken());if(!m)throw new Error("Not authenticated");const h=new FormData;h.append("file",d),f&&h.append("brandId",f);const p=await fetch(`${Qf}/storage/upload`,{method:"POST",headers:{Authorization:`Bearer ${m}`},body:h});if(!p.ok)throw new Error("Failed to upload file");return p.json()},onSuccess:()=>{r.invalidateQueries({queryKey:["media"]})}}),o=mn({mutationFn:async({key:d})=>{var h;const f=await((h=Qe.currentUser)==null?void 0:h.getIdToken());if(!f)throw new Error("Not authenticated");const m=encodeURIComponent(d);console.log("Deleting file with key:",d),console.log("DELETE request URL:",`${Qf}/storage/delete?fileName=${m}`);try{const p=await fetch(`${Qf}/storage/delete?fileName=${m}`,{method:"DELETE",headers:{Authorization:`Bearer ${f}`}});if(console.log("DELETE response status:",p.status),console.log("DELETE response headers:",Object.fromEntries([...p.headers.entries()])),!p.ok){const y=await p.text();throw console.error("Delete file API error:",p.status,y),new Error(`Failed to delete file: ${p.status} ${y}`)}const g=p.status===204?{success:!0}:await p.json();return console.log("Delete file success for key:",d,"Response:",g),{success:!0,key:d,response:g}}catch(p){throw console.error("Network or parsing error during delete:",p),p}},onSuccess:d=>{console.log("Delete file mutation successful:",d),r.invalidateQueries({queryKey:["media"]})},onError:d=>{console.error("Delete file mutation error:",d)}}),l=mn({mutationFn:async({fileNames:d})=>{var h;const f=await((h=Qe.currentUser)==null?void 0:h.getIdToken());if(!f)throw new Error("Not authenticated");console.log("Calling bulkDelete API with fileNames:",d);const m={fileNames:d};console.log("Request body:",JSON.stringify(m)),console.log("Bulk DELETE request URL:",`${Qf}/storage/bulkDelete`);try{const p=await fetch(`${Qf}/storage/bulkDelete`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${f}`},body:JSON.stringify(m)});if(console.log("Bulk DELETE response status:",p.status),console.log("Bulk DELETE response headers:",Object.fromEntries([...p.headers.entries()])),!p.ok){const y=await p.text();throw console.error("Bulk delete API error:",p.status,y),new Error(`Failed to bulk delete files: ${p.status} ${y}`)}const g=await p.json();return console.log("Bulk delete success:",g),{success:!0,fileNames:d,result:g}}catch(p){throw console.error("Network or parsing error during bulk delete:",p),p}},onSuccess:d=>{console.log("Bulk delete mutation successful:",d),r.invalidateQueries({queryKey:["media"]})},onError:d=>{console.error("Bulk delete mutation error:",d)}}),c=async d=>{try{return await navigator.clipboard.writeText(d),!0}catch(f){return console.error("Failed to copy URL:",f),!1}},u=d=>{const f=document.createElement("a");f.href=d.url;const m=d.key.split("/"),h=m[m.length-1];f.download=h,document.body.appendChild(f),f.click(),document.body.removeChild(f)};return{useMediaQuery:a,uploadMedia:i.mutate,uploadMediaAsync:i.mutateAsync,isUploading:i.isPending,uploadError:i.error,deleteMedia:o.mutate,deleteMediaAsync:o.mutateAsync,isDeleting:o.isPending,deleteError:o.error,bulkDeleteMedia:l.mutate,bulkDeleteMediaAsync:l.mutateAsync,isBulkDeleting:l.isPending,bulkDeleteError:l.error,copyMediaUrl:c,downloadMedia:u}},C4="https://api.socialness.ai",NZe=async e=>{var t,r;
3878try{console.log(`Converting image URL to File: ${e}`);const n=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!n)throw new Error("No authentication token available");console.log("Attempting to use server proxy to download image and avoid CORS issues");const a=`${C4}/storage/proxy-download`;try{const i=await fetch(a,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(!i.ok)throw console.warn(`Proxy endpoint returned error: ${i.status} ${i.statusText}`),new Error(`Proxy failed: ${i.status}`);const o=await i.blob();let l=o.type||"image/jpeg";if(!l||l==="application/octet-stream"){const f=(r=e.split(".").pop())==null?void 0:r.toLowerCase();f==="png"?l="image/png":f==="jpg"||f==="jpeg"?l="image/jpeg":f==="gif"?l="image/gif":f==="webp"?l="image/webp":l="image/jpeg"}const c=l.split("/")[1]||"jpg",u=`image-${Date.now()}.${c}`,d=new File([o],u,{type:l});return console.log(`Successfully converted URL to File: ${u} (${l}, ${Math.round(o.size/1024)}KB)`),d}catch(i){return console.warn("Proxy download failed:",i),console.warn("Falling back to direct URL submission"),null}}catch(n){return console.error("Error converting image URL to File:",n),null}},QH=async(e,t="")=>{var r;if(!e)throw new Error("No file provided");console.log(`Processing profile image upload: ${e.name} (${e.type}, ${Math.round(e.size/1024)}KB)`),console.log(`Using API URL: ${C4}`);try{const n=await((r=Qe.currentUser)==null?void 0:r.getIdToken());if(!n)throw new Error("No authentication token available");console.log("Uploading profile image via upload endpoint...");const a=new FormData;a.append("file",e),t&&(a.append("brandId",t),console.log(`Including brandId: ${t} in upload request`));const i=`${C4}/storage/upload`;console.log(`Making POST request to: ${i}`);const o=await fetch(i,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:a});if(console.log("Upload response status:",o.status),console.log("Upload response statusText:",o.statusText),!o.ok){let u;try{const d=await o.json();u=JSON.stringify(d)}catch{u=await o.text()}throw new Error(`Failed to upload image: ${o.status} ${o.statusText}. Details: ${u}`)}const l=await o.text();console.log("Raw response text:",l);let c="";try{if(l.trim().startsWith("{")||l.trim().startsWith("[")){const u=JSON.parse(l);console.log("Parsed response data:",u),typeof u=="object"&&u!==null&&(c=u.url||u.data&&u.data.url||u.fileUrl||u.mediaUrl||u.imageUrl||"")}else l.trim().startsWith("http")&&(c=l.trim())}catch(u){console.warn("Error parsing response as JSON, will try direct URL:",u),l.trim().startsWith("http")&&(c=l.trim())}if(!c&&l.includes("http")){const u=l.match(/(https?:\/\/[^\s"']+)/);u&&u[0]&&(c=u[0],console.log("Extracted URL from response text:",c))}if(!c)throw new Error(`Could not find image URL in response. Raw response: ${l.substring(0,100)}...`);return console.log("Profile image successfully uploaded"),console.log("Using image URL:",c),c}catch(n){throw console.error("Error uploading profile image:",n),new Error(`Image upload failed: ${n.message||"Unknown error"}`)}},SZe=async(e,t)=>{if(!e)throw new Error("User ID is required");const r=fE(vE,"users",e);await v7(r,{...t,updatedAt:new Date().toISOString()})},CZe=()=>{const{t:e,i18n:t}=Te(),{user:r,setUser:n}=Ps(),[a,i]=b.useState((r==null?void 0:r.firstName)||""),[o,l]=b.useState((r==null?void 0:r.lastName)||""),[c,u]=b.useState((r==null?void 0:r.email)||""),[d,f]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(""),[y,v]=b.useState(""),[x,j]=b.useState(()=>{const le=t.language;return le==="pt-BR"?"pt-BR":le.split("-")[0]}),[C,N]=b.useState(!1),[S,M]=b.useState(!1),[k,I]=b.useState(!1),[T,L]=b.useState((r==null?void 0:r.photoURL)||null),[R,_]=b.useState(!1),[B,z]=b.useState(null),[D,A]=b.useState(!1);Wj();const P=v2();b.useEffect(()=>{const le=t.language,ae=le==="pt-BR"?"pt-BR":le.split("-")[0];j(ae)},[t.language]),b.useEffect(()=>{const le=t.language,ae=le==="pt-BR"?"pt-BR":le.split("-")[0];j(ae)},[]);const E=[{code:"en",name:"English",flag:"🇬🇧"},{code:"fr",name:"Français",flag:"🇫🇷"},{code:"es",name:"Español",flag:"🇪🇸"},{code:"de",name:"Deutsch",flag:"🇩🇪"},{code:"it",name:"Italiano",flag:"🇮🇹"},{code:"pt-BR",name:"Português (Brasil)",flag:"🇧🇷"}],F=le=>{j(le),t.changeLanguage(le)},$=async le=>{le.preventDefault(),A(!0),z(null),I(!1);const ae=Qe.currentUser;if(!ae){z(e("settings.profile.error.noAuth","Authentication error.")),A(!1);return}const te=`${a} ${o}`.trim(),ne={firstName:a.trim(),lastName:o.trim(),name:te};try{await ok(ae,{displayName:te}),await SZe(ae.uid,ne),n({...r,firstName:ne.firstName,lastName:ne.lastName,name:ne.name}),I(!0),setTimeout(()=>I(!1),3e3)}catch(J){Ie.error("Settings","Error updating profile",J),z(J.message||e("settings.profile.error.generic","Failed to update profile."))}finally{A(!1)}},H=le=>{le.preventDefault(),u(d),f(""),N(!0),setTimeout(()=>N(!1),3e3)},X=le=>{le.preventDefault(),h(""),g(""),v(""),M(!0),setTimeout(()=>M(!1),3e3)},ue=async le=>{var te;const ae=(te=le.target.files)==null?void 0:te[0];if(ae)try{const ne=URL.createObjectURL(ae);L(ne),_(!0),Ie.info("Settings",`Uploading avatar: ${ae.name}`);const J=await QH(ae),G=Qe.currentUser;if(G){await ok(G,{photoURL:J});try{await v7(fE(P,"users",G.uid),{photoURL:J,updatedAt:new Date().toISOString()}),Ie.info("Settings","User document updated with new photoURL in Firestore")}catch(Q){Ie.error("Settings","Error updating user document in Firestore",Q)}n({...r,photoURL:J}),Ie.info("Settings",`Avatar updated successfully with URL: ${J}`),I(!0),setTimeout(()=>I(!1),3e3)}}catch(ne){Ie.error("Settings","Error uploading avatar",ne),alert(e("settings.avatarUploadFailed","Failed to upload avatar image. Please try again.")),L((r==null?void 0:r.photoURL)||null)}finally{_(!1),T&&T!==(r==null?void 0:r.photoURL)&&URL.revokeObjectURL(T)}};return s.jsx(rs,{title:e("common.settings"),subtitle:e("settings.manageAccount","Manage your account settings and preferences"),children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("form",{onSubmit:$,className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Fi,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("settings.profile","Profile")})]}),k&&s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ma,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:e("settings.profile.success","Profile updated successfully")})]}),B&&s.jsx("div",{className:"flex items-center gap-2 text-red-600",children:s.jsx("span",{className:"text-sm",children:B})})]}),s.jsxs("div",{className:"flex flex-col md:flex-row items-start gap-6 mb-6",children:[s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("div",{className:"w-24 h-24 rounded-full bg-gray-100 flex items-center justify-center overflow-hidden",children:R?s.jsx("div",{className:"flex items-center justify-center h-full w-full bg-gray-200 bg-opacity-50",children:s.jsx(uL,{className:"w-8 h-8 text-primary-600 animate-spin"})}):T?s.jsx("img",{src:T,alt:e("settings.profile","Profile preview"),className:"w-full h-full object-cover"}):s.jsx(Fi,{className:"w-12 h-12 text-gray-400"})}),s.jsx("label",{htmlFor:"avatar-upload",className:"absolute bottom-0 right-0 p-1.5 bg-white rounded-full border border-gray-200 shadow-sm cursor-pointer hover:border-primary-500",children:s.jsx(Zy,{className:"w-4 h-4 text-gray-500"})}),s.jsx("input",{id:"avatar-upload",type:"file",accept:"image/*",className:"hidden",onChange:ue,disabled:R})]}),s.jsxs("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.profile.firstName","First Name")}
3878),s.jsx("input",{type:"text",id:"firstName",value:a,onChange:le=>i(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.profile.lastName","Last Name")}),s.jsx("input",{type:"text",id:"lastName",value:o,onChange:le=>l(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsx("div",{className:"sm:col-span-2",children:s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e("settings.uploadProfilePicture","Upload a new profile picture. The image should be at least 400x400 pixels.")})})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:e("settings.language.title","Language Preference")}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-4",children:E.map(le=>{const ae=x===le.code;return s.jsxs("button",{onClick:()=>F(le.code),className:`flex items-center gap-3 p-4 rounded-lg ${ae?"border-2 border-primary-600 bg-[#CFBFF7] bg-opacity-30":"border border-gray-200 hover:border-primary-600"}`,children:[s.jsx("span",{className:"text-2xl",children:le.flag}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-medium text-gray-900",children:le.name}),s.jsx("div",{className:"text-sm text-gray-500",children:le.code.toUpperCase()})]}),ae&&s.jsx(ma,{className:"w-5 h-5 text-primary-600 ml-auto stroke-[2.5]"})]},le.code)})})]}),s.jsx("div",{className:"mt-6 flex justify-end",children:s.jsxs("button",{type:"submit",disabled:D,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center",children:[D&&s.jsx(uL,{className:"animate-spin -ml-1 mr-2 h-4 w-4"}),e("settings.profile.updateButton","Save Changes")]})})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(rp,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("settings.email.title","Email Address")})]}),C&&s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ma,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:e("settings.email.success","Email updated successfully")})]})]}),s.jsxs("form",{onSubmit:H,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.email.current","Current Email")}),s.jsx("input",{type:"email",value:c,disabled:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-lg bg-gray-50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.email.new","New Email")}),s.jsx("input",{type:"email",value:d,onChange:le=>f(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:e("settings.email.placeholder","Enter your new email")})]}),s.jsx("button",{type:"submit",disabled:!d,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed",children:e("settings.email.update","Update Email")})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(N0,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:e("settings.security.title","Security")})]}),S&&s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ma,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:e("settings.security.success","Password updated successfully")})]})]}),s.jsxs("form",{onSubmit:X,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.security.currentPassword","Current Password")}),s.jsx("input",{type:"password",value:m,onChange:le=>h(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:e("settings.security.currentPasswordPlaceholder","Enter your current password")})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.security.newPassword","New Password")}),s.jsx("input",{type:"password",value:p,onChange:le=>g(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:e("settings.security.newPasswordPlaceholder","Enter your new password")})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e("settings.security.confirmPassword","Confirm New Password")}),s.jsx("input",{type:"password",value:y,onChange:le=>v(le.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:e("settings.security.confirmPasswordPlaceholder","Confirm your new password")})]}),s.jsx("button",{type:"submit",disabled:!m||!p||!y||p!==y,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed",children:e("settings.security.update","Update Password")})]})]})]})]})})},Sv="https://api.socialness.ai/management",k4=e=>{if(!e)return"—";const t=new Date(e);
3878return Number.isNaN(t.getTime())?e:t.toLocaleString("fr-FR",{dateStyle:"medium",timeStyle:"short"})},kZe=e=>{if(!e)return"—";const r=[e.planName||e.plan||"—"];return e.billing&&r.push(e.billing),e.endDate&&r.push(`échéance ${k4(e.endDate)}`),r.join(" · ")},MZe={high:"border-red-200 bg-red-50",medium:"border-amber-200 bg-amber-50",ok:"border-green-200 bg-green-50"},IZe=()=>{var I,T,L,R,_,B,z,D,A,P;const[e,t]=b.useState(""),[r,n]=b.useState(!1),[a,i]=b.useState(""),[o,l]=b.useState(null),[c,u]=b.useState(""),[d,f]=b.useState(!1),[m,h]=b.useState(""),[p,g]=b.useState(!1),[y,v]=b.useState(!1),[x,j]=b.useState(""),C=async()=>{var F;const E=await((F=Qe.currentUser)==null?void 0:F.getIdToken());if(!E)throw new Error("Session expirée, reconnecte-toi.");return E},N=async E=>{E==null||E.preventDefault(),i(""),h(""),l(null);const F=e.trim().toLowerCase();if(F){n(!0);try{const $=await fetch(`${Sv}/admin/diagnose-user?email=${encodeURIComponent(F)}`,{headers:{Authorization:`Bearer ${await C()}`,"Content-Type":"application/json"}});if($.status===403)throw new Error("Accès refusé : ce compte n'est pas admin.");if(!$.ok)throw new Error(`Erreur serveur (${$.status}).`);l(await $.json())}catch($){i($ instanceof Error?$.message:"Erreur inconnue.")}finally{n(!1)}}},S=async()=>{var F;const E=(F=o==null?void 0:o.checks.account)==null?void 0:F.uid;if(!(!E||!o)&&window.confirm(`Se connecter EN TANT QUE ${o.email} ?
3879
3880⚠️ Ça remplace ta session admin actuelle (tu seras déconnecté de ton compte et reconnecté en tant que cet utilisateur). Pour ne pas perdre ta session admin, fais-le plutôt dans une fenêtre privée/incognito.`)){g(!0);try{const $=await fetch(`${Sv}/admin/impersonate`,{method:"POST",headers:{Authorization:`Bearer ${await C()}`,"Content-Type":"application/json"},body:JSON.stringify({uid:E})}),H=await $.json().catch(()=>({}));if(!$.ok||!H.token)throw new Error((H==null?void 0:H.error)||`Échec (${$.status}).`);await Ale(Qe,H.token),window.location.href="/"}catch($){alert($ instanceof Error?$.message:"Échec de la connexion en tant que cet utilisateur."),g(!1)}}},M=async()=>{var E,F;if(o&&window.confirm(`Réparer le rattachement de ${o.email} ?
3881
3882Ça ré-écrit le userId temporaire (placeholder) vers son vrai uid Firebase dans l'organisation et les marques.`)){v(!0),j("");try{const $=await fetch(`${Sv}/admin/repair-membership`,{method:"POST",headers:{Authorization:`Bearer ${await C()}`,"Content-Type":"application/json"},body:JSON.stringify({email:o.email})}),H=await $.json().catch(()=>({}));if(!$.ok)throw new Error((H==null?void 0:H.error)||`Échec (${$.status}).`);j(`${H.message} (uid ${H.realUid} · org-membres corrigés: ${((E=H.orgMembersFixed)==null?void 0:E.length)??0} · marques corrigées: ${((F=H.brandsFixed)==null?void 0:F.length)??0})`),await N()}catch($){j($ instanceof Error?$.message:"Erreur inconnue.")}finally{v(!1)}}},k=async()=>{const E=c.trim();if(!(!E||!o)&&window.confirm(`Rattacher ${o.email} à l'organisation ${E} (membre actif) ?`)){f(!0),h("");try{const F=await fetch(`${Sv}/admin/attach-to-org`,{method:"POST",headers:{Authorization:`Bearer ${await C()}`,"Content-Type":"application/json"},body:JSON.stringify({email:o.email,orgId:E})}),$=await F.json().catch(()=>({}));if(!F.ok)throw new Error(($==null?void 0:$.error)||`Échec (${F.status}).`);h($.alreadyMember?`Déjà membre de « ${$.orgName} ».`:`✅ Rattaché à « ${$.orgName} ». L'accès devrait être débloqué.`),u(""),await N()}catch(F){h(F instanceof Error?F.message:"Erreur inconnue.")}finally{f(!1)}}};return s.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Diagnostic utilisateur"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Tape l'email d'un client / collègue invité pour savoir pourquoi il n'arrive pas à entrer dans l'app."}),s.jsxs("form",{onSubmit:N,className:"mt-6 flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx($i,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}
3882),s.jsx("input",{type:"email",value:e,onChange:E=>t(E.target.value),placeholder:"[email protected]",className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm"})]}),s.jsxs("button",{type:"submit",disabled:r||!e.trim(),className:"inline-flex items-center gap-2 px-5 py-2 rounded-lg bg-primary-600 text-white text-sm font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[r?s.jsx(Rn,{className:"h-4 w-4 animate-spin"}):s.jsx($i,{className:"h-4 w-4"}),"Diagnostiquer"]})]}),a&&s.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:[s.jsx(qs,{className:"h-4 w-4 flex-shrink-0"}),a]}),o&&s.jsxs("div",{className:"mt-6 space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-gray-500",children:"Verdict"}),o.verdicts.map((E,F)=>s.jsx("div",{className:`rounded-lg border p-4 ${MZe[E.severity]}`,children:s.jsxs("div",{className:"flex items-start gap-2",children:[E.severity==="ok"?s.jsx(Nm,{className:"h-5 w-5 text-green-600 flex-shrink-0 mt-0.5"}):s.jsx(qs,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:E.cause}),s.jsxs("p",{className:"mt-1 text-sm text-gray-600",children:[s.jsx("span",{className:"font-semibold",children:"Fix : "}),E.fix]})]})]})},F))]}),((I=o.checks.account)==null?void 0:I.exists)&&(((T=o.checks.orgs)==null?void 0:T.some(E=>
3882E.userIdMatches===!1))||((L=o.checks.orgs)==null?void 0:L.some(E=>{var F;return(((F=E.brands)==null?void 0:F.length)||0)>0}))&&(((R=o.checks.brandsReal)==null?void 0:R.length)||0)===0)&&s.jsxs("div",{className:"rounded-lg border border-indigo-200 bg-indigo-50/40 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-800",children:[s.jsx(gL,{className:"h-4 w-4"}),"Réparer le rattachement"]}),s.jsxs("p",{className:"mt-1 text-xs text-gray-600",children:["Ré-écrit le ",s.jsx("span",{className:"font-mono",children:"userId"})," temporaire (placeholder) vers le vrai uid Firebase dans l'org et les marques. À utiliser quand « câblé sur un autre userId » apparaît dans le verdict."]})]}),s.jsxs("button",{onClick:M,disabled:y,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-indigo-600 text-white text-sm font-medium hover:bg-indigo-700 disabled:opacity-50 flex-shrink-0",children:[y?s.jsx(Rn,{className:"h-4 w-4 animate-spin"}):s.jsx(gL,{className:"h-4 w-4"}),"Réparer"]})]}),x&&s.jsx("p",{className:"mt-2 text-sm text-gray-700",children:x})]}),s.jsxs("div",{className:"rounded-lg border border-gray-200 divide-y divide-gray-100 text-sm",children:[s.jsxs("div",{className:"p-3",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Compte & activité"}),(_=o.checks.account)!=null&&_.exists?s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-0.5 text-gray-700",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:o.checks.account.name||"(sans nom)"})," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:o.checks.account.uid})]}),s.jsxs("div",{className:"text-xs text-gray-500",children:["Créé le ",k4(o.checks.account.createdAt)," · Dernière connexion ",k4(o.checks.account.lastLoginAt)]}),(o.checks.account.emailVerified!==void 0||o.checks.account.disabled!==void 0)&&s.jsxs("div",{className:"text-xs text-gray-500",children:["Email ",o.checks.account.emailVerified?"✅ vérifié":"⚠️ non vérifié",o.checks.account.disabled?" · ❌ compte désactivé":" · compte actif"]})]}),s.jsxs("button",{onClick:S,disabled:p,title:"Se connecter en tant que cet utilisateur (fais-le en navigation privée)",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-300 text-xs font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-50 flex-shrink-0",children:[p?s.jsx(Rn,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Zme,{className:"h-3.5 w-3.5"}),"Se connecter en tant que"]})]}):s.jsx("span",{className:"text-red-600",children:"❌ aucun compte"})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Invitations reçues"}),(B=o.checks.invitations)!=null&&B.length?o.checks.invitations.map(E=>s.jsxs("div",{className:"font-mono text-xs text-gray-700",children:[E.id," · ",E.status," · ",E.role,"/",E.orgRole]},E.id)):s.jsx("span",{className:"text-gray-400",children:"aucune"})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Invitations envoyées"}),(z=o.checks.invitationsSent)!=null&&z.length?o.checks.invitationsSent.map(E=>s.jsxs("div",{className:"font-mono text-xs text-gray-700",children:["→ ",E.invitedEmail," · ",E.status," · ",E.role]},E.id)):s.jsx("span",{className:"text-gray-400",children:"aucune"})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Organisations liées & abonnement"}),(D=o.checks.orgs)!=null&&D.length?s.jsx("div",{className:"space-y-2",children:o.checks.orgs.map(E=>{var F;return s.jsxs("div",{className:"rounded border border-gray-100 bg-gray-50 p-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-gray-900",children:E.name}),s.jsx("span",{className:E.entitled?"text-green-600 text-xs":"text-red-600 text-xs",children:E.entitled?"✅ donne accès":"❌ pas d’accès"})]}),s.jsxs("div",{className:"text-xs text-gray-500",children:[E.relation," · rôle ",E.role," · statut org ",E.orgStatus,E.membershipStatus?` · membre ${E.membershipStatus}`:""]}),s.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:[s.jsx("span",{className:"font-semibold",children:"Abonnement :"})," ",kZe(E.subscription)]}),s.jsx("div",{className:"font-mono text-[11px] text-gray-400 mt-0.5",children:E.orgId}),E.userIdMatches===!1&&s.jsxs("div",{className:"mt-1 text-xs text-red-600",children:["⚠️ userId stocké ",s.jsx("span",{className:"font-mono",children:E.memberUserId})," ≠ uid du compte → l'app ne voit pas cette adhésion (placeholder). Cliquer « Réparer »."]}),(F=E.brands)!=null&&F.length?s.jsxs("div",{className:"mt-1 text-xs text-gray-600",children:["Brands (métadonnées) : ",E.brands.map($=>`${$.brandName} (${$.role}/${$.status}
3882)`).join(", ")]}):null]},E.orgId)})}):s.jsx("span",{className:"text-gray-400",children:"aucune"})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Marques réelles (ce que l'app affiche)"}),(A=o.checks.brandsReal)!=null&&A.length?s.jsx("div",{className:"text-xs text-gray-700",children:o.checks.brandsReal.map(E=>E.name||E.brandId).join(", ")}):s.jsx("span",{className:"text-amber-600 text-xs",children:"aucune ⚠️ (l'app affichera « 0 marque »)"})]})]}),((P=o.checks.account)==null?void 0:P.exists)&&s.jsxs("div",{className:"rounded-lg border border-gray-200 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700",children:[s.jsx(j0,{className:"h-4 w-4"}),"Rattacher à une organisation"]}),s.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Colle l'",s.jsx("span",{className:"font-mono",children:"orgId"})," d'une org active (ex. celui affiché ci-dessus pour un collègue qui a accès) pour rattacher ",s.jsx("span",{className:"font-medium",children:o.email})," comme membre actif."]}),s.jsxs("div",{className:"mt-3 flex gap-2",children:[s.jsx("input",{value:c,onChange:E=>u(E.target.value),placeholder:"organisation_...",className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg font-mono text-xs focus:outline-none focus:ring-2 focus:ring-primary-500"}),s.jsxs("button",{onClick:k,disabled:d||!c.trim(),className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-900 text-white text-sm font-medium hover:bg-black disabled:opacity-50 disabled:cursor-not-allowed",children:[d?s.jsx(Rn,{className:"h-4 w-4 animate-spin"}):s.jsx(j0,{className:"h-4 w-4"}),"Rattacher"]})]}),m&&s.jsx("p",{className:"mt-2 text-sm text-gray-700",children:m})]})]})]})},EZe=({title:e,analysisData:t,withAnalysis:r=!0,onAnalyze:n,isAnalyzing:a=!1})=>{const{t:i}=Te(),o=!!(t!=null&&t.summary&&(t!=null&&t.strengths)&&(t!=null&&t.areasOfImprovement)),l=r&&o,c=(u=[])=>u.map((d,f)=>s.jsxs("li",{className:"flex items-start",children:[s.jsxs("span",{className:"font-medium text-gray-900 mr-2",children:[f+1,"."]}),s.jsx("span",{className:"text-gray-700",children:d})]},f));return s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white overflow-hidden h-full",children:[s.jsx("div",{className:"p-6 border-b border-gray-200",style:{backgroundColor:"#F2F0FD"},children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Hn,{className:"w-6 h-6 text-indigo-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900 font-title",children:l?e:i("personas.analysis.aiReportTitle","AI Analysis Report")})]})})}),l?s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex flex-col space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg font-semibold text-indigo-900 mb-3 flex items-center",children:[s.jsx(Jr,{className:"w-5 h-5 mr-2"}),i("personas.analysis.summary","Summary")]}),s.jsx("p",{className:"text-gray-700 leading-relaxed",children:t==null?void 0:t.summary})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"border-2 border-green-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-green-600 mb-3 flex items-center",children:[s.jsx("div",{className:"w-1 h-4 bg-green-500 mr-2 rounded-full"}),s.jsx(C0,{className:"w-4 h-4 mr-1"}),i("personas.analysis.strengths","Strengths")]}),s.jsx("ul",{className:"space-y-2 text-sm",children:c(t==null?void 0:t.strengths)})]}),s.jsxs("div",{className:"border-2 border-orange-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-orange-600 mb-3 flex items-center",children:[s.jsx("div",{className:"w-1 h-4 bg-orange-500 mr-2 rounded-full"}),s.jsx(Fs,{className:"w-4 h-4 mr-1"}),i("personas.analysis.improvements","Areas for Improvement")]}),s.jsx("ul",{className:"space-y-2 text-sm",children:c(t==null?void 0:t.areasOfImprovement)})]})]}),((t==null?void 0:t.recommendedNewPersonas)&&t.recommendedNewPersonas.length>0||(t==null?void 0:t.demographicInsights)||(t==null?void 0:t.brandPersonaAlignment)||(t==null?void 0:t.gapAnalysis))&&s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(t==null?void 0:t.recommendedNewPersonas)&&t.recommendedNewPersonas.length>0&&s.jsxs("div",{className:"border-2 border-blue-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-blue-600 mb-3 flex items-center",children:[s.jsx("div",{className:"w-1 h-4 bg-blue-500 mr-2 rounded-full"}),s.jsx(Jr,{className:"w-4 h-4 mr-1"}),i("personas.analysis.recommendedPersonas","Recommended New Personas")]}),s.jsx("ul",{className:"space-y-2 text-sm",children:c(t.recommendedNewPersonas)})]}),((t==null?void 0:t.demographicInsights)||(t==null?void 0:t.brandPersonaAlignment)||(t==null?void 0:t.gapAnalysis))&&s.jsxs("div",{className:"border-2 border-purple-100 rounded-lg p-4",children:[s.jsxs("h3",{className:"text-sm font-medium text-purple-600 mb-3 flex items-center",children:[s.jsx("div",{className:"w-1 h-4 bg-purple-500 mr-2 rounded-full"}),s.jsx(Fs,{className:"w-4 h-4 mr-1"}),i("personas.analysis.expertsInsights","Experts Insights")]}),s.jsxs("div",{className:"space-y-3 text-sm",children:[t.demographicInsights&&s.jsxs("div",{children:[s.jsxs("h4",{className:"font-medium text-purple-700 mb-1",children:["• ",i("personas.analysis.demographicInsights","Demographic Insights")]}),s.jsx("p",{className:"text-gray-700 ml-4",children:t.demographicInsights})]}),t.brandPersonaAlignment&&s.jsxs("div",{children:[s.jsxs("h4",{className:"font-medium text-purple-700 mb-1",children:["• ",i("personas.analysis.brandPersonaAlignment","Brand-Persona Alignment")]}),s.jsx("p",{className:"text-gray-700 ml-4",children:t.brandPersonaAlignment})]}),t.gapAnalysis&&s.jsxs("div",{children:[s.jsxs("h4",{className:"font-medium text-purple-700 mb-1",children:["• ",i("personas.analysis.gapAnalysis","Gap Analysis")]}),s.jsx("p",{className:"text-gray-700 ml-4",children:t.gapAnalysis})]})]})]})]})]})},"persona-analysis-content"):s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex flex-col items-center justify-center text-center py-8",children:[s.jsx(Eu,{className:"w-12 h-12 text-indigo-400 mb-4"}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:i("common.ai.getAnalysisTitleGeneral","Get AI Analysis")}),s.jsx("p",{className:"text-gray-600 mb-6 max-w-md",children:i("personas.analysis.description","Get AI insights about your current personas and recommendations for new ones to better understand your target audience.")}),s.jsx("button",{onClick:n,disabled:a||!n,className:"inline-flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors disabled:bg-indigo-400 disabled:cursor-not-allowed",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"}),i("common.ai.analyzing","Analyzing...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Eu,{className:"w-5 h-5 mr-2"}),i("common.ai.analyzeButton","Analyze Now")]})})]})},"persona-analysis-cta-content")]})},KH=({media:e,postId:t})=>{const[r,n]=b.useState(!1),a=FHe(e),i=Xn(e),o=c=>{switch(c){case"firestore-mapValue":return"bg-blue-50 text-blue-700 border-blue-200";case"object-with-url":return"bg-green-50 text-green-700 border-green-200";case"string":return"bg-yellow-50 text-yellow-700 border-yellow-200";case"array":return"bg-purple-50 text-purple-700 border-purple-200";default:return"bg-red-50 text-red-700 border-red-200"}},l=c=>{switch(c){case"firestore-mapValue":return"🔄";case"object-with-url":return"✅";case"string":return"📝";case"array":return"📚";default:return"❌"}};return s.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg p-3 text-xs",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500",children:"Media Debug"}),t&&s.jsxs("span",{className:"text-gray-400 text-[10px]",children:["ID: ",t.slice(0,8)]})]}),s.jsx("button",{onClick:()=>n(!r),className:"p-1 hover:bg-gray-100 rounded",children:r?s.jsx(ch,{className:"w-3 h-3"}
3882):s.jsx(xa,{className:"w-3 h-3"})})]}),s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsxs("div",{className:`px-2 py-1 rounded text-[10px] border ${o(a.structure)}`,children:[l(a.structure)," ",a.structure]}),s.jsxs("div",{className:`px-2 py-1 rounded text-[10px] border ${a.hasUrl?"bg-green-50 text-green-700 border-green-200":"bg-red-50 text-red-700 border-red-200"}`,children:[a.hasUrl?s.jsx(Ba,{className:"w-2 h-2 inline mr-1"}):s.jsx(bs,{className:"w-2 h-2 inline mr-1"}),a.hasUrl?"URL OK":"No URL"]})]}),r&&s.jsxs("div",{className:"space-y-2 pt-2 border-t border-gray-100",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Original Type:"}),s.jsx("span",{className:"ml-2 font-mono",children:a.originalType})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-gray-500",children:"Is Array:"}),s.jsx("span",{className:"ml-2",children:a.isArray?"✅":"❌"})]}),i&&s.jsxs("div",{className:"bg-gray-50 p-2 rounded",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Normalized Result:"}),s.jsxs("div",{className:"font-mono text-[10px] space-y-1",children:[s.jsxs("div",{children:["URL: ",i.url?"✅":"❌"]}),s.jsxs("div",{children:["Type: ",i.type]}),i.fileName&&s.jsxs("div",{children:["File: ",i.fileName]})]})]}),s.jsxs("div",{className:"bg-gray-50 p-2 rounded",children:[s.jsx("div",{className:"text-gray-500 mb-1",children:"Raw Data:"}),s.jsx("pre",{className:"font-mono text-[10px] overflow-x-auto max-h-20 overflow-y-auto",children:JSON.stringify(e,null,2)})]})]})]})},TZe=({id:e,name:t,jobTitle:r,tags:n,ageRange:a,age:i,languages:o,socialNetworks:l,problems:c,goals:u,motivations:d,challenges:f,formatLength:m,avatarUrl:h,location:p,income:g,education:y,relationship:v,buying_behavior:x,brand_affinity:j,quote:C,brandId:N,brandName:S,brandLogo:M,recentPosts:k,onClick:I,onEdit:T,onDelete:L})=>{const{t:R}=Te(),_=pn(),[B,z]=b.useState(!1),[D,A]=b.useState(!1),[P,E]=b.useState(null),[F,$]=b.useState({x:0,y:0}),[H,X]=b.useState(0),ue=b.useRef(null),[le,ae]=b.useState(!1),[te,ne]=b.useState(!1),J=ie=>{switch(ie.toLowerCase()){case"en":return"🇬🇧";case"fr":return"🇫🇷";case"es":return"🇪🇸";default:return"🌐"}},G=(l||[]).map(ie=>{var ye,pe;if(typeof ie=="string")try{const ce=JSON.parse(ie);return{platform:((ye=ce.platform)==null?void 0:ye.toLowerCase())||"",frequency:ce.frequency}}catch(ce){return console.error("Error parsing socialNetwork JSON:",ce),null}return typeof ie=="object"&&ie.platform?{platform:((pe=ie.platform)==null?void 0:pe.toLowerCase())||"",frequency:ie.frequency}:null}).filter(ie=>ie!==null),Q=ie=>ie?Array.isArray(ie)?ie.join(", "):ie:"",W=ie=>{if(ie.target.closest("button")){ie.stopPropagation();return}I==null||I()},Y=ie=>{let ye=null;return ie.postMediaUrl&&ie.postMediaUrl.trim()!==""&&(ye={url:ie.postMediaUrl,type:"image"}),{id:ie.postId,brandName:S||"",brandLogo:M||"",content:ie.postContent,format:"regular",media:ye,platforms:[ie.postPlatform],status:ie.postStatus,scheduledAt:ie.postScheduledAt||null,publishedAt:null,createdAt:ie.postCreatedAt,updatedAt:ie.postUpdatedAt,brandId:N}};b.useLayoutEffect(()=>{ue.current&&X(ue.current.getBoundingClientRect().height)},[P]);const q=()=>{const ie=window.innerWidth,ye=window.innerHeight,pe=Math.min(800,ie*.9),ce=20;let xe=F.x+10,Ee=F.y-100;return xe+pe+ce>ie&&(xe=F.x-pe-10),xe<ce&&(xe=ce),Ee+H+ce>ye&&(Ee=ye-H-ce),Ee<ce&&(Ee=ce),{x:xe,y:Ee}},Z=ie=>{_(`/posts/${ie}/edit`)},me=()=>{ne(!0)},we=()=>{const ie=G.map(ye=>ye.platform).filter(ye=>ye);console.log("PersonaCard - AI: Extracted platforms from networks:",G),console.log("PersonaCard - AI: Recommended platforms to send:",ie),ne(!1),_("/content-creation",{state:{selectedBrandId:N,selectedPersonaId:e,returnToPersonas:!0,recommendedPlatforms:ie}})},he=()=>{const ie=G.map(ye=>ye.platform).filter(ye=>ye);console.log("PersonaCard - Manual: Extracted platforms from networks:",G),console.log("PersonaCard - Manual: Recommended platforms to send:",ie),ne(!1),_("/content-creation",{state:{selectedBrandId:N,selectedPersonaId:e,createManually:!0,returnToPersonas:!0,recommendedPlatforms:ie}})};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg hover:shadow-xl transition-shadow p-6 cursor-pointer",onClick:W,children:[s.jsxs("div",{className:"flex items-start gap-6 mb-6",children:[s.jsxs("div",{className:"relative w-32 h-32 flex-shrink-0",children:[s.jsx("div",{className:"w-full h-full aspect-square rounded-lg border border-black bg-primary-100 flex items-center justify-center overflow-hidden",children:h&&!B?s.jsx("img",{src:h,alt:`${t}'s avatar`,className:"w-full h-full object-cover",onError:()=>z(!0)}):s.jsx(Fi,{className:"w-16 h-16 text-primary-600"})}),M&&!D&&s.jsx("div",{className:"absolute -top-2 -right-3 w-8 h-8 bg-white border border-black rounded-md shadow-sm flex items-center justify-center overflow-hidden z-10",children:s.jsx("img",{src:M,alt:S||"Brand logo",className:"w-full h-full object-contain p-0.5",onError:()=>A(!0),title:S})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900 truncate",children:t}),s.jsx("div",{className:"flex gap-1 flex-shrink-0",children:(o||[]).map((ie,ye)=>s.jsx("span",{className:"text-sm",children:J(ie)},ye))})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 self-start",children:[s.jsxs("button",{onClick:ie=>{ie.stopPropagation(),I==null||I()},className:"p-2 rounded-lg hover:bg-purple-100 transition-colors group relative",title:R("common.view","View"),children:[s.jsx(xa,{
3882className:"w-4 h-4 text-primary-600 group-hover:text-primary-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[R("common.view","Voir"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),s.jsxs("button",{onClick:ie=>{ie.stopPropagation(),T==null||T()},className:"p-2 rounded-lg hover:bg-purple-100 transition-colors group relative",title:R("common.edit","Edit"),children:[s.jsx(L7,{className:"w-4 h-4 text-primary-600 group-hover:text-primary-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-primary-100 text-primary-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[R("common.edit","Modifier"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-primary-100"})]})]}),s.jsxs("button",{onClick:ie=>{ie.stopPropagation(),L==null||L()},className:"p-2 rounded-lg hover:bg-red-100 transition-colors group relative",title:R("common.delete","Delete"),children:[s.jsx(lc,{className:"w-4 h-4 text-red-500 group-hover:text-red-700"}),s.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-red-100 text-red-800 text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none z-50 whitespace-nowrap",children:[R("common.delete","Supprimer"),s.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-l-transparent border-r-transparent border-t-red-100"})]})]})]})]}),s.jsx("div",{className:"mt-1 min-w-0",children:s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("div",{children:r}),s.jsxs("div",{className:"text-gray-500",children:[R("personas.form.age"),": ",i," ",R("common.yearsOld","years old")]})]})})]})]}),C&&s.jsx("div",{className:"-mt-4 mb-6",children:s.jsxs("div",{className:"flex",children:[s.jsx("div",{className:"w-1 bg-primary-600 mr-2"}),s.jsxs("p",{className:"text-sm italic text-gray-700 break-words w-full",children:['"',C,'"']})]})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:R("personas.form.tabs.profile","Profile")}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[p&&s.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded-lg text-xs flex items-center",children:[s.jsx("span",{className:"mr-1",children:"📍"})," ",p]}),g&&s.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded-lg text-xs flex items-center",children:[s.jsx("span",{className:"mr-1",children:"💰"})," ",g]}),y&&s.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded-lg text-xs flex items-center",children:[s.jsx("span",{className:"mr-1",children:"🎓"})," ",y]}),v&&s.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded-lg text-xs flex items-center",children:[s.jsx("span",{className:"mr-1",children:"👥"})," ",v]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:(n||[]).map((ie,ye)=>s.jsx("span",{className:"px-2 py-1 bg-primary-50 text-primary-700 rounded-lg text-sm",children:ie},ye))})]}),G.length>0&&s.jsx(oA,{networks:G,showAddButton:!1}),s.jsxs(s.Fragment,{children:[s.jsx("hr",{className:"my-4 border-t border-gray-200"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[R("brands.posts","Posts")," ",k&&k.length>0?`(${k.length})`:""]}),s.jsxs("button",{onClick:me,className:"text-sm text-primary-600 hover:text-primary-700 font-medium transition-colors flex items-center",children:[s.jsx(tn,{className:"w-4 h-4 inline mr-1"}),R("posts.createPost","Créer un post")]})]}),k&&k.length>0?s.jsx("div",{className:"grid grid-cols-3 gap-2",children:k.slice(0,3).map(ie=>s.jsxs("div",{className:"relative group cursor-pointer",title:`${ie.postContent.substring(0,50)}...`,onClick:()=>Z(ie.postId),onMouseEnter:ye=>{E(ie),$({x:ye.clientX,y:ye.clientY})},onMouseMove:ye=>{$({x:ye.clientX,y:ye.clientY})},onMouseLeave:()=>E(null),children:[s.jsxs("div",{className:"aspect-square rounded-lg overflow-hidden bg-gray-100 border border-gray-200",children:[(()=>{let ye=null;ie.postMediaUrl&&ie.postMediaUrl.trim()!==""&&(ye={url:ie.postMediaUrl,type:"image"});const pe=Xn(ye);return pe?s.jsx(Zi,{src:pe.url,alt:ie.postTitle,type:pe.type,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",controls:!1}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:s.jsx("span",{className:"text-xs",children:"📝"})})})(),s.jsx("div",{className:"absolute top-1 right-1",children:s.jsx("div",{className:"bg-white/90 backdrop-blur-sm rounded-full p-1",children:s.jsx(cr,{platform:W2(ie.postPlatform),size:12})})}),(()=>{let ye=null;ie.postMediaUrl&&ie.postMediaUrl.trim()!==""&&(ye={url:ie.postMediaUrl,type:"image"});const pe=Xn(ye);return pe&&s.jsx("div",{className:"absolute bottom-1 right-1 bg-white text-gray-800 text-xs px-1 py-0.5 rounded-full flex items-center shadow-sm border border-gray-200",children:s.jsx("span",{className:"text-[10px]",children:pe.type==="video"?"🎬":"🖼️"})})})(),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:s.jsx("p",{className:"text-white text-xs font-medium truncate",children:ie.postContent})})]}),le&&s.jsx("div",{className:"mt-2",children:s.jsx(KH,{media:ie.postMediaUrl&&ie.postMediaUrl.trim()!==""?{url:ie.postMediaUrl,type:"image"}:null,postId:ie.postId})})]},ie.postId))}):s.jsx("div",{className:"mb-3 text-xs text-gray-500 italic",children:R("posts.noPosts","Aucun post pour ce persona")}),P&&s.jsx("div",{ref:ue,className:"fixed pointer-events-none z-50",style:{left:q().x,top:q().y},children:s.jsx(db,{post:Y(P)})})]})]}),s.jsx("hr",{className:"my-4 border-t border-gray-200"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:R("personas.form.tabs.reasons","Reasons")}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:R("personas.form.goals")})]}),s.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:Q(u)})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🚀"}),s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:R("personas.form.motivations")})]}),s.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:Q(d)})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"😣"}),s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:R("personas.form.problems")})]}),s.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:Q(c)})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🔥"}),s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:R("personas.form.challenges")})]}),s.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:Q(f)})]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(da,{className:"w-4 h-4 text-gray-400"}),s.jsx("h4",{className:"text-sm font-medium text-gray-700",children:R("personas.form.contentFormat","Content Format")})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:(m||[]).map((ie,ye)=>{const pe=ce=>{switch(ce){case"Short/Reel":return"📱";case"Long/Classic":return"📺";case"Story/Ephemeral":return"⚡";case"Live/Stream":return"🎥";default:return"📄"}};return s.jsxs("span",{className:"px-2 py-1 bg-green-50 text-green-700 rounded-lg text-xs flex items-center gap-1",children:[s.jsx("span",{children:pe(ie)}),ie]},ye)})})]}),(x||j||C)&&s.jsxs("div",{className:"border-t border-gray-200 pt-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:R("personas.form.tabs.behavior","Behavior")}),x&&s.jsx("div",{className:"mb-2",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-lg",children:"🛒"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-xs font-medium text-gray-600",children:R("personas.form.buyingBehavior")}),s.jsx("p",{className:"text-sm text-gray-700 line-clamp-2",children:x})]})]})}),j&&s.jsx("div",{children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-lg",children:"🏷️"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-xs font-medium text-gray-600",children:R("personas.form.brandAffinity")}),s.jsx("p",{className:"text-sm text-gray-700 line-clamp-2",children:j})]})]})})]})]}),s.jsx(np,{isOpen:te,onClose:()=>ne(!1),onCreateWithAI:we,onCreateManually:he})]})},AZe=[{id:"Short/Reel",emoji:"📱",description:"Quick, engaging content under 60 seconds"},{id:"Long/Classic",emoji:"📺",description:"In-depth content over 1 minute"}
3882,{id:"Story/Ephemeral",emoji:"⚡",description:"24-hour temporary content"},{id:"Live/Stream",emoji:"🎥",description:"Real-time interactive content"}],PZe=({selectedFormats:e,onFormatChange:t})=>{const r=n=>{const a=e.includes(n)?e.filter(i=>i!==n):[...e,n];t(a)};return s.jsx("div",{className:"grid grid-cols-1 gap-3",children:AZe.map(n=>s.jsxs("button",{onClick:()=>r(n.id),className:`flex items-center gap-3 p-3 rounded-lg border text-sm transition-colors ${e.includes(n.id)?"border-primary-600 bg-primary-50 text-primary-700":"border-gray-200 hover:border-primary-600"}`,children:[s.jsx("span",{className:"text-xl",children:n.emoji}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-medium",children:n.id}),s.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.id))})},_Ze=()=>{const e=[{id:17,label:"<18",emoji:"👶"}];for(let t=19;t<=64;t++)e.push({id:t,label:t.toString(),emoji:t<30?"👨‍💼":t<45?"👨‍💻":t<55?"👨‍🏫":"👨‍🦳"});return e.push({id:65,label:"65+",emoji:"👴"}),e},Cv=_Ze(),LZe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),[i,o]=b.useState(""),l=b.useRef(null),c=b.useRef(null),u=Cv.find(f=>f.id===e)||Cv[1],d=i?Cv.filter(f=>f.label.toLowerCase().includes(i.toLowerCase())):Cv;return b.useEffect(()=>{const f=m=>{c.current&&!c.current.contains(m.target)&&a(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),b.useEffect(()=>{n&&l.current&&l.current.focus()},[n]),s.jsxs("div",{className:"relative",ref:c,children:[s.jsxs("button",{onClick:()=>a(!n),className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left text-sm h-10 ${r}`,type:"button",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:u.emoji}),s.jsx("span",{className:"text-gray-700 text-sm",children:u.label})]}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20 max-h-60 overflow-auto",children:[s.jsx("div",{className:"p-2 border-b border-gray-100",children:s.jsxs("div",{className:"relative",children:[s.jsx($i,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{ref:l,type:"text",placeholder:"Search age...",value:i,onChange:f=>o(f.target.value),className:"w-full pl-8 pr-2 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500"})]})}),s.jsx("div",{className:"py-1",children:d.map(f=>s.jsx("button",{onClick:()=>{t(f.id),a(!1),o("")},className:`w-full text-left px-4 py-2 ${f.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600 hover:bg-gray-50"}`,type:"button",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:f.emoji}),s.jsx("div",{className:"font-medium",children:f.label})]})},f.id))})]})]})},kv=({error:e,className:t="",...r})=>s.jsxs("div",{children:[s.jsx("input",{className:`w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent ${e?"border-red-500":""} ${t}`,...r}),e&&s.jsx("p",{className:"mt-1 text-xs text-red-500",children:e})]}),DZe="https://api.socialness.ai",Kf=(...e)=>{},JH=e=>e?e.includes("media.socialness.ai")||e.includes("storage.socialness.ai")||e.includes("cdn.socialness.ai"):!1,Z5=e=>e?!JH(e):!1,OZe=async(e,t,r="")=>{var n,a,i;try{if(!e)throw new Error("No URL provided");if(JH(e))return Kf("URL is already from Socialness media, skipping upload:",e),e;Kf("Processing external image URL:",e);const o=await((n=Qe.currentUser)==null?void 0:n.getIdToken());if(!o)throw new Error("No authentication token available");const l=`${DZe}/storage/external-url`;Kf(`Making request to ${l}`);const c=await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"},body:JSON.stringify({url:e,brandId:r||void 0})});if(!c.ok)throw new Error(`Failed to process external URL: ${c.status} ${c.statusText}`);const u=await c.json();
3882Kf("API response:",u);const d=u.publicUrl||u.url||((a=u.data)==null?void 0:a.publicUrl)||((i=u.data)==null?void 0:i.url);if(!d)throw Kf("No URL found in API response:",u),new Error("No URL in response from external URL processing endpoint");return Kf("External URL successfully processed to:",d),d}catch(o){throw o}},RZe=({imageFile:e,onImageFileChange:t,existingImageUrl:r,isUploading:n=!1,size:a="md",alt:i="Profile image"})=>{const{t:o}=Te(),[l,c]=b.useState(!1),u={sm:"w-16 h-16",md:"w-24 h-24 md:w-32 md:h-32",lg:"w-36 h-36 md:w-48 md:h-48"},d={sm:"w-6 h-6",md:"w-10 h-10 md:w-12 md:h-12",lg:"w-12 h-12 md:w-16 md:h-16"},f=v=>{v.preventDefault(),v.stopPropagation(),v.type==="dragenter"||v.type==="dragover"?c(!0):v.type==="dragleave"&&c(!1)},m=v=>{if(v.preventDefault(),v.stopPropagation(),c(!1),v.dataTransfer.files&&v.dataTransfer.files[0]){const x=v.dataTransfer.files[0];p(x)}},h=v=>{if(v.target.files&&v.target.files[0]){const x=v.target.files[0];p(x)}},p=v=>{if(!v.type.startsWith("image/")){alert(o("common.errors.invalidImageType","Please upload an image file"));return}if(v.size>5*1024*1024){alert(o("common.errors.imageTooLarge","Image size should be less than 5MB"));return}t(v)},g=()=>{t(null)},y=`image-profile-upload-${Math.random().toString(36).substring(2,9)}`;return s.jsxs("div",{className:"flex-shrink-0",children:[s.jsx("div",{className:`${u[a]} flex-shrink-0`,children:s.jsxs("div",{className:`w-full h-full rounded-lg border-2 ${l?"border-primary-500 bg-primary-50":e||r?"border-gray-300":"border-dashed border-gray-300"} flex items-center justify-center bg-gray-50 overflow-hidden relative`,onDragEnter:f,onDragLeave:f,onDragOver:f,onDrop:m,children:[e?s.jsx("img",{src:URL.createObjectURL(e),alt:`${i} Preview`,className:"w-full h-full object-cover"}):r?s.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover"}):s.jsx(Fi,{className:`${d[a]} text-gray-400`}),s.jsx("input",{type:"file",id:y,accept:"image/*",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:h,disabled:n}),(e||r)&&s.jsx("div",{className:"absolute top-1 right-1 flex gap-1",children:s.jsx("button",{onClick:v=>{v.preventDefault(),v.stopPropagation(),g()},className:"p-1 bg-white rounded-md shadow-sm hover:bg-gray-50 text-gray-600",disabled:n,children:s.jsx(_t,{className:"w-3 h-3"})})})]})}),s.jsx("label",{htmlFor:y,className:"mt-2 flex justify-center text-xs text-primary-600 hover:text-primary-500 cursor-pointer",children:n?s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"animate-spin h-3 w-3 mr-2 border-2 border-primary-500 border-t-transparent rounded-full"}),o("common.uploading","Uploading...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Zy,{className:"w-3 h-3 mr-1"}),e||r?o("common.changeImage","Change Image"):o("common.uploadImage","Upload Image")]})})]})},$Ze={name:"",jobTitle:"",bio:"",tags:[],age:28,languages:["en"],socialNetworks:[],problems:"",goals:"",motivations:"",challenges:"",formatLength:[],brandIds:[],location:"",income:"",education:"",relationship:"",quote:"",buying_behavior:"",brand_affinity:""},FZe=({initialData:e,onSubmit:t,onCancel:r})=>{var E,F;const{t:n}=Te(),[a,i]=ui(),o=a.get("tab")||"profile",[l,c]=b.useState(o),[u,d]=b.useState(!1),[f,m]=b.useState({...$Ze,...e,languages:e!=null&&e.languages&&e.languages.length>0?e.languages:["en"],socialNetworks:((E=e==null?void 0:e.socialNetworks)==null?void 0:E.filter($=>$&&$.platform))||[]}),h=!!(e!=null&&e.id),[p,g]=b.useState(!1),[y,v]=b.useState(null),[x,j]=b.useState(""),[C,N]=b.useState(!1),[S,M]=b.useState(""),{data:k,isLoading:I}=oa(),T=k?k.brands||[]:[],L=Wj(),R=[{message:n("personas.saving.steps.validating","Validating persona data..."),duration:2e3},{message:n("personas.saving.steps.processing","Processing persona data..."),duration:2e3},{message:n("personas.saving.steps.saving","Saving persona to database..."),duration:2e3},{message:n("personas.saving.steps.finalizing","Finalizing your persona..."),duration:2e3}];b.useEffect(()=>{if(C){M(R[0].message);const $=setInterval(()=>{M(H=>{const ue=(R.findIndex(le=>le.message===H)+1)%R.length;return R[ue].message})},2e3);return()=>clearInterval($)}},[C]),b.useEffect(()=>{window.scrollTo(0,0)},[]),b.useEffect(()=>{if((a.get("tab")||"profile")!==l){const H=new URLSearchParams(a);H.set("tab",l),i(H,{replace:!0})}},[l]),b.useEffect(()=>{const $=a.get("tab")||"profile";$!==l&&c($)},[a]);const _=($,H)=>{m(X=>({...X,[$]:H}))},B=($,H)=>{_("socialNetworks",[...f.socialNetworks,{platform:$,frequency:H,pertinence:"Primary"}])},z=$=>{_("socialNetworks",f.socialNetworks.filter(H=>H.platform!==$))},D=$=>{if($.key==="Enter"&&x.trim()){$.preventDefault();const H=x.trim();f.tags.includes(H)||_("tags",[...f.tags,H]),j("")}},A=[{id:"profile",label:n("personas.form.tabs.profile","Profile"),icon:s.jsx(Fi,{className:"w-4 h-4"})},{id:"reasons",label:n("personas.form.tabs.reasons","Reasons"),icon:s.jsx(jf,{className:"w-4 h-4"})},{id:"behavior",label:n("personas.form.tabs.behavior","Behavior"),icon:s.jsx(Qme,{className:"w-4 h-4"})}],P=async()=>{var $;N(!0),M(n("personas.saving.steps.validating","Validating persona data..."));try{const H={...f},X=(($=f.brandIds)==null?void 0:$[0])||"";if(H.avatarUrl&&Z5(H.avatarUrl))try{M(n("personas.saving.steps.processingAvatar","Processing external image...")),console.log("External avatar URL detected, processing before submission:",H.avatarUrl);const ne=await OZe(H.avatarUrl,L,X);if(!ne||ne===H.avatarUrl){console.error("Failed to process external URL - server returned original URL"),alert(n("personas.form.errors.externalUrlProcessing","Could not process external image URL. Please try a different image.")),N(!1);return}console.log("Successfully processed external URL:",ne),H.avatarUrl=ne}catch(ne){console.error("Failed to process external avatar URL:",ne),alert(n("personas.form.errors.externalUrlProcessing","Could not process external image URL. Please try a different image.")),N(!1);return}if(y)try{M(n("personas.saving.steps.uploadingAvatar","Uploading avatar image...")),console.log("Uploading image file:",y.name),g(!0);const ne=await QH(y,X);if(!ne)throw new Error("Upload succeeded but no URL was returned");H.avatarUrl=ne,console.log("Image uploaded successfully, URL:",ne)}catch(ne){console.error("Image upload failed during form submission:",ne),alert(n("personas.form.errors.uploadFailed","Failed to upload image. Please try again.")),N(!1);return}finally{g(!1)}if(H.avatarUrl&&Z5(H.avatarUrl)){console.error("External URL was not properly processed:",H.avatarUrl),alert(n("personas.form.errors.externalUrlNotProcessed","External image URL could not be processed. Please try a different image.")),N(!1);return}M(n("personas.saving.steps.processing","Processing persona data..."));const ue=ne=>Array.isArray(ne)?ne.map(J=>
3882J.trim()).filter(Boolean):typeof ne=="string"&&ne?ne.split(`
3883`).map(J=>J.trim()).filter(Boolean):[];H.problems=ue(H.problems),H.goals=ue(H.goals),H.motivations=ue(H.motivations),H.challenges=ue(H.challenges),Array.isArray(H.brandIds)&&H.brandIds.length>0&&(H.brandId=H.brandIds[0]),H.avatarUrl&&(H.avatarURL=H.avatarUrl),H.buying_behavior=H.buying_behavior||"",H.brand_affinity=H.brand_affinity||"",H.quote=H.quote||"",M(n("personas.saving.steps.saving","Saving persona to database...")),console.log("Submitting persona with data:",{...H,avatarUrl:H.avatarUrl?"[Image URL - Redacted]":null});const le=Date.now(),ae=3e3;await t(H);const te=Date.now()-le;te<ae&&(M(n("personas.saving.steps.finalizing","Finalizing your persona...")),await new Promise(ne=>setTimeout(ne,ae-te)))}catch(H){console.error("Error saving persona:",H),alert(n("personas.form.errors.saveFailed","Failed to save persona. Please try again."))}finally{N(!1)}};return s.jsxs("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:[C&&s.jsx(Wu,{title:h?n("personas.saving.updating","Updating your persona"):n("personas.saving.creating","Creating your new persona"),currentStep:S,videoSrc:"/Panda Socialness.ai - Casting a spell.mov"}),s.jsx("div",{className:"w-[95%] max-w-7xl mx-auto",children:s.jsxs("div",{className:"py-4 md:py-8",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("button",{onClick:r,className:"p-2 rounded-lg hover:text-primary-600 transition-colors",children:s.jsx(lh,{className:"w-5 h-5 md:w-6 md:h-6"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl md:text-3xl font-semibold text-gray-900 font-title",children:h?f.name:n("personas.form.createTitle","Create Persona")}),s.jsx("p",{className:"text-xs md:text-sm text-gray-500",children:h?n("personas.form.editSubtitle","Edit your persona details"):n("personas.form.createSubtitle","Create a new target audience persona")})]})]}),s.jsxs("button",{onClick:P,className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors text-sm md:text-base",children:[s.jsx(il,{className:"w-4 h-4 md:w-5 md:h-5 mr-2"}),h?n("common.save"):n("personas.form.create","Create Persona")]})]}),s.jsx("div",{className:"mb-6",children:s.jsx(bH,{tabs:A,activeTab:l,onTabChange:c})}),l==="profile"?s.jsxs("div",{className:"space-y-4 md:space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.keyInfo","Key Information")}),s.jsxs("div",{className:"space-y-4 md:space-y-6",children:[s.jsxs("div",{className:"flex items-start gap-4 md:gap-6 mb-4",children:[s.jsx(RZe,{imageFile:y,onImageFileChange:v,existingImageUrl:f.avatarUrl,isUploading:p,size:"md",alt:f.name||"Persona"}),s.jsxs("div",{className:"flex-1 space-y-3 md:space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.name")}),s.jsx("input",{type:"text",value:f.name,onChange:$=>_("name",$.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm",placeholder:"John Doe"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.age")}),s.jsx(LZe,{value:f.age,onChange:$=>_("age",$)})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.jobTitle")}),s.jsx("input",{type:"text",value:f.jobTitle,onChange:$=>_("jobTitle",$.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm",placeholder:"Marketing Manager @ Company"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.location")}),s.jsx(kv,{value:f.location,onChange:$=>_("location",$.target.value),placeholder:"Enter location"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.brandAssociation","Brand Association")}),s.jsx(hl,{brands:T,selectedBrandId:((F=f.brandIds)==null?void 0:F[0])||"",onBrandSelect:$=>_("brandIds",[$]),isLoading:I,showRedirectionCard:!1})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.languages")}),s.jsx(pH,{languages:f.languages,onLanguagesChange:$=>_("languages",$)})]})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.format","Format")}),s.jsx("div",{className:"space-y-4 md:space-y-6",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-2",children:n("personas.form.formatLength")}),s.jsx(PZe,{selectedFormats:f.formatLength,onFormatChange:$=>_("formatLength",$)})]})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.communication","Communication")}),s.jsx("div",{className:"space-y-4 md:space-y-6",children:s.jsx("div",{children:s.jsx(oA,{networks:f.socialNetworks,onAddNetwork:()=>d(!0),onDeleteNetwork:z,isPersonaForm:!0})})})]}),s.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.story","Persona's Story")}),s.jsxs("div",{className:"space-y-4 md:space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.bio")}),s.jsx("textarea",{value:f.bio,onChange:$=>_("bio",$.target.value),rows:4,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"})]}),s.jsxs("div",{className:"flex flex-col md:flex-row md:gap-6 space-y-4 md:space-y-0",children:[s.jsxs("div",{className:"md:w-2/12",children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.income")}),s.jsx(kv,{value:f.income,onChange:$=>_("income",$.target.value),placeholder:"Enter income"})]}),s.jsxs("div",{className:"md:w-4/12",children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.relationship")}),s.jsx(kv,{value:f.relationship,onChange:$=>_("relationship",$.target.value),placeholder:"Enter relationship status"})]}),s.jsxs("div",{className:"md:w-6/12",children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.education")}),s.jsx(kv,{value:f.education,onChange:$=>_("education",$.target.value),placeholder:"Enter education"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700 mb-1",children:n("personas.form.tags")}),s.jsx(Ud,{tags:f.tags,onTagsChange:$=>_("tags",$),placeholder:n("personas.form.tagsPlaceholder"),inputValue:x,onInputChange:j,onInputKeyDown:D})]})]})]})]})]}):l==="reasons"?s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.problemsChallenges","Problems & Challenges")}),s.jsxs("div",{className:"space-y-4 md:space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"😣"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.problems")})]}),s.jsx("textarea",{value:Array.isArray(f.problems)?f.problems.join(`
3884`):f.problems||"",onChange:$=>{_("problems",$.target.value)},rows:5,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🔥"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.challenges")})]}),s.jsx("textarea",{value:Array.isArray(f.challenges)?f.challenges.join(`
3885`):f.challenges||"",onChange:$=>{_("challenges",$.target.value)},rows:5,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"})]})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.cardTitles.goalsMotivations","Goals & Motivations")}),s.jsxs("div",{className:"space-y-4 md:space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🎯"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.goals")})]}),s.jsx("textarea",{value:Array.isArray(f.goals)?f.goals.join(`
3886`):f.goals||"",onChange:$=>{_("goals",$.target.value)},rows:5,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🚀"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.motivations")})]}),s.jsx("textarea",{value:Array.isArray(f.motivations)?f.motivations.join(`
3887`):f.motivations||"",onChange:$=>{_("motivations",$.target.value)},rows:5,className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"})]})]})]})]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.quote","Quote")}),s.jsx("div",{className:"space-y-4 md:space-y-6",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"💬"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.quote","Persona Quote")})]}),s.jsx("textarea",{value:f.quote||"",onChange:$=>_("quote",$.target.value),rows:6,placeholder:n("personas.form.quoteDescription"),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:n("personas.form.quoteDescription")})]})})]}),s.jsxs("div",{className:"lg:col-span-2 space-y-4 md:space-y-6",children:[s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.buyingBehavior","Buying Behavior")}),s.jsx("div",{className:"space-y-4 md:space-y-6",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"🛒"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.buyingBehaviorLabel")})]}),s.jsx("textarea",{value:f.buying_behavior||"",onChange:$=>_("buying_behavior",$.target.value),rows:4,placeholder:n("personas.form.buyingBehaviorPlaceholder"),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:n("personas.form.buyingBehaviorDescription")})]})})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 md:p-6",children:[s.jsx("h2",{className:"text-lg md:text-xl font-semibold mb-4 md:mb-6",children:n("personas.form.brandAffinity","Brand Affinity")}),s.jsx("div",{className:"space-y-4 md:space-y-6",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"text-lg",children:"❤️"}),s.jsx("label",{className:"block text-xs md:text-sm font-medium text-gray-700",children:n("personas.form.brandAffinity","Brand Relationships")})]}),s.jsx("textarea",{value:f.brand_affinity||"",onChange:$=>_("brand_affinity",$.target.value),rows:4,placeholder:n("personas.form.brandAffinityPlaceholder"),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:n("personas.form.brandAffinityDescription")})]})})]})]})]})]})}),s.jsx(yH,{isOpen:u,onClose:()=>d(!1),onAdd:B,existingPlatforms:f.socialNetworks.filter($=>$&&$.platform).map($=>$.platform.toLowerCase())})]})},zZe=({isOpen:e,onClose:t,onBrandSelect:r})=>{const{t:n}=Te(),{data:a,isLoading:i,isError:o}=oa(),[l,c]=b.useState({}),u=a?a.brands||[]:[],d=f=>{c(m=>({...m,[f]:!0}
3887))};return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-2xl w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold",children:n("personas.selectBrand","Select a Brand")}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),i?s.jsxs("div",{className:"flex items-center justify-center py-12",children:[s.jsx(Rn,{className:"w-8 h-8 text-indigo-600 animate-spin"}),s.jsx("span",{className:"ml-2 text-gray-600",children:n("common.loading")})]}):o?s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4",children:[s.jsx("h3",{className:"text-red-800 font-medium",children:n("common.error")}),s.jsx("p",{className:"text-red-600 text-sm mt-1",children:n("personas.errors.brandsFetchFailed","Failed to fetch brands. Please try again.")})]}):u.length===0?s.jsx("div",{className:"text-center py-8",children:s.jsx("p",{className:"text-gray-500",children:n("personas.noBrands","No brands available. Please create a brand first.")})}):s.jsx("div",{className:"grid grid-cols-3 gap-4 max-h-[60vh] overflow-y-auto p-1",children:u.map(f=>s.jsxs("button",{onClick:()=>r(f.id),className:"flex flex-col items-center justify-center gap-3 p-4 rounded-lg border border-black hover:border-primary-600 hover:bg-primary-50 transition-colors h-full",children:[f.logo&&!l[f.id]?s.jsx("img",{src:f.logo,alt:f.name,className:"w-16 h-16 rounded-lg object-cover",onError:()=>d(f.id)}):s.jsx("div",{className:"w-16 h-16 rounded-lg bg-gray-100 flex items-center justify-center",children:s.jsx("span",{className:"text-gray-400 text-xl font-bold",children:f.name.charAt(0)})}),s.jsx("div",{className:"text-center",children:s.jsx("h3",{className:"font-medium text-gray-900",children:f.name})})]},f.id))}),u.length>0&&s.jsx("div",{className:"mt-6 text-center text-sm text-gray-500",children:n("personas.brandSelectorHelp","Select a brand to create a persona for")})]})]})}):null},BZe=({isOpen:e,onClose:t,brandId:r,errorData:n})=>{const{t:a}=Te();if(!e)return null;const i=(n==null?void 0:n.requiredFields)||{},o=Object.entries(i);return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(qs,{className:"w-5 h-5"}),s.jsx("h2",{className:"text-xl font-semibold",children:a("personas.errors.brandSetupIncompleteTitle","Configuration de marque incomplète")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-700",children:a("personas.errors.brandSetupIncompleteMessage","Les champs suivants sont manquants dans votre marque. Veuillez les compléter pour pouvoir générer des personas pertinents :")}),o.length>0&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[s.jsx("h4",{className:"text-sm font-medium text-red-800 mb-2",children:a("personas.errors.missingFields","Champs manquants :")}),s.jsx("ul",{className:"list-disc list-inside space-y-1",children:o.map(([l,c])=>s.jsxs("li",{className:"text-sm text-red-700",children:[s.jsx("span",{className:"font-medium",children:X5(l,a)}),c&&c!==X5(l,a)&&s.jsxs("span",{className:"text-red-600 ml-1",children:["- ",c]})]},l))})]}),s.jsx("p",{className:"text-sm text-gray-600",children:a("personas.errors.brandSetupInstructions",'Rendez-vous dans la section "Stratég
3887ie de marque" pour compléter ces informations.')})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:a("common.close","Fermer")}),s.jsx("button",{onClick:()=>{r?window.location.href=`/brand-strategy-lab/${r}/edit`:window.location.href="/brand-strategy-lab"},className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700",children:a("personas.errors.goToBrandSetup","Aller à la configuration")})]})]})]})})};function X5(e,t){return{"brandIdentity.name":t("brands.form.name","Nom de la marque"),"brandIdentity.industry":t("brands.form.industry","Secteur d'activité"),"goToMarketStrategy.marketScope":t("brands.form.marketScope","Portée du marché"),"goToMarketStrategy.targetMarkets":t("brands.form.targetMarkets","Marchés cibles"),"goToMarketStrategy.businessModel":t("brands.form.businessModel","Modèle économique"),"goToMarketStrategy.distributionType":t("brands.form.distributionType","Type de distribution"),"goToMarketStrategy.targetSegments":t("brands.form.targetSegments","Segments cibles"),"goToMarketStrategy.keyPersonaTypes":t("brands.form.keyPersonaTypes","Types de personas clés")}[e]||e.split(".").pop()||e}const UZe=()=>{const e=qr();return mn({mutationFn:t=>$Je(t),onSuccess:()=>{e.invalidateQueries({queryKey:["personas"]})}})},VZe=()=>{const e=qr();return mn({mutationFn:t=>FJe(t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["personas"]}),e.invalidateQueries({queryKey:["persona",r.id]})}})},WZe=()=>{const e=qr();return mn({mutationFn:t=>zJe(t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["personas"]}),e.removeQueries({queryKey:["persona",r]})}})},e$="https://api.socialness.ai",Kn=(...e)=>{},GS=e=>{if(!e)return"en";const t=e.substring(0,2).toLowerCase();return t.length===2&&/^[a-z]{2}$/.test(t)?t:"en"},t$=e=>{var t;if(e instanceof TypeError&&e.message==="Load failed")return"Network connection failed. Please check your internet connection and try again.";if(e.status)switch(e.status){case 400:return(t=e.errorData)!=null&&t.message?`Invalid request: ${e.errorData.message}`:"The request contains invalid data. Please try again or contact support if the problem persists.";case 401:return"Your session has expired. Please log out and log back in to continue.";case 403:return"You do not have permission to generate personas. Please contact support.";case 404:return"The persona generation service is currently unavailable. Please try again later.";case 429:return"Too many requests. Please wait a moment before trying again.";case 500:return"A server error occurred. Our team has been notified. Please try again later.";case 503:return"The service is temporarily unavailable. Please try again in a few minutes.";default:return e.message||"An unexpected error occurred. Please try again."}return e.message?e.message:"An unexpected error occurred. Please try again."},qZe=()=>{const[e,t]=b.useState(!1),[r,n]=b.useState(null);return{mutate:async(i,o)=>{const l=async(c=1)=>{var v,x,j,C,N;const u=await((v=Qe.currentUser)==null?void 0:v.getIdToken(!0));if(!u)throw new Error("No authentication token available");Kn("🔍 Persona Generation - Firebase token length:",u.length),Kn("🔍 Persona Generation - Firebase token starts with:",u.substring(0,50)+"..."),Kn("🔍 Persona Generation - Firebase token ends with:","..."+u.substring(u.length-50)),Kn("🔍 Persona Generation - Firebase user:",(x=Qe.currentUser)==null?void 0:x.uid),Kn("🔍 Persona Generation - Firebase user email:",(j=Qe.currentUser)==null?void 0:j.email);const{brandId:d,language:f}=i;if(!d)throw new Error("Brand ID is required for persona generation");if(typeof d!="string")throw new Error(`Brand ID must be a string, received: ${typeof d}`);if(d.trim().length===0)throw new Error("Brand ID cannot be empty");if(!f)throw new Error("Language is required for persona generation");if(c===1)try{Kn("🔥 Performing warm-up request to prepare server...");const S=`${e$}/management/personas?brandId=${d}&withAnalysis=false&appLanguage=en`,M=await fetch(S,{method:"GET",headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"}});Kn("🔥 Warm-up response status:",M.status),M.ok?Kn("✅ Warm-up successful"):Kn("⚠️ Warm-up failed but continuing..."),await new Promise(k=>setTimeout(k,500))}catch{}const m=Date.now(),h=`${e$}/ai-coach/personas/generate?timestamp=${m}`,p={brandId:d,language:GS(f)};Kn("🔍 Persona Generation - Request body:",JSON.stringify(p)),Kn("🔍 Persona Generation - Language:",GS(f));const g=await fetch(h,{method:"POST",headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"},body:JSON.stringify(p)});if(Kn("🔍 Persona Generation - Response status:",g.status),Kn("🔍 Persona Generation - Response headers:",Object.fromEntries([...g.headers.entries()])),!g.ok){const S=await g.text();Kn(`🚨 Persona Generation API error (${g.status}):`,S);let M=null;try{M=JSON.parse(S),Kn("🚨 Parsed error data:",M)}catch{}if(g.status===400&&(Kn("   - Request Body:",JSON.stringify(p)),Kn("   - Language:",GS(f)),Kn("   - User ID:",(C=Qe.currentUser)==null?void 0:C.uid),Kn("   - User Email:",(N=Qe.currentUser)==null?void 0:N.email)),g.status===404&&c<3)return await new Promise(I=>setTimeout(I,1e3*c)),l(c+1);const k=new Error(`Failed to generate persona: ${g.status}`);throw k.status=g.status,k.errorData=M,k.errorText=S,k.message=t$(k),k}return await g.json()};try{t(!0),n(null);const c=await l();return o!=null&&o.onSuccess&&o.onSuccess(c),c}catch(c){c instanceof TypeError&&c.message,c.status&&(Kn("   - Status:",c.status),Kn("   - Error Data:",c.errorData),Kn("   - Error Text:",c.errorText),Kn("   - Original Message:",c.message));const u=new Error(t$(c));if(u.originalError=c,u.status=c.status,u.errorData=c.errorData,n(u),o!=null&&o.onError)try{o.onError(u)}catch{}throw u}finally{t(!1)}},isLoading:e,error:r}},r$=e=>{if(!e)return"en";const t=e.substring(0,2).toLowerCase();return t.length===2&&/^[a-z]{2}$/.test(t)?t:"en"},GZe=()=>{const{t:e}=Te(),[t,r]=b.useState(""),[n,a]=b.useState(0),i=e("personas.loading.aiGeneration","AI is working its magic..."),o=[{message:e("personas.loading.steps.analyzing","Analyzing your personas data..."),duration:2e3},{message:e("personas.loading.steps.processing","Processing demographic insights..."),duration:2e3},{message:e("personas.loading.steps.generating","Generating AI recommendations..."),duration:2e3},{message:e("personas.loading.steps.preparing","Preparing persona profiles..."),duration:2e3}];return b.useEffect(()=>{r(o[0].message);const l=setInterval(()=>{a(c=>{const u=(c+1)%o.length;return r(o[u].message),u})},2e3);return()=>clearInterval(l)},[]),s.jsxs(s.Fragment,{children:[s.jsx(Wu,{title:i,currentStep:t,videoSrc:"/Panda Socialness.ai - Casting a spell.mov"}),s.jsx(ZH,{})]})},ZH=()=>s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"mb-8",children:s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white overflow-hidden h-full animate-pulse",children:[s.jsx("div",{className:"p-6 border-b border-gray-200 bg-gray-100",children:s.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/3"})}),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-full mb-2"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-5/6"})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[s.jsxs("div",{className:"flex-1 border-2 border-gray-100 rounded-lg p-4",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/3 mb-3"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-full mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-4/5 mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-full"})]}),s.jsxs("div",{className:"flex-1 border-2 border-gray-100 rounded-lg p-4",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/3 mb-3"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-full mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-4/5 mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-2 bg-gray-200 rounded w-full"})]})]})]})})]})}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 pb-8",children:Array(4).fill(0).map((e,t)=>s.jsxs("div",{className:"rounded-xl border border-black shadow-lg bg-white p-6 animate-pulse",children:[s.jsxs("div",{className:"flex items-start mb-4",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-200 rounded-full mr-4"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"h-5 bg-gray-200 rounded w-1/3 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-4"}),s.jsx("div",{className:"flex gap-2 mb-3",children:Array(3).fill(0).map((r,n)=>s.jsx("div",{className:"h-6 bg-gray-200 rounded px-3 py-1"},`skeleton-tag-${t}-${n}`))})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-full"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-5/6"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-4/5"})]})]},`persona-skeleton-${t}`))})]}),HS=()=>{var ct;const{t:e,i18n:t}=Te(),{showToast:r}=bc(),n=pn(),a=vs(),{personaId:i}=U4(),[o,l]=b.useState(""),[c,u]=b.useState(!1),[d,f]=b.useState(null),[m,h]=hb("modal",""),p=m==="create",g=m==="upgrade",[y,v]=b.useState(!1),[x,j]=b.useState(!1),[C,N]=b.useState("all"),[S,M]=b.useState(null),[k,I]=b.useState(!1),[T,L]=b.useState(!1),[R,_]=b.useState(!1),[B,z]=b.useState(!1),[D,A]=b.useState(null),[P,E]=b.useState(!1),[F,$]=b.useState(!1),[H,X]=b.useState({isOpen:!1}),{data:ue}=oa(),le=ue?ue.brands||[]:[],{currentBrandId:ae}=yhe(),te=le.map(oe=>({id:oe.id,name:oe.name,logo:oe.logo})),ne={id:"all",name:"All Brands",logo:"/logo.svg"};b.useEffect(()=>{Ie.info("Personas",`Current brand ID: ${ae}`),Ie.info("Personas",`Available brands count: ${(le==null?void 0:le.length)||0}`),Ie.info("Personas",`Selected brand for filter: ${C}`)},[ae,le,C]);const{data:J,isLoading:G,isError:Q,error:W,refetch:Y}=Vj(void 0,!1,B),q=UZe(),Z=VZe(),me=WZe(),we=qZe(),{data:he}=BJe(i,!1);Wj();const ie=b.useMemo(()=>J?J.personas||[]:[],[J]),ye=((ct=J==null?void 0:J.pagination)==null?void 0:ct.total)??ie.length,pe=(J==null?void 0:J.personaLimits)??(J==null?void 0:J.personasLimit)??void 0;b.useEffect(()=>{},[G,Q,W,J,ie]),b.useEffect(()=>{const oe=a.state;if(oe){const{selectedBrandId:Ne,createWithAI:Ae,createManually:lt,editPersonaId:Mt,returnToBrands:jt}=oe;Ne&&N(Ne),jt&&E(!0),Mt?n(`/ai-personas-builder/${Mt}/edit`,{replace:!0}):Ae?Ne?qe(Ne):h("create"):lt&&n("/ai-personas-builder/new",{replace:!0}),n(a.pathname,{replace:!0})}},[a.state,ie]),b.useEffect(()=>{a.pathname.endsWith("/ai-personas-builder/new")&&(f(null),u(!0))},[a.pathname]),b.useEffect(()=>{if(i){const oe=ie.find(Ne=>Ne.id===i);oe&&(f(fe(oe)),u(!0))}},[i,ie]),b.useEffect(()=>
3887{i&&(he!=null&&he.persona)&&(f(fe(he.persona)),u(!0))},[i,he]);const ce=b.useMemo(()=>{if(!ie.length)return te;const oe=[...new Set(ie.map(Ne=>Ne.brandId))];return te.filter(Ne=>oe.includes(Ne.id))},[te,ie]),xe=J==null?void 0:J.globalAnalysis;Ie.info("Personas",`Total personas found: ${ie.length}`),xe&&Ie.info("Personas","Global analysis data loaded");let Ee=ie.length>0?`You have ${ie.length} persona${ie.length>1?"s":""} configured. Click "Analyze with AI" to get insights.`:"No personas created yet. Create your first persona to get started.";if(ie.length>0,ie.length>0,xe)Ee=xe.summary||Ee,xe.strengths&&Array.isArray(xe.strengths)&&xe.strengths.map((oe,Ne)=>`${Ne+1}. ${oe}`).join(`
3888`),xe.areasOfImprovement&&Array.isArray(xe.areasOfImprovement)&&xe.areasOfImprovement.map((oe,Ne)=>`${Ne+1}. ${oe}`).join(`
3889`);else if(ie.length>0&&ie[0].analysis){const oe=ie[0].analysis;Ie.info("Analysis data from first persona:",oe),Ee=oe.summary||`Analysis for ${ie.length} persona(s)`,oe.strengths&&(Array.isArray(oe.strengths)?oe.strengths.map((Ne,Ae)=>`${Ae+1}. ${Ne}`).join(`
3890`):`${oe.strengths}`),oe.weaknesses&&(Array.isArray(oe.weaknesses)?oe.weaknesses.map((Ne,Ae)=>`${Ae+1}. ${Ne}`).join(`
3891`):`${oe.weaknesses}`)}const Ye=ie.filter(oe=>{const Ne=o.toLowerCase(),Ae=!o||oe.name.toLowerCase().includes(Ne)||oe.jobTitle.toLowerCase().includes(Ne)||oe.tags.some(Mt=>Mt.toLowerCase().includes(Ne)),lt=C==="all"?!0:oe.brandId===C;return Ae&&lt}),fe=oe=>{let Ne=[];return oe.socialNetworks&&Array.isArray(oe.socialNetworks)&&(Ie.info("Personas","Raw socialNetworks from API:",oe.socialNetworks),Ne=oe.socialNetworks.map(Ae=>{if(typeof Ae=="object"&&Ae.platform)return Ie.info("Personas","SocialNetwork already object:",Ae),Ae;if(typeof Ae=="string")try{const lt=JSON.parse(Ae);return Ie.info("Personas","Parsed socialNetwork JSON:",lt),lt.platform?lt:null}catch(lt){return Ie.error("Personas","Error parsing socialNetwork JSON:",lt),null}return Ie.warn("Personas","Unknown socialNetwork format:",Ae),null}).filter(Ae=>Ae!==null),Ie.info("Personas","Final parsed socialNetworks:",Ne)),{id:oe.id,name:oe.name,jobTitle:oe.jobTitle,bio:oe.bio,tags:oe.tags||[],age:oe.age||28,ageRange:oe.ageRange,languages:oe.languages||[],socialNetworks:Ne,problems:oe.problems,goals:oe.goals,motivations:oe.motivations,challenges:oe.challenges,formatLength:oe.formatLength||[],avatarUrl:oe.avatarUrl,location:oe.location,income:oe.income,education:oe.education,relationship:oe.relationship,quote:oe.quote,buying_behavior:oe.buying_behavior,brand_affinity:oe.brand_affinity,brandIds:[oe.brandId]}},je=async oe=>{const Ne=oe.brandIds[0]||ae||"";if(Ie.info("Personas","Submitting persona data",{name:oe.name,brandId:Ne}),!oe.id||oe.id.startsWith("local-")){Ie.info("Personas","Creating new persona (detected local ID)");const{id:Ae,...lt}=oe,Mt={name:oe.name,brandId:Ne,jobTitle:oe.jobTitle||"",bio:oe.bio||"",tags:oe.tags||[],age:oe.age||25,languages:oe.languages||[],socialNetworks:oe.socialNetworks||[],ageRange:oe.ageRange||"25-34",problems:oe.problems||[],goals:oe.goals||[],motivations:oe.motivations||[],challenges:oe.challenges||[],formatLength:oe.formatLength||[],location:oe.location||"",income:oe.income||"",education:oe.education||"",relationship:oe.relationship||"",quote:oe.quote||"",buying_behavior:oe.buying_behavior||"",brand_affinity:oe.brand_affinity||""};oe.avatarUrl&&(Ie.info("Personas",`Avatar URL detected: ${oe.avatarUrl.length} characters`),Mt.avatarURL=oe.avatarUrl),I(!0);try{await q.mutateAsync(Mt),Ie.info("Personas","Successfully created persona");try{z(!1),A(null),await Y()}catch(jt){Ie.error("Personas","Error refetching personas after creation",jt)}u(!1),f(null),I(!1),a.pathname.startsWith("/ai-personas-builder/")&&n("/ai-personas-builder"),P&&n("/brand-strategy-lab")}catch(jt){Ie.error("Personas","Error creating persona",jt),jt.response&&Ie.error("Personas",`Error response status: ${jt.response.status}`),Ie.info("Personas","Trying with absolute minimal data");const Xe={name:oe.name,brandId:Ne,jobTitle:oe.jobTitle||"",bio:oe.bio||"",tags:[],age:25,languages:[],socialNetworks:[],ageRange:"25-34",problems:[],goals:[],motivations:[],challenges:[],formatLength:[]};Ie.info("Personas","Submitting minimal API data");try{await q.mutateAsync(Xe),Ie.info("Personas","Successfully created persona with minimal data");try{z(!1),A(null),await Y()}catch(Bt){Ie.error("Personas","Error refetching personas after minimal creation",Bt)}u(!1),f(null),I(!1),a.pathname.startsWith("/ai-personas-builder/")&&n("/ai-personas-builder"),P&&n("/brand-strategy-lab")}catch(Bt){Ie.error("Personas","Error creating persona with minimal data",Bt),alert(`Failed to create persona: ${jt}`),I(!1)}}}else{Ie.info("Personas","Updating existing persona"),L(!0);try{await Z.mutateAsync(oe),Ie.info("Personas","Successfully updated persona"),z(!1),A(null),await Y(),u(!1),f(null),L(!1),a.pathname.startsWith("/ai-personas-builder/")&&n("/ai-personas-builder"),P&&n("/brand-strategy-lab")}catch(Ae){Ie.error("Personas","Error updating persona",Ae),alert(`Failed to update persona: ${Ae}`),L(!1)}}},We=oe=>{M(oe)},yt=()=>{S&&(_(!0),me.mutate(S,{onSuccess:async()=>{try{z(!1),A(null),await Y(),M(null),_(!1)}catch(oe){Ie.error("Personas","Error refetching personas after deletion",oe),M(null),_(!1)}},onError:oe=>{Ie.error("Personas","Error deleting persona",oe),M(null),_(!1)}}))},gt=()=>{if(le.length===0){alert(e("personas.errors.noBrands","No brands available. Please create a brand first."));return}le.length===1?(Ie.info("Personas","Using single brand for persona generation"),qe(le[0].id)):(h(""),v(!0))}
3891,qe=async oe=>{if(Ie.debug("Personas","generatePersonaWithAI called",{brandId:oe,type:typeof oe,length:oe==null?void 0:oe.length}),!oe){alert(e("personas.errors.noBrandSelected","Please select a brand first"));return}console.log("🔍 generatePersonaWithAI called with brandId:",oe),console.log("🔍 brandId type:",typeof oe),console.log("🔍 brandId length:",oe==null?void 0:oe.length),Ie.info("Personas",`Generating persona for brand ID: ${oe}`),j(!0),v(!1);try{await we.mutate({brandId:oe,language:r$(t.language||"en")},{onSuccess:async Ne=>{try{Ie.info("Personas","Successfully generated persona");const Ae=Ne.persona;let lt=Ae.imageUrl;f({id:`local-${Date.now()}`,name:Ae.name||"",jobTitle:Ae.jobTitle||"",bio:Ae.bio||"",age:Ae.age||25,tags:Ae.tags||[],languages:Ae.language?[Ae.language]:[],socialNetworks:Ae.social_platforms?Ae.social_platforms.map(Mt=>({platform:Mt.platform,pertinence:"Primary",frequency:"daily"})):[],problems:Ae.problems||[],goals:Ae.goals||[],values:Ae.values||[],avatarUrl:lt,brandIds:[oe],location:Ae.location||"",income:Ae.income||"",education:Ae.education||"",relationship:Ae.relationship||"",challenges:Ae.challenges||[],motivations:Ae.motivations||[],quote:Ae.quote||"",buying_behavior:Ae.buying_behavior||"",brand_affinity:Ae.brand_affinity||"",formatLength:Ae.format||[]}),u(!0),j(!1)}catch(Ae){Ie.error("Personas","Error in onSuccess callback:",Ae),j(!1),r(e("personas.errors.generationFailed","Failed to generate persona. Please try again."),"error")}},onError:Ne=>{if(Ie.error("Personas","Error generating persona",JSON.stringify(Ne)),j(!1),Ne.status===400&&Ne.errorData){const Ae=Ne.errorData;if(Ae.code==="brand_validation_failed"&&Ae.requiredFields){X({isOpen:!0,brandId:oe,errorData:Ae});return}}if(Ne.message&&Ne.message.includes("400"))try{const Ae=Ne.message.match(/\{.*\}/);if(Ae){const lt=JSON.parse(Ae[0]);if(lt.code==="brand_validation_failed"&&lt.requiredFields){X({isOpen:!0,brandId:oe,errorData:lt});return}}}catch(Ae){Ie.error("Personas","Failed to parse error JSON",Ae)}r(e("personas.errors.generationFailed","Failed to generate persona. Please try again."),"error")}})}catch(Ne){Ie.error("Personas","Mutation error in generatePersonaWithAI:",Ne),j(!1),r(e("personas.errors.generationFailed","Failed to generate persona. Please try again."),"error")}},ze=()=>{h(""),f(null),u(!0)},$e=async()=>{var oe;if(ie.length===0){$(!0);return}try{j(!0);const Ne=await((oe=Qe.currentUser)==null?void 0:oe.getIdToken());if(!Ne)throw new Error("No authentication token available");const Ae=r$(t.language||"en"),lt=`https://api.socialness.ai/ai-coach/personas/analyze?language=${Ae}`;Ie.info("Personas","Calling analyze API:",{url:lt,language:Ae});const Mt=await fetch(lt,{method:"GET",headers:{Authorization:`Bearer ${Ne}`,"Content-Type":"application/json"}});if(Ie.info("Personas","API response status:",Mt.status),!Mt.ok){const Xe=await Mt.text();throw Ie.error("Personas","API error response:",Xe),new Error(`Failed to analyze personas: ${Mt.status} ${Xe}`)}const jt=await Mt.json();if(Ie.info("Personas","Analysis response:",jt),jt.analysis&&jt.analysis.globalAnalysis)A(jt.analysis.globalAnalysis),z(!0),Ie.info("Personas","Analysis data set successfully");else throw Ie.error("Personas","Invalid response structure:",jt),new Error("Invalid response structure from analysis API");j(!1)}catch(Ne){Ie.error("Personas","Error analyzing personas:",Ne),j(!1),alert(`Failed to analyze personas: ${Ne instanceof Error?Ne.message:"Unknown error"}`)}};return c?s.jsx(FZe,{initialData:d||void 0,onSubmit:je,onCancel:()=>{u(!1),f(null)}}):s.jsxs(s.Fragment,{children:[s.jsxs(rs,{title:e("personas.title","Personas"),subtitle:e("personas.subtitle"),actions:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:$e,disabled:x,className:"inline-flex items-center px-4 py-2 bg-white text-primary-600 border border-primary-600 rounded-lg hover:bg-primary-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[x?s.jsx(Rn,{className:"w-5 h-5 mr-2 animate-spin"},"analyze-loading"):s.jsx(Eu,{className:"w-5 h-5 mr-2"}
3891,"analyze-idle"),e("personas.analyzeWithAI","Analyze with AI")]}),s.jsxs("button",{onClick:()=>{const oe=typeof pe=="number"&&ye>=pe;h(oe?"upgrade":"create")},className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"},"create-icon"),e("personas.create")]})]}),children:[s.jsxs("div",{className:"mb-8 flex items-end justify-between gap-4",children:[s.jsxs("div",{className:"flex-grow relative",children:[s.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:s.jsx($i,{className:"h-5 w-5 text-gray-400"},"search-icon")}),s.jsx("input",{type:"text",value:o,onChange:oe=>l(oe.target.value),placeholder:e("personas.search"),className:"block w-full rounded-lg border border-gray-200 bg-white py-2 pl-10 pr-3 text-sm placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{className:"flex-shrink-0 flex flex-col items-end gap-2",children:[s.jsx("div",{className:"text-black text-base font-semibold",children:typeof pe=="number"?s.jsxs(s.Fragment,{children:[ye,"/",pe," ",e("billing.features.personas",{count:pe})]}):s.jsxs(s.Fragment,{children:[ye," ",e("billing.features.personas",{count:ye})]})}),s.jsx(hl,{brands:[ne,...ce],selectedBrandId:C,onBrandSelect:N})]})]}),G||k||T||R?s.jsx(ZH,{}):Q?s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-8",children:[s.jsx("h3",{className:"text-red-800 font-medium",children:e("common.error")}),s.jsx("p",{className:"text-red-600 text-sm mt-1",children:(W==null?void 0:W.message)||e("common.unknownError")})]}):s.jsxs(s.Fragment,{children:[(B||D||xe)&&s.jsx("div",{className:"mb-8",children:s.jsx(EZe,{title:e("personas.analysis.title"),analysisData:D||(xe?{summary:xe.summary||Ee,strengths:xe.strengths||[],areasOfImprovement:xe.areasOfImprovement||[],recommendedNewPersonas:xe.recommendedNewPersonas||[],demographicInsights:xe.demographicInsights,brandPersonaAlignment:xe.brandPersonaAlignment,gapAnalysis:xe.gapAnalysis}:void 0),withAnalysis:B,onAnalyze:$e,isAnalyzing:x})}),Ye.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("p",{className:"text-gray-500",children:e(o?"personas.noSearchResults":"personas.noPersonas")}),!o&&s.jsxs("button",{onClick:()=>h("create"),className:"mt-4 inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"},"create-first-icon"),e("personas.createFirst")]})]}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 pb-8",children:Ye.map(oe=>{const Ne=`persona-${oe.id}-${oe.brandId||"no-brand"}`;return s.jsx(TZe,{...oe,age:oe.age??28,onClick:()=>{n(`/ai-personas-builder/${oe.id}/edit`)},onEdit:()=>{n(`/ai-personas-builder/${oe.id}/edit`)},onDelete:()=>We(oe.id)},Ne)})})]})]}),s.jsx(BG,{isOpen:p,onClose:()=>h(""),onCreateWithAI:gt,onCreateManually:ze}),s.jsx(zZe,{isOpen:y,onClose:()=>v(!1),onBrandSelect:qe}),x&&s.jsx(GZe,{}),s.jsx(Pj,{isOpen:S!==null,onClose:()=>M(null),onConfirm:yt,title:e("personas.delete.title","Delete Persona"),message:e("personas.delete.message","Are you sure you want to delete this persona? This action cannot be undone."),warning:e("personas.delete.warning","All associated data will be permanently removed.")}),F&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>$(!1)}),s.jsxs("div",{className:"relative bg-white rounded-lg border-2 border-black shadow-xl max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center mb-6",children:[s.jsx("div",{className:"flex-shrink-0 flex items-center justify-center h-10 w-10 rounded-full bg-yellow-100 mr-3",children:s.jsx(Eu,{className:"h-6 w-6 text-yellow-600"},"modal-wand-icon")}),s.jsx("div",{children:s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:e("personas.noPersonasForAnalysis.title","Analyse des Personas")})})]}),s.jsx("div",{className:"mb-6",children:s.jsx("p",{className:"text-gray-600",children:e("personas.noPersonasForAnalysis.message","Il faut d'abord que tu crées un persona pour pouvoir lancer une analyse IA.")})}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[s.jsx("button",{type:"button",onClick:()=>$(!1),className:"w-full sm:w-auto px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:e("common.cancel","Annuler")}),s.jsxs("button",{type:"button",onClick:()=>{$(!1),h("create")},className:"w-full sm:w-auto px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-4 h-4 mr-2 inline"},"modal-create-icon"),e("personas.noPersonasForAnalysis.createCTA","Créer un Persona")]})]})]})]}),s.jsx(BZe,{isOpen:H.isOpen,onClose:()=>X({isOpen:!1}),brandId:H.brandId,errorData:H.errorData}),s.jsx(sA,{isOpen:g,onClose:()=>h(""),onUpgrade:()=>n("/billing"),resourceKey:"personas"})]})},HZe=e=>e.platforms?Array.isArray(e.platforms)?e.platforms.filter(t=>typeof t=="string"):typeof e.platforms=="object"?Object.keys(e.platforms):[]:[],XH=({post:e,onDragStart:t})=>{const[r,n]=b.useState(!1),[a,i]=b.useState({x:0,y:0}),o=h=>{n(!0),i({x:h.clientX,y:h.clientY})},l=h=>{i({x:h.clientX,y:h.clientY})},c=()=>{const h=window.innerWidth,p=window.innerHeight,g=Math.min(800,h*.9),y=Math.min(500,p*.8),v=20;let x=a.x+10,j=a.y-100;return x+g+v>h&&(x=a.x-g-10),x<v&&(x=v),j+y+v>p&&(j=p-y-v),j<v&&(j=v),{x,y:j}},u=()=>{n(!1)},d=()=>
3891{if(e.status==="idea")return"";const h=e.scheduledAt||e.updatedAt;if(h)try{const p=Xa(h);if(Gn(p))return sr(p,"HH:mm")}catch{try{const p=new Date(h);if(Gn(p))return sr(p,"HH:mm")}catch{return""}}return""};console.log("Post data:",{content:e.content.substring(0,20)+"...",scheduledAt:e.scheduledAt,formattedTime:d(),status:e.status});const f=h=>{switch(h){case"idea":return"💡";case"draft":return"📝";case"scheduled":return"📆";case"pending":return"🚧";case"waiting_for_approval":return"⏳";case"published":return"✅";default:return""}},m=h=>{const p=Xn(h.media);return p?p.type==="video"?"🎬":p.type==="image"?"🖼️":"📱":"📝"};return s.jsxs(s.Fragment,{children:[s.jsx("div",{draggable:!0,onDragStart:h=>t==null?void 0:t(h,e),className:`p-0.5 sm:p-1 border rounded text-xs cursor-move w-full max-w-full overflow-hidden relative ${e.status==="idea"?"bg-amber-50 border-amber-400 border-dashed hover:bg-amber-100":e.status==="ready_to_publish"?"bg-white border-green-500 hover:bg-gray-50":e.status==="rejected"?"bg-white border-red-500 hover:bg-gray-50":e.status==="waiting_for_approval"?"bg-white border-orange-500 hover:bg-gray-50":"bg-white border-black hover:bg-gray-50"}`,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,children:s.jsxs("div",{className:"flex items-start gap-1 sm:gap-2 w-full",children:[(()=>{const h=Xn(e.media);if(!h)return null;const p=/\.pdf(\?|#|$)/i.test(h.url);return s.jsx("div",{className:"flex-shrink-0 w-6 h-6 sm:w-8 sm:h-8 lg:w-10 lg:h-10 bg-gray-100 rounded overflow-hidden relative",children:p?s.jsx(Ef,{src:h.url,className:"w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:h.url,altText:"Post media",type:h.type,className:"w-full h-full",objectFit:"cover",controls:!1,autoPlayOnMount:h.type==="video",muted:!0})})})(),s.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-start justify-between gap-0.5 sm:gap-1",children:[s.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[s.jsx("span",{className:"block truncate text-[10px] sm:text-xs leading-tight",children:e.status==="idea"&&e.title||e.content}),!Xn(e.media)&&s.jsx("span",{className:"text-[8px] sm:text-[10px] bg-gray-100 px-0.5 py-0 rounded mt-0.5 inline-block",children:m(e)})]}),s.jsx("span",{className:"text-[10px] sm:text-xs flex-shrink-0",children:f(e.status)})]}),s.jsxs("div",{className:"flex items-center justify-between mt-0.5 sm:mt-1",children:[s.jsxs("div",{className:"flex gap-0.5 items-center min-w-0 overflow-hidden",children:[e.brandLogo&&s.jsx("img",{src:e.brandLogo,alt:e.brandName||"Brand logo",className:"w-2 h-2 sm:w-3 sm:h-3 rounded object-cover flex-shrink-0",onError:h=>{h.currentTarget.style.display="none"}}),HZe(e).map(h=>s.jsx(cr,{platform:h,size:10},h))]}),d()&&s.jsx("span",{className:"text-[10px] sm:text-xs text-gray-500 flex-shrink-0 ml-1",children:d()})]})]})]})}),r&&s.jsx("div",{className:"fixed pointer-events-none",style:{left:c().x,top:c().y,zIndex:1e3},children:s.jsx(db,{post:e})})]})},YZe=({currentDate:e,onDateChange:t,posts:r,onPostClick:n,onDrop:a,dragOverDate:i,onDragOver:o,onPostDragStart:l})=>{const c=Pu(e),u=op(c),d=ll(c,{weekStartsOn:1}),f=X8(u,{weekStartsOn:1}),m=J8({start:d,end:f}),h=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],p=U.useRef(null),[g,y]=U.useState(null);U.useEffect(()=>{const k=()=>{if(!p.current)return;const I=p.current.getBoundingClientRect(),T=window.innerHeight-I.top-16;y(Math.max(T,300))};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const v=k=>{if(k.status==="idea"){const L=k.reminderAt||null;if(!L)return null;let R=Xa(L);return Gn(R)||(R=new Date(L)),Gn(R)?R:null}const I=k.publishedAt||k.scheduledAt||null;if(!I)return null;let T=Xa(I);return Gn(T)||(T=new Date(I)),Gn(T)?T:null},x=k=>{const I=sr(k,"yyyy-MM-dd");return r.filter(T=>{try{const L=v(T);return L?sr(L,"yyyy-MM-dd")===I:!1}catch(L){return console.error(`Error processing post ${T.id}:`,L),!1}})},j=()=>{t(lp(e))},C=()=>{t(q8(e,1))},N=(k,I)=>{k.preventDefault(),o&&o(I)},S=k=>{k.preventDefault();const I=k.currentTarget.getBoundingClientRect(),T=k.clientX,L=k.clientY;(T<I.left||T>I.right||L<I.top||L>I.bottom)&&o&&o(null)},M=(k,I)=>{k.preventDefault(),o&&o(null),a&&a(I)};return s.jsx("div",{className:"bg-white rounded-xl border border-black shadow-lg overflow-hidden w-full max-w-full",children:s.jsxs("div",{className:"overflow-x-auto",children:[s.jsxs("div",{className:"p-2 sm:p-4 flex items-center justify-between border-b border-gray-200",children:[s.jsx("button",{onClick:j,className:"p-1 sm:p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(wE,{className:"w-4 h-4 sm:w-5 sm:h-5 text-gray-600"})}),s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:sr(e,"MMMM yyyy")}),s.jsx("button",{onClick:C,className:"p-1 sm:p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(jE,{className:"w-4 h-4 sm:w-5 sm:h-5 text-gray-600"})})]}),s.jsx("div",{className:"grid grid-cols-7 border-b border-gray-200 min-w-[320px]",children:h.map(k=>s.jsx("div",{className:"py-1 sm:py-2 text-center text-xs sm:text-sm font-medium text-gray-700",children:k},k))}),s.jsx("div",{ref:p,className:"grid grid-cols-7 auto-rows-fr divide-x divide-y w-full min-w-[320px]",style:g?{height:g}:void 0,children:m.map((k,I)=>{const T=x(k),L=xke(k,e),R=Fk(k),_=i&&sr(i,"yyyy-MM-dd")===sr(k,"yyyy-MM-dd");return s.jsxs("div",{className:`p-1 sm:p-2 overflow-hidden transition-colors h-full flex flex-col ${L?_?"bg-primary-50":"bg-white":"bg-gray-50"} hover:bg-gray-50`,onDragOver:B=>N(B,k),onDragLeave:S,onDrop:B=>M(B,k),children:[s.jsx("div",{className:"flex justify-start",children:s.jsx("div",{className:`flex items-center justify-center w-5 h-5 sm:w-7 sm:h-7 rounded-full ${R?"bg-red-500":""}`,children:s.jsx("p",{className:`text-xs sm:text-sm font-medium ${L?R?"text-white":"text-gray-900":"text-gray-400"}`,children:sr(k,"d")})})}),s.jsx("div",{className:"space-y-0.5 sm:space-y-1 mt-0.5 sm:mt-1 overflow-y-auto flex-1",children:T.map(B=>s.jsx("div",{onClick:()=>n==null?void 0:n(B),className:"cursor-pointer",children:s.jsx(XH,{post:B,onDragStart:l})},B.id))})]},k.toString())})})]})})},QZe=({currentDate:e,onDateChange:t,posts:r,onPostClick:n,onDrop:a,dragOverDate:i,onDragOver:o,onPostDragStart:l})=>{const c=ll(e,{weekStartsOn:1}
3891),u=X8(e,{weekStartsOn:1}),d=J8({start:c,end:u}),f=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],m=Array.from({length:24},(C,N)=>N),h=C=>{if(C.status==="idea"){const M=C.reminderAt||null;if(!M)return null;let k=Xa(M);return Gn(k)||(k=new Date(M)),Gn(k)?k:null}const N=C.publishedAt||C.scheduledAt||null;if(!N)return null;let S=Xa(N);return Gn(S)||(S=new Date(N)),Gn(S)?S:null},p=(C,N)=>{const S=sr(C,"yyyy-MM-dd");return r.filter(M=>{try{const k=h(M);if(!k)return!1;const I=sr(k,"yyyy-MM-dd"),T=bke(k);return I===S&&T===N}catch(k){return console.error("Error processing post:",M.id,k),!1}})},g=()=>{t(Rke(e))},y=()=>{t(K8(e,1))},v=(C,N,S)=>{if(C.preventDefault(),o){const M=new Date(N);M.setHours(S,0,0,0),o(M)}},x=C=>{C.preventDefault();const N=C.currentTarget.getBoundingClientRect(),S=C.clientX,M=C.clientY;(S<N.left||S>N.right||M<N.top||M>N.bottom)&&o&&o(null)},j=(C,N,S)=>{if(C.preventDefault(),o&&o(null),a){const M=new Date(N);M.setHours(S,0,0,0),a(M)}};return s.jsx("div",{className:"bg-white rounded-xl border border-black shadow-lg overflow-hidden w-full max-w-full",children:s.jsxs("div",{className:"overflow-x-auto",children:[s.jsxs("div",{className:"p-2 sm:p-4 flex items-center justify-between border-b border-gray-200",children:[s.jsx("button",{onClick:g,className:"p-1 sm:p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(wE,{className:"w-4 h-4 sm:w-5 sm:h-5 text-gray-600"})}),s.jsxs("h2",{className:"text-lg sm:text-xl font-semibold",children:[sr(c,"dd MMM")," - ",sr(u,"dd MMM yyyy")]}),s.jsx("button",{onClick:y,className:"p-1 sm:p-2 hover:bg-gray-100 rounded-lg transition-colors",children:s.jsx(jE,{className:"w-4 h-4 sm:w-5 sm:h-5 text-gray-600"})})]}),s.jsxs("div",{className:"grid grid-cols-8 border-b border-gray-200 min-w-[400px]",children:[s.jsx("div",{className:"p-1 sm:p-3 text-center text-xs sm:text-sm font-medium text-gray-700 border-r border-gray-100"}),f.map((C,N)=>s.jsxs("div",{className:`p-1 sm:p-3 text-center text-xs sm:text-sm font-medium border-r border-gray-100 last:border-r-0 ${Fk(d[N])?"bg-primary-50 text-primary-700":"text-gray-700"}`,children:[s.jsx("div",{children:C}),s.jsx("div",{className:"text-sm sm:text-lg font-semibold mt-0.5 sm:mt-1",children:sr(d[N],"d")})]},C))]}),s.jsx("div",{className:"min-w-[400px]",children:m.map(C=>s.jsxs("div",{className:"grid grid-cols-8 border-b border-gray-100 min-h-12 sm:min-h-16",children:[s.jsxs("div",{className:"p-1 sm:p-2 text-[10px] sm:text-xs text-gray-500 border-r border-gray-100 flex items-start justify-end pr-1 sm:pr-3",children:[C,":00"]}),d.map(N=>{const S=p(N,C),M=Fk(N),k=i&&sr(N,"yyyy-MM-dd")===sr(i,"yyyy-MM-dd")&&i.getHours()===C;return s.jsx("div",{className:`p-0.5 sm:p-1 border-r border-gray-100 last:border-r-0 min-h-12 sm:min-h-16 transition-colors ${M?"bg-primary-50/20":"bg-white hover:bg-gray-50"} ${k?"bg-primary-100 ring-2 ring-primary-300":""}`,onDragOver:I=>v(I,N,C),onDragLeave:x,onDrop:I=>j(I,N,C),children:s.jsx("div",{className:"space-y-0.5 sm:space-y-1",children:S.map(I=>s.jsx("div",{onClick:()=>n==null?void 0:n(I),className:"cursor-pointer",children:s.jsx(XH,{post:I,onDragStart:l})},I.id))})},`${N.toString()}-${C}`)})]},C))})]})})};function n$(e,t,r){const n=yke(),a=ZZe(e,r.timeZone,r.locale??n.locale);return"formatToParts"in a?KZe(a,t):JZe(a,t)}function KZe(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function JZe(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function ZZe(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function XZe(e,t){const r=aXe(t);return"formatToParts"in r?tXe(r,e):rXe(r,e)}const eXe={year:0,month:1,day:2,hour:3,minute:4,second:5};function tXe(e,t){try{const r=e.formatToParts(t),n=[];for(let a=0;a<r.length;a++){const i=eXe[r[a].type];i!==void 0&&(n[i]=parseInt(r[a].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function rXe(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const YS={},a$=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/Ne
3891w_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),nXe=a$==="06/25/2014, 00:00:00"||a$==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function aXe(e){return YS[e]||(YS[e]=nXe?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),YS[e]}function dA(e,t,r,n,a,i,o){const l=new Date(0);return l.setUTCFullYear(e,t,r),l.setUTCHours(n,a,i,o),l}const s$=36e5,sXe=6e4,QS={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function qj(e,t,r){if(!e)return 0;let n=QS.timezoneZ.exec(e);if(n)return 0;let a,i;if(n=QS.timezoneHH.exec(e),n)return a=parseInt(n[1],10),i$(a)?-(a*s$):NaN;if(n=QS.timezoneHHMM.exec(e),n){a=parseInt(n[2],10);const o=parseInt(n[3],10);return i$(a,o)?(i=Math.abs(a)*s$+o*sXe,n[1]==="+"?-i:i):NaN}if(lXe(e)){t=new Date(t||Date.now());const o=r?t:iXe(t),l=M4(o,e);return-(r?l:oXe(t,l,e))}return NaN}function iXe(e){return dA(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function M4(e,t){const r=XZe(e,t),n=dA(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,n-a}function oXe(e,t,r){let a=e.getTime()-t;const i=M4(new Date(a),r);if(t===i)return t;a-=i-t;const o=M4(new Date(a),r);return i===o?i:Math.max(i,o)}function i$(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const o$={};function lXe(e){if(o$[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),o$[e]=!0,!0}catch{return!1}}const cXe=60*1e3,uXe={X:function(e,t,r){const n=KS(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return l$(n);case"XXXX":case"XX":return im(n);case"XXXXX":case"XXX":default:return im(n,":")}},x:function(e,t,r){const n=KS(r.timeZone,e);switch(t){case"x":return l$(n);case"xxxx":case"xx":return im(n);case"xxxxx":case"xxx":default:return im(n,":")}},O:function(e,t,r){const n=KS(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+dXe(n,":");case"OOOO":default:return"GMT"+im(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return n$("short",e,r);case"zzzz":default:return n$("long",e,r)}}};function KS(e,t){const r=e?qj(e,t,!0)/cXe:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function xw(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function im(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=xw(Math.floor(n/60),2),i=xw(Math.floor(n%60),2);return r+a+t+i}function l$(e,t){return e%60===0?(e>0?"-":"+")+xw(Math.abs(e)/60,2):im(e,t)}function dXe(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.floor(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+xw(i,2)}function c$(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const eY=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,JS=36e5,u$=6e4,fXe=2,Es={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:eY};function ww(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?fXe:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const n=mXe(e),{year:a,restDateString:i}=hXe(n.date,r),o=pXe(i,a);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const l=o.getTime();let c=0,u;if(n.time&&(c=gXe(n.time),c===null||isNaN(c)))return new Date(NaN);if(n.timeZone||t.timeZone){if(u=qj(n.timeZone||t.timeZone,new Date(l+c)),isNaN(u))return new Date(NaN)}else u=c$(new Date(l+c)),u=c$(new Date(l+c+u));return new Date(l+c+u)}else return new Date(NaN)}function mXe(e){const t={};let r=Es.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=Es.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const a=Es.timeZone.exec(n);a?(t.time=n.replace(a[1],""),t.timeZone=a[1].trim()):t.time=n}return t}function hXe(e,t){if(e){const r=Es.YYY[t],n=Es.YYYYY[t];let a=Es.YYYY.exec(e)||n.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=Es.YY.exec(e)||r.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function pXe(e,t){if(t===null)return null;let r,n,a;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let i=Es.MM.exec(e);if(i)return r=new Date(0),n=parseInt(i[1],10)-1,f$(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(i=Es.DDD.exec(e),i){r=new Date(0);const o=parseInt(i[1],10);return vXe(t,o)?(r.setUTCFullYear(t,0,o),r):new Date(NaN)}if(i=Es.MMDD.exec(e),i){r=new Date(0),n=parseInt(i[1],10)-1;const o=parseInt(i[2],10);return f$(t,n,o)?(r.setUTCFullYear(t,n,o),r):new Date(NaN)}if(i=Es.Www.exec(e),i)return a=parseInt(i[1],10)-1,m$(a)?d$(t,a):new Date(NaN);if(i=Es.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const o=parseInt(i[2],10)-1;return m$(a,o)?d$(t,a,o):new Date(NaN)}return null}function gXe(e){let t,r,n=Es.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),ZS(t)?t%24*JS:NaN;if(n=Es.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),ZS(t,r)?t%24*JS+r*u$:NaN;if(n=Es.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const a=parseFloat(n[3].replace(",","."));return ZS(t,r,a)?t%24*JS+r*u$+a*1e3:NaN}return null}
3891function d$(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const a=n.getUTCDay()||7,i=t*7+r+1-a;return n.setUTCDate(n.getUTCDate()+i),n}const yXe=[31,28,31,30,31,30,31,31,30,31,30,31],bXe=[31,29,31,30,31,30,31,31,30,31,30,31];function tY(e){return e%400===0||e%4===0&&e%100!==0}function f$(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=tY(e);if(n&&r>bXe[t]||!n&&r>yXe[t])return!1}return!0}function vXe(e,t){if(t<1)return!1;const r=tY(e);return!(r&&t>366||!r&&t>365)}function m$(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function ZS(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const xXe=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wXe(e,t,r={}){t=String(t);const n=t.match(xXe);if(n){const a=ww(r.originalDate||e,r);t=n.reduce(function(i,o){if(o[0]==="'")return i;const l=i.indexOf(o),c=i[l-1]==="'",u=i.replace(o,"'"+uXe[o[0]](a,o,r)+"'");return c?u.substring(0,l-1)+u.substring(l+1):u},t)}return sr(e,t,r)}function ud(e,t,r){e=ww(e,r);const n=qj(t,e,!0),a=new Date(e.getTime()-n),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function jXe(e,t,r,n){return n={...n,timeZone:t,originalDate:e},wXe(ud(e,t,{timeZone:n.timeZone}),r,n)}function NXe(e,t,r){if(typeof e=="string"&&!e.match(eY))return ww(e,{...r,timeZone:t});e=ww(e,r);const n=dA(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=qj(t,new Date(n));return new Date(n+a)}const h$=e=>{const t=e.split("/"),r=t[0],n=t.length>1?t[t.length-1].replace(/_/g," "):r;if(e==="America/Los_Angeles")return{name:"Pacific Time - US & Canada",group:"US/Canada"};if(e==="America/Denver")return{name:"Mountain Time - US & Canada",group:"US/Canada"};if(e==="America/Chicago")return{name:"Central Time - US & Canada",group:"US/Canada"};
3891if(e==="America/New_York")return{name:"Eastern Time - US & Canada",group:"US/Canada"};if(e==="America/Anchorage")return{name:"Alaska Time",group:"US/Canada"};let a=r;return["America","Europe","Asia","Africa","Australia","Pacific"].includes(r)?a=r:e==="UTC"&&(a="Standard"),{name:n,group:a}},SXe=(e,t)=>t==="fr"&&{America:"Amérique","US/Canada":"États-Unis/Canada",Europe:"Europe",Asia:"Asie",Africa:"Afrique",Australia:"Australie",Pacific:"Pacifique",Standard:"Standard"}[e]||e,p$=(e,t)=>{if(t!=="fr")return e;let r=e;r.includes(" - ")&&(r=r.split(" - ")[0]);const n={Paris:"Paris",London:"Londres",Lisbon:"Lisbonne",Rome:"Rome",Berlin:"Berlin",Madrid:"Madrid",Vienna:"Vienne",Amsterdam:"Amsterdam",Brussels:"Bruxelles",Luxembourg:"Luxembourg",Moscow:"Moscou",Athens:"Athènes",Dublin:"Dublin",Copenhagen:"Copenhague",Oslo:"Oslo",Stockholm:"Stockholm",Helsinki:"Helsinki",Warsaw:"Varsovie",Prague:"Prague",Budapest:"Budapest",Zurich:"Zurich",Geneva:"Genève",New_York:"New York",Los_Angeles:"Los Angeles",Chicago:"Chicago",Toronto:"Toronto",Vancouver:"Vancouver",Montreal:"Montréal",Mexico_City:"Mexico",Tokyo:"Tokyo",Beijing:"Pékin",Shanghai:"Shanghai",Hong_Kong:"Hong Kong",Singapore:"Singapour",Sydney:"Sydney",Melbourne:"Melbourne",Auckland:"Auckland",Cairo:"Le Caire",Johannesburg:"Johannesburg",Sao_Paulo:"São Paulo",Buenos_Aires:"Buenos Aires","Pacific Time":"Heure du Pacifique","Mountain Time":"Heure des Rocheuses","Central Time":"Heure du Centre","Eastern Time":"Heure de l'Est","Alaska Time":"Heure de l'Alaska",Dubai:"Dubaï",Jerusalem:"Jérusalem",Istanbul:"Istanbul",Kiev:"Kiev",Minsk:"Minsk",Bangkok:"Bangkok",Jakarta:"Jakarta",Kuala_Lumpur:"Kuala Lumpur",Manila:"Manille",Seoul:"Séoul",Taipei:"Taipei",Perth:"Perth",Brisbane:"Brisbane",Adelaide:"Adélaïde",Hobart:"Hobart",Wellington:"Wellington",Fiji:"Fidji",Honolulu:"Honolulu",Anchorage:"Anchorage",Phoenix:"Phoenix",Denver:"Denver",Houston:"Houston",Minneapolis:"Minneapolis",Detroit:"Détroit",Philadelphia:"Philadelphie",Boston:"Boston",Atlanta:"Atlanta",Miami:"Miami",Havana:"La Havane",Saint_Johns:"Saint-Jean",Halifax:"Halifax",Winnipeg:"Winnipeg",Edmonton:"Edmonton",Bogota:"Bogota",Lima:"Lima",Santiago:"Santiago",Caracas:"Caracas",Reykjavik:"Reykjavik",Casablanca:"Casablanca",Lagos:"Lagos",Nairobi:"Nairobi",Riyadh:"Riyad",Tehran:"Téhéran",Karachi:"Karachi",Kolkata:"Calcutta",Mumbai:"Bombay",New_Delhi:"New Delhi",Dhaka:"Dacca",Ljubljana:"Ljubljana",Kaliningrad:"Kaliningrad",Kirov:"Kirov"};if(n[r])return n[r];const a=r.replace(/_/g," ");return n[a]?n[a]:r==="London"?"Londres":r==="Lisbon"?"Lisbonne":r},CXe=({selectedTimezone:e,onTimezoneChange:t,className:r="",disabled:n=!1})=>{const{t:a,i18n:i}=Te(),[o,l]=b.useState(!1),[c,u]=b.useState(""),d=b.useRef(null),f=b.useRef(null),m=i.language.startsWith("fr")?of:uc,h=i.language.startsWith("fr"),p=b.useMemo(()=>{let x;try{x=Intl.supportedValuesOf("timeZone")}catch{Ie.warn("TimezoneDropdown",'Intl.supportedValuesOf("timeZone") is not supported, using a limited list'),x=["UTC","Europe/London","Europe/Paris","America/New_York","America/Los_Angeles","Asia/Tokyo"]}const j=i.language||"en",C=new Date;return x.map(N=>{const{name:S,group:M}=h$(N),k=p$(S,j),I=SXe(M,j);let T="";try{T=jXe(C,N,h?"HH:mm":"h:mmaaa",{locale:m})}catch(L){Ie.warn("TimezoneDropdown",`Error formatting time for ${N}`,L)}return{ianaName:N,friendlyName:k,group:I,currentTime:T}}).sort((N,S)=>N.group===S.group?N.friendlyName.localeCompare(S.friendlyName):N.group==="US/Canada"||N.group==="États-Unis/Canada"?-1:S.group==="US/Canada"||S.group==="États-Unis/Canada"?1:(N.group||"").localeCompare(S.group||""))},[i.language,m,h]);b.useEffect(()=>{if(o&&!n){const x=j=>{d.current&&!d.current.contains(j.target)&&l(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)}},[o,n]),b.useEffect(()=>{if(o&&e&&f.current&&!n){const x=f.current.querySelector(`[data-iana-name="${e}"]`);x&&x.scrollIntoView({block:"nearest"})}},[o,e,p,n]);const g=b.useMemo(()=>p.reduce((j,C)=>{if(!C.friendlyName.toLowerCase().includes(c.toLowerCase())&&!C.ianaName.toLowerCase().includes(c.toLowerCase()))return j;const N=C.group||"Other";return j[N]||(j[N]=[]),j[N].push(C),j},{}),[p,c]),y=x=>{n||(t(x),l(!1),u(""))},v=b.useMemo(()=>{const x=i.language||"en",j=p.find(S=>S.ianaName===e);if(j)return{friendlyName:j.friendlyName,ianaName:j.ianaName};const C=h$(e);return{friendlyName:p$(C.name,x),ianaName:e}},[p,e,i.language]);return s.jsxs("div",{className:`relative ${r}`,ref:d,children:[s.jsxs("button",{type:"button",onClick:()=>!n&&l(!o),disabled:n,className:`w-full flex items-center justify-between px-3 py-2 border rounded-lg bg-white text-left 
3892                  focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500
3893                  ${n?"border-gray-200 bg-gray-100 cursor-not-allowed":"border-gray-300"}`,children:[s.jsxs("span",{className:`flex items-center gap-2 text-sm ${n?"text-gray-400":"text-gray-700"}`,children:[s.jsx(Zs,{className:`w-4 h-4 ${n?"text-gray-300":"text-gray-400"}`}),v.friendlyName]}),s.jsx(Vr,{className:`w-4 h-4 transition-transform ${n?"text-gray-300":"text-gray-500"} ${o&&!n?"transform rotate-180":""}`})]}),o&&!n&&s.jsxs("div",{ref:f,className:"absolute left-0 right-0 mt-1.5 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20 max-h-80 overflow-y-auto",children:[s.jsx("div",{className:"p-2 sticky top-0 bg-white z-10 border-b border-gray-200",children:s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx($i,{className:"h-4 w-4 text-gray-400"})}),s.jsx("input",{type:"text",placeholder:a("common.timezoneDropdown.searchPlaceholder","Search timezones..."),className:"block w-full pl-9 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",value:c,onChange:x=>u(x.target.value)})]})}),Object.entries(g).map(([x,j])=>
3893{const C=x==="US/Canada"||x==="États-Unis/Canada"||x==="Standard";return s.jsxs("div",{children:[s.jsx("h3",{className:`px-3 py-2 text-xs font-semibold uppercase tracking-wider 
3894                  ${C?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600"}`,children:x}),j.map(N=>s.jsxs("button",{type:"button","data-iana-name":N.ianaName,onClick:()=>y(N.ianaName),className:`w-full text-left px-3 py-2.5 text-sm flex justify-between items-center transition-colors duration-150 ease-in-out
3895                      ${N.ianaName===e?"bg-primary-600 text-white":"text-gray-800 hover:bg-primary-50 hover:text-primary-700"}`,children:[s.jsx("span",{children:N.friendlyName}),N.currentTime&&s.jsx("span",{className:`${N.ianaName===e?"text-primary-100":"text-gray-500"}`,children:N.currentTime})]},N.ianaName))]},x)}),Object.keys(g).length===0&&s.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 text-center",children:a("common.timezoneDropdown.noResults","No timezones found")})]})]})};function Mv(e,t){if(!e||!Gn(e))return null;const r=NXe(e,t);return Gn(r)?r.toISOString():null}function kXe(e,t=Date.now()){return new Date(e).getTime()>t}const MXe={en:uc,fr:of},IXe=e=>{if(!e)return"";const t=e.split("/");return t[t.length-1].replace(/_/g," ")},fA=({initialScheduledAtUtc:e,onScheduleChange:t})=>{const{t:r,i18n:n}=Te(),[a,i]=b.useState(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}),[o,l]=b.useState(!!e),[c,u]=b.useState(null);b.useEffect(()=>{const y=!!e;if(console.log("📅 ScheduleCard - useEffect - initialScheduledAtUtc:",e,"hasInitialSchedule:",y),l(y),y&&e)try{const v=Xa(e);if(console.log("📅 ScheduleCard - useEffect - parsedUtc:",v,"isValid:",Gn(v)),Gn(v)){const x=ud(v,a);console.log("📅 ScheduleCard - useEffect - zonedDate for timezone",a,":",x),u(x)}else u(null)}catch(v){console.error("Error parsing initialScheduledAtUtc in ScheduleCard:",v),u(null)}else y||u(null)},[e]);const d=()=>{const y=!o;if(l(y),y){let v=c;if(!v){if(e)try{const x=Xa(e);Gn(x)&&(v=ud(x,a))}catch{}if(v)u(v);else{const x=ud(new Date(Date.now()+36e5),a);x.setMinutes(Math.ceil(x.getMinutes()/15)*15,0,0),u(x),v=x}}if(v&&Gn(v))t(Mv(v,a),a);else{const x=ud(new Date(Date.now()+36e5),a);x.setMinutes(Math.ceil(x.getMinutes()/15)*15,0,0),u(x),t(Mv(x,a),a)}}else t(null,a)},f=y=>{o&&(y&&Gn(y)?(u(y),t(Mv(y,a),a)):(u(null),t(null,a)))},m=y=>{i(y),o&&c&&t(Mv(c,y),y)},h=MXe[n.resolvedLanguage]||uc;let p="";const g=o?c:e?ud(Xa(e),a):null;if(g&&Gn(g))try{const y=sr(g,"PPp",{locale:h}),v=IXe(a);p=r("cards.schedule.statusScheduled","Scheduled for {{date}} ({{timezoneName}} time)",{date:y,timezoneName:v})}catch(y){console.error("Error formatting display date-time:",y),p=r("common.error","Error")}return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(vo,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:r("cards.schedule.title","Schedule Post")})]}),s.jsx(sm,{message:r("tooltips.scheduleCard","Schedule your post for a future date and time. If no date is set, the post can be published immediately or saved as a draft.")})]}),s.jsxs("div",{className:"flex items-center justify-between mb-4 pb-4 border-b border-gray-200",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:r("cards.schedule.toggleLabel","Planifier pour plus tard")}),s.jsx("p",{className:"text-xs text-gray-500 max-w-xs",children:r("cards.schedule.toggleDescription","Choisissez quand publier. La suggestion de l'IA pour votre marque peut vous aider.")})]}),s.jsxs("button",{type:"button",onClick:d,className:`${o?"bg-primary-600":"bg-gray-200"} relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500`,role:"switch","aria-checked":o,children:[s.jsx("span",{className:"sr-only",children:r("cards.schedule.toggleLabel","Schedule for later")}),s.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"} pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200`})]})]}),s.jsxs("div",{className:"space-y-4 mb-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"schedule-date-picker",className:`block text-xs font-medium mb-1 ${o?"text-gray-700":"text-gray-400"}`,children:r("common.date","Date")}),s.jsx(bh,{id:"schedule-date-picker",selected:c,onChange:f,dateFormat:h.code==="fr"?"dd/MM/yyyy":"MM/dd/yyyy",className:`w-full p-2 border rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 ${o?"border-gray-300":"bg-gray-100 text-gray-500 cursor-not-allowed"}`,placeholderText:r("cards.schedule.datePlaceholder","Select date"),minDate:ud(new Date,a),locale:h,disabled:!o,c
3895alendarClassName:"custom-datepicker-theme"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"schedule-time-picker",className:`block text-xs font-medium mb-1 ${o?"text-gray-700":"text-gray-400"}`,children:r("common.time","Time")}),s.jsx(bh,{id:"schedule-time-picker",selected:c,onChange:f,showTimeSelect:!0,showTimeSelectOnly:!0,timeIntervals:15,timeCaption:r("common.time","Time"),dateFormat:"p",className:`w-full p-2 border rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 ${o?"border-gray-300":"bg-gray-100 text-gray-500 cursor-not-allowed"}`,placeholderText:r("cards.schedule.timePlaceholder","Select time"),locale:h,disabled:!o,calendarClassName:"custom-datepicker-theme"})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"schedule-timezone-picker",className:`block text-xs font-medium mb-1 ${o?"text-gray-700":"text-gray-400"}`,children:r("common.timezoneDropdown.timezoneLabel","Fuseau horaire")}),s.jsx(CXe,{selectedTimezone:a,onTimezoneChange:m,disabled:!o})]})]}),s.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:r("cards.schedule.statusTitle","Publishing Status")}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ql,{className:"w-4 h-4 text-gray-400"}),(o||e)&&g?s.jsx("span",{className:o?"text-primary-600":"text-gray-600",children:p}):s.jsx("span",{className:"text-gray-600",children:r("cards.schedule.statusImmediate","Will be published immediately")})]})]})]})},EXe=({isOpen:e,onClose:t,onConfirm:r,post:n,initialDate:a})=>{const{t:i}=Te(),o=()=>{if(!a)return null;console.log("📅 ScheduleModal - getInitialScheduledDate - Received initialDate:",a,"ISO:",a.toISOString());const p=a.getFullYear(),g=a.getMonth(),y=a.getDate(),v=a.getHours(),x=a.getMinutes(),C=new Date(p,g,y,v,x,0,0).toISOString();return console.log("📅 ScheduleModal - getInitialScheduledDate - Created ISO string:",C,"for local time",v+":"+String(x).padStart(2,"0")),C},[l,c]=b.useState(o()),[u,d]=b.useState();U.useEffect(()=>{const p=o();p&&c(p)},[a]);const f=(p,g)=>{c(p),d(g)},m=()=>{r(l,u),t()},h=()=>{t()};return!e||!n?null:s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[s.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:h}),s.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[s.jsxs("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:i("modal.schedule.title","When do you want to publish?")}),s.jsxs("button",{onClick:h,className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500",children:[s.jsx("span",{className:"sr-only",children:i("common.close","Close")}),s.jsx(_t,{className:"h-6 w-6"})]})]}),s.jsx("div",{className:"mb-6 p-3 bg-gray-50 rounded-lg border border-gray-200",children:s.jsxs("div",{className:"flex items-start gap-3",children:[n.media&&s.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex-shrink-0 overflow-hidden",children:s.jsx("img",{src:n.media.url,alt:"",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm text-gray-900 line-clamp-3",children:n.content||"Sans texte"}),n.brandName&&s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:n.brandName})]})]})}),s.jsx(fA,{initialScheduledAtUtc:l,onScheduleChange:f})]}),s.jsxs("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[s.jsx("button",{type:"button",onClick:m,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary-600 text-base font-medium text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:ml-3 sm:w-auto 
3895sm:text-sm",children:i("common.confirm","Valider")}),s.jsx("button",{type:"button",onClick:h,className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:i("common.cancel","Annuler")})]})]})]})})},TXe=wf((e,t)=>{const r=lp(new Date);return{dateRange:"this-month",customDateRange:{start:Pu(r),end:op(r)},selectedBrand:"all",view:"calendar",statusFilter:"all",mediaFormat:"all",postFormat:"all",currentDate:new Date,setDateRange:n=>e(a=>a.dateRange===n?a:{dateRange:n}),setCustomDateRange:n=>e({customDateRange:n}),setSelectedBrand:n=>e(a=>a.selectedBrand===n?a:{selectedBrand:n}),setView:n=>e(a=>a.view===n?a:{view:n}),setStatusFilter:n=>e(a=>a.statusFilter===n?a:{statusFilter:n}),setMediaFormat:n=>e(a=>a.mediaFormat===n?a:{mediaFormat:n}),setPostFormat:n=>e(a=>a.postFormat===n?a:{postFormat:n}),setCurrentDate:n=>e({currentDate:n})}});function AXe(){const e=TXe(),[t,r]=ui(),n=b.useRef(!0),a=b.useRef(!1),i=b.useRef(e);b.useEffect(()=>{i.current=e},[e]),b.useEffect(()=>{let k=!1;const I=new URLSearchParams(t);I.has("platform")&&(I.delete("platform"),k=!0),I.has("tab")&&(I.delete("tab"),k=!0),k&&r(I)},[t,r]);const o=b.useRef({skipSync:!1}).current,l=b.useRef({skipSync:!1}).current,c=b.useRef({skipSync:!1}).current,u=b.useRef({skipSync:!1}).current,d=b.useRef({skipSync:!1}).current,f=b.useRef({skipSync:!1}).current,[m,h]=fa("view",e.view,o),[p,g]=fa("status",e.statusFilter,l),[y,v]=fa("brand",e.selectedBrand,c),[x,j]=fa("dateRange",e.dateRange,u);fa("mediaFormat",e.mediaFormat,d),fa("postFormat",e.postFormat,f),b.useEffect(()=>{if(n.current){const k=i.current;m!==k.view&&k.setView(m),p!==k.statusFilter&&k.setStatusFilter(p),y!==k.selectedBrand&&k.setSelectedBrand(y),x!==k.dateRange&&k.setDateRange(x),n.current=!1}},[]);const C=b.useCallback(k=>{k!==m&&(h(k),a.current=!0,i.current.setView(k),a.current=!1)},[m,h]),N=b.useCallback(k=>{k!==p&&(g(k),a.current=!0,i.current.setStatusFilter(k),a.current=!1)},[p,g]),S=b.useCallback(k=>{k!==y&&(v(k),a.current=!0,i.current.setSelectedBrand(k),a.current=!1)},[y,v]),M=b.useCallback(k=>{k!==x&&(j(k),a.current=!0,i.current.setDateRange(k),a.current=!1)},[x,j]);return b.useEffect(()=>{!n.current&&!a.current&&m!==i.current.view&&i.current.setView(m)},[m]),b.useEffect(()=>{!n.current&&!a.current&&p!==i.current.statusFilter&&i.current.setStatusFilter(p)},[p]),b.useEffect(()=>{!n.current&&!a.current&&y!==i.current.selectedBrand&&i.current.setSelectedBrand(y)},[y]),b.useEffect(()=>{!n.current&&!a.current&&x!==i.current.dateRange&&i.current.setDateRange(x)},[x]),{view:m,statusFilter:p,selectedBrand:y,dateRange:x,setView:C,setStatusFilter:N,setSelectedBrand:S,setDateRange:M,customDateRange:e.customDateRange,currentDate:e.currentDate,setCustomDateRange:e.setCustomDateRange,setCurrentDate:e.setCurrentDate}}const PXe="https://api.socialness.ai",_Xe=e=>e.toISOString().slice(0,10),g$=e=>{if(e){if(typeof e=="string")return e;if(e instanceof Date)return _Xe(e)}},gg=e=>e?typeof e=="string"?e:e instanceof Date?e.toISOString():"":"",LXe=e=>{var a,i,o,l,c;let t=null;if(e.media){if(typeof e.media=="string")t={url:e.media,type:"image"};else if(Array.isArray(e.media)&&e.media.length>0){const u=e.media[0];if((a=u==null?void 0:u.mapValue)!=null&&a.fields){const d=u.mapValue.fields;t={url:((i=d.url)==null?void 0:i.stringValue)||"",type:((l=(o=d.type)==null?void 0:o.stringValue)==null?void 0:l.toLowerCase())==="video"?"video":"image",thumbnailUrl:(c=d.thumbnailUrl)==null?void 0:c.stringValue}}else if(u&&u.url){const d=u.type==="video"?"video":"image";t={url:u.url,type:d,thumbnailUrl:u.thumbnailUrl}}else typeof u=="string"&&(t={url:u,type:"image"})}else if(e.media.url){const u=e.media.type==="video"?"video":"image";t={url:e.media.url,type:u,thumbnailUrl:e.media.thumbnailUrl}}}let r=[];e.platforms&&(Array.isArray(e.platforms)?r=e.platforms:typeof e.platforms=="object"&&(r=Object.keys(e.platforms)));const n={};return e.platforms&&typeof e.platforms=="object"&&Object.entries(e.platforms).forEac
3895h(([u,d])=>{d!=null&&d.results&&(n[u]={status:d.results.status,postId:d.results.postId,publishedAt:d.results.publishedAt,postUrl:d.results.postUrl,engagement:d.results.engagement||{likes:0,comments:0,shares:0,views:0}})}),{id:e.id,source:e.source||"socialness",hiddenByUser:e.hiddenByUser===!0,title:e.title||"",description:e.description||"",content:e.content||"",status:e.status||"draft",brandId:e.brandId||"",brandName:e.brandName||"",brandLogo:e.brandLogo||"",platforms:r,scheduledAt:gg(e.scheduledAt),publishedAt:gg(e.publishedAt),reminderAt:gg(e.reminderAt)||null,createdAt:gg(e.createdAt),updatedAt:gg(e.updatedAt),media:t,format:e.format||"post",postMediaType:(()=>{const u=e.postMediaType||e.post_media_type||e.mediaType||e.media_type,d=Aj(u);if(d==="image"||d==="video"||d==="document"||d==="multi"||d==="text")return d;if(Array.isArray(e.media)&&e.media.length>1)return"multi"})(),reviewerId:e.reviewerId,userId:e.userId,engagement:e.engagement||{likes:0,comments:0,shares:0,views:0},platformResults:n,platformData:e.platforms||{}}},rY=e=>{const{data:t}=oa(),r=g$(e==null?void 0:e.start),n=g$(e==null?void 0:e.end),a=e==null?void 0:e.applanguage,i=e==null?void 0:e.sort,o=e==null?void 0:e.order,l=(e==null?void 0:e.fresh)===!0||typeof window<"u"&&new URLSearchParams(window.location.search).get("fresh")==="true";return Wa({queryKey:["posts",{start:r||null,end:n||null,applanguage:a||null,sort:i||null,order:o||null,fresh:l||null}],queryFn:async()=>{var c;try{const u=Qe.currentUser;if(!u)throw new Error("No authenticated user");const d=await u.getIdToken(),f=new URLSearchParams;r&&f.set("start",r),n&&f.set("end",n),a&&f.set("applanguage",a),i&&f.set("sort",i),o&&f.set("order",o),l&&f.set("fresh","true"),f.set("limit","100");const m=`${PXe}/management/posts${f.toString()?`?${f.toString()}`:""}`;console.log("🔍 API Request:",m),console.log("🔑 Token preview:",d.slice(0,20)+"...");const h=await fetch(m,{headers:{Authorization:`Bearer ${d}`,"Content-Type":"application/json"}});if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const p=await h.json();return console.log("📦 Raw API Response:",JSON.stringify(p,null,2)),console.log("📊 Posts count in response:",((c=p.posts)==null?void 0:c.length)||0),{posts:(p.posts||[]).map(LXe),pagination:p.pagination||{},source:"api"}}catch(u){throw Ie.error("usePosts","Failed to fetch posts",u),u}},staleTime:5*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1})},mA=()=>{const e=qr();return mn({mutationFn:async({postId:t,postData:r,isFormData:n=!1})=>{try{Ie.info("useUpdatePost",`Updating post ID: ${t}`);const a=await U8(t,r,n);return Ie.info("useUpdatePost","Post updated successfully"),{success:!0,data:a}}catch(a){throw Ie.error("useUpdatePost","Error updating post:",a),a}},onSuccess:()=>{e.invalidateQueries({queryKey:["posts"]}),Ie.info("useUpdatePost","Posts queries invalidated")}})},DXe=({isOpen:e,onClose:t,idea:r,onPromoteToDraft:n,onDelete:a,onUp
3895date:i,isPromoting:o=!1,isDeleting:l=!1,isUpdating:c=!1})=>{const{t:u}=Te(),[d,f]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(null),[y,v]=b.useState(!1);b.useEffect(()=>{if(r&&e){if(f(r.title||r.content||""),h(r.description||""),r.reminderAt){const C=Xa(r.reminderAt);g(Gn(C)?C:null)}else g(null);v(!1)}},[r,e]);const x=C=>N=>{C(N),v(!0)},j=()=>{!r||!i||i(r.id,{title:d.trim(),description:m.trim(),reminderAt:p?p.toISOString():null})};return!e||!r?null:s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl shadow-xl max-w-md w-full p-6 border border-black",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xl",children:"💡"}),s.jsx("h2",{className:"text-xl font-semibold",children:u("ideaDetail.title","Post Idea")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"idea-detail-title",className:"block text-sm font-medium text-gray-700 mb-1",children:u("ideaDetail.ideaTitle","Title")}),s.jsx("input",{id:"idea-detail-title",type:"text",value:d,onChange:C=>x(f)(C.target.value),className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"idea-detail-desc",className:"block text-sm font-medium text-gray-700 mb-1",children:u("ideaDetail.description","Notes")}),s.jsx("textarea",{id:"idea-detail-desc",value:m,onChange:C=>x(h)(C.target.value),rows:3,className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm"})]}),r.brandName&&s.jsxs("div",{className:"flex items-center gap-2",children:[r.brandLogo&&s.jsx("img",{src:r.brandLogo,alt:r.brandName,className:"w-5 h-5 rounded object-cover",onError:C=>{C.currentTarget.style.display="none"}}),s.jsx("span",{className:"text-sm text-gray-500",children:r.brandName})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[s.jsx(Wme,{className:"inline h-4 w-4 mr-1 text-amber-500"}),u("ideaModal.reminderDate","Remind me on")]}),s.jsx(bh,{selected:p,onChange:C=>x(g)(C),dateFormat:"PPP",minDate:new Date,placeholderText:u("ideaModal.reminderPlaceholder","Pick a date (optional)"),className:"w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-amber-500 focus:border-amber-500 sm:text-sm",isClearable:!0,inline:!0})]})]}),s.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[y&&i&&s.jsx("button",{type:"button",onClick:j,disabled:!d.trim()||c,className:"w-full inline-flex items-center justify-center gap-2 rounded-md border border-transparent shadow-sm px-4 py-2.5 bg-amber-500 text-base font-medium text-white hover:bg-amber-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-amber-500 sm:text-sm disabled:opacity-50",children:c?u("common.saving","Saving..."):u("common.save","Save")}),s.jsxs("button",{type:"button",onClick:()=>n(r),disabled:o,className:"w-full inline-flex items-center justify-center gap-2 rounded-md border border-transparent shadow-sm px-4 py-2.5 bg-primary-600 text-base font-medium text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:text-sm disabled:opacity-50",children:[s.jsx(A7,{className:"h-4 w-4"}),o?u("common.saving","Saving..."):u("ideaDetail.promoteToDraft","Turn into a post")]}),s.jsxs("button",{type:"button",onClick:()=>a(r.id),disabled:l,className:"w-full inline-flex items-center justify-center gap-2 rounded-md border border-red-300 shadow-sm px-4 py-2.5 bg-white text-base font-medium text-red-600 hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm disabled:opacity-50",children:[s.jsx(lc,{className:"h-4 w-4"}),l?u("common.deleting","Deleting..."):u("common.delete","Delete")]})]})]})]})})},nY=()=>{const e=qr();return mn({mutationFn:async t=>{try{console.log(`🗑️ Deleting post ID: ${t}`);const r=await gje(t);if(!r.success){const n=r.message||"Failed to delete post";throw r.status!==void 0?new km(n,r.status,r.code):new Error(n)}return console.log("✅ Post deleted successfully"),r}catch(r){throw console.error("❌ Error deleting post:",r),r}},onSuccess:()=>
3895{e.invalidateQueries({queryKey:["posts"]})}})},OXe=()=>{const{t:e,i18n:t}=Te(),r=pn(),[n,a]=U.useState(!1),[i,o]=U.useState("month"),[l,c]=U.useState(!1),[u,d]=U.useState([]),[f,m]=U.useState([]),[h,p]=U.useState([]),[g,y]=U.useState([]),[v,x]=U.useState(null),[j,C]=U.useState({x:0,y:0}),N=U.useRef(null),[S,M]=U.useState({width:0,height:0}),[k,I]=U.useState(!1),[T,L]=U.useState(null),[R,_]=U.useState(null),[B,z]=U.useState(null),[D,A]=U.useState(!1),[P,E]=U.useState(void 0),F=V2(),$=nY(),[H,X]=U.useState(null),[ue,le]=U.useState(!1),[ae,te]=U.useState(!1),[ne,J]=U.useState({brand:!0,created:!0,updated:!0,published:!0}),{currentDate:G,setCurrentDate:Q}=AXe(),W=U.useMemo(()=>new Date(G.getFullYear(),G.getMonth(),1),[G]),Y=U.useMemo(()=>new Date(G.getFullYear(),G.getMonth()+1,0),[G]),{data:q,isLoading:Z,isFetching:me,error:we}=rY({start:W,end:Y,applanguage:t.language}),he=(q==null?void 0:q.posts)||[],ie=(ve,Fe="#0B65C2")=>{const nt=[],At=/(https?:\/\/[^\s]+|www\.[^\s]+|#[\p{L}\d_]+)/giu;let Wt=0,In;for(;(In=At.exec(ve))!==null;){const ir=In.index;ir>Wt&&nt.push(ve.slice(Wt,ir));const Qt=In[0];if(Qt.startsWith("#"))nt.push(s.jsx("span",{className:`text-[${Fe}]`,children:Qt},`hash-${ir}`));else{const Sn=Qt.startsWith("http")?Qt:`http://${Qt}`;nt.push(s.jsx("a",{href:Sn,target:"_blank",rel:"noreferrer",className:"hover:underline",style:{color:Fe},children:Qt},`link-${ir}`))}Wt=At.lastIndex}return Wt<ve.length&&nt.push(ve.slice(Wt)),nt},{showToast:ye}=bc(),pe=mA();U.useEffect(()=>{},[l]);const ce=U.useMemo(()=>{const ve=Array.from(new Set(he.map(Fe=>Fe.brandId).filter(Boolean)));return[{id:"all",name:e("brandDropdown.allBrands","All Brands"),logo:"/logo.svg"},...ve.map(Fe=>{const nt=he.find(At=>At.brandId===Fe);return{id:Fe,name:(nt==null?void 0:nt.brandName)||"Unknown Brand",logo:(nt==null?void 0:nt.brandLogo)||""}})]},[he,e]),xe=U.useMemo(()=>[{id:"idea",label:e("statusDropdown.idea","Idea"),emoji:"💡",description:e("statusDropdown.ideaDesc","A post idea saved for later with an optional reminder date.")},{id:"draft",label:e("statusDropdown.draft","Draft"),emoji:"📝",description:e("statusDropdown.draftDesc","Post is in progress, not yet submitted for review or scheduling.")},{id:"scheduled",label:e("statusDropdown.scheduled","Scheduled"),emoji:"📆",description:e("statusDropdown.scheduledDesc","Post is approved and set for automatic publishing at a future time.")},{id:"ready_to_publish",label:e("statusDropdown.ready_to_publish","Ready to Publish"),emoji:"🚀",description:e("statusDropdown.ready_to_publishDesc","Post is complete, approved, and awaiting its scheduled time or manual publishing.")},{id:"waiting_for_approval",label:e("statusDropdown.waiting_for_approval","Waiting for approval"),emoji:"⏳",description:e("statusDropdown.waiting_for_approvalDesc","Post has been submitted and is awaiting review by an approver.")},{id:"published",label:e("statusDropdown.published","Published"),emoji:"✅",description:e("statusDropdown.publishedDesc","Post has been successfully shared on the selected platforms.")},{id:"rejected",label:e("statusDropdown.rejected","Rejected"),emoji:"❌",description:e("statusDropdown.rejectedDesc","Post was reviewed but not approved for publishing by an approver.")},{id:"error",label:e("statusDropdown.error","Error"),emoji:"⚠️",description:e("statusDropdown.errorDesc","An error occurred while trying to publish or process the post.")},{id:"processing",label:e("statusDropdown.processing","Processing"),emoji:"⚙️",description:e("statusDropdown.processingDesc","Post is currently being processed by the system (e.g., media upload, API submission).")}],[e]),Ee=U.useMemo(()=>[{id:"all",label:e("mediaFormat.all","All Media"),emoji:"🌐"},{id:"image",label:e("mediaFormat.image","Image"),emoji:"📷"},{id:"video",label:e("mediaFormat.video","Video"),emoji:"🎥"},{id:"carousel",label:e("mediaFormat.carousel","Carousel"),emoji:"🖼️"},{id:"text",label:e("mediaFormat.text","Text"),emoji:"📄"}],[e]),Ye=U.useMemo(()=>[{id:"all",label:e("postFormat.all","All Formats"),emoji:"🌐"},{id:"regular",label:e("postFormat.regular","Regular"),emoji:"📄"},{id:"reel",label:e("postFormat.reel","Reel"),emoji:"🎬"}],[e]),fe=ve=>{const Fe=ve.postMediaType;if(Fe)switch(Fe.toLowerCase()){case"image":return"image";case"video":return"video";case"multi-images":return"carousel";case"document":return"text";default:return"all"}const nt=Xn(ve.media);return nt?nt.type==="image"?"image":nt.type==="video"?"video":"all":"all"},je=ve=>ve.format==="reel"?"reel":"regular",We=he.filter(ve=>!(ve.status==="draft"||f.length>0&&!f.includes("all")&&(!ve.brandId||!f.includes(ve.brandId))||u.length>0&&!u.includes(ve.status)||h.length>0&&!h.includes("all")&&!h.includes(fe(ve))||g.length>0&&!g.includes("all")&&!g.includes(je(ve)))),yt=he.filter(ve=>!(ve.status!=="draft"||f.length>0&&!f.includes("all")&&(!ve.brandId||!f.includes(ve.brandId))||h.length>0&&!h.includes("all")&&!h.includes(fe(ve))||g.length>0&&!g.includes("all")&&!g.includes(je(ve)))),gt=U.useMemo(()=>{const ve={};return he.forEach(Fe=>{const nt=Fe.brandId||"unknown";ve[nt]=(ve[nt]||0)+1}),ve},[he]),qe=U.useMemo(()=>{const ve={};return he.forEach(Fe=>{const nt=Fe.status||"unknown";ve[nt]=(ve[nt]||0)+1}),ve},[he]),ze=U.useMemo(()=>{const ve={};return he.forEach(Fe=>{const nt=fe(Fe);ve[nt]=(ve[nt]||0)+1}),ve},[he]),$e=U.useMemo(()=>{const ve={};return he.forEach(Fe=>{const nt=je(Fe);ve[nt]=(ve[nt]||0)+1}),ve},[he]),ct=ve=>
3895{if(ve.status==="idea"){X(ve),le(!0);return}window.scrollTo(0,0),r(`/posts/${ve.id}/edit`,{state:{post:ve}})},oe=()=>{a(!1),r("/content-creation")},Ne=()=>{a(!1),r("/posts/new")},Ae=()=>{a(!1),E(void 0),A(!0)},lt=(ve,Fe)=>{L(Fe);const nt=ve.currentTarget,At=nt.getBoundingClientRect(),Wt=nt.cloneNode(!0);Wt.style.width=At.width+"px",Wt.style.height=At.height+"px",Wt.style.position="absolute",Wt.style.top="-1000px",Wt.style.left="-1000px",Wt.style.pointerEvents="none",Wt.style.transform="none",Wt.style.opacity="0.9",Wt.style.backgroundColor="white",Wt.style.borderRadius="8px",Wt.style.border="1px solid black",Wt.style.boxShadow="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",document.body.appendChild(Wt),ve.dataTransfer.setDragImage(Wt,At.width/2,At.height/2),setTimeout(()=>{document.body.contains(Wt)&&document.body.removeChild(Wt)},0)},Mt=ve=>{T&&(console.log("📅 handleDrop - Dropped on date:",ve,"ISO:",ve.toISOString()),_(ve),I(!0))},jt=async(ve,Fe)=>{if(T&&ve)try{console.log("📅 handleScheduleConfirm - Received scheduledAtUtc:",ve,"timezone:",Fe),console.log("📅 handleScheduleConfirm - Original dropDate was:",R,"ISO:",R==null?void 0:R.toISOString());const nt={...T,status:"scheduled",scheduledAt:ve};await pe.mutateAsync({postId:T.id,postData:nt,isFormData:!1}),ye(e("calendar.scheduleSuccess","Post scheduled successfully!"),"success"),L(null),_(null),I(!1)}catch(nt){console.error("Error scheduling post:",nt),ye(e("calendar.scheduleError","Failed to schedule post. Please try again."),"error")}},Xe=()=>{L(null),_(null),I(!1)};U.useLayoutEffect(()=>{if(!v)return;const ve=()=>{if(N.current){const At=N.current.getBoundingClientRect();At.width>0&&At.height>0&&M({width:At.width,height:At.height})}};ve();const Fe=requestAnimationFrame(ve);let nt=null;return N.current&&"ResizeObserver"in window&&(nt=new ResizeObserver(()=>{requestAnimationFrame(()=>{if(N.current){const At=N.current.getBoundingClientRect();At.width>0&&At.height>0&&M({width:Math.ceil(At.width),height:Math.ceil(At.height)})}})}),nt.observe(N.current)),window.addEventListener("resize",ve),()=>{cancelAnimationFrame(Fe),window.removeEventListener("resize",ve),nt&&nt.disconnect()}},[v]);const Bt=()=>{const ve=window.innerWidth,Fe=window.innerHeight,nt=Math.min(800,ve*.9),At=Math.min(500,Fe*.8),Wt=S.width||nt,In=S.height||At,ir=20,Qt=Math.min(Wt,ve-ir*2),Sn=Math.min(In,Fe-ir*2);let nn=j.x+10,Lt=j.y-100;return nn+Qt+ir>ve&&(nn=j.x-Qt-10),nn<ir&&(nn=ir),Qt+ir*2>ve&&(nn=ir),Lt+Sn+ir>Fe&&(Lt=Fe-Sn-ir),Lt<ir&&(Lt=ir),Sn+ir*2>Fe&&(Lt=ir),{x:nn,y:Lt,width:Qt,height:Sn}};return Z?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0 animate-pulse overflow-x-hidden",children:s.jsxs("div",{className:"w-full max-w-[95%] mx-auto px-2 sm:px-4 py-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6 sm:mb-8",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/2 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"})]}),s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-32"})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6 sm:mb-8",children:[s.jsx("div",{className:"flex-1"})," ",s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[s.jsx("div",{className:"h-8 sm:h-10 bg-gray-200 rounded-lg w-full sm:w-32 lg:w-40"}),s.jsx("div",{className:"h-8 sm:h-10 bg-gray-200 rounded-lg w-full sm:w-32 lg:w-40"})]})]}),s.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-lg p-2 sm:p-4 lg:p-6 max-w-full overflow-hidden",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("div",{className:"h-6 w-6 sm:h-8 sm:w-8 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-5 sm:h-6 bg-gray-200 rounded w-1/3"}),s.jsx("div",{className:"h-6 w-6 sm:h-8 sm:w-8 bg-gray-200 rounded-full"})]}),s.jsx("div",{className:"grid grid-cols-7 gap-0.5 sm:gap-1 text-center text-xs font-semibold text-gray-500 mb-2",children:[...Array(7)].map((ve,Fe)=>s.jsx("div",{className:"h-3 sm:h-4 bg-gray-200 rounded w-1/2 mx-auto"},Fe))}),s.jsx("div",{className:"grid grid-cols-7 gap-px border-t border-l overflow-hidden",children:[...Array(35)].map((ve,Fe)=>s.jsx("div",{className:"relative bg-gray-50 border-r border-b h-16 sm:h-24 lg:h-32",children:s.jsx("div",{className:"absolute top-0.5 left-0.5 sm:top-1 sm:left-1 h-3 w-3 sm:h-4 sm:w-4 bg-gray-200 rounded"})},Fe))})]})]})}):s.jsxs(s.Fragment,{children:[me&&s.jsx(Wu,{title:e("calendar.loading.title","Loading your calendar..."),currentStep:e("calendar.loading.refreshing","Refreshing posts..."),videoSrc:"/Panda - Gold Digger.mov"}),s.jsxs(rs,{title:e("calendar.title"),subtitle:s.jsxs("div",{children:[e("calendar.subtitle"),we&&s.jsx("div",{className:"mt-2 p-2 bg-red-50 border border-red-200 rounded-lg text-sm",children:s.jsxs("p",{className:"text-sm text-red-600",children:["⚠️ ",e("calendar.errorLoadingPosts","Unable to load some posts. The calendar may not show all scheduled content.")]})})]}),actions:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:()=>{E(void 0),A(!0)},className:"inline-flex items-center px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors",children:[s.jsx(Fs,{className:"w-5 h-5 mr-2"}),e("calendar.addIdea","Add Idea")]}),s.jsxs("button",{onClick:()=>a(!0),className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("sidebar.createContent")]})]}),className:"overflow-x-hidden",headerClassName:"w-full max-w-[100vw] mx-auto px-2 sm:px-4 overflow-x-hidden",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6 sm:mb-8 overflow-x-auto",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>o("month"),className:`inline-flex items-center px-2 sm:px-3 py-1.5 rounded-lg text-sm ${i==="month"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[s.jsx(vo,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),"Mois"]}),s.jsxs("button",{onClick:()=>o("week"),className:`inline-flex items-center px-2 sm:px-3 py-1.5 rounded-lg text-sm ${i==="week"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[s.jsx(vo,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),"Semaine"]})]}),s.jsx("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 sm:gap-3 w-full sm:w-auto",children:(()=>{const ve=(u.length>0?1:0)+(f.length>0?1:0)+(h.length>0?1:0)+(g.length>0?1:0);return s.jsx("div",{className:"relative",children:s.jsxs("button",{onClick:()=>c(Fe=>!Fe),className:"inline-flex items-center px-4 py-2 border border-gray-300 rounded-lg bg-white text-sm font-medium text-gray-700 hover:text-primary-600","aria-expanded":l,children:[s.jsx(k2,{className:"w-4 h-4 mr-2 text-primary-500"}),e("calendar.filters","Filtres"),ve>0&&s.jsx("span",{className:"ml-2 inline-flex items-center justify-center rounded-full bg-primary-600 text-white text-xs w-5 h-5",children:ve})]})})})()})]}),s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 lg:gap-6",children:[s.jsx("div",{className:"flex-1 min-w-0",children:i==="month"?s.jsx(YZe,{currentDate:G,onDateChange:Q,posts:We,onPostClick:ct,onDrop:Mt,dragOverDate:B,onDragOver:z,onPostDragStart:lt}):s.jsx(QZe,{currentDate:G,onDateChange:Q,posts:We,onPostClick:ct,onDrop:Mt,dragOverDate:B,onDragOver:z,onPostDragStart:lt})}),s.jsxs("div",{className:"w-full lg:w-80 bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4 mt-4 lg:mt-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("span",{className:"bg-orange-100 text-orange-700 text-xs font-medium px-2.5 py-0.5 rounded-full",children:yt.length}),s.jsx("h3",{className:"font-semibold text-gray-900",children:"Non planifiés"})]}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Glissez et déposez ces brouillons sur le calendrier pour les programmer."}),yt.length>0?s.jsx("div",{className:"space-y-3",children:yt.map(ve=>s.jsxs("div",{draggable:!0,onClick:()=>ct(ve),className:"cursor-move p-3 border border-black rounded-lg hover:bg-gray-50 transition-colors",onDragStart:Fe=>lt(Fe,ve),onMouseEnter:Fe=>{x(ve.id),C({x:Fe.clientX,y:Fe.clientY})},onMouseMove:Fe=>{v===ve.id&&C({x:Fe.clientX,y:Fe.clientY})},onMouseLeave:()=>x(null),children:[s.jsxs("div",{className:"flex items-start gap-3",children:[(()=>{const Fe=Xn(ve.media);if(!Fe)return null;const nt=/\.pdf(\?|#|$)/i.test(Fe.url);return s.jsx("div",{className:"flex-shrink-0 w-12 h-12 bg-gray-100 rounded overflow-visible relative",children:nt?s.jsx(Ef,{src:Fe.url,className:"w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:Fe.url,altText:"Post media",type:Fe.type,className:"w-full h-full",objectFit:"cover",controls:!1,autoPlayOnMount:Fe.type==="video",muted:!0}
3895)})})(),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[s.jsx("p",{className:"text-sm text-gray-900 line-clamp-2 flex-1",children:ie(ve.content)}),!ve.media&&s.jsx("span",{className:"text-[10px] bg-gray-100 px-1 py-0.5 rounded flex-shrink-0",children:"📝"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ve.brandLogo&&s.jsx("img",{src:ve.brandLogo,alt:ve.brandName||"Brand logo",className:"w-4 h-4 rounded object-cover"}),s.jsx("div",{className:"flex gap-1",children:ve.platforms.map(Fe=>s.jsx(cr,{platform:Fe,size:14},Fe))})]})]})]}),ae&&s.jsx("div",{className:"mt-2",children:s.jsx(KH,{media:ve.media,postId:ve.id})})]},ve.id))}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx("div",{className:"text-gray-400 mb-2",children:"📝"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Aucun brouillon en attente"})]})]})]})]}),v&&(()=>{const ve=Bt();return s.jsx("div",{ref:N,className:"fixed pointer-events-none z-50 overflow-auto",style:{left:ve.x,top:ve.y,width:ve.width,height:ve.height,maxWidth:"95vw",maxHeight:"90vh"},children:s.jsx(db,{post:yt.find(Fe=>Fe.id===v)})})})(),l&&s.jsxs("div",{className:"fixed inset-0 z-50",children:[s.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:()=>c(!1)}),s.jsx("div",{className:"absolute right-0 top-0 h-full w-full sm:w-[380px] bg-white shadow-2xl border-l border-gray-200 transform transition-transform duration-300 ease-out",children:s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"px-5 py-4 border-b border-gray-200 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e("calendar.filters","Filtres")}),s.jsx("button",{onClick:()=>c(!1),className:"text-gray-500 hover:text-gray-700","aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("calendar.filter.status","Statut")}),s.jsx("div",{className:"space-y-3",children:xe.map(ve=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 rounded border-gray-300 text-primary-600",checked:u.includes(ve.id),onChange:Fe=>{d(nt=>Fe.target.checked?[...nt,ve.id]:nt.filter(At=>At!==ve.id))}}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0",children:ve.emoji}),s.jsxs("span",{className:"truncate font-semibold",children:[ve.label," (",qe[ve.id]??0,")"]})]}),s.jsx("div",{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:ve.description})]})]},ve.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("calendar.filter.mediaFormat","Type de média")}),s.jsx("div",{className:"space-y-3",children:Ee.filter(ve=>ve.id!=="all").map(ve=>s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:h.includes(ve.id),onChange:Fe=>{p(nt=>Fe.target.checked?[...nt,ve.id]:nt.filter(At=>At!==ve.id))}}),s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx("span",{children:ve.emoji}),s.jsxs("span",{className:"truncate max-w-[220px]",children:[ve.label," (",ze[ve.id]??0,")"]})]})]},ve.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("calendar.filter.postFormat","Format du post")}),s.jsx("div",{className:"space-y-3",children:Ye.filter(ve=>ve.id!=="all").map(ve=>s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:g.includes(ve.id),onChange:Fe=>{y(nt=>Fe.target.checked?[...nt,ve.id]:nt.filter(At=>At!==ve.id))}}),s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx("span",{children:ve.emoji}),s.jsxs("span",{className:"truncate max-w-[220px]",children:[ve.label," (",$e[ve.id]??0,")"]})]})]},ve.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("calendar.filter.brand","Marque")}),s.jsx("div",{className:"space-y-3",children:ce.map(ve=>s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:f.includes(ve.i
3895d),onChange:Fe=>{if(ve.id==="all"){m(Fe.target.checked?["all"]:[]);return}m(nt=>{const At=nt.filter(Wt=>Wt!=="all");return Fe.target.checked?At.includes(ve.id)?At:[...At,ve.id]:At.filter(Wt=>Wt!==ve.id)})}}),s.jsxs("span",{className:"inline-flex items-center gap-2",children:[ve.id!=="all"&&ve.logo?s.jsx("img",{src:ve.logo,alt:ve.name,className:"w-5 h-5 rounded object-contain"}):null,s.jsxs("span",{className:"truncate max-w-[220px]",children:[ve.name,ve.id!=="all"?` (${gt[ve.id]??0})`:""]})]})]},ve.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("calendar.filter.columns","Colonnes")}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:ne.brand,onChange:ve=>J(Fe=>({...Fe,brand:ve.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("calendar.columns.brand","Marque")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:ne.created,onChange:ve=>J(Fe=>({...Fe,created:ve.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("calendar.columns.created","Créé")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:ne.updated,onChange:ve=>J(Fe=>({...Fe,updated:ve.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("calendar.columns.updated","Modifié")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:ne.published,onChange:ve=>J(Fe=>({...Fe,published:ve.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("calendar.columns.published","Publié")})]})]})]})]}),s.jsxs("div",{className:"px-5 py-4 border-t border-gray-200 flex items-center justify-between",children:[s.jsx("button",{type:"button",onClick:()=>{d([]),m([]),p([]),y([]),J({brand:!0,created:!0,updated:!0,published:!0})},className:"px-4 py-2 text-sm rounded-lg text-gray-700 hover:text-primary-600",children:e("common.reset","Réinitialiser")}),s.jsx("div",{})]})]})})]}),s.jsx(np,{isOpen:n,onClose:()=>a(!1),onCreateWithAI:oe,onCreateManually:Ne,onCreateIdea:Ae}),s.jsx(EXe,{isOpen:k,onClose:Xe,onConfirm:jt,post:T,initialDate:R||void 0}),s.jsx(UE,{isOpen:D,onClose:()=>A(!1),initialDate:P,isLoading:F.isPending,onSave:async ve=>{try{await F.mutateAsync({postData:{title:ve.title,description:ve.description,brandId:ve.brandId,status:"idea",reminderAt:ve.reminderAt,platforms:{},content:""}}),ye(e("calendar.ideaSaved","Idea saved!"),"success"),A(!1)}catch(Fe){console.error("Error saving idea:",Fe),ye(e("calendar.ideaError","Failed to save idea."),"error")}}}),s.jsx(DXe,{isOpen:ue,onClose:()=>{le(!1),X(null)},idea:H,isPromoting:pe.isPending,isDeleting:$.isPending,onUpdate:async(ve,Fe)=>{try{await pe.mutateAsync({postId:ve,postData:{title:Fe.title,description:Fe.description,reminderAt:Fe.reminderAt},isFormData:!1}),ye(e("ideaDetail.ideaUpdated","Idea updated!"),"success"),le(!1),X(null)}catch(nt){console.error("Error updating idea:",nt),ye(e("calendar.ideaError","Failed to save idea."),"error")}},onPromoteToDraft:async ve=>{try{await pe.mutateAsync({postId:ve.id,postData:{status:"draft"},isFormData:!1}),ye(e("calendar.promotedToDraft","Idea promoted to draft!"),"success"),le(!1),X(null),r(`/posts/${ve.id}/edit`)}catch(Fe){console.error("Error promoting idea:",Fe),ye(e("calendar.promoteError","Failed to promote idea."),"error")}},onDelete:async ve=>{try{await $.mutateAsync(ve),ye(e("calendar.ideaDeleted","Idea deleted."),"success"),le(!1),X(null)}catch(Fe){console.error("Error deleting idea:",Fe),ye(e("calendar.ideaDeleteError","Failed to delete idea."),"error")}}})]})}
3895,RXe=({value:e,onChange:t,className:r=""})=>{const[n,a]=b.useState(!1),{t:i,i18n:o}=Te(),l=U.useMemo(()=>[{id:"educate",name:i("contentCreation.form.goals.educate","Educate"),emoji:"📚",description:i("contentCreation.form.goalDescriptions.educate","Educational content that teaches and shares knowledge with your audience")},{id:"entertain",name:i("contentCreation.form.goals.entertain","Entertain"),emoji:"🎭",description:i("contentCreation.form.goalDescriptions.entertain","Entertaining content that captivates and engages through humor, stories, or creativity")},{id:"inform",name:i("contentCreation.form.goals.inform","Inform"),emoji:"📢",description:i("contentCreation.form.goalDescriptions.inform","Informative content that shares news, updates, or important information")},{id:"promote",name:i("contentCreation.form.goals.promote","Promote"),emoji:"🚀",description:i("contentCreation.form.goalDescriptions.promote","Promotional content that highlights products, services, or campaigns")}],[i,o.language]),c=l.find(u=>u.id===e)||null;return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),a(!n)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${r}`,children:[s.jsx("span",{className:"flex items-center gap-2",children:c?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-lg",children:c.emoji}),s.jsx("span",{className:"text-gray-700",children:c.name})]}):s.jsx("span",{className:"text-gray-500",children:i("contentCreation.form.selectGoal","Select a goal")})}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:u=>{u.stopPropagation(),a(!1)}}),s.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsx("div",{className:"py-1",children:l.map(u=>s.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),t(u.id),a(!1)},className:`w-full text-left px-4 py-2 ${u.id===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:u.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:u.name}),s.jsx("div",{className:"text-xs text-gray-500",children:u.description})]})]})},u.id))})})]})]})},aY=[{code:"en",name:"English",emoji:"🇬🇧"},{code:"en-US",name:"English (United States)",emoji:"🇺🇸"},{code:"en-GB",name:"English (United Kingdom)",emoji:"🇬🇧"},{code:"fr",name:"French",emoji:"🇫🇷"},{code:"fr-CA",name:"French (Canada)",emoji:"🇨🇦"},{code:"de",name:"German",emoji:"🇩🇪"},{code:"es",name:"Spanish",emoji:"🇪🇸"},{code:"es-MX",name:"Spanish (Mexico)",emoji:"🇲🇽"},{code:"it",name:"Italian",emoji:"🇮🇹"},{code:"pt",name:"Portuguese",emoji:"🇵🇹"},{code:"pt-BR",name:"Portuguese (Brazil)",emoji:"🇧🇷"},{code:"nl",name:"Dutch",emoji:"🇳🇱"},{code:"ru",name:"Russian",emoji:"🇷🇺"},{code:"ar",name:"Arabic",emoji:"🇸🇦"},{code:"zh",name:"Mandarin Chinese",emoji:"🇨🇳"},{code:"ja",name:"Japanese",emoji:"🇯🇵"},{code:"ko",name:"Korean",emoji:"🇰🇷"},{code:"hi",name:"Hindi",emoji:"🇮🇳"},{code:"bn",name:"Bengali",emoji:"🇧🇩"},{code:"tr",name:"Turkish",emoji:"🇹🇷"},{code:"vi",name:"Vietnamese",emoji:"🇻🇳"},{code:"tl",name:"Tagalog / Filipino",emoji:"🇵🇭"},{code:"fa",name:"Persian (Farsi)",emoji:"🇮🇷"},{code:"pl",name:"Polish",emoji:"🇵🇱"},{code:"th",name:"Thai",emoji:"🇹🇭"},{code:"sv",name:"Swedish",emoji:"🇸🇪"},{code:"ro",name:"Romanian",emoji:"🇷🇴"},{code:"uk",name:"Ukrainian",emoji:"🇺🇦"},{code:"cs",name:"Czech",emoji:"🇨🇿"},{code:"lb",name:"Luxembourgish",emoji:"🇱🇺"},{code:"da",name:"Danish",emoji:"🇩🇰"},{code:"fi",name:"Finnish",emoji:"🇫🇮"},{code:"no",name:"Norwegian",emoji:"🇳🇴"}],$Xe=e=>{const t=aY.find(r=>r.code===e.toLowerCase());return t||{code:e.toLowerCase(),name:e.toUpperCase(),emoji:"🌐"}}
3895,FXe=({value:e,onChange:t,buttonLabel:r="Select Language",className:n=""})=>{const[a,i]=b.useState(!1),[o,l]=b.useState("");b.useEffect(()=>{if(a){const f=()=>i(!1);return document.addEventListener("click",f),()=>document.removeEventListener("click",f)}},[a]);const c=aY.filter(f=>f.name.toLowerCase().includes(o.toLowerCase())||f.code.toLowerCase().includes(o.toLowerCase())),u=f=>{t(f),i(!1),l("")},d=$Xe(e);return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),i(!a)},className:`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-lg bg-white text-left ${n}`,children:[e?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:d.emoji}),s.jsx("span",{className:"text-gray-700",children:d.name})]}):s.jsx("span",{className:"text-gray-700",children:r}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500"})]}),a&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:f=>{f.stopPropagation(),i(!1)}}),s.jsxs("div",{className:"absolute left-0 right-0 mt-2 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20 max-h-96 overflow-auto",children:[s.jsx("div",{className:"p-3 border-b border-gray-200",children:s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx($i,{className:"h-4 w-4 text-gray-400"})}),s.jsx("input",{type:"text",placeholder:"Search languages...",className:"block w-full pl-9 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500",value:o,onChange:f=>l(f.target.value),onClick:f=>f.stopPropagation()})]})}),s.jsxs("div",{className:"py-1",children:[c.map(f=>s.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),u(f.code)},className:`w-full text-left px-4 py-2 ${f.code===e?"bg-primary-50 text-primary-600":"text-gray-700 hover:text-primary-600 hover:bg-gray-50"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:f.emoji}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:f.name}),s.jsxs("div",{className:"text-xs text-gray-500",children:["(",f.code,")"]})]})]})},f.code)),c.length===0&&s.jsx("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No languages found"})]})]})]})]})},Gj=(e,t)=>{if(!(e!=null&&e.social_accounts))return null;const r=e.social_accounts.find(n=>n.platform.toLowerCase()===t.toLowerCase());return(r==null?void 0:r.followers_count)||null},zl=e=>e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString(),XS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20id='like-consumption-medium'%20data-supported-dps='24x24'%3e%3cg%3e%3cpath%20d='M12%200a12%2012%200%200112%2012%2012%2012%200%2001-12%2012A12%2012%200%20010%2012%2012%2012%200%200112%200z'%20fill='none'/%3e%3ccircle%20cx='12'%20cy='12'%20r='11'%20fill='%23378fe9'/%3e%3cpath%20d='M11.71%209.54H5.88A1.37%201.37%200%20004.5%2011%201.43%201.43%200%20006%2012.34h.25a1.25%201.25%200%2000-.1%202.5%201.25%201.25%200%2000.52%202.23%201.23%201.23%200%2000-.13.88%201.33%201.33%200%20001.33%201h3.6a5.54%205.54%200%20001.4-.18l2.26-.66h3c1.58-.06%202-7.29%200-7.29h-.86c-.14%200-.23-.3-.62-.72-.58-.62-1.23-1.42-1.69-1.88a11.19%2011.19%200%2001-2.68-3.46c-.37-.8-.41-1.17-1.18-1.17a1.22%201.22%200%2000-1%201.28c0%20.42.09.84.16%201.26a12.52%2012.52%200%20001.55%203.46'%20fill='%23d0e8ff'%20fill-rule='evenodd'/%3e%3cpath%20d='M11.71%209.54H5.88a1.43%201.43%200%2000-1%20.43A1.43%201.43%200%20006%2012.36h.25A1.23%201.23%200%20005%2013.61a1.25%201.25%200%20001.15%201.25%201.22%201.22%200%2000-.47%201.28%201.24%201.24%200%20001%20.94%201.23%201.23%200%2000-.13.88%201.33%201.33%200%20001.33%201h3.6a6%206%200%20001.4-.18l2.26-.66h3c1.58-.05%202-7.28%200-7.28h-.86c-.14%200-.23-.3-.62-.72-.59-.62-1.24-1.43-1.66-1.88a11.19%2011.19%200%2001-2.68-3.46c-.37-.81-.41-1.2-1.18-1.17a1.15%201.15%200%2000-1%201.28c0%20.4.05.81.11%201.21a12.12%2012.12%200%20001.55%203.44'%20fill='none'%20stroke='%23004182'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",zXe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20id='empathy-consumption-medium'%20data-supported-dps='24x24'%3e%3cg%3e%3cpath%20d='M12%2
389500a12%2012%200%200112%2012%2012%2012%200%2001-12%2012A12%2012%200%20010%2012%2012%2012%200%200112%200z'%20fill='none'/%3e%3ccircle%20cx='12'%20cy='12'%20r='11'%20fill='%23df704d'/%3e%3cpath%20d='M11.54%207.3a4.09%204.09%200%2000-5.83%200%204.18%204.18%200%20000%205.88L12%2019.5l6.29-6.32a4.18%204.18%200%20000-5.88%204.1%204.1%200%2000-2.92-1.22h0a4.07%204.07%200%2000-2.9%201.24l-.47.44z'%20fill='%23fff3f0'%20stroke='%2377280c'%20fill-rule='evenodd'/%3e%3cpath%20d='M17.39%207.57a3.12%203.12%200%2001.84%201c1.41%202.62-.95%204.26-2.43%205.75-1%201-1.91%201.92-2.9%202.84M8.52%207a3.42%203.42%200%2000-1.19.16%202.88%202.88%200%2000-1.49%201.28%203.87%203.87%200%2000-.48%202v.15'%20fill='none'/%3e%3cpath%20d='M11.54%207.22a4.09%204.09%200%2000-5.83%200%204.18%204.18%200%20000%205.88L12%2019.42l6.29-6.32a4.18%204.18%200%20000-5.88A4.1%204.1%200%200015.37%206h0a4.06%204.06%200%2000-2.9%201.23l-.47.45z'%20fill='none'%20stroke='%2377280c'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",BXe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20id='support-consumption-medium'%20data-supported-dps='24x24'%3e%3cdefs%3e%3cmask%20id='reactions-support-consumption-medium-a'%20x='0'%20y='0'%20width='24'%20height='24'%20maskUnits='userSpaceOnUse'%3e%3cpath%20d='M12%2023A11%2011%200%20101%2012a11%2011%200%200011%2011z'%20fill='%23fff'/%3e%3c/mask%3e%3c/defs%3e%3cg%20mask='url(%23reactions-support-consumption-medium-a)'%3e%3ccircle%20cx='12'%20cy='12'%20r='12'%20fill='none'/%3e%3cpath%20d='M12%2023A11%2011%200%20101%2012a11%2011%200%200011%2011z'%20fill='%23d8d8d8'/%3e%3cpath%20d='M12%2023A11%2011%200%20101%2012a11%2011%200%200011%2011z'%20fill='%23bba9d1'/%3e%3cpath%20d='M8.36%2014.28H8c-.36-.13-2.16-.82-3.38-1.16a.39.39%200%2001-.28-.33%201.06%201.06%200%2001.21-.79.65.65%200%2001.52-.26%201.06%201.06%200%2001.31%200%202.73%202.73%200%2001.66.39l.09.07.56.39.52.37%201.31.52c.18.08.92.42.87.6s-.83.17-1%20.17z'%20fill='%23fde7ff'/%3e%3cpath%20d='M5.09%2011.93a1%201%200%2001.24.05%203.1%203.1%200%2001.7.42l1.11.77%202.19.94a5.18%205.18%200%2001-1.18%200H8.1c-.49-.19-2.2-.83-3.39-1.16a.18.18%200%2001-.13-.15.87.87%200%2001.13-.63.42.42%200%2001.37-.
389517zm0-.39a.88.88%200%2000-.7.34%201.3%201.3%200%2000-.2.92.6.6%200%2000.43.52c1.22.34%203%201%203.36%201.15a.58.58%200%2000.19%200h.25c.27%200%202.46.28%202.52%200-.43-.25-2-1-2.29-1.18l-1.3-.52-.52-.36a5%205%200%2001-.53-.38L6.2%2012a2.47%202.47%200%2000-.72-.42%201.15%201.15%200%2000-.37-.06z'%20style='isolation:isolate'%20fill='%23fce2ba'%20opacity='.23'/%3e%3cpath%20d='M21.23%2019.91a33.64%2033.64%200%2001-5.3-.53h-.1a29.14%2029.14%200%2001-3.93-.81c-1.15-.35-2.28-.8-3.37-1.23L8%2017.16c-1-.41-1.87-.75-2.64-1.08L5.11%2016a10.91%2010.91%200%2001-1.34-.63C3.17%2015%203%2014.53%203.25%2014a.87.87%200%2001.86-.5h.07a1.13%201.13%200%2001.26%200%2028.83%2028.83%200%20014.25%201.36l1.78.06%204%20.14a7.3%207.3%200%2000-3-1.28c-.37-.1-.71-.2-.78-.47a1.06%201.06%200%2001.35-1.13%201.44%201.44%200%2001.84-.2%205.19%205.19%200%20011%20.13%204.24%204.24%200%2001.53.16%205.6%205.6%200%20001.29.28%2015.14%2015.14%200%20012.2.45c2.24.6%202.68%201.72%203%202.4-.09-.27%200-.07%200-.17l.06-.09h1.48c.18%200%201-.21%201%200a9.33%209.33%200%2001-1%204.7.29.29%200%2001-.21.16z'%20fill='%23eae2f3'/%3e%3cpath%20d='M20.18%2015.13a.17.17%200%2000.14%200z'%20fill='%23d67676'/%3e%3cpath%20d='M8.93%204.64a2.23%202.23%200%2000-3.08%200%202.15%202.15%200%20000%203.07L9.17%2011l3.36-3.3a2.14%202.14%200%20000-3.06A2.2%202.2%200%200011%204a2.23%202.23%200%2000-1.55.63l-.24.25z'%20fill='%23ecaa96'%20fill-rule='evenodd'/%3e%3cpath%20d='M22.89%2015.31a4.45%204.45%200%2001-.19%202.55A5.34%205.34%200%200121.42%2020a85.21%2085.21%200%2001-8.62-1c-1.58-.27-9.31-3.65-9.61-3.82a1.13%201.13%200%2001.52-1.67c.85-.25%203%201.12%204.41%201.25s4.5.25%205.65.25-1-.8-1.59-1-1.48-.4-1.67-1%20.42-1%20.93-1a14.1%2014.1%200%20012.72.67%209.22%209.22%200%20013.61.61%204.2%204.2%200%20012.16%202c.16.34%202.79-.11%202.96.02z'%20fill='none'%20stroke='%23493d57'/%3e%3cpath%20d='M4.11%2013.47C3.75%2012.5%204.33%2012%205%2012s1.35.61%202.45%201.3A27.28%2027.28%200%200011%2015'%20fill='none'%20stroke='%23493d57'/%3e%3cpath%20d='M8.74%205.13a2.23%202.23%200%2000-3.09%200%202.15%202.15%200%20000%203L9%2011.5l3.37-3.3A2.15%202.15%200%200013%206.31a2.19%202.19%200%2000-1.21-1.59%202.14%202.14%200%2000-1-.22%202.22%202.22%200%2000-1.56.64L9%205.38z'%20fill='none'%20stroke='%2377280c'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",UXe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20id='interest-consumption-medium'%20data-supported-dps='24x24'%3e%3cg%3e%3cpath%20d='M12%200a12%2012%200%200112%2012%2012%2012%200%2001-12%2012A12%2012%200%20010%2012%2012%2012%200%200112%200z'%20fill='none'/%3e%3ccircle%20cx='12'%20cy='12'%20r='11'%20fill='%23f5bb5c'/%3e%3cpath%20d='M13.29%2020.48h-2.52a.86.86%200%2001-.84-.84v-2.1h4.2v2.1a.86.86%200%2001-.84.84z'%20fill='%23ffe1b2'%20fill-rule='evenodd'/%3e%3cpath%20d='M9.93%2018v-.42A4.7%204.7%200%20009.69%2016a5.21%205.21%200%2000-.81-1.26A5.14%205.14%200%20017%2010.84a5%205%200%201110.08%200%205.27%205.27%200%2001-2%204l-.06.05a1.75%201.75%200%2000-.29.32%202.49%202.49%200%2000-.36.73%205.15%205.15%200%2000-.24%201.61V18'%20fill='%23fcf0de'%20fill-rule='evenodd'/%3e%3cpath%20d='M7%203.68l1.05%201.39M17.49%203.68l-1.06%201.39M12%202v2.1'%20fill='none'%20stroke='%235d3b01'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.15%206.93A3.51%203.51%200%20009.23%208a3.93%203.93%200%2000-1.07%201.9'%20fill='none'%20stroke='%23fff'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cpath%20d='M11.26%2015.06a4%204%200%20003.5-1%204.31%204.31%200%2000-.22-6.5M14.13%2014.6a3.62%203.62%200%2000-.77%202.51'%20fill='none'/%3e%3cpath%20d='M13.29%2020.48h-2.52a.86.86%200%2001-.84-.84v-2.1h4.2v2.1a.86.86%200%2001-.84.84z'%20fill='none'%20stroke='%235d3b01'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.93%2018v-.42A4.7%204.7%200%20009.69%2016a2.34%202.34%200%2000-.41-.74%204.1%204.1%200%2000-.58-.67%205.39%205.39%200%2001-.58-.59%204.93%204.93%200%2001-.83-1.46%204.68%204.68%200%2001-.29-1.7h0A5%205%200%201115.93%2014a6.45%206.45%200%2001-.9.91%201.93%201.93%200%2000-.31.33
3895%202.73%202.73%200%2000-.35.73%204.88%204.88%200%2000-.24%201.61V18'%20fill='none'%20stroke='%235d3b01'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",VXe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%3e%3ccircle%20cx='11'%20cy='11'%20r='11'%20style='fill:%20%2344bfd3;'/%3e%3ccircle%20cx='11'%20cy='11'%20r='8'%20style='fill:%20%23d5f9fe;%20stroke:%20%23104e58;'/%3e%3cpath%20d='M9.98,8.88c-1.26-.73-2.86-.42-3.75,.73l.38,.45,.22-.12c.92-.51,1.99-.67,3.02-.45l.21-.55-.08-.05Z'%20style='fill:%20%23104e58;'/%3e%3cpath%20d='M15.68,9.6c-.9-1.14-2.5-1.45-3.75-.73l-.08,.05h0l.21,.55c1.03-.22,2.1-.05,3.02,.45l.22,.12,.38-.45h0Z'%20style='fill:%20%23104e58;'/%3e%3cpath%20d='M8.32,6.43c-.58-.08-1.78,.18-2.39,1.11'%20style='fill:%20none;%20stroke:%20%23104e58;%20stroke-linecap:%20round;'/%3e%3cpath%20d='M13.5,6.43c.58-.08,1.78,.18,2.39,1.11'%20style='fill:%20none;%20stroke:%20%23104e58;%20stroke-linecap:%20round;'/%3e%3cpath%20d='M14.48,12H7.52c-.51,0-.85,.51-.65,.98,.58,1.36,1.68,3.02,4.13,3.02s3.54-1.66,4.13-3.02c.2-.46-.14-.98-.65-.98Z'%20style='fill:%20%232199ac;'/%3e%3cpath%20d='M11,14c-1.52,0-3,1-2,1.5q1,.5,2,.5h0q1,0,2-.5c1-.5-.48-1.5-2-1.5Z'%20style='fill:%20%23d5f9fe;'/%3e%3cpath%20d='M14.72,11.5H7.28c-.67,0-1.17,.65-.94,1.31,.27,.79,.69,1.8,1.41,2.62,.73,.84,1.78,1.47,3.26,1.47s2.52-.63,3.26-1.47c.72-.82,1.14-1.83,1.41-2.62,.22-.66-.28-1.31-.94-1.31Zm-1.21,3.27c-.57,.65-1.36,1.13-2.51,1.13s-1.93-.47-2.51-1.13c-.58-.67-.95-1.52-1.21-2.27h7.42c-.26,.75-.62,1.61-1.21,2.27Z'%20style='fill:%20%23104e58;'/%3e%3c/svg%3e",y$=e=>{var n;if(!e||e.startsWith("blob:"))return!1;const r=(n=e.split("?")[0].split(".").pop())==null?void 0:n.toLowerCase();return["mp4","mov","webm","m4v"].includes(r||"")},b$=({content:e,brand:t,mediaUrl:r,mediaUrls:n,format:a="regular",hideEngagementCounts:i})=>{const{t:o}=Te(),l=Gj(t,"linkedin"),c=zl(l),u=d=>{const f=[],m=(d||"").split(`
3896`),h=/(https?:\/\/[^\s]+|www\.[^\s]+|#[\p{L}\d_]+)/giu;return m.forEach((p,g)=>{g>0&&f.push(s.jsx("br",{},`br-${g}`));let y=0,v;for(;(v=h.exec(p))!==null;){const x=v.index;x>y&&f.push(p.slice(y,x));const j=v[0];if(j.startsWith("#"))f.push(s.jsx("span",{className:"text-[#0B65C2]",children:j},`hash-${g}-${x}`));else{const C=j.startsWith("http")?j:`http://${j}`;f.push(s.jsx("a",{href:C,target:"_blank",rel:"noreferrer",className:"text-[#0B65C2] hover:underline",children:j},`link-${g}-${x}`))}y=h.lastIndex}y<p.length&&f.push(p.slice(y))}),f};return a==="regular"?s.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden w-full text-sm",children:[s.jsx("div",{className:"p-2.5",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-gray-100 overflow-hidden flex-shrink-0",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"font-semibold text-gray-900 truncate text-sm",children:(t==null?void 0:t.name)||"Company Name"}),s.jsxs("p",{className:"text-xs text-gray-500",children:[c," ",o("previews.followers","followers")]}),s.jsxs("p",{className:"text-xs text-gray-500 flex items-center",children:["1h • ",s.jsx(Zs,{className:"w-2.5 h-2.5 ml-0.5"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsxs("span",{className:"text-[#0b66c2] text-xs font-medium hover:underline cursor-pointer",children:["+ ",o("previews.follow","Follow")]}),s.jsx("button",{className:"p-0.5 hover:bg-gray-100 rounded-full",children:s.jsx(oc,{className:"w-4 h-4 text-gray-600"})})]})]})}),s.jsx("div",{className:"px-2.5 pb-2",children:s.jsx("p",{className:"text-gray-900 break-words",style:{fontSize:"0.8rem",whiteSpace:"pre-wrap"},children:u(e)})}),n&&n.length>1?s.jsx("div",{className:"px-2.5 pb-2",children:s.jsxs("div",{className:"space-y-0.5",children:[(()=>{const d=n[0];return s.jsx("div",{className:"w-full bg-gray-100 aspect-video rounded-sm overflow-hidden",children:s.jsx(Un,{mediaUrl:d,altText:"LinkedIn media",type:"image",className:"w-full h-full",objectFit:"cover"})})})(),(()=>{const d=n.slice(1,4),f=Math.max(0,n.length-4),m=d.length===1?"grid-cols-1":d.length===2?"grid-cols-2":"grid-cols-3";return s.jsx("div",{className:`grid ${m} gap-0.5`,children:d.map((h,p)=>s.jsxs("div",{className:"relative bg-gray-100 aspect-video rounded-sm overflow-hidden",children:[s.jsx(Un,{mediaUrl:h,altText:`LinkedIn media ${p+2}`,type:"image",className:"w-full h-full",objectFit:"cover"}),p===d.length-1&&f>0&&s.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:s.jsxs("span",{className:"text-white text-[1.3rem] font-semibold",children:["+",f]})})]},`${h}-${p}`))})})()]})}):(r||n&&n.length===1)&&s.jsx("div",{className:r!=null&&r.includes("#pdfthumb")?"bg-gray-100 aspect-[4/5]":"bg-gray-100 aspect-video",children:s.jsx(Un,{mediaUrl:(r||(n==null?void 0:n[0])||"").replace("#pdfthumb",""),altText:"LinkedIn media",type:y$(r||(n==null?void 0:n[0])||"")?"video":"image",className:"w-full h-full",aspectRatio:r!=null&&r.includes("#pdfthumb")?"4 / 5":void 0,objectFit:r!=null&&r.includes("#pdfthumb")?"contain":"cover"},`${r||(n==null?void 0:n[0])}-${y$(r||(n==null?void 0:n[0])||"")?"video":"image"}`)}),!i&&s.jsx("div",{className:"px-2.5 pb-1.5 mt-1.5",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsxs("div",{className:"flex -sp
3896ace-x-1",children:[s.jsx("img",{src:XS,alt:"Like",className:"w-3.5 h-3.5"}),s.jsx("img",{src:zXe,alt:"Love",className:"w-3.5 h-3.5"}),s.jsx("img",{src:BXe,alt:"Support",className:"w-3.5 h-3.5"}),s.jsx("img",{src:UXe,alt:"Insightful",className:"w-3.5 h-3.5"}),s.jsx("img",{src:VXe,alt:"Funny",className:"w-3.5 h-3.5"})]}),s.jsx("span",{children:"213"})]}),s.jsx("div",{className:"flex items-center gap-1",children:s.jsxs("span",{children:["78 ",o("previews.comments","comments")," • 121 ",o("previews.reposts","reposts")]})})]})}),s.jsxs("div",{className:"px-1 py-0.5 border-t flex",children:[s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-1 py-1.5 hover:bg-gray-100 rounded",children:[s.jsx("img",{src:XS,alt:"Like",className:"w-3.5 h-3.5"}),s.jsx("span",{className:"text-xs font-medium text-gray-600",children:o("previews.actions.like","Like")})]}),s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-1 py-1.5 hover:bg-gray-100 rounded",children:[s.jsx(jf,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"text-xs font-medium text-gray-600",children:o("previews.actions.comment","Comment")})]}),s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-1 py-1.5 hover:bg-gray-100 rounded",children:[s.jsx(O7,{className:"w-3.5 h-3.5 text-gray-600",strokeWidth:1.5}),s.jsx("span",{className:"text-xs font-medium text-gray-600",children:o("previews.actions.repost","Repost")})]}),s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-1 py-1.5 hover:bg-gray-100 rounded",children:[s.jsx(nf,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"text-xs font-medium text-gray-600",children:o("previews.actions.send","Send")})]})]})]}):s.jsx("div",{className:"bg-black text-white rounded-xl shadow-md border border-gray-700 overflow-hidden w-full max-w-[320px] mx-auto",children:s.jsxs("div",{className:"relative w-full aspect-[9/16] bg-gray-900 flex flex-col",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Un,{mediaUrl:r,altText:"LinkedIn Shorts",type:"video",aspectRatio:"9/16"},r),s.jsxs("div",{className:"absolute right-3 bottom-4 flex flex-col items-center space-y-4",children:[s.jsxs("button",{className:"flex flex-col items-center space-y-0.5",children:[s.jsx("img",{src:XS,alt:"Like",className:"w-4 h-4"}),s.jsx("span",{className:"text-[10px]",children:"67.3k"})]}),s.jsxs("button",{className:"flex flex-col items-center space-y-0.5",children:[s.jsx(sl,{className:"w-4 h-4"}),s.jsx("span",{className:"text-[10px]",children:"856"})]}),s.jsxs("button",{className:"flex flex-col items-center space-y-0.5",children:[s.jsx(li,{className:"w-4 h-4"}),s.jsx("span",{className:"text-[10px]",children:"43"})]}),s.jsx("button",{className:"flex flex-col items-center",children:s.jsx(Kx,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-2.5 bg-gradient-to-t from-black/60 to-transparent",children:s.jsx("div",{className:"flex items-end justify-between",children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[s.jsx("div",{className:"h-4 w-4 rounded-full bg-gray-100 overflow-hidden",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsx("span",{className:"text-xs font-semibold",children:(t==null?void 0:t.name)||"Company Name"})]}),s.jsx("p",{className:"text-xs",style:{whiteSpace:"pre-wrap"},children:u(e)})]})})})]})})},WXe=({content:e,brand:t,mediaUrl:r,mediaUrls:n,format:a="regular",engagement:i,hideEngagementCounts:o})=>{const{t:l}=Te(),c=Gj(t,"instagram"),u=c?Math.floor(c*.04):3241,d=c?Math.floor(c*.01):42;return a==="regular"?s.jsxs("div",{className:"bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden max-w-sm mx-auto",children:[s.jsx("div",{className:"p-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-gray-100 overflow-hidden",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsx("span",{className:"font-semibold text-sm",children:(t==null?void 0:t.name)||"company_name"})]}),s.jsx("button",{className:"p-1",children:s.jsx(oc,{className:"w-5 h-5 text-gray-600"})})]})}),s.jsx("div",{className:"relative w-full pb-[125%] bg-gray-100 flex items-center justify-center",children:s.jsx(Un,{mediaUrl:n&&n.length>0?n[0]:r,altText:"Instagram post",type:"image",className:"absolute inset-0 w-full h-full object-cover"})}),n&&n.length>1&&s.jsx("div",{className:"px-3 mt-2 flex items-center justify-center gap-1.5",children:(()=>{const f=Math.min(n.length,10),m=f-1,h=8,p=4;return Array.from({length:f}).map((g,y)=>{const v=y===0;let x=h;if(!v&&m>0){const C=(y-1)/(m-1||1);x=Math.round(h+(p-h)*C)}return s.jsx("span",{style:{width:x,height:x},className:`inline-block rounded-full ${v?"bg-[#2563eb]":"bg-gray-300"} opacity-90`},y)})})()}),s.jsxs("div",{className:"p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{"aria-label":l("previews.actions.like","Like"),children:s.jsx(w0,{className:"w-6 h-6"})}),s.jsx("button",{"aria-label":l("previews.actions.comment","Comment"),children:s.jsx(sl,{className:"w-6 h-6"})}),s.jsx("button",{"aria-label":l("previews.actions.send","Send"),children:s.jsx(nf,{className:"w-6 h-6"})})]}),s.jsx("button",{children:s.jsx(Kx,{className:"w-6 h-6"})})]}),!o&&s.jsx("div",{className:"mb-1",children:s.jsx("p",{className:"text-sm font-semibold",children:i!=null&&i.likes?`${i.likes.toLocaleStr
3896ing()} ${l("previews.actions.like","Like").toLowerCase()}${i.likes===1?"":"s"}`:`${u.toLocaleString()} ${l("previews.actions.like","Like").toLowerCase()}s`})}),s.jsx("div",{className:"mb-1",children:s.jsxs("p",{className:"whitespace-pre-line",style:{fontSize:"0.8rem"},children:[s.jsx("span",{className:"font-semibold mr-1",children:(t==null?void 0:t.name)||"company_name"}),e]})}),!o&&s.jsx("p",{className:"text-sm text-gray-500",children:i!=null&&i.comments?l("previews.viewAllComments","View all {{count}} comments",{count:i.comments}):l("previews.viewAllComments","View all {{count}} comments",{count:d})}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:l("previews.time.hoursAgo","{{count}} HOURS AGO",{count:2})})]})]}):s.jsx("div",{className:"bg-black text-white rounded-xl shadow-md border border-gray-800 overflow-hidden max-w-[320px] mx-auto",children:s.jsx("div",{className:"relative w-full aspect-[9/16] bg-gray-900 flex flex-col",children:s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Un,{mediaUrl:r,altText:"Instagram Reel",type:"video",fullSize:!1,className:"h-full w-full object-cover",controls:!1,autoPlayOnMount:!0,loop:!0,muted:!0,aspectRatio:"9/16"}),s.jsxs("div",{className:"absolute right-3 bottom-24 flex flex-col items-center space-y-5",children:[s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(w0,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:i!=null&&i.likes?i.likes>=1e3?`${(i.likes/1e3).toFixed(1)}k`:i.likes.toString():"142k"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(sl,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:i!=null&&i.comments?i.comments>=1e3?`${(i.comments/1e3).toFixed(1)}k`:i.comments.toString():"1,024"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(nf,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:i!=null&&i.shares?i.shares>=1e3?`${(i.shares/1e3).toFixed(1)}k`:i.shares.toString():"483"})]}),s.jsx("button",{className:"flex flex-col items-center",children:s.jsx(Kx,{className:"w-7 h-7"})}),s.jsx("button",{className:"flex flex-col items-center",children:s.jsx(oc,{className:"w-7 h-7"})})]}),s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/70 to-transparent",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-gray-100 overflow-hidden flex-shrink-0",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsx("span",{className:"font-semibold text-sm",children:(t==null?void 0:t.name)||"company_name"}),s.jsx("button",{className:"border border-white text-white text-xs px-2 py-1 rounded",children:l("previews.follow","Follow")})]}),s.jsx("p",{className:"mb-3 whitespace-pre-line",style:{fontSize:"0.8rem"},children:e}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(SE,{className:"w-3 h-3 mr-2"}),s.jsxs("div",{className:"flex-1 text-xs truncate",children:[l("previews.originalAudio","Original audio")," • ",(t==null?void 0:t.name)||"company_name"]})]})]})]})})})}
3896,qXe=({content:e,brand:t,mediaUrl:r,mediaUrls:n,format:a="regular",hideEngagementCounts:i})=>{const{t:o}=Te(),l=c=>{const u=[],d=(c||"").split(`
3897`),f=/(https?:\/\/[^\s]+|www\.[^\s]+|#[\p{L}\d_]+)/giu;return d.forEach((m,h)=>{h>0&&u.push(s.jsx("br",{},`br-${h}`));let p=0,g;for(;(g=f.exec(m))!==null;){const y=g.index;y>p&&u.push(m.slice(p,y));const v=g[0];if(v.startsWith("#"))u.push(s.jsx("span",{className:"text-[#0063D1]",children:v},`hash-${h}-${y}`));else{const x=v.startsWith("http")?v:`http://${v}`;u.push(s.jsx("a",{href:x,target:"_blank",rel:"noreferrer",className:"text-[#0063D1] hover:underline",children:v},`link-${h}-${y}`))}p=f.lastIndex}p<m.length&&u.push(m.slice(p))}),u};return a==="regular"?s.jsxs("div",{className:"bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden",children:[s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-gray-100 overflow-hidden",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("h3",{className:"font-semibold text-gray-900",children:(t==null?void 0:t.name)||"Company Name"})}),s.jsxs("p",{className:"text-xs text-gray-500 flex items-center",children:["3h • ",s.jsx(Zs,{className:"w-3 h-3 ml-1"})]})]})]}),s.jsx("div",{children:s.jsx("button",{className:"p-2 hover:bg-gray-100 rounded-full",children:s.jsx(oc,{className:"w-5 h-5 text-gray-600"})})})]})}),s.jsx("div",{className:"px-4 pb-3",children:s.jsx("p",{className:"text-gray-900 break-words",style:{fontSize:"0.8rem",whiteSpace:"pre-wrap"},children:l(e)})}),n&&n.length>0?s.jsx("div",{className:"bg-gray-100",children:(()=>{const c=n.slice(0,5),u=n.length-c.length,d=c.slice(0,2),f=c.slice(2);return s.jsxs("div",{className:"w-full",children:[s.jsx("div",{className:"grid grid-cols-2 gap-px",children:d.map((m,h)=>s.jsx("div",{className:"relative w-full h-full",style:{aspectRatio:"1 / 1"},children:s.jsx(Un,{mediaUrl:m,altText:"Facebook post",type:"image",className:"w-full h-full",objectFit:"cover"})},`r1-${h}`))}),f.length>0&&s.jsx("div",{className:"grid grid-cols-3 gap-px mt-px",children:f.map((m,h)=>{const p=h===f.length-1&&u>0;return s.jsxs("div",{className:"relative w-full h-full",style:{aspectRatio:"1 / 1"},children:[s.jsx(Un,{mediaUrl:m,altText:"Facebook post",type:"image",className:"w-full h-full",objectFit:"cover"}),p&&s.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:s.jsxs("span",{className:"text-white font-semibold text-xl",children:["+",u+1]})})]},`r2-${h}`)})})]})})()}):r?s.jsx("div",{className:"w-full bg-gray-100 min-h-[200px] max-h-[400px]",children:s.jsx(Un,{mediaUrl:r,altText:"Facebook post",type:"image",className:"w-full h-full object-contain",objectFit:"contain"})}):null,!i&&s.jsx("div",{className:"px-4 py-2 border-t border-b",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[s.jsx("div",{className:"flex items-center gap-1",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"bg-blue-500 rounded-full p-1",children:s.jsx(co,{className:"w-2 h-2 text-white"})}),s.jsx("span",{className:"ml-1",children:"425"})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["64 ",o("previews.comments","comments")]}),s.jsxs("span",{children:["32 ",o("previews.actions.share","Share")]})]})]})}),s.jsxs("div",{className:"px-4 py-1 flex",children:[s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-2 py-2 hover:bg-gray-100 rounded",children:[s.jsx(co,{className:"w-5 h-5 text-gray-500"}),s.jsx("span",{className:"text-sm font-medium text-gray-500",children:o("previews.actions.like","Like")})]}),s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-2 py-2 hover:bg-gray-100 rounded",children:[s.jsx(sl,{className:"w-5 h-5 text-gray-500"}),s.jsx("span",{className:"text-sm font-medium text-gray-500",children:o("previews.actions.comment","Comment")})]}),s.jsxs("button",{className:"flex-1 flex items-center justify-center gap-2 py-2 hover:bg-gray-100 rounded",children:[s.jsx(li,{className:"w-5 h-5 text-gray-500"}),s.jsx("span",{className:"text-sm font-medium text-gray-500",children:o("previews.actions.share","Share")})]})]})]}):s.jsx("div",{className:"bg-black text-white rounded-xl shadow-md border border-gray-800 overflow-hidden max-w-[320px] mx-auto",children:s.jsx("div",{className:"relative w-full aspect-[9/16] bg-gray-900 flex flex-col",children:s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Un,{mediaUrl:r,altText:"Facebook Reel",type:"video",fullSize:!1,className:"h-full w-full object-cover",controls:!1,autoPlayOnMount:!0,loop:!0,muted:!0,aspectRatio:"9/16"}),s.jsxs("div",{className:"absolute right-3 bottom-24 flex flex-col items-center space-y-5",children:[s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(co,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:"87k"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(sl,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:"543"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(li,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:"126"})]}),s.jsx("button",{className:"flex flex-col items-center",children:s.jsx(oc,{className:"w-7 h-7"})})]}),s.jsx("div",{className:"absolute top-0 left-0 right-0 p-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-gray-100 overflow-hidden",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsx("span",{className:"font-semibold text-sm flex-1",children:(t==null?void 0:t.name)||"Company Name"}),s.jsx("button",{className:"text-blue-500 text-sm font-medium",children:o("previews.follow","Follow")})]})}),s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/70 to-transparent",children:[s.jsx("p",{className:"mb-3",style:{fontSize:"0.8rem",whiteSpace:"pre-wrap"},children:l(e)}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(SE,{className:"w-3 h-3 mr-2"}),s.jsxs("div",{className:"flex-1 text-xs truncate",children:[o("previews.originalAudio","Original audio")," • ",(t==null?void 0:t.name)||"Company Name"]})]})]})]})})})},GXe=({content:e,brand:t,brandName:r,brandLogo:n,mediaUrl:a,format:i="regular"})=>{const l=t!=null&&t.social_accounts&&Array.isArray(t.social_accounts)?t.social_accounts.find(d=>d.platform.toLowerCase()==="twitter"):null,c=()=>l!=null&&l.username?l.username:(r||(t==null?void 0:t.name)||"brandname").toLowerCase().replace(/\s/g,""),u=()=>l!=null&&l.picture_url?l.picture_url:n||"https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png";return s.jsx("div",{className:"bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden w-full",children:s.jsx("div",{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[s.jsx("div",{className:"h-10 w-10 sm:h-12 sm:w-12 rounded-lg bg-gray-100 overflow-hidden flex-shrink-0",children:u()?s.jsx("img",{src:u(),alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-1 text-sm sm:text-base",children:[s.jsx("span",{className:"font-bold text-gray-900 truncate",children:r||(t==null?void 0:t.name)||"Brand Name"}),s.jsxs("span",{className:"text-gray-500 truncate",children:["@",c()]}),s.jsx("span",{className:"text-gray-500 mx-1",children:"·"}),s.jsx("span",{className:"text-gray-500",children:"2h"})]})}),s.jsx("button",{className:"flex-shrink-0",children:s.jsx(oc,{className:"w-4 h-4 sm:w-5 sm:h-5 text-gray-600"})})]}),s.jsxs("div",{className:"mt-1",children:[s.jsx("p",{className:"text-gray-900 whitespace-pre-line",style:{fontSize:"0.8rem"},children:e}),a&&s.jsx("div",{className:`mt-3 bg-gray-100 rounded-xl overflow-hidden ${i==="reel"?"aspect-[9/16]":"aspect-video"}`,children:s.jsx(Un,{mediaUrl:a,altText:"Twitter media",type:i==="reel"?"video":"image",className:"w-full h-full"})})]}),s.jsxs("div",{className:"flex items-center justify-between mt-3 text-gray-500",children:[s.jsxs("button",{className:"flex items-center group",children:[s.jsx("div",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center group-hover:bg-blue-50 group-hover:text-blue-500 rounded-full",children:s.jsx(sl,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("span",{className:"text-xs sm:text-sm ml-1",children:"24"})]}),s.jsxs("button",{className:"flex items-center group",children:[s.jsx("div",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center group-hover:bg-green-50 group-hover:text-green-500 rounded-full",children:s.jsx(O7,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("span",{className:"text-xs sm:text-sm ml-1",children:"142"})]}),s.jsxs("button",{className:"flex items-center group",children:[s.jsx("div",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center group-hover:bg-red-50 group-hover:text-red-500 rounded-full",children:s.jsx(w0,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("span",{className:"text-xs sm:text-sm ml-1",children:"1.2K"})]}),s.jsxs("button",{className:"flex items-center group",children:[s.jsx("div",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center group-hover:bg-blue-50 group-hover:text-blue-500 rounded-full",children:s.jsx(xE,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("span",{className:"text-xs sm:text-sm ml-1",children:"247K"})]}),s.jsx("button",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center hover:bg-blue-50 hover:text-blue-500 rounded-full",children:s.jsx(li,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]})]})]})})})},HXe=({content:e,brand:t,mediaUrl:r,format:n="regular"})=>{const i=t!=null&&t.social_accounts&&Array.isArray(t.social_accounts)?t.social_accounts.find(m=>m.platform.toLowerCase()==="youtube"):null,o=Gj(t,"youtube"),l=o?Math.floor(o*.03):23e3,c=o?Math.floor(o*.01):1893,u=o||126e3,d=()=>i!=null&&i.username?i.username:(t==null?void 0:t.name)||"companyname",f=()=>i!=null&&i.picture_url?i.picture_url:(t==null?void 0:t.logo)||"";return n==="regular"?s.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden w-full",children:[s.jsx("div",{className:"w-full bg-gray-100 aspect-video",children:s.jsx(Un,{mediaUrl:r,altText:"YouTube video",type:"video",className:"w-full h-full"})}),s.jsxs("div",{className:"p-4",children:[s.jsx("h3",{className:"font-semibold text-lg mb-2 line-clamp-2",children:e.split(`
3898`)[0]||"Video Title"}),s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-gray-100 overflow-hidden flex-shrink-0",children:f()?s.jsx("img",{src:f(),alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium text-sm",children:d()}),s.jsxs("div",{className:"text-xs text-gray-600",children:[zl(u)," subscribers"]}
3898)]}),s.jsx("button",{className:"bg-black text-white px-4 py-2 rounded-full text-sm font-medium",children:"Subscribe"})]}),s.jsxs("div",{className:"flex items-center gap-2 border-t border-b border-gray-200 py-2",children:[s.jsxs("div",{className:"flex items-center mr-3",children:[s.jsxs("button",{className:"flex items-center gap-1 bg-gray-100 rounded-l-full px-4 py-1.5",children:[s.jsx(co,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:zl(l)})]}),s.jsx("button",{className:"bg-gray-100 rounded-r-full px-4 py-1.5",children:s.jsx(hL,{className:"w-5 h-5"})})]}),s.jsxs("button",{className:"flex items-center gap-1 bg-gray-100 rounded-full px-4 py-1.5",children:[s.jsx(li,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:"Share"})]}),s.jsx("button",{className:"flex items-center gap-1 bg-gray-100 rounded-full px-4 py-1.5 ml-auto",children:s.jsx(oc,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"mt-3 text-sm",children:s.jsx("p",{className:"whitespace-pre-line",children:e.split(`
3899`).slice(1).join(`
3900`)||"Video description goes here..."})})]})]}):s.jsx("div",{className:"bg-black text-white rounded-xl shadow-md border border-gray-800 overflow-hidden max-w-[320px] mx-auto",children:s.jsx("div",{className:"relative w-full aspect-[9/16] bg-gray-900 flex flex-col",children:s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Un,{mediaUrl:r,altText:"YouTube Shorts",type:"video",fullSize:!1,className:"h-full w-full object-cover",controls:!1,autoPlayOnMount:!0,loop:!0,muted:!0,aspectRatio:"9/16"},r),s.jsxs("div",{className:"absolute right-3 bottom-20 flex flex-col items-center space-y-6",children:[s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(co,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:zl(l)})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(hL,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:"Dislike"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(sl,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:zl(c)})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(li,{className:"w-7 h-7"}),s.jsx("span",{className:"text-xs mt-1",children:"Share"})]}),s.jsx("button",{className:"flex flex-col items-center",children:s.jsx(oc,{className:"w-7 h-7"})})]}),s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/70 to-transparent",children:[s.jsx("p",{className:"mb-3 whitespace-pre-line",style:{fontSize:"0.8rem"},children:e}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-gray-100 overflow-hidden",children:f()?s.jsx("img",{src:f(),alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("span",{className:"font-medium text-sm",children:["@",d()]})]})]})]})})})},YXe=({content:e,brand:t,mediaUrl:r})=>s.jsxs("div",{className:"bg-white rounded-xl shadow-md border border-gray-200 overflow-hidden",children:[s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"h-12 w-12 rounded-lg bg-gray-100 overflow-hidden",children:t!=null&&t.logo?s.jsx("img",{src:t.logo,alt:"",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-blue-600",children:(t==null?void 0:t.name)||"Company Name"}),s.jsx("p",{className:"text-xs text-gray-500",children:"2h • Public"})]})]})}),s.jsx("div",{className:"px-4 pb-3",children:s.jsx("p",{className:"text-gray-900 whitespace-pre-line",style:{fontSize:"0.8rem"},children:e})}),r&&s.jsx("div",{className:"aspect-video bg-gray-100",children:s.jsx(Un,{mediaUrl:r,altText:"Google Business media",type:"image",aspectRatio:"16/9"})}),s.jsxs("div",{className:"px-4 py-3 flex items-center gap-6 text-gray-600",children:[s.jsxs("button",{className:"flex items-center gap-2",children:[s.jsx(co,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:"Like"})]}),s.jsxs("button",{className:"flex items-center gap-2",children:[s.jsx(jf,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:"Comment"})]}),s.jsxs("button",{className:"flex items-center gap-2",children:[s.jsx(li,{className:"w-5 h-5"}),s.jsx("span",{className:"text-sm",children:"Share"})]})]})]}),QXe=({content:e,brand:t,mediaUrl:r})=>{const a=t!=null&&t.social_accounts&&Array.isArray(t.social_accounts)?t.social_accounts.find(m=>m.platform.toLowerCase()==="tiktok"):null,i=Gj(t,"tiktok"),o=i?Math.floor(i*.08):245700,l=i?Math.floor(i*.02):1893,c=i?Math.floor(i*.01):5621,u=i?Math.floor(i*.03):84200,d=()=>a!=null&&a.username?a.username:(t==null?void 0:t.name)||"companyname",f=()=>a!=null&&a.picture_url?a.picture_url:(t==null?void 0:t.logo)||"";return s.jsx("div",{className:"bg-black text-white rounded-xl shadow-md border border-gray-800 overflow-hidden max-w-[320px] mx-auto",children:s.jsx("div",{className:"relative w-full aspect-[9/16] bg-gray-900 flex flex-col",children:s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Un,{mediaUrl:r,altText:"TikTok video",type:"video",fullSize:!1,className:"h-full w-full object-cover",controls:!1,autoPlayOnMount:!0,loop:!0,muted:!0,aspectRatio:"9/16"},r),s.jsxs("div",{className:"absolute right-3 bottom-20 flex flex-col items-center space-y-5",children:[s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("div",{className:"h-10 w-10 bg-gray-100 overflow-hidden flex-shrink-0 mb-1",style:{borderRadius:"50%"},children:f()?s.jsx("img",{src:f(),alt:"",className:"w-full h-full object-cover",style:{borderRadius:"50%"}}):s.jsx("div",{className:"w-full h-full bg-gray-200"})}),s.jsx("div",{className:"w-5 h-5 bg-red-500 rounded-full flex items-center justify-center -mt-3 text-xs font-bold",children:"+"})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(w0,{className:"w-8 h-8"}),s.jsx("span",{className:"text-xs mt-1",children:zl(o)})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(sl,{className:"w-8 h-8"}),s.jsx("span",{className:"text-xs mt-1",children:zl(l)})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(Kx,{className:"w-8 h-8"}),s.jsx("span",{className:"text-xs mt-1",children:zl(u)})]}),s.jsxs("button",{className:"flex flex-col items-center",children:[s.jsx(li,{className:"w-8 h-8"}),s.jsx("span",{className:"text-xs mt-1",children:zl(c)})]}),s.jsx("div",{className:"h-10 w-10 flex-none bg-white/20 backdrop-blur-sm overflow-hidden",style:{borderRadius:"50%"},children:f()?s.jsx("img",{src:f(),alt:"",className:"w-full h-full object-cover",style:{borderRadius:"50%"}}):s.jsx("div",{className:"w-full h-full bg-gray-200"})})]}),s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/70 to-transparent",children:[s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsxs("span",{className:"font-semibold",children:["@",d()]})}),s.jsx("p",{className:"mb-3 whitespace-pre-line",style:{fontSize:"0.8rem"},children:e}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(SE,{className:"w-3 h-3 mr-2"}),s.jsx("div",{className:"text-xs marquee-container overflow-hidden",children:s.jsxs("div",{className:"animate-marquee whitespace-nowrap",children:[(t==null?void 0:t.name)||"companyname"," - Original Sound"]})})]})]})]})})})},KXe=({content:e,brandName:t,brandLogo:r,mediaUrl:n,mediaUrls:a,hideEngagementCounts:i=!1,platformData:o})=>{const l=a&&a.length>0?a[0]:n;let c="",u="",d=[];if(o&&o.platforms&&o.platforms.pinterest){const g=o.platforms.pinterest.settings;g&&(c=g.title||"",u=g.description||""),o.hashtags&&(d=o.hashtags)}const m=(typeof e=="string"?e:JSON.stringify(e)).split(`
3901`).filter(g=>g.trim()),h=c||m[0]||"Pin Title",p=u||m.slice(1).join(`
3902`)||"Pin description";return s.jsxs("div",{className:"max-w-sm mx-auto bg-white rounded-lg overflow-hidden shadow-lg",children:[s.jsxs("div",{className:"relative",children:[l?s.jsx("img",{src:l,alt:"Pin content",className:"w-full aspect-[4/5] object-cover",onError:g=>{var v;const y=g.target;y.style.display="none",(v=y.nextElementSibling)==null||v.classList.remove("hidden")}}
3902):null,s.jsx("div",{className:`w-full aspect-[4/5] bg-gradient-to-br from-red-400 to-pink-500 flex items-center justify-center ${l?"hidden":""}`,children:s.jsxs("div",{className:"text-white text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-white bg-opacity-20 rounded-full flex items-center justify-center mb-2",children:s.jsx("svg",{className:"w-8 h-8",fill:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})}),s.jsx("p",{className:"text-sm",children:"Pin Image"})]})})]}),s.jsxs("div",{className:"px-4 py-3 bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("button",{className:"flex items-center gap-1 text-black hover:text-red-500 transition-colors",children:[s.jsx(w0,{className:"w-5 h-5"}),!i&&s.jsx("span",{className:"text-sm text-black",children:"0"})]}),s.jsxs("button",{className:"flex items-center gap-1 text-black hover:text-blue-500 transition-colors",children:[s.jsx(sl,{className:"w-5 h-5"}),!i&&s.jsx("span",{className:"text-sm text-black",children:"0"})]}),s.jsx("button",{className:"flex items-center gap-1 text-black hover:text-green-500 transition-colors",children:s.jsx(li,{className:"w-5 h-5"})}),s.jsx("button",{className:"flex items-center gap-1 text-black hover:text-gray-800 transition-colors",children:s.jsx(oc,{className:"w-5 h-5"})})]}),s.jsx("button",{className:"bg-red-600 text-white px-4 py-1 rounded-full text-sm font-medium hover:bg-red-700 transition-colors",children:"Save"})]}),s.jsxs("div",{className:"mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r?s.jsx("img",{src:r,alt:t||"Brand",className:"w-6 h-6 rounded-full"}):s.jsx("div",{className:"w-6 h-6 bg-gray-300 rounded-full flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-black",children:"B"})}),s.jsx("span",{className:"text-sm font-medium text-black",children:t||"Brand Name"})]}),s.jsx("p",{className:"text-sm font-bold text-black mb-1 truncate",children:h}),s.jsxs("div",{className:"relative mb-2",children:[s.jsx("p",{className:"text-sm text-black pr-16 overflow-hidden whitespace-nowrap relative",style:{maskImage:"linear-gradient(to right, black 70%, transparent 100%)",WebkitMaskImage:"linear-gradient(to right, black 70%, transparent 100%)"},children:p}),s.jsx("span",{className:"absolute right-0 top-1/2 -translate-y-1/2 text-sm text-black bg-white pl-2",children:"see more"})]}),s.jsx("div",{className:"flex items-center gap-2 text-sm text-black",children:s.jsx("span",{children:"Show translation"})}),d&&d.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[d.slice(0,3).map((g,y)=>s.jsxs("span",{className:"text-xs text-blue-600 font-medium",children:["#",g]},y)),d.length>3&&s.jsxs("span",{className:"text-xs text-gray-500",children:["+",d.length-3," more"]})]})]}),s.jsx("button",{className:"w-full bg-gray-200 text-gray-800 py-2 rounded-lg text-sm font-medium hover:bg-gray-300 transition-colors flex items-center justify-center gap-2",children:"Visit site"})]})]})};function sY({platform:e,content:t,brand:r,brandName:n,brandLogo:a,media:i,mediaUrl:o,mediaUrls:l,format:c="regular",hideEngagementCounts:u}){const[d,f]=b.useState(void 0);b.useEffect(()=>{let g;const y=N=>{if(N){if(typeof N=="string")return N||void 0;if(typeof N=="object"&&typeof N.url=="string")return N.url||void 0}},v=N=>typeof window<"u"&&(N instanceof File||N instanceof Blob),x=N=>{if(N){if(v(N))return N;if(Array.isArray(N)){const S=N[0];return v(S)?S:S&&typeof S=="object"&&v(S.file)?S.file:void 0}if(typeof N=="object"&&N!==null){if(v(N.file))return N.file;if(v(N.blob))return N.blob}}};if(typeof o=="string"&&o.trim()!=="")return f(o),()=>{};const j=y(i);if(j&&j.trim()!=="")return f(j),()=>{};const C=x(i);return C?(g=URL.createObjectURL(C),f(g)):f(void 0),()=>{g&&URL.revokeObjectURL(g)}},[i,o]);const m=n||(r==null?void 0:r.name),h=a||(r==null?void 0:r.logo);let p="";
3902return typeof t=="string"?p=t.replace(/\\n/g,`
3903`):t&&typeof t=="object"?"text"in t&&t.text?p=typeof t.text=="string"?t.text.replace(/\\n/g,`
3904`):JSON.stringify(t.text):p=JSON.stringify(t):p=String(t),JXe(e,p,r,m,h,d,c,l,u)}function JXe(e,t,r,n,a,i,o="regular",l,c){const u=t.replace(/\\n/g,`
3905`);switch(e){case"linkedin":return s.jsx(b$,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,mediaUrls:l,format:o,hideEngagementCounts:c});case"instagram":return s.jsx(WXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,mediaUrls:l,format:o,hideEngagementCounts:c});case"facebook":return s.jsx(qXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,mediaUrls:l,format:o,hideEngagementCounts:c});case"twitter":return s.jsx(GXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,format:o});case"youtube":return s.jsx(HXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,format:o});case"google-business":return s.jsx(YXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,format:o});case"tiktok":return s.jsx(QXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,format:o});case"pinterest":return s.jsx(KXe,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,mediaUrls:l,format:o,hideEngagementCounts:c,platformData:t});default:return s.jsx(b$,{content:u,brand:r,brandName:n,brandLogo:a,mediaUrl:i,mediaUrls:l,format:o})}}const I4=({platform:e,content:t,hashtags:r,onCreatePost:n,brandId:a,format:i="regular",imageUrl:o,isSelected:l=!1,onSelectionChange:c})=>{const{t:u}=Te(),{data:d}=oa();let f="";
3905typeof t=="string"?f=t.replace(/\\n/g,`
3906`):t&&typeof t=="object"?"text"in t&&t.text?f=typeof t.text=="string"?t.text.replace(/\\n/g,`
3907`):JSON.stringify(t.text):f=JSON.stringify(t):f=String(t);const m=(r==null?void 0:r.map(v=>typeof v=="string"?v:JSON.stringify(v)))||[],h=d?d.brands||[]:[],p=a?h.find(v=>v.id===a):void 0,g=v=>{switch(v.toLowerCase()){case"instagram":return"📸";case"linkedin":return"💼";case"facebook":return"👍";case"twitter":return"🐦";case"tiktok":return"🎵";case"youtube":return"🎬";default:return"📱"}},y=v=>{switch(v.toLowerCase()){case"instagram":return"instagram";case"linkedin":return"linkedin";case"facebook":return"facebook";case"twitter":return"twitter";case"tiktok":return"tiktok";case"youtube":return"youtube";case"google-business":return"google-business";default:return"linkedin"}};return s.jsxs("div",{className:"bg-white rounded-lg shadow-md overflow-hidden border border-black",children:[s.jsxs("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200 flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"text-xl mr-2",children:g(e)}),s.jsx("h3",{className:"font-medium text-gray-800 capitalize",children:e})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[n&&s.jsx("button",{onClick:()=>n(e,f,m),className:"p-1.5 rounded-md hover:bg-gray-200 transition-colors",title:u("contentCreation.results.createPost"),children:s.jsx(no,{className:"h-5 w-5 text-gray-600"})}),c&&s.jsx("input",{type:"checkbox",checked:l,onChange:v=>c(v.target.checked),className:"w-4 h-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500"})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(sY,{platform:y(e),content:t,brand:p,format:i,media:o?{url:o,type:"image",uploadedAt:new Date().toISOString()}:void 0})})]})};class ZXe extends b.Component{constructor(r){super(r);vt(this,"maxRecoveryAttempts",3);vt(this,"isDatabaseRelatedError",r=>{const n=r.message.toLowerCase(),a=r.name.toLowerCase();if(Gc(r))return!0;const i=["firestore","firebase","connection failed","network error","quota exceeded","permission denied","unavailable"],o=["database","connection lost","server lost","offline","network","fetch failed","load failed"];return[...i,...o].some(l=>n.includes(l)||a.includes(l))});vt(this,"handleRetry",async()=>{if(this.state.recoveryAttempts>=this.maxRecoveryAttempts){window.location.reload();return}this.setState({isRecovering:!0});try{let r=!1;if(this.state.error&&Gc(this.state.error)?r=await w7():(await new Promise(n=>setTimeout(n,2e3)),r=!0),r)this.setState({hasError:!1,error:void 0,isRecovering:!1,recoveryAttempts:this.state.recoveryAttempts+1});else throw new Error("Recovery failed")}catch(r){console.error("Recovery attempt failed:",r),this.setState({isRecovering:!1,recoveryAttempts:this.state.recoveryAttempts+1}),this.state.recoveryAttempts>=this.maxRecoveryAttempts-1&&setTimeout(()=>{confirm("Recovery attempts failed. Would you like to refresh the page?")&&window.location.reload()},1e3)}});vt(this,"handleRefresh",()=>{window.location.reload()});vt(this,"renderErrorUI",()=>{const{error:r,isRecovering:n,recoveryAttempts:a}=this.state;if(!r)return null;if(this.props.fallbackComponent){const f=this.props.fallbackComponent;return s.jsx(f,{error:r,retry:this.handleRetry})}const i=Gc(r),o=i?x7(r):null;let l=s.jsx(qs,{className:"w-12 h-12 text-red-500"}),c="Database Connection Error",u="There was a problem connecting to the database. This might be temporary.",d=!0;return i&&o?(l=s.jsx(oL,{className:"w-12 h-12 text-red-500"}),c="Database Storage Issue",u=o.userMessage,d=o.canRetry&&a<this.maxRecoveryAttempts):r.message.includes("network")||r.message.includes("fetch")?(l=s.jsx(uhe,{className:"w-12 h-12 text-red-500"}),c="Network Connection Error",u="Unable to connect to our services. Please check your internet connection."):(r.message.includes("firestore")||r.message.includes("firebase"))&&(l=s.jsx(oL,{className:"w-12 h-12 text-orange-500"}),c="Service Connection Error",u="Unable to connect to our database services. This may be temporary."),s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8",children:s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-xl p-8 text-center max-w-md mx-auto",children:[s.jsx("div",{className:"flex justify-center mb-4",children:l}
3907),s.jsx("h2",{className:"text-xl font-semibold text-red-800 mb-2",children:c}),s.jsx("p",{className:"text-red-600 mb-6",children:u}),a>0&&s.jsxs("p",{className:"text-sm text-red-500 mb-4",children:["Recovery attempts: ",a,"/",this.maxRecoveryAttempts]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[d&&s.jsxs("button",{onClick:this.handleRetry,disabled:n,className:"inline-flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[s.jsx(ai,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),n?"Recovering...":"Try Again"]}),s.jsxs("button",{onClick:this.handleRefresh,className:"inline-flex items-center px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition-colors",children:[s.jsx(ai,{className:"w-4 h-4 mr-2"}),"Refresh Page"]})]}),!1]})})})});this.state={hasError:!1,error:void 0,isRecovering:!1,recoveryAttempts:0}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("Database Error Boundary caught an error:",r,n),this.isDatabaseRelatedError(r)&&(console.error("Database-related error detected:",{name:r.name,message:r.message,stack:r.stack,isIndexedDB:Gc(r)}),window.Sentry&&window.Sentry.captureException(r,{tags:{errorBoundary:"database",errorType:"database_connection",isIndexedDB:Gc(r).toString()}}))}render(){return this.state.hasError?this.renderErrorUI():this.props.children}}const mf="https://api.socialness.ai",v$=[{value:"instagram",label:"Instagram"},{value:"linkedin",label:"LinkedIn"},{value:"facebook",label:"Facebook"},{value:"twitter",label:"Twitter"},{value:"tiktok",label:"TikTok"},{value:"youtube",label:"YouTube"}];class om extends Error{constructor(r,n={}){super(r);vt(this,"code");vt(this,"status");vt(this,"errorType");vt(this,"details");this.name="ContentGenerationError",this.code=n.code,this.status=n.status,this.errorType=n.errorType,this.details=n.details}}const Cl=e=>{if(!(typeof e!="string"||!e.trim()||/<(?:!doctype|html|body)\b/i.test(e)))return e.trim()},x$=(e,t)=>
3907{const r=e&&typeof e=="object"?e:{},n=r.error&&typeof r.error=="object"?r.error:{},a=Cl(r.code)||Cl(n.code),i=Cl(r.errorType)||Cl(n.errorType),o=Cl(r.details)||Cl(n.details),l=Cl(r.message)||Cl(r.error)||Cl(n.message),c=a==="image_generation_failed"?"The image could not be generated. Please try again later, or turn off image generation to generate text only.":l||`Unable to generate content (HTTP ${t}). Please try again later.`;return new om(c,{code:a,status:t,errorType:i,details:o})},Iv="/ai-coach/content/generate",XXe=async e=>{var t;console.log("Starting content generation with params:",e);try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw console.error("Authentication token not available"),new om("Please sign in again before generating content.",{code:"authentication_required",errorType:"authentication_error"});console.log(`Attempting to generate content using endpoint: ${mf}${Iv}`);const n=await fetch(`${mf}${Iv}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(e)});if(console.log(`Response status from ${Iv}:`,n.status),!n.ok){const c=await n.text();console.error(`API error from ${Iv}:`,n.status,c);let u=null;try{u=JSON.parse(c)}catch{}throw x$(u,n.status)}const a=await n.text();console.log("Raw API response text length:",a.length),console.log("Contains escaped newlines:",a.includes("\\n"));let i;try{i=JSON.parse(a)}catch(c){throw console.error("Failed to parse API response JSON:",c),console.error("Raw response text was:",a),new om("The server returned an invalid response. Please try again later.",{code:"invalid_response",status:n.status,errorType:"parse_error"})}if(!i||typeof i!="object"||Array.isArray(i))throw new om("The server returned an invalid response. Please try again later.",{code:"invalid_response",status:n.status,errorType:"parse_error"});const o=i,l=n.status===206&&Array.isArray(o.generatedContents)&&o.generatedContents.some(c=>typeof(c==null?void 0:c.generatedContent)=="string"&&c.generatedContent.trim());if(o.success===!1||o.error&&!l)throw x$(o,n.status);return console.log("Content generation API response:",i),o}catch(r){throw console.error("Error during content generation request:",r),!(r instanceof om)&&r instanceof Error&&/failed to fetch|fetch failed|network ?error|network request failed|load failed/i.test(r.message)?new om("The server response could not be received. Check your connection before trying again.",{code:"network_error",errorType:"network_error"}):r}},eet=async e=>{var t;console.log("🔄 Starting batch content generation with params:",JSON.stringify(e,null,2));try{const r=await((t=Qe.currentUser)==null?void 0:t.getIdToken());if(!r)throw console.error("❌ Authentication token not available"),new Error("No authentication token available");console.log("🔐 Token obtained successfully, length:",r.length);const n="/ai-coach/content/generate/batch",a=`${mf}${n}`;console.log(`🌐 Attempting to generate batch content using endpoint: ${a}`);const i=JSON.stringify(e);console.log("📦 Request body:",i);const o=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:i});if(console.log(`📡 Response status from ${n}:`,o.status),console.log("📡 Response headers:",Object.fromEntries(o.headers.entries())),!o.ok){const u=await o.text();console.error(`API error from ${n}:`,o.status,u);let d=u;try{const f=JSON.parse(u);d=(f==null?void 0:f.details)||(f==null?void 0:f.error)||u}catch{}throw new Error(`Failed to generate batch content: ${o.status} ${o.statusText}. Details: ${d}`)}const l=await o.text();console.log("Raw batch API response text length:",l.length);let c;try{c=JSON.parse(l)}catch(u){throw console.error("Failed to parse batch API response JSON:",u),console.error("Raw response text was:",l),new Error("Failed to parse AI batch response. The format received from the server was invalid.")}return console.log("Batch content generation API response:",c),c}catch(r){return console.error("Error during batch content generation request:",r),{success:!1,message:r instanceof Error?r.message:"An unknown error occurred during the batch request",data:{contents:[]}}}},tet=()=>mn({mutationFn:e=>XXe(e),onError:e=>{console.error("Content generation error:",e)}}),iY=e=>e&&e.substring(0,2).toLowerCase()||"en",oY=async(e=3)=>{for(let t=0;t<e;t++)try{const r=Qe.currentUser;if(!r)throw new Error("No authenticated user");const n=await r.getIdToken(!0);if(!n)throw new Error("Failed to get authentication token");return n}catch(r){const n=r instanceof Error?r.message:String(r);if(console.warn(`Authentication attempt ${t+1} failed:`,n),t===e-1)throw new Error("Authentication failed after multiple attempts");await new Promise(a=>setTimeout(a,1e3*(t+1)))}throw new Error("Authentication failed")},lY=async(e,t,r,n=3e4)=>{var o;const a=new AbortController,i=setTimeout(()=>a.abort(),n);try{const l={Authorization:`Bearer ${r}`,"Content-Type":"application/json",Accept:"application/json"},c=performance.now(),u=await fetch(e,{method:"POST",headers:l,body:JSON.stringify(t),signal:a.signal}),f=performance.now()-c;if(clearTimeout(i),!u.ok){const p=await u.text();console.error("❌ API error response:",u.status,p);let g={};try{g=JSON.parse(p)}catch{console.warn("⚠️ Could not parse error response as JSON"),g={error:p}}return{success:!1,error:g.error||`HTTP ${u.status}: ${u.statusText}`,code:g.code||"api_error",reason:g.reason,status:u.status,ideas:[],data:{ideas:[]}}}const m=await u.json(),h=m.ideas||((o=m.data)==null?void 0:o.ideas)||[];return{success:!0,ideas:h,data:{ideas:h},timestamp:new Date().toISOString()}}catch(l){if(clearTimeout(i),l instanceof Error&&l.name==="AbortError")return console.error("❌ Request timed out after",n,"ms"),{success:!1,error:"Request timed out. Please try again.",code:"timeout_error",ideas:[],data:{ideas:[]}};const c=l instanceof Error?l.message:String(l);return console.error("❌ Network error:",c),console.error("❌ Full error object:",l),{success:!1,error:c||"Network error occurred",code:"network_error",ideas:[],data:{ideas:[]}}}},ret=e=>{const{brandId:t,personaId:r,appLanguage:n,debug:a=!1,excludeIdeas:i}=e,[o,l]=b.useState(!1);return b.useEffect(()=>{if(t&&r){const c=setTimeout(()=>{l(!0)},100);return()=>clearTimeout(c)}l(!1)},[t,r]),Wa({queryKey:["contentIdeas",t,r,n,a,i],enabled:o,staleTime:2*60*1e3,gcTime:5*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:(c,u)=>{const d=u instanceof Error?u.message:String(u);return d.includes("Authentication")||d.includes("401")?!1:c<3},retryDelay:c=>Math.min(2e3*2**c,45e3),refetchInterval:a?c=>
3907c&&c.success?!1:3e4:!1,refetchIntervalInBackground:!1,queryFn:async()=>{try{const c=Math.random()*1e3;await new Promise(h=>setTimeout(h,c));const u=await oY(),d=iY(n);console.log("🌍 useContentIdeas: Sending appLanguage to API:",d,"from input:",n);const f={brandId:t,personaId:r,appLanguage:d};i&&i.length>0&&(f.excludeIdeas=i),console.log("🌍 useContentIdeas: Request body:",JSON.stringify(f,null,2));const m=await lY(`${mf}/ai-coach/content/ideas`,f,u,3e4);return m.success,m}catch(c){return console.error("❌ Fatal error in content ideas query:",c),{success:!1,error:(c instanceof Error?c.message:String(c))||"An unexpected error occurred",code:"unknown_error",ideas:[],data:{ideas:[]}}}}})},net=e=>{const{brandId:t,personaId:r,appLanguage:n}=e,a=iY(n);console.log("🌍 useContentIdeasWithAccumulation: Received appLanguage:",n,"normalized:",a);const[i,o]=b.useState([]),[l,c]=b.useState(!1),u=b.useRef(!1),d=ret({brandId:t,personaId:r,appLanguage:a}),f=b.useMemo(()=>{if(d.error)return d.error;const h=d.data;return(h==null?void 0:h.success)!==!1?null:Object.assign(new Error(h.error||"Failed to load content ideas"),{code:h.code,reason:h.reason,status:h.status})},[d.error,d.data]);b.useEffect(()=>{var p,g;const h=d.data;if(h!=null&&h.success&&((p=h==null?void 0:h.data)!=null&&p.ideas||h!=null&&h.ideas)){const y=((g=h==null?void 0:h.data)==null?void 0:g.ideas)||(h==null?void 0:h.ideas)||[];o(y)}else h&&h.success},[d.data]);const m=b.useCallback(async()=>{var h;if(!(l||!t||!r||u.current)){u.current=!0,c(!0);try{const p=await oY(),g=i.map(x=>typeof x=="object"&&x!==null?x.title:x).filter(Boolean);console.log("🌍 generateMoreIdeas: Using normalizedAppLanguage:",a,"from params:",n);const y={brandId:t,personaId:r,appLanguage:a};g.length>0&&(y.excludeIdeas=g),console.log("🌍 generateMoreIdeas: Request body:",JSON.stringify(y,null,2));const v=await lY(`${mf}/ai-coach/content/ideas`,y,p,3e4);if(v.success){const x=v.ideas||((h=v.data)==null?void 0:h.ideas)||[];o(j=>[...j,...x])}else throw new Error(v.error||"Failed to generate more ideas")}catch(p){throw console.error("❌ Error generating more ideas:",p),p}finally{u.current=!1,c(!1)}}},[t,r,n,i,l]);return b.useEffect(()=>{t&&r&&(o([]),u.current=!1)},[t,r]),{ideas:i,isLoading:d.isLoading,isGeneratingMore:l,error:f,generateMoreIdeas:m,refetch:d.refetch}};function cY({isVisible:e,hasImage:t}){const{t:r}=Te(),[n,a]=b.useState(""),[i,o]=b.useState(0),l=[{message:r("contentCreation.generation.steps.analyzing","Analyzing your brand voice and style..."),duration:1500},{message:r("contentCreation.generation.steps.creating","Creating engaging content tailored to your audience..."),duration:1500},{message:r("contentCreation.generation.steps.optimizing","Optimizing for your selected platforms..."),duration:1500},{message:r("contentCreation.generation.steps.hashtags","Adding hashtags and keywords for visibility..."),duration:1500},{message:r("contentCreation.generation.steps.polishing","Polishing and finalizing your content..."),duration:1500}],c=[{message:r("contentCreation.generation.steps.generatingImage","Generating creative imagery for your content..."),duration:1800},{message:r("contentCreation.generation.steps.designingVisuals","Designing visuals that match your brand identity..."),duration:1800}],u=t?[...l.slice(0,2),...c,...l.slice(2)]:l;return b.useEffect(()=>{if(!e){o(0),a("");return}o(0),a(u[0].message);const d=setInterval(()=>{o(f=>{const m=f+1;return m>=u.length?(a(u[0].message),0):(a(u[m].message),m)})},4500);return()=>clearInterval(d)},[e,t,u]),e?s.jsx(Wu,{title:r("contentCreation.generation.title","Creating Your AI Content"),currentStep:n,videoSrc:"/Panda Riding Horse for GIF.mov"}):null}const uY=({value:e,onChange:t})=>{const{t:r}=Te(),n=[{value:"square",label:r("contentCreation.imageSize.square","Square (1:1)"),emoji:"🔲",description:r("contentCreation.imageSizeDescriptions.square","Perfect for most social platforms")},{value:"9:16",label:r("contentCreation.imageSize.portrait916","Portrait (9:16)"),emoji:"📱",description:r("contentCreation.imageSizeDescriptions.portrait916","Ideal for Stories and TikTok")},{value:"4:5",label:r("contentCreation.imageSize.portrait45","Portrait (4:5)"),emoji:"🖼️",description:r("contentCreation.imageSizeDescriptions.portrait45","Good for Instagram and Pinterest")}];return s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:n.map(a=>s.jsxs("button",{type:"button",onClick:()=>
3907t(a.value),className:`flex items-center gap-3 p-3 rounded-lg border ${e===a.value?"border-primary-600 bg-primary-50 text-primary-700":"border-gray-300 hover:border-primary-600"}`,children:[s.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-gray-100 rounded-full",children:s.jsx("span",{className:"text-xl",children:a.emoji})}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-medium text-sm",children:a.label}),s.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.value))})},aet="https://api.socialness.ai",Zg=async e=>{try{const t=Qe.currentUser;if(!t)throw new Error("Vous devez être connecté pour sauvegarder un brouillon");const r=await t.getIdToken(),n={};e.platforms&&Array.isArray(e.platforms)&&e.platforms.forEach(l=>{var u;const c=l.toLowerCase();n[c]={settings:((u=e.platformSettings)==null?void 0:u[c])||{}},c==="instagram"&&!n[c].settings.share_to_feed&&(n[c].settings={share_to_feed:!0,video_cover_timestamp_ms:1e3,...n[c].settings}),c==="facebook"&&!n[c].settings.title&&(n[c].settings={title:e.content.substring(0,100),...n[c].settings}),c==="youtube"&&!n[c].settings.title&&(n[c].settings={title:e.content.substring(0,100),privacy:"public",category_id:"22",...n[c].settings}),c==="tiktok"&&!n[c].settings.privacy_level&&(n[c].settings={privacy_level:"PUBLIC_TO_EVERYONE",disable_comment:!1,disable_duet:!1,disable_stitch:!1,brand_safety_brand_owned:!1,brand_safety_paid_partnership:!1,...n[c].settings}),c==="linkedin"&&!n[c].settings.visibility&&(n[c].settings={visibility:"PUBLIC",...n[c].settings})});const a={brandId:e.brandId,title:e.title||"",content:e.content,format:e.format,status:"draft",needsReview:e.needsReview||!1,reviewerId:e.reviewerId||"",platforms:n,media:e.media?[{url:e.media.url,type:e.media.type.toUpperCase(),thumbnailUrl:e.media.thumbnailUrl||"",description:e.media.description||""}]:void 0,hashtags:e.hashtags||[],tags:e.tags||[]};console.log("Saving draft with new API format:",a);const i=await fetch(`${aet}/management/posts`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();return console.log("Draft saved successfully:",o),w$(e),o}catch(t){throw console.error("Error saving draft with API:",t),w$(e),t}},w$=e=>{try{const t={...e,savedAt:new Date().toISOString(),isDraft:!0},r=JSON.parse(localStorage.getItem("contentDrafts")||"[]");r.push(t),localStorage.setItem("contentDrafts",JSON.stringify(r)),console.log("Draft saved locally:",t)}catch(t){console.error("Error saving draft locally:",t)}},dY=({isOpen:e,onClose:t,onDiscard:r,onSaveAndProceed:n,totalPosts:a,isLoadingSave:i=!1})=>{const{t:o}=Te(),l=a-1;return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4 text-center sm:p-0",children:[s.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity","aria-hidden":"true",onClick:i?void 0:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl w-full max-w-md p-6 sm:my-8 sm:max-w-lg sm:p-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-yellow-600",children:[s.jsx(qs,{className:"h-6 w-6"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o("contentCreation.modals.aiPostDraft.title","Handle Other Generated Posts")})]}),!i&&s.jsxs("button",{type:"button",onClick:t,className:"p-1 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500",children:[s.jsx(_t,{className:"h-5 w-5"}),s.jsx("span",{className:"sr-only",children:o("common.close","Close")})]})]}),s.jsx("div",{className:"text-center mb-6",children:s.jsx("p",{className:"text-sm text-gray-600",children:o("contentCreation.modals.aiPostDraft.message","You are about to edit 1 of {{totalPosts}} posts. What do you want to do with the {{count}} remaining post(s)?",{totalPosts:a,count:l})})}),s.jsxs("div",{className:"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3 gap-3",children:[s.jsx("button",{type:"button",onClick:r,disabled:i,className:"w-full sm:w-auto inline-flex justify-center rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:o("contentCreation.modals.aiPostDraft.discard","Discard Others & Edit")}),s.jsxs("button",{type:"button",onClick:n,disabled:i,className:"w-full sm:w-auto inline-flex justify-center items-center rounded-lg border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[i?s.jsx(Rn,{className:"animate-spin -ml-1 mr-2 h-4 w-4"}):s.jsx(il,{className:"-ml-1 mr-2 h-4 w-4"}),i?o("common.saving","Saving..."):o("contentCreation.modals.aiPostDraft.saveAndEdit","Save Others as Drafts & Edit")]})]})]})]})}):null},set=async e=>{try{const t=localStorage.getItem("token");console.log("🔐 Token present:",!!t),console.log("📝 Request payload:",e);const r={brandId:e.brandId,postContent:e.postContent,tone:"professional",platforms:["instagram","linkedin"],aspect_ratio:oet(e.aspect_ratio),style_type:e.style_type},n=await ul.post("/ai-coach/image/generate",r);return console.log("✅ API Response:",n.data),n.data}catch(t){throw console.error("❌ Error regenerating image:",t),console.error("Error response:",t==null?void 0:t.response),t}},iet=async e=>{try{const t=localStorage.getItem("token");console.log("🔐 Token present:",!!t),console.log("📝 Image generation request payload:",e);const r=await ul.post("/ai-coach/image/generate",e);return console.log("✅ Image generation API Response:",r.data),r.data}catch(t){throw console.error("❌ Error generating image:",t),console.error("Error response:",t==null?void 0:t.response),t}},fY=e=>({square:"1x1","9:16":"9x16","4:5":"4x5"})[e]||"1x1",oet=e=>({ASPECT_1_1:"1x1",ASPECT_9_16:"9x16",ASPECT_4_5:"4x5",ASPECT_3_4:"4x5"})[e]||e,mY=e=>e,cet=()=>mn({mutationFn:set,onError:e=>{console.error("Image regeneration failed:",e)}}),uet=()=>mn({mutationFn:iet,onError:e=>{console.error("Image generation failed:",e)}}),Hj=({isOpen:e,title:t,message:r,gifUrl:n="https://media.socialness.ai/loading/Pikachu+-+Waiting.gif",videoSrc:a})=>e?s.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-4 sm:p-8 mx-4 sm:mx-0 max-w-md w-full text-center",children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900 dark:text-white mb-2 sm:mb-4",children:t}),s.jsx("div",{className:"loading",children:a?s.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInl
3907ine:!0,className:"w-full h-auto rounded-lg",style:{maxHeight:"280px",minHeight:"200px"},children:[s.jsx("source",{src:a,type:"video/mp4"}),n&&s.jsx("img",{src:n,alt:"Loading...",className:"w-full h-auto rounded-lg",style:{maxHeight:"280px",minHeight:"200px"}})]}):s.jsx("img",{src:n,alt:"Loading...",className:"w-full h-auto rounded-lg",style:{maxHeight:"280px",minHeight:"200px"}})}),r&&s.jsx("p",{className:"mt-4 text-sm font-semibold text-gray-900 dark:text-white animate-pulse",children:r})]})}):null,hY=({isOpen:e,onClose:t,onGenerate:r,onValidate:n,isLoading:a=!1,currentImageStyle:i="auto",currentImageSize:o="square",generatedImageUrl:l=null})=>{const{t:c}=Te(),[u,d]=b.useState(i),[f,m]=b.useState(o),[h,p]=b.useState(!1),g=()=>{r(u,f)},y=()=>{a||t()};return e?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:y}),s.jsxs("div",{className:"relative bg-white rounded-lg border-2 border-black shadow-xl max-w-xl w-full p-6",children:[s.jsx("div",{className:"absolute top-4 right-4",children:s.jsxs("button",{type:"button",className:"text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",onClick:y,disabled:a,children:[s.jsx("span",{className:"sr-only",children:c("common.close")}),s.jsx(_t,{className:"h-6 w-6"})]})}),s.jsxs("div",{className:"flex items-center mb-6",children:[s.jsx("div",{className:"flex-shrink-0 flex items-center justify-center h-10 w-10 rounded-full bg-primary-100 mr-3",children:s.jsx(Hn,{className:"h-6 w-6 text-primary-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:c("contentCreation.modals.regenerateImage.title","Regenerate Image")}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:c("contentCreation.modals.regenerateImage.description","Choose your preferred image style and size to generate a new image for your content.")})]})]}),s.jsxs("div",{className:"mt-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:c("contentCreation.form.imageStyle","Image Style")}),s.jsx(iA,{value:u,onChange:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:c("contentCreation.form.imageSize","Image Size")}),s.jsx(uY,{value:f,onChange:m})]})]}),l&&s.jsxs("div",{className:"mt-6",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:c("contentCreation.modals.regenerateImage.preview","Generated Image Preview")}),s.jsx("p",{className:"text-xs text-gray-500 mb-3",children:c("contentCreation.modals.regenerateImage.hoverForFullSize","Hover for full size")}),s.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden bg-gray-50 cursor-zoom-in relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:s.jsx("img",{src:l,alt:c("contentCreation.modals.regenerateImage.previewAlt","Generated image preview"),className:"w-full h-auto object-contain max-h-64"})})]}),h&&l&&s.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black bg-opacity-75 pointer-events-none transition-opacity duration-300 ease-in-out",children:[s.jsx("div",{className:"relative",children:s.jsx("img",{src:l,alt:c("contentCreation.modals.regenerateImage.fullSizePreview","Zoom x2 preview"),className:"rounded-lg shadow-2xl transition-transform duration-300 ease-in-out",style:{maxHeight:"32rem",maxWidth:"90vw",objectFit:"contain"}})}),s.jsx("div",{className:"absolute top-4 right-4 bg-black bg-opacity-50 text-white px-3 py-1 rounded-lg text-sm transition-opacity duration-300 ease-in-out",children:c("contentCreation.modals.regenerateImage.fullSizeHint","Zoom x2")})]}),s.jsx("div",{className:"mt-6 sm:flex sm:flex-row-reverse",children:l?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>n(l),className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto 
3907sm:text-sm",children:c("contentCreation.modals.regenerateImage.validate","Use This Image")}),s.jsx("button",{type:"button",onClick:g,disabled:a,className:"mt-3 w-full inline-flex justify-center rounded-md border border-primary-600 shadow-sm px-4 py-2 bg-white text-base font-medium text-primary-600 hover:bg-primary-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-t-transparent border-primary-600 rounded-full animate-spin"}),c("contentCreation.modals.regenerateImage.generating","Generating...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-2"}),c("contentCreation.modals.regenerateImage.regenerate","Generate Another")]})}),s.jsx("button",{type:"button",onClick:y,disabled:a,className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:c("common.cancel","Cancel")})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:g,disabled:a,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary-600 text-base font-medium text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-t-transparent border-white rounded-full animate-spin"}),c("contentCreation.modals.regenerateImage.generating","Generating...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-2"}),c("contentCreation.modals.regenerateImage.generate","Generate New Image")]})}),s.jsx("button",{type:"button",onClick:y,disabled:a,className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed",children:c("common.cancel","Cancel")})]})})]})]}):null},det=({onTextReceived:e,currentLanguage:t="fr-FR",isDisabled:r=!1,placeholder:n="Cliquez pour dicter",className:a="",onListeningChange:i})=>{const[o,l]=b.useState(!1),[c,u]=b.useState(!0),[d,f]=b.useState(null),[m,h]=b.useState(!1),[p,g]=b.useState("unknown"),[y,v]=b.useState(null);b.useEffect(()=>{const I=!!(window.SpeechRecognition||window.webkitSpeechRecognition);u(I),I||Ie.warn("SpeechToTextButton","Speech recognition not supported in this browser")},[]),b.useEffect(()=>{const k=navigator.permissions;
3907if(!k||!k.query)return;let I=!0;return k.query({name:"microphone"}).then(T=>{I&&(g(T.state),T.onchange=()=>g(T.state))}).catch(()=>{g("unknown")}),()=>{I=!1}},[]);const x=async()=>{try{return p!=="granted"&&(await navigator.mediaDevices.getUserMedia({audio:!0}),g("granted")),!0}catch(k){return g("denied"),f("Accès au microphone refusé. Cliquez sur le cadenas du navigateur et autorisez le micro."),Ie.warn("SpeechToTextButton","Microphone permission denied or failed",k),!1}},j=()=>{h(!1),f(null),Ie.info("SpeechToTextButton","Speech recognition reactivated by user")},C=()=>{y&&(y.stop(),v(null)),l(!1),i&&i(!1)},N=async()=>{if(!c){f("La reconnaissance vocale n'est pas supportée dans ce navigateur");return}if(r||m){m&&f("Reconnaissance vocale temporairement désactivée en raison d'erreurs réseau. Rechargez la page pour réactiver.");return}if(await x()){f(null);try{const I=window.SpeechRecognition||window.webkitSpeechRecognition;if(!I){f("La reconnaissance vocale n'est pas supportée dans ce navigateur");return}const T=new I;v(T),T.continuous=!0,T.interimResults=!0,T.lang=t,T.maxAlternatives=1,T.onstart=()=>{l(!0),i&&i(!0),Ie.debug("SpeechToTextButton","Speech recognition started",{language:t})},T.onend=()=>{l(!1),i&&i(!1),v(null),Ie.debug("SpeechToTextButton","Speech recognition ended")},T.onresult=L=>{const R=L.results[0][0].transcript;Ie.debug("SpeechToTextButton","Speech recognized",{transcript:R,confidence:L.results[0][0].confidence}),R&&R.trim()&&e(R.trim())},T.onerror=L=>{l(!1),v(null);const R=S(L.error);f(R),Ie.error("SpeechToTextButton","Speech recognition error",{error:L.error,message:R}),L.error==="network"&&(h(!0),Ie.warn("SpeechToTextButton","Speech recognition disabled due to network issues"))},T.start()}catch(I){l(!1),f("Erreur lors du démarrage de la reconnaissance vocale"),Ie.error("SpeechToTextButton","Failed to start speech recognition",I)}}},S=k=>{switch(k){case"not-allowed":return"Accès au microphone refusé. Veuillez autoriser l'accès.";case"no-speech":return"Aucune parole détectée. Veuillez réessayer.";case"audio-capture":return"Erreur de capture audio. Vérifiez votre microphone.";case"network":return"Erreur réseau. La reconnaissance vocale nécessite une connexion internet. Vérifiez votre connexion.";case"service-not-allowed":return"Service de reconnaissance vocale non autorisé. Essayez un autre navigateur.";case"bad-grammar":return"Erreur de configuration linguistique. Essayez de changer de langue.";default:return`Erreur de reconnaissance vocale: ${k}`}},M=k=>({"fr-FR":"🇫🇷","fr-CA":"🇨🇦",fr:"🇫🇷","en-US":"🇺🇸","en-GB":"🇬🇧",en:"🇺🇸","es-ES":"🇪🇸","es-MX":"🇲🇽",es:"🇪🇸","de-DE":"🇩🇪",de:"🇩🇪","it-IT":"🇮🇹",it:"🇮🇹","pt-BR":"🇧🇷","pt-PT":"🇵🇹",pt:"🇧🇷","nl-NL":"🇳🇱",nl:"🇳🇱","ru-RU":"🇷🇺",ru:"🇷🇺","ar-SA":"🇸🇦",ar:"🇸🇦","zh-CN":"🇨🇳",zh:"🇨🇳","ja-JP":"🇯🇵",ja:"🇯🇵","ko-KR":"🇰🇷",ko:"🇰🇷"})[k]||`🌐 (${k})`;return c?s.jsxs("div",{className:"relative flex justify-end",children:[s.jsx("button",{type:"button",onClick:p==="prompt"||p==="denied"?x:o?C:N,disabled:p!=="prompt"&&p!=="denied"&&(r||m),className:`
3908          inline-flex items-center justify-center w-10 h-10 rounded-lg border-2 transition-colors duration-200
3909          ${p==="prompt"||p==="denied"?"border-amber-500 bg-amber-500 text-white hover:bg-amber-600":o?"border-green-500 bg-green-500 text-white":"border-gray-400 bg-gray-400 text-white hover:bg-gray-500"}
3910          ${p!=="prompt"&&p!=="denied"&&(r||m)?"opacity-50 cursor-not-allowed bg-gray-300 border-gray-300":"cursor-pointer shadow-md hover:shadow-lg"}
3911        `,title:p==="prompt"||p==="denied"?"Autoriser le microphone":o?`Écoute en cours... (${M(t)})`:`${n} (${M(t)})`,"aria-label":p==="prompt"||p==="denied"?"Autoriser le microphone":o?"Arrêter la reconnaissance vocale":"Démarrer la reconnaissance vocale",children:o?s.jsx(ma,{size:18}):s.jsx(the,{size:18})}),d&&s.jsx("div",{className:"absolute top-full right-0 mt-2 w-full max-w-xs bg-red-50 border border-red-200 rounded-md px-3 py-2 text-xs text-red-700 shadow-sm z-20",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"flex-1",children:d}),s.jsxs("div",{className:"flex gap-1",children:[m&&s.jsx("button",{type:"button",onClick:j,className:"text-blue-600 hover:text-blue-800 font-medium underline text-xs","aria-label":"Réactiver la reconnaissance vocale",children:"Réactiver"}),s.jsx("button",{type:"button",onClick:()=>f(null),className:"text-red-500 hover:text-red-700 text-sm leading-none","aria-label":"Fermer le message d'erreur",children:"×"})]})]})})]}):s.jsx("button",{type:"button",disabled:!0,className:`inline-flex items-center justify-center w-10 h-10 rounded-lg border border-gray-300 bg-gray-100 text-gray-400 cursor-not-allowed ${a}`,title:"Reconnaissance vocale non supportée","aria-label":"Reconnaissance vocale non disponible",children:s.jsx(bs,{size:18})})}
3911,fet=U.memo(({value:e,onChange:t})=>{const{i18n:r}=Te(),[n,a]=b.useState(0);return U.useEffect(()=>{a(i=>i+1)},[r.language]),s.jsx(iA,{value:e,onChange:t},`image-style-${n}-${r.language}`)}),met=U.memo(({value:e,onChange:t})=>{const{i18n:r}=Te(),[n,a]=b.useState(0);return U.useEffect(()=>{a(i=>i+1)},[r.language]),s.jsx(gH,{value:e,onChange:t},`tone-select-${n}-${r.language}`)}),het=U.memo(({value:e,onChange:t})=>{const{i18n:r}=Te(),[n,a]=b.useState(0);return U.useEffect(()=>{a(i=>i+1)},[r.language]),s.jsx(uY,{value:e,onChange:t},`image-size-${n}-${r.language}`)}),pet=U.memo(({value:e,onChange:t,buttonLabel:r})=>{const{i18n:n}=Te(),[a,i]=b.useState(0);return U.useEffect(()=>{i(o=>o+1)},[n.language,e]),s.jsx(FXe,{value:e,onChange:t,buttonLabel:r},`language-dropdown-${a}-${n.language}-${e}`)}),get=({value:e,onChange:t,placeholder:r})=>{const n=U.useRef(null);return s.jsx("textarea",{id:"shortDescription",name:"shortDescription",rows:6,ref:n,value:e,onChange:t,placeholder:r,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm pt-2 pb-8 pl-3 pr-20 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm"})},yet=()=>{var rr,se,Be,at,Ke;const{t:e,i18n:t}=Te(),r=pn(),n=qr(),a=vs(),i=U.useRef(!1),o=U.useRef(!1),l=U.useRef(!1),[c,u]=b.useState(!1),[d,f]=b.useState(null),[m,h]=b.useState(!1),[p,g]=b.useState(!1),y=b.useRef(null),[v,x]=b.useState(null),[j,C]=b.useState(null),[N,S]=b.useState(!1),[M,k]=b.useState(null),[I,T]=b.useState(""),[L,R]=b.useState(!1),[_,B]=b.useState(!1),z=cet();b.useEffect(()=>{document.title=e("contentCreation.title","Content Creation")},[e]);const[D,A]=b.useState({brandId:"",personaId:"",platforms:[],topic:"",shortDescription:"",goal:"",tone:"professional",contentLength:"medium",language:(()=>{const ee=typeof t.language=="string"?t.language:"en",de=["en","en-US","en-GB","fr","fr-CA","de","es","es-MX","it","pt","pt-BR","nl","ru","ar","zh","ja","ko","hi","bn","tr","vi","tl","fa","pl","th","sv","ro","uk","cs","lb","da","fi","no"],Se=ee.toLowerCase();if(de.includes(Se))return Se;const Ue=Se.split("-")[0];return de.includes(Ue)?Ue:"en"})(),keywords:[],sourceUrl:"",format:"regular",generateImage:!1,imageStyle:"auto",imageSize:"4:5",useExtractedImage:!1}),[P,E]=b.useState({}),[F,$]=b.useState(null),[H,X]=b.useState(!1),[ue,le]=b.useState(!1),[ae,te]=b.useState(!1),[ne,J]=b.useState(null),[G,Q]=b.useState(0),W=b.useRef(null),[Y,q]=b.useState(!1),[Z,me]=b.useState(null),we=ee=>{const de=Math.floor(ee/60).toString().padStart(1,"0"),Se=Math.floor(ee%60).toString().padStart(2,"0");return`${de}:${Se}`},he=ee=>({"fr-FR":"🇫🇷","fr-CA":"🇨🇦",fr:"🇫🇷","en-US":"🇺🇸","en-GB":"🇬🇧",en:"🇺🇸","es-ES":"🇪🇸","es-MX":"🇲🇽",es:"🇪🇸","de-DE":"🇩🇪",de:"🇩🇪","it-IT":"🇮🇹",it:"🇮🇹","pt-BR":"🇧🇷","pt-PT":"🇵🇹",pt:"🇧🇷","nl-NL":"🇳🇱",nl:"🇳🇱","ru-RU":"🇷🇺",ru:"🇷🇺","ar-SA":"🇸🇦",ar:"🇸🇦","zh-CN":"🇨🇳",zh:"🇨🇳","ja-JP":"🇯🇵",ja:"🇯🇵","ko-KR":"🇰🇷",ko:"🇰🇷"})[ee]||"🌐",[ie,ye]=b.useState(!1),[pe,ce]=b.useState([]),[xe,Ee]=b.useState({});t.language;const Ye=v$.filter(ee=>!["tiktok","youtube"].includes(ee.value)).map(ee=>({id:ee.value,name:ee.label})),{data:fe,error:je}=oa(),We=fe?fe.brands||[]:[];b.useEffect(()=>{je&&Ei(je,"brands-fetch")},[je]);const gt=(()=>{if(!D.brandId||!We.length)return[];const ee=We.find(de=>de.id===D.brandId);return ee!=null&&ee.social_accounts?ee.social_accounts.filter(de=>de.platform&&de.username).map(de=>({platform:de.platform.toLowerCase(),username:de.username,picture_url:de.profile_url||de.picture_url||""})):[]})();b.useEffect(()=>{We&&We.length===1&&!D.brandId&&A(ee=>({...ee,brandId:We[0].id}))},[We,D.brandId]),b.useEffect(()=>{const ee=a.state;if(ee){const{selectedBrandId:de,selectedPersonaId:Se,createManually:Ue,returnToBrands:Pe,returnToPersonas:tt,recommendedPlatforms:kt,preFilledTopic:or,preFilledDescription:Nr,fromBoostMode:Fr}=ee;if(de&&de!==D.brandId&&A(Sr=>({...Sr,brandId:de})),Se&&Se!==D.personaId&&console.log("Will set persona from navigation:",Se),kt&&Array.isArray(kt)&&kt.length>0){console.log("ContentCreation: Setting recommended platforms from persona:",kt);const Sr=v$.filter(kr=>!["tiktok","youtube"].includes(kr.value)).map(kr=>kr.value);console.log("ContentCreation: Available platform IDs:",Sr);const Zt=kt.map(kr=>kr.toLowerCase()).filter(kr=>Sr.includes(kr));console.log("ContentCreation: Normalized platforms to set:",Zt),Zt.length>0?A(kr=>(console.log("ContentCreation: Updating platforms from",kr.platforms,"to",Zt),{...kr,platforms:Zt})):console.log("ContentCreation: No valid platforms found to set")}Fr&&(console.log("ContentCreation: Handling data from BoostMode"),(or||Nr)&&(A(Sr=>
3911({...Sr,topic:or||Sr.topic,shortDescription:Nr||Sr.shortDescription})),Nr&&(o.current=!0),console.log("ContentCreation: Pre-filled form with:",{topic:or,description:Nr}))),r(a.pathname,{replace:!0})}},[a.state,r]);const{data:qe,isLoading:ze,error:$e}=Vj(void 0,!1,!1),ct=(qe==null?void 0:qe.personas)||[];b.useEffect(()=>{$e&&Ei($e,"personas-fetch")},[$e]);const oe=b.useMemo(()=>ct.length?D.brandId?ct.filter(ee=>ee.brandId===D.brandId):ct:[],[ct,D.brandId]),Ne=b.useCallback(ee=>ee&&ee.substring(0,2).toLowerCase()||"en",[]),Ae=b.useMemo(()=>{const ee=Ne(t.language);return console.log("🌍 APP LANGUAGE for content ideas:",ee,"from i18n.language:",t.language),ee},[t.language,Ne]),[lt,Mt]=b.useState(!1),{ideas:jt,isLoading:Xe,isGeneratingMore:Bt,error:ve,generateMoreIdeas:Fe,refetch:nt}=net({brandId:lt&&D.brandId||"",personaId:lt&&D.personaId||"",appLanguage:Ae}),At=async()=>{!D.brandId||!D.personaId||(console.log("=".repeat(80)),console.log("🔥 GENERATING IDEAS - LANGUAGE DEBUG:"),console.log("i18n.language (raw):",t.language),console.log("appLanguage (normalized, sent to API):",Ae),console.log("=".repeat(80)),lt?await qt():(Mt(!0),setTimeout(()=>{nt()},100)))};b.useEffect(()=>{ve&&Ei(ve,"content-ideas-fetch")},[ve]);const Wt=ve==null?void 0:ve.message,In=!!ve;b.useEffect(()=>{Mt(!1)},[D.brandId,D.personaId]),b.useEffect(()=>{D.brandId&&D.personaId&&n.invalidateQueries({queryKey:["contentIdeas",D.brandId,D.personaId]})},[Ae,D.brandId,D.personaId,n]),b.useEffect(()=>{D.brandId&&D.personaId&&(console.log(`🔄 Brand/Persona changed: ${D.brandId}/${D.personaId} - resetting auto-selection flag`),l.current=!1,console.log("✅ Auto-selection flag reset, new ideas will be auto-selected when they load")),R(!1),B(!1)},[D.brandId,D.personaId]),b.useEffect(()=>{var ee,de;if(jt.length>0&&!((ee=D.sourceUrl)!=null&&ee.trim())&&!((de=D.shortDescription)!=null&&de.trim())&&!o.current&&!l.current){const Se=Math.floor(Math.random()*jt.length),Ue=jt[Se];console.log("Auto-selecting random content idea (first time only):",Ue),l.current=!0,Ze(Ue)}},[jt,D.sourceUrl,D.shortDescription]),b.useEffect(()=>{const ee=a.state;if(ee!=null&&ee.selectedPersonaId&&oe.length>0){const de=oe.find(Se=>Se.id===ee.selectedPersonaId);de&&de.id!==D.personaId&&(console.log("Setting persona from navigation:",de.id),A(Se=>({...Se,personaId:de.id})))}},[oe,a.state,D.personaId]),b.useEffect(()=>{D.brandId},[D.brandId,oe]),b.useEffect(()=>{D.brandId&&oe.length>0?oe.length===1?(console.log("Auto-selecting single persona:",oe[0].id),A(ee=>({...ee,personaId:oe[0].id}))):(console.log("Multiple personas available, user needs to select"),D.personaId&&(oe.some(de=>de.id===D.personaId)||A(de=>({...de,personaId:""})))):D.brandId&&oe.length===0&&(console.log("No personas available for this brand yet"),A(ee=>({...ee,personaId:""})))},[D.brandId,oe]),b.useEffect(()=>{D.brandId&&We.length>0&&!a.state&&(console.log("Brand changed, resetting platform selection"),A(ee=>({...ee,platforms:[]})))},[D.brandId,We,a.state]);const ir=tet(),Qt=b.useRef(null),Sn=()=>{window.scrollTo({top:0,behavior:"smooth"})},nn=()=>{var ee;(ee=Qt.current)==null||ee.scrollIntoView({behavior:"smooth",block:"start"})},Lt=ee=>{var Se,Ue;if(console.log("Transforming content response:",ee),!ee)return console.error("Content response is empty or undefined"),{success:!1,message:"Empty response received",data:{contents:[]}};if(ee.imageUrl,ee.generatedContents&&Array.isArray(ee.generatedContents))try{console.log("Processing response with generatedContents array");const Pe=ee.generatedContents.map(tt=>{var or;let kt=tt.generatedContent||"";return typeof kt=="string"&&kt.includes("\\n")&&(kt=kt.replace(/\\n
3911/g,`
3912`)),{platform:((or=tt.platform)==null?void 0:or.toLowerCase())||"unknown",content:kt,hashtags:_e(kt),imageUrl:tt.imageUrl||ee.imageUrl}});return console.log("Transformed content from generatedContents:",Pe),{...ee,success:!0,data:{contents:Pe}}}catch(Pe){console.error("Error transforming generatedContents:",Pe)}let de=[];try{ee.generatedContents&&Array.isArray(ee.generatedContents)?(de=ee.generatedContents.map(Pe=>{var kt;let tt=Pe.generatedContent||"";return typeof tt=="string"&&tt.includes("\\n")&&(tt=tt.replace(/\\n/g,`
3913`)),{platform:((kt=Pe.platform)==null?void 0:kt.toLowerCase())||"unknown",content:tt,hashtags:_e(tt)}}),console.log("Extracted from generatedContents array:",de)):(Se=ee.data)!=null&&Se.contents?(de=ee.data.contents.map(Pe=>typeof Pe.content=="string"&&Pe.content.includes("\\n")?{...Pe,content:Pe.content.replace(/\\n/g,`
3914`)}:Pe),console.log("Using existing contents array:",de)):(Ue=ee.content)!=null&&Ue.platforms&&(de=Object.entries(ee.content.platforms).map(([Pe,tt])=>{if(typeof tt=="string"){const kt=tt;return kt.includes("\\n")?{platform:Pe.toLowerCase(),content:kt.replace(/\\n
3914/g,`
3915`),hashtags:_e(kt.replace(/\\n/g,`
3916`))}:{platform:Pe.toLowerCase(),content:kt,hashtags:_e(kt)}}else if(tt&&typeof tt=="object"){const kt=tt;if("text"in kt&&typeof kt.text=="string"&&kt.text.includes("\\n")){const or={...kt,text:kt.text.replace(/\\n/g,`
3917`)};return{platform:Pe.toLowerCase(),content:or,hashtags:_e(or)}}}return{platform:Pe.toLowerCase(),content:tt,hashtags:_e(tt)}}),console.log("Extracted from content.platforms object:",de))}catch(Pe){console.error("Error extracting content from response:",Pe)}return{...ee,success:ee.success===void 0?!0:ee.success,message:ee.message||"Content format not recognized",data:{contents:de.length>0?de:[]}}},_e=ee=>{const de=[];let Se="";typeof ee=="string"?Se=ee:ee&&typeof ee=="object"?"text"in ee&&ee.text?Se=typeof ee.text=="string"?ee.text:JSON.stringify(ee.text):Se=JSON.stringify(ee):ee&&(Se=String(ee));const Ue=/#(\w+)/g;let Pe;for(;(Pe=Ue.exec(Se))!==null;)de.push(`#${Pe[1]}`);return de};b.useEffect(()=>{E({})},[D]),b.useEffect(()=>{var Se,Ue;const ee=["en","en-US","en-GB","fr","fr-CA","de","es","es-MX","it","pt","pt-BR","nl","ru","ar","zh","ja","ko","hi","bn","tr","vi","tl","fa","pl","th","sv","ro","uk","cs","lb","da","fi","no"];let de="en";if(D.brandId&&We.length>0){const Pe=We.find(tt=>tt.id===D.brandId);if(Pe!=null&&Pe.languages&&Array.isArray(Pe.languages)&&Pe.languages.length>0){const tt=Pe.languages[0].toLowerCase();if(ee.includes(tt))de=tt;else{const kt=tt.split("-")[0];ee.includes(kt)&&(de=kt)}console.log("Using brand language:",de,"from brand:",Pe.name),R(!0)}else R(!1)}if(de==="en"&&(!D.brandId||!((Ue=(Se=We.find(Pe=>Pe.id===D.brandId))==null?void 0:Se.languages)!=null&&Ue.length))){const tt=(typeof t.language=="string"?t.language:"en").toLowerCase();if(ee.includes(tt))de=tt;else{const kt=tt.split("-")[0];de=ee.includes(kt)?kt:"en"}console.log("Using user language fallback:",de),R(!1)}de!==D.language&&A(Pe=>({...Pe,language:de}))},[D.brandId,We,t.language]),b.useEffect(()=>{if(!D.generateImage||!D.brandId||!We.length){B(!1);return}const ee=We.find(Se=>Se.id===D.brandId);let de="auto";ee!=null&&ee.imageStyle&&typeof ee.imageStyle=="string"?(de=ee.imageStyle,console.log("Using brand imageStyle:",de,"from brand:",ee.name),B(!0)):(console.log("No brand imageStyle found, using auto fallback"),B(!1)),de!==D.imageStyle&&A(Se=>({...Se,imageStyle:de}))},[D.generateImage,D.brandId,We]);const et=()=>{var de;const ee={};return D.brandId||(ee.brandId=e("contentCreation.errors.brandRequired")),D.personaId||(ee.personaId=e("contentCreation.errors.personaRequired")),D.platforms.length===0&&(ee.platforms=e("contentCreation.errors.platformsRequired")),!D.shortDescription.trim()&&!((de=D.sourceUrl)!=null&&de.trim())&&(ee.shortDescription=e("contentCreation.errors.descriptionOrSourceRequired")),D.tone||(ee.tone=e("contentCreation.errors.toneRequired")),D.contentLength||(ee.contentLength=e("contentCreation.errors.contentLengthRequired")),D.language||(ee.language=e("contentCreation.errors.languageRequired")),D.shortDescription.length>600&&(ee.shortDescription=e("contentCreation.errors.descriptionTooLong","Description too long (max 600 characters)")),E(ee),Object.keys(ee).length===0},ft=ee=>{if(ee.preventDefault(),i.current=!0,et()){const de={...D};de.shortDescription=D.shortDescription,de.goal&&(de.goal=de.goal.toLowerCase());const Se=de.useExtractedImage||!1;if(Se&&(de.generateImage=!1),delete de.useExtractedImage,de.generateImage&&de.imageStyle){const Ue=de.imageStyle==="3d"?"RENDER_3D":de.imageStyle.toUpperCase();if(de.style_type=Ue,de.imageSize){const Pe={square:"1x1","9:16":"9x16","4:5":"4x5"};de.aspect_ratio=Pe[de.imageSize]||"1x1",console.log("Using aspect ratio:",de.aspect_ratio,"from size:",de.imageSize)}}console.log("*** CONTENT GENERATION EXPLICITLY TRIGGERED BY USER ACTION ***"),console.log("Request data:",de),i.current?(console.log("Content generation allowed, making API call"),ir.mutate(de,{onSuccess:async Ue=>{var tt,kt,or,Nr;if(i.current=!1,console.log("Content generation API call successful, raw response:",Ue),Se&&(Z!=null&&Z.image)){console.log("📥 Downloading and uploading extracted image:",Z.image);try{const Fr=await NZe(Z.image,"extracted-image.jpg");if(Fr){const Sr=Qe.currentUser;if(Sr){const Zt=await Sr.getIdToken(),kr=new FormData;kr.append("file",Fr),D.brandId&&kr.append("brandId",D.brandId);const Ce=await fetch(`${mf}/storage/upload`,{method:"POST",headers:{Authorization:`Bearer ${Zt}`},body:kr});if(Ce.ok){const Ge=await Ce.json(),Je=Ge.publicUrl||Ge.url||Ge.fileUrl||((tt=Ge.data)==null?void 0:tt.url);Je?(Ue.imageUrl=Je,console.log("✅ Image uploaded successfully:",Je)):(console.warn("⚠️ Upload succeeded but no URL returned, using original"),Ue.imageUrl=Z.image)}else console.error("❌ Upload failed, using original URL"),Ue.imageUrl=Z.image}else console.warn("⚠️ No authenticated user, using original URL"),Ue.imageUrl=Z.image}else console.warn("⚠️ Failed to download image, using original URL"),Ue.imageUrl=Z.image}catch(Fr){console.error("❌ Error uploading extracted image:",Fr),Ue.imageUrl=Z.image}}const Pe=Lt(Ue);console.log("Setting generated content with transformed data:",Pe),console.log("generatedContent.imageUrl:",Pe.imageUrl),console.log("First post imageUrl:",(Nr=(or=(kt=Pe.data)==null?void 0:kt.contents)==null?void 0:or[0])==null?void 0:Nr.imageUrl),$(Pe),le(!0),(de.generateImage||Se)&&(Pe!=null&&Pe.imageUrl)&&(x(D.imageStyle||"auto"),C(D.imageSize||"4:5"))},onError:Ue=>{i.current=!1,console.error("Content generation API call failed:",Ue),E({submit:Ue.message||e("contentCreation.errors.generationFailed")})}})):console.log("Content generation attempted but not allowed - not explicitly triggered by user")}else console.warn("Form validation failed, not proceeding with content generation"),console.log("Current errors:",P),setTimeout(()=>{const de=document.querySelector("form .flex.justify-between");de&&de.scrollIntoView({behavior:"smooth",block:"center"})},100)};b.useEffect(()=>{ue&&Qt.current&&(document.body.contains(Qt.current)&&(window.innerWidth>=1024?Sn():Qt.current.scrollIntoView({behavior:"smooth",block:"start"})),le(!1))},[ue,F,Sn,nn]),b.useEffect(()=>{if(!p)return;const ee=de=>{y.current&&!y.current.contains(de.target)&&g(!1)};return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[p]);const pt=()=>{i.current=!0,ft({preventDefault:()=>{}})},$t=()=>{if(!D)return;i.current=!0;const ee={...D,generateImage:!1};
3917if(delete ee.style_type,delete ee.aspect_ratio,i.current){const de=(F==null?void 0:F.imageUrl)||null;ir.mutate(ee,{onSuccess:Se=>{var Fr,Sr;i.current=!1;const Ue=Lt(Se),Pe={},tt=[],kt=((Fr=F==null?void 0:F.data)==null?void 0:Fr.contents)||[],or=Zt=>typeof Zt=="string"?Zt:Zt&&typeof Zt=="object"&&"text"in Zt&&typeof Zt.text=="string"?Zt.text:"",Nr=((Sr=Ue==null?void 0:Ue.data)==null?void 0:Sr.contents)||[];for(const Zt of Nr){const kr=(Zt.platform||"unknown").toLowerCase(),Ce=kt.find(Xt=>(Xt.platform||"").toLowerCase()===kr),Ge=Ce?or(Ce.content):"",Je=or(Zt.content);Je&&(Pe[kr]=Je,tt.push({platform:kr,oldContent:Ge,newContent:Je}))}tt.length>0&&(ce(tt),Ee(Pe),ye(!0)),de&&(x(D.imageStyle||v||"auto"),C(D.imageSize||j||"4:5"))},onError:Se=>{i.current=!1,E({submit:(Se==null?void 0:Se.message)||e("contentCreation.errors.generationFailed")})}})}},Pt=ee=>{const{name:de,value:Se}=ee.target;de==="shortDescription"&&(o.current=!0,console.log("Description manually edited to:",Se)),de==="sourceUrl"&&me(null),A(Ue=>({...Ue,[de]:Se}))},Ft=()=>{A({brandId:"",personaId:"",platforms:[],topic:"",shortDescription:"",goal:"",tone:"professional",contentLength:"medium",language:"en",keywords:[],sourceUrl:"",format:"regular",generateImage:!1,imageStyle:"auto",imageSize:"4:5"}),$(null),E({}),o.current=!1,l.current=!1,T(""),R(!1),B(!1),console.log("Form reset, including manually edited description flag and auto-selection flag")},Dr=(ee,de,Se)=>{var or,Nr,Fr,Sr;const Ue=(Nr=(or=F==null?void 0:F.data)==null?void 0:or.contents)==null?void 0:Nr.find(Zt=>Zt.platform===ee),Pe=typeof Ue=="object"&&Ue&&"imageUrl"in Ue&&typeof Ue.imageUrl=="string"?Ue.imageUrl:null,tt=ee.toLowerCase();(((Sr=(Fr=F==null?void 0:F.data)==null?void 0:Fr.contents)==null?void 0:Sr.filter(Zt=>Zt.platform.toLowerCase()!==tt))||[]).length>0?(f({platform:tt,content:de,hashtags:Se,imageUrl:Pe}),u(!0)):r("/posts/new",{state:{content:de,platform:tt,hashtags:Se,brandId:D.brandId,imageUrl:Pe}})},K=()=>{u(!1),d&&(r("/posts/new",{state:{content:d.content,platform:d.platform,hashtags:d.hashtags,brandId:D.brandId,imageUrl:d.imageUrl}}),f(null))},ke=async()=>{var de,Se,Ue;if(!((de=F==null?void 0:F.data)!=null&&de.contents)||!d)return;h(!0);const ee=F.data.contents.filter(Pe=>Pe.platform.toLowerCase()!==(d==null?void 0:d.platform.toLowerCase()));try{for(const Pe of ee){const tt=(Ue=(Se=F==null?void 0:F.data)==null?void 0:Se.contents)==null?void 0:Ue.find(Fr=>Fr.platform===Pe.platform);let kt=null;tt&&typeof tt=="object"&&tt!==null&&tt.hasOwnProperty("imageUrl")&&(typeof tt.imageUrl=="string"?kt=tt.imageUrl:tt.imageUrl===null&&(kt=null));let or="";if(typeof Pe.content=="string")or=Pe.content;else if(Pe.content&&typeof Pe.content=="object"&&Pe.content!==null&&Pe.content.hasOwnProperty("text")){const Fr=Pe.content;typeof Fr.text=="string"&&(or=Fr.text)}const Nr={brandId:D.brandId,title:"",content:or,format:D.format||"regular",platforms:[Pe.platform.toLowerCase()],needsReview:!1,reviewerId:"",tags:[],hashtags:Pe.hashtags||[],platformSettings:{}};kt&&(Nr.media={url:kt,type:"image",thumbnailUrl:""}),await Zg(Nr)}K()}catch(Pe){console.error("Error saving other posts as drafts:",Pe),K()}finally{h(!1),u(!1)}},Ze=ee=>{console.log("Content idea selected:",ee),o.current=!1;let de="",Se="",Ue="";typeof ee=="object"&&ee!==null?(de=ee.title||"",Se=ee.description||"",Ue=ee.goal?ee.goal.toLowerCase():""):Se=ee,A(Pe=>({...Pe,topic:de,shortDescription:Se,goal:Ue||Pe.goal})),console.log("Updated description via state with:",Se),Ue&&console.log("Updated goal with:",Ue)},bt=()=>{console.log("Purging description and deselecting content idea"),A(ee=>({...ee,topic:"",shortDescription:""})),o.current=!1},Re=ee=>{if(ee.key==="Enter"&&I.trim()){ee.preventDefault();const de=I.trim();D.keywords.includes(de)||A(Se=>({...Se,keywords:[...Se.keywords,de]})),T("")}},dt="bg-white rounded-lg shadow-md p-6 border border-black",Et="flex items-center gap-2 mb-4 pb-2 border-b border-gray-200",xt="text-lg font-semibold text-gray-800",qt=async()=>{if(!Bt){console.log("🎲 Manually generating more ideas...");try{await Fe(),console.log("✅ More ideas generated successfully")}catch(ee){console.error("❌ Failed to generate more ideas:",ee)}}},Gr=ee=>{if(!ee)return null;try{const de=new URL(ee.trim()),Se=de.hostname.replace(/^www\./,"").toLowerCase();
3917if(Se==="youtu.be"){const Ue=de.pathname.split("/").filter(Boolean)[0];return Ue&&/^[A-Za-z0-9_-]{11}$/.test(Ue)?Ue:null}if(Se==="youtube.com"||Se==="m.youtube.com"||Se==="music.youtube.com"){const Ue=de.searchParams.get("v");if(Ue&&/^[A-Za-z0-9_-]{11}$/.test(Ue))return Ue;const Pe=de.pathname.split("/").filter(Boolean);if(Pe.length>=2&&["embed","shorts","live"].includes(Pe[0])){const tt=Pe[1];return/^[A-Za-z0-9_-]{11}$/.test(tt)?tt:null}}return null}catch{return null}},la=async()=>{var ee,de,Se,Ue,Pe,tt;if((ee=D.sourceUrl)!=null&&ee.trim()){q(!0),me(null);try{const kt=Qe.currentUser;if(!kt)throw new Error("No authenticated user");const Nr=Ne(Ae),Fr=await kt.getIdToken(),Sr=await fetch(`${mf}/ai-coach/article/summarize`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Fr}`},body:JSON.stringify({url:D.sourceUrl.trim(),language:Nr})});if(!Sr.ok){const kr=await Sr.text();throw new Error(`Failed to summarize article: ${Sr.status} ${kr}`)}const Zt=await Sr.json();if(Zt.summary){const kr=Gr(D.sourceUrl.trim()),Ce=kr?`https://img.youtube.com/vi/${kr}/hqdefault.jpg`:void 0,Ge={image:((de=Zt.summary.metadata)==null?void 0:de.image)||((Ue=(Se=Zt.summary.visual_elements)==null?void 0:Se.metadata)==null?void 0:Ue.image)||Ce,recap:Zt.summary.recap,title:(Pe=Zt.summary.metadata)==null?void 0:Pe.title,description:(tt=Zt.summary.metadata)==null?void 0:tt.description};if(me(Ge),Ge.recap){const Je=Ge.recap.length>550?Ge.recap.substring(0,550).trim()+"...":Ge.recap;A(Xt=>({...Xt,shortDescription:Je})),o.current=!1}}}catch(kt){console.error("Error checking URL:",kt),alert(e("contentCreation.form.urlCheckError","Failed to check URL. Please try again."))}finally{q(!1)}}},$n=(ee,de)=>{var tt;if(!((tt=F==null?void 0:F.data)!=null&&tt.contents)||!D.brandId||!D.personaId){console.error("Missing required data for image regeneration");return}const Se=F.data.contents[0];let Ue="";if(typeof Se.content=="string"?Ue=Se.content:Se.content&&typeof Se.content=="object"&&"text"in Se.content&&(Ue=Se.content.text||""),!Ue){console.error("No post content found for image regeneration");return}const Pe={postContent:Ue,brandId:D.brandId,personaId:D.personaId,aspect_ratio:fY(de),style_type:mY(ee)};z.mutate(Pe,{onSuccess:kt=>{kt.imageUrl&&k(kt.imageUrl)},onError:kt=>{console.error("Image regeneration failed:",kt),E({...P,submit:kt.message||"Image regeneration failed"})}})},Rt=ee=>{var de,Se;if(F){const Ue={...F,imageUrl:ee,data:{...F.data,contents:((Se=(de=F.data)==null?void 0:de.contents)==null?void 0:Se.map(Pe=>({...Pe,imageUrl:ee})))||[]}};$(Ue),console.log("✅ Image updated for all platforms:",ee)}k(null),S(!1)};return b.useEffect(()=>()=>{},[]),s.jsxs(s.Fragment,{children:[s.jsx(rs,{title:e("contentCreation.title"),subtitle:e("contentCreation.subtitle"),children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[s.jsx("div",{children:s.jsxs("form",{onSubmit:ee=>{console.log("Form submit event triggered"),ee.preventDefault(),ft(ee)},className:"space-y-6",children:[s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(Jr,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:"Audience"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"brandId",className:"block text-sm font-medium text-gray-700 mb-3",children:[e("contentCreation.form.brand")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:We.map(ee=>s.jsxs("button",{type:"button",onClick:()=>A(de=>({...de,brandId:ee.id})),className:`flex flex-col items-center gap-2 p-3 rounded-lg border border-black ${D.brandId===ee.id?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[s.jsx("img",{src:ee.logo,alt:ee.name,className:"w-10 h-10 rounded-lg object-cover",onError:de=>{de.target.style.display="none"}}),s.jsx("span",{className:"text-sm text-gray-700 truncate max-w-full",children:ee.name})]},ee.id))}),P.brandId&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.brandId})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"personaId",className:"block text-sm font-medium text-gray-700 mb-3",children:[e("contentCreation.form.persona")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:ze?Array(2).fill(0).map((ee,de)=>s.jsxs("div",{className:"flex items-start p-3 rounded-lg border border-gray-200 animate-pulse",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-gray-200 flex-shrink-0"}),s.jsxs("div",{className:"ml-3 text-left w-full",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/2 mb-2"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/4"})]})]},de)):oe.length>0?oe.map(ee=>{const de=Se=>{switch(Se.toLowerCase()){case"en":return"🇬🇧";case"fr":return"🇫🇷";case"es":return"🇪🇸";default:return"🌐"}};return s.jsxs("button",{type:"button",onClick:()=>A(Se=>({...Se,personaId:ee.id})),className:`flex items-start p-3 rounded-lg border border-black ${D.personaId===ee.i
3917d?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[ee.avatarUrl?s.jsx("img",{src:ee.avatarUrl,alt:ee.name,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:Se=>{Se.target.style.display="none"}}):s.jsx("div",{className:"w-12 h-12 rounded-lg border border-gray-200 bg-primary-50 flex items-center justify-center flex-shrink-0",children:s.jsx(Fi,{className:"w-6 h-6 text-primary-600"})}),s.jsxs("div",{className:"ml-3 text-left",children:[s.jsx("span",{className:"text-sm font-medium text-gray-800 block",children:ee.name}),s.jsx("span",{className:"text-xs text-gray-500 block",children:ee.jobTitle}),s.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[s.jsx("span",{className:"text-xs text-gray-500",children:ee.age}),ee.languages&&ee.languages.map((Se,Ue)=>s.jsx("span",{className:"text-xs",children:de(Se)},Ue))]})]})]},ee.id)}):s.jsxs("div",{className:"col-span-2 p-4 border border-dashed border-gray-300 rounded-lg text-center",children:[s.jsx("p",{className:"text-sm text-gray-500 mb-3",children:e("contentCreation.form.noPersonas","No personas available for this brand")}),s.jsx(Us,{to:"/ai-personas-builder",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:e("contentCreation.form.createPersona","Create a Persona")})]})}),P.personaId&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.personaId}),s.jsx("div",{className:"sr-only",children:s.jsxs("select",{id:"personaId",name:"personaId",value:D.personaId,onChange:Pt,"aria-hidden":"true",className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm rounded-md",children:[s.jsx("option",{value:"",children:e("contentCreation.form.selectPersona")}),oe.map(ee=>s.jsx("option",{value:ee.id,children:ee.name},ee.id))]})})]})]})]}),s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(li,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:e("cards.platforms.title","Platforms")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:[e("contentCreation.form.platforms")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:Ye.map(ee=>{if(ee.id==="all")return null;const de=ee.id,Se=D.platforms.includes(de),Ue=gt.find(Pe=>Pe.platform===de);return s.jsx("button",{type:"button",onClick:()=>{D.platforms.includes(de)?A(Pe=>({...Pe,platforms:Pe.platforms.filter(tt=>tt!==de)})):A(Pe=>({...Pe,platforms:[...Pe.platforms,de]}))},className:`flex flex-col items-center gap-2 p-3 rounded-lg border border-black ${Se?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:Ue?s.jsxs(s.Fragment,{children:[s.jsx(Du,{pictureUrl:Ue.picture_url,username:Ue.username,platform:ee.id,size:"md"}),s.jsxs("span",{className:"text-xs text-gray-700 text-center line-clamp-2 overflow-hidden whitespace-normal break-words",children:["@",Ue.username]})]}):s.jsxs(s.Fragment,{children:[s.jsx(cr,{platform:ee.id,size:24}),s.jsx("span",{className:"text-sm text-gray-700",children:ee.name})]})},ee.id)})}),P.platforms&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.platforms})]})]}),s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(Ti,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:e("contentCreation.form.sourceCard","Source")})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:e("contentCreation.form.contentIdeas","Content Ideas")}),s.jsx("button",{type:"button",onClick:At,disabled:Xe||Bt||!D.brandId||!D.personaId,className:`inline-flex items-center px-3 py-1.5 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed ${Xe||Bt?"bg-gray-400 hover:bg-gray-400":"bg-primary-600 hover:bg-primary-700"}`,children:Xe||Bt?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-1.5 border-2 border-t-transparent border-white rounded-full animate-spin"}),s.jsx("span",{className:"text-sm font-semibold",children:e("common.generating","Generating...")})]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-1.5"}),s.jsx("span",{className:"text-sm font-semibold",children:lt?e("contentCreation.form.generateMoreIdeas","Generate 5 more ideas"):e("contentCreation.form.generateIdeas","Generate ideas")})]})})]}),!D.brandId||!D.personaId?s.jsx("p",{className:"text-sm text-gray-500",children:e("contentCreation.form.selectBrandAndPersona","Please select a brand and persona to generate ideas")}):Xe&&!lt?s.jsx("p",{className:"text-sm text-gray-500",children:e("contentCreation.form.clickToGenerate",'Click "Generate ideas" to get started')}):Xe?s.jsx("div",{className:"grid grid-cols-1 gap-2",children:Array(5).fill(0).map((ee,de)=>s.jsxs("div",{className:"flex items-center w-full px-3 py-2 rounded-md text-sm border border-gray-200 animate-pulse",children:[s.jsx("div",{className:"h-3 w-3 bg-gray-300 rounded-sm mr-2 flex-shrink-0"}),s.jsx("div",{className:"h-4 bg-gray-300 rounded w-3/4"})]},de))}):In?s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-red-500 mb-2",children:Wt?`Error: ${Wt}`:e("contentCreation.form.ideasError","Failed to load content ideas")}),s.jsx("button",{type:"button",onClick:()=>nt(),className:"text-xs text-primary-600 hover:text-primary-800",children:e("common.retry","Retry")})]}):jt.length>0?s.jsx("div",{className:"grid grid-cols-1 gap-2",children:jt.map((ee,de)=>{const Se=typeof ee=="object"&&ee!==null?ee.title:ee,Ue=typeof ee=="object"&&ee!==null?ee.goal:null,Pe=Ue?e(`contentCreation.form.goals.${Ue.toLowerCase()}`,Ue):null,tt=typeof ee=="object"&&ee!==null&&ee.title===D.topic&&ee.description===D.shortDescription||typeof ee=="string"&&ee===D.shortDescription;return s.jsxs("button",{type:"button",onClick:()=>Ze(ee),className:`flex items-center w-full px-3 py-2 rounded-md text-sm border transition-colors ${tt?"bg-primary-50 text-primary-700 border-primary-200 hover:bg-primary-100":"bg-white text-gray-700 border-gray-200 hover:border-gray-300"}`,children:[s.jsx($7,{className:`h-3 w-3 min-w-3 mr-2 flex-shrink-0 ${tt?"text-primary-600":"text-gray-400"}`}),s.jsxs("span",{className:"text-left truncate w-full flex items-center gap-1",style:{textTransform:"none"},children:[s.jsx("span",{className:"truncate",children:Se}),Pe&&s.jsxs("span",{className:"italic text-gray-500 flex-shrink-0",children:["(",Pe,")"]})]})]},de)})}):lt?s.jsx("p",{className:"text-sm text-gray-500",children:e("contentCreation.form.noIdeas","No content ideas available")}):s.jsx("p",{className:"text-sm text-gray-500",children:e("contentCreation.form.clickToGenerate",'Click "Generate ideas" to get started')})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"sourceUrl",className:"block text-sm font-medium text-gray-700 mb-1",children:e("contentCreation.form.sourceUrl")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"url",id:"sourceUrl",name:"sourceUrl",value:D.sourceUrl,onChange:Pt,placeholder:e("contentCreation.form.sourceUrlPlaceholder","Enter source URL (optional)"),className:"mt-1 flex-1 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm"}),s.jsx("button",{type:"button",onClick:la,disabled:!((rr=D.sourceUrl)!=null&&rr.trim())||Y,className:"mt-1 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:Y?s.jsx(Rn,{className:"w-4 h-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(ma,{className:"w-4 h-4 mr-1"}),e("contentCreation.form.add","Add")]})})]}),Z&&s.jsxs("div",{className:"mt-3 flex gap-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[Z.image&&s.jsx("div",{className:"flex-shrink-0",children:s.jsx("img",{src:Z.image,alt:Z.title||"Article preview",className:"w-32 h-32 object-cover rounded-lg",onError:ee=>{ee.target.style.display="none"}})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[Z.title&&s.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-1 truncate",children:Z.title}),Z.description&&s.jsx("p",{className:"text-xs text-gray-600 mb-2 line-clamp-2",children:Z.description}),Z.recap&&s.jsx("p",{className:"text-xs text-gray-700 line-clamp-3",children:Z.recap})]})]})]})]})]}),s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(da,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:e("contentCreation.form.contentCard","Content")})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"goal",className:"block text-sm font-medium text-gray-700 mb-1",children:e("contentCreation.form.goal","Goal")}),s.jsx(RXe,{value:D.goal||"",onChange:ee=>{A(de=>({...de,goal:ee}))}})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-1",children:[s.jsx("label",{htmlFor:"shortDescription",className:"block text-sm font-medium text-gray-700",children:e("contentCreation.form.description")}),s.jsxs("span",{className:`text-xs ${D.shortDescription.length>600?"text-red-600":"text-gray-500"}`,children:[D.shortDescription.length,"/600 ",e("common.characters","characters")]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(get,{value:D.shortDescription,onChange:ee=>{o.current=!0,Pt(ee)},placeholder:e("contentCreation.form.descriptionPlaceholder")}),s.jsxs("div",{className:"absolute bottom-2 left-2 right-2 flex items-end justify-end",children:[ae&&s.jsx("div",{className:"flex items-end justify-between gap-0.5 h-8 flex-1 mr-2 overflow-hidden",children:Array.from({length:60}).map((ee,de)=>{const Se=[2,6,10,14,18,22,26,30,32,34,36,38,40,42,44,46,44,42,40,38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,6,8,10,12,16,20,24,28,32,36,40,44,46,42,38,34,30,26,22,18,14,10,6],Ue=[474,433,407,458,400,427,441,419,487,442,463,428,445,412,489,435,456,421,467,439,451,417,473,429,448,414,485,437,459,423,469,441,453,419,475,431,461,425,471,443,455,421,477,433,463,427,479,445,465,449,432,456,411,478,434,462,426,470,444,454];return s.jsx("div",{className:"flex-1 bg-green-500 rounded-sm opacity-35 min-w-0",style:{height:`${Se[de]}px`,animation:`sound ${Ue[de]}
3917ms -800ms linear infinite alternate`}},de)})}),s.jsxs("div",{className:"flex items-end gap-2 flex-shrink-0",children:[ae&&s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-green-50 border border-green-200 rounded-md text-sm font-mono text-green-700",children:[s.jsx("span",{className:"text-green-500",children:"⏱️"}),s.jsx("span",{children:we(G)})]}),s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[s.jsx("div",{className:"flex items-center justify-center w-8 h-8 text-lg bg-white border border-gray-200 rounded-md shadow-sm",children:he(D.language||"fr-FR")}),s.jsx(det,{currentLanguage:D.language||"fr-FR",onTextReceived:ee=>{const de=D.shortDescription?`${D.shortDescription} ${ee}`:ee;A(Se=>({...Se,shortDescription:de})),o.current=!0},onListeningChange:ee=>{if(te(ee),ee){J(Date.now()),Q(0),W.current&&cancelAnimationFrame(W.current);const de=()=>{Q(Math.floor((Date.now()-(ne||Date.now()))/1e3)),W.current=requestAnimationFrame(de)};W.current=requestAnimationFrame(de)}else W.current&&cancelAnimationFrame(W.current),W.current=null},isDisabled:D.shortDescription.length>=600,placeholder:"Dicter la description"})]})]})]})]}),s.jsxs("div",{className:"mt-1 text-xs text-gray-500 flex items-center gap-1",children:[s.jsx("span",{children:"🎤 Reconnaissance vocale en:"}),s.jsx("span",{className:"font-medium",children:D.language==="fr-FR"?"Français":D.language==="en-US"?"English (US)":D.language==="es-ES"?"Español":D.language==="de-DE"?"Deutsch":"Langue actuelle"})]}),s.jsxs("div",{className:"flex justify-between items-center mt-1",children:[s.jsxs("div",{className:"flex-1",children:[P.shortDescription&&s.jsx("p",{className:"text-sm text-red-600",children:P.shortDescription}),o.current&&!P.shortDescription&&s.jsx("p",{className:"text-xs text-blue-600",children:e("contentCreation.form.manuallyEdited","You have manually edited this description")})]}),(D.shortDescription||D.topic)&&s.jsx("button",{type:"button",onClick:bt,className:"text-sm text-primary-600 hover:text-primary-800 font-medium transition-colors ml-4",children:e("common.purge")})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"keywords",className:"block text-sm font-medium text-gray-700 mb-1",children:e("contentCreation.form.keywords")}),s.jsx(Ud,{tags:D.keywords,onTagsChange:ee=>A(de=>({...de,keywords:ee})),placeholder:e("contentCreation.form.keywordsPlaceholder"),inputValue:I,onInputChange:T,onInputKeyDown:Re})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"contentLength",className:"block text-sm font-medium text-gray-700 mb-3",children:[e("contentCreation.form.contentLength")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{value:"short",label:e("contentCreation.contentLength.short","Short"),emoji:"📱",description:e("contentCreation.contentLength.shortDescription","Brief content, ideal for quick engagement")},{value:"medium",label:e("contentCreation.contentLength.medium","Medium"),emoji:"📄",description:e("contentCreation.contentLength.mediumDescription","Balanced length for most platforms")},{value:"long",label:e("contentCreation.contentLength.long","Long"),emoji:"📚",description:e("contentCreation.contentLength.longDescription","In-depth content with detailed information")}].map(ee=>s.jsxs("button",{type:"button",onClick:()=>A(de=>({...de,contentLength:ee.value})),className:`flex items-center gap-3 p-3 rounded-lg border ${D.contentLength===ee.value?"border-primary-600 bg-primary-50 text-primary-700":"border-gray-300 hover:border-primary-600"}`,children:[s.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-gray-100 rounded-full",children:s.jsx("span",{className:"text-xl",children:ee.emoji})}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-medium",children:ee.label}),s.jsx("div",{className:"text-xs text-gray-500",children:ee.description})]})]},ee.value))}),P.contentLength&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.contentLength})]})]})]}),s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(jf,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:e("contentCreation.form.voice","Voice")})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"tone",className:"block text-sm font-medium text-gray-700 mb-1",children:[e("contentCreation.form.tone")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(met,{value:D.tone,onChange:ee=>{console.log("ContentToneSelect onChange triggered with value:",ee),A(de=>
3917({...de,tone:ee})),console.log("Form data updated for tone, NO CONTENT GENERATION should be triggered")}}),P.tone&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.tone})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"language",className:"block text-sm font-medium text-gray-700 mb-1",children:[e("contentCreation.form.language")," ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(pet,{value:D.language||"en",onChange:ee=>{console.log("Language changed to:",ee),A(de=>({...de,language:ee})),R(!1)},buttonLabel:e("contentCreation.form.selectLanguage")}),P.language&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:P.language}),L&&!P.language&&s.jsxs("p",{className:"mt-1 text-sm text-emerald-600 font-medium",children:["✓ ",e("contentCreation.form.languageSetFromBrand","We have selected this default language based on the language that you put in your brand analysis")]})]})]})]}),s.jsxs("div",{className:dt,children:[s.jsxs("div",{className:Et,children:[s.jsx(rf,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:xt,children:e("contentCreation.form.postImage","Post Image")})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"imageSelection",className:"block text-sm font-medium text-gray-700 mb-3",children:e("contentCreation.form.imageSelection","Image Selection")}),s.jsx("div",{className:`grid grid-cols-1 ${Z!=null&&Z.image?"sm:grid-cols-3":"sm:grid-cols-2"} gap-3`,children:[{value:"none",label:e("contentCreation.form.textOnly","Text Only"),emoji:"📝",description:e("contentCreation.form.textOnlyDescription","Generate content without an image")},{value:"generate",label:e("contentCreation.form.withImage","With an Image"),emoji:"🖼️",description:e("contentCreation.form.withImageDescription","Generate content with a related image")},...Z!=null&&Z.image?[{value:"extracted",label:e("contentCreation.form.useExtractedImage","Use Existing Image"),emoji:"🔗",description:e("contentCreation.form.useExtractedImageDescription","Use the image extracted from your link")}]:[]].map(ee=>{const de=ee.value==="none"&&!D.generateImage&&!D.useExtractedImage||ee.value==="generate"&&D.generateImage&&!D.useExtractedImage||ee.value==="extracted"&&D.useExtractedImage;return s.jsxs("button",{type:"button",onClick:()=>{ee.value==="none"?A(Se=>({...Se,generateImage:!1,useExtractedImage:!1})):ee.value==="generate"?A(Se=>({...Se,generateImage:!0,useExtractedImage:!1})):ee.value==="extracted"&&A(Se=>({...Se,generateImage:!1,useExtractedImage:!0}))},className:`flex items-center gap-3 p-3 rounded-lg border ${de?"border-primary-600 bg-primary-50 text-primary-700":"border-gray-300 hover:border-primary-600"}`,children:[s.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-gray-100 rounded-full",children:s.jsx("span",{className:"text-xl",children:ee.emoji})}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-medium",children:ee.label}),s.jsx("div",{className:"text-xs text-gray-500",children:ee.description})]})]},ee.value)})})]}),D.generateImage&&s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{htmlFor:"imageStyle",className:"block text-sm font-medium text-gray-700 mb-1",children:e("contentCreation.form.imageStyle")}),s.jsx(fet,{value:D.imageStyle||"auto",onChange:ee=>{console.log("ImageStyleSelect onChange triggered with value:",ee),A(de=>({...de,imageStyle:ee})),B(!1)}}),_&&D.generateImage&&s.jsxs("p",{className:"mt-1 text-sm text-emerald-600 font-medium",children:["✓ ",e("contentCreation.form.imageStyleSetFromBrand","We have selected this default image style based on the image style that you put in your brand analysis")]})]}),D.generateImage&&s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{htmlFor:"imageSize",className:"block text-sm font-medium text-gray-700 mb-1",children:e("contentCreation.form.imageSize","Image Size")}),s.jsx(het,{value:D.imageSize||"4:5",onChange:ee=>{console.log("ImageSizeSelect onChange triggered with value:",ee),A(de=>({...de,imageSize:ee}))}})]})]})]}),P.submit&&s.jsx("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:s.jsx("p",{className:"text-sm text-red-600",children:P.submit})}),s.jsxs("div",{className:"flex justify-between pt-4",children:[s.jsx("button",{type:"button",onClick:Ft,className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:e("contentCreation.form.reset")}),s.jsx("button",{type:"submit",disabled:ir.isPending||D.shortDescription.length>600,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:ir.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"animate-spin -ml-1 mr-2 h-4 w-4"}),e("contentCreation.form.generating")]}):e("contentCreation.form.generate")})]}),Object.keys(P).length>0&&!P.submit&&s.jsxs("div",{className:"mt-4 bg-red-50 border border-red-200 rounded-md p-4",children:[s.jsx("h3",{className:"text-sm font-medium text-red-800 mb
3917-2",children:e("contentCreation.form.errorSummary","Please fix the following errors:")}),s.jsx("ul",{className:"list-disc pl-5 space-y-1",children:Object.entries(P).map(([ee,de])=>s.jsx("li",{className:"text-sm text-red-600",children:de},ee))})]})]})}),s.jsx("div",{ref:Qt,children:s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 border border-black h-full",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:e("contentCreation.results.title")}),((se=F==null?void 0:F.data)==null?void 0:se.contents)&&F.data.contents.length>0&&s.jsxs("div",{className:"flex space-x-2",ref:y,children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>g(ee=>!ee),disabled:ir.isPending,className:"inline-flex items-center px-3 py-1.5 border border-primary-600 shadow-sm text-sm font-medium rounded-md text-primary-600 bg-white hover:bg-primary-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",title:e("contentCreation.results.regenerate","Régénérer"),children:[s.jsx(ai,{className:"h-4 w-4 mr-1.5"}),e("contentCreation.results.regenerate","Régénérer")]}),p&&s.jsx("div",{className:"absolute right-0 mt-2 w-56 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-50",children:s.jsxs("div",{className:"py-1",children:[s.jsxs("button",{type:"button",className:"group w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:text-primary-600 hover:bg-primary-50",onClick:()=>{g(!1),S(!0)},children:[s.jsx(rf,{className:"w-4 h-4 text-gray-500 group-hover:text-primary-600"}),s.jsx("span",{children:e("contentCreation.results.regenerateImage","Régénérer l'image")})]}),s.jsxs("button",{type:"button",className:"group w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:text-primary-600 hover:bg-primary-50",onClick:()=>{g(!1),$t()},children:[s.jsx(da,{className:"w-4 h-4 text-gray-500 group-hover:text-primary-600"}),s.jsx("span",{children:e("contentCreation.results.regenerateText","Régénérer le texte")})]}),s.jsxs("button",{type:"button",className:"group w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:text-primary-600 hover:bg-primary-50",onClick:()=>{g(!1),pt()},children:[s.jsx(ai,{className:"w-4 h-4 text-gray-500 group-hover:text-primary-600"}),s.jsx("span",{children:e("contentCreation.results.regenerateBoth","Régénérer les deux")})]})]})})]}),s.jsxs("button",{type:"button",disabled:m,onClick:async()=>{var ee;if(!(!((ee=F==null?void 0:F.data)!=null&&ee.contents)||!D.brandId)){h(!0);try{for(const de of F.data.contents){const Se=(de.platform||"").toLowerCase();let Ue="";typeof de.content=="string"?Ue=de.content:de.content&&typeof de.content=="object"&&"text"in de.content&&(Ue=de.content.text||"");let Pe=null;de&&typeof de=="object"&&"imageUrl"in de&&typeof de.imageUrl=="string"?(Pe=de.imageUrl,console.log("📷 Using post-specific image:",Pe)):F.imageUrl?(Pe=F.imageUrl,console.log("📷 Using global generatedContent.imageUrl:",Pe)):console.log("⚠️ No image found for post:",de.platform);const tt={brandId:D.brandId,title:"",content:Ue,format:D.format||"regular",platforms:[Se],needsReview:!1,reviewerId:"",tags:[],hashtags:de.hashtags||[],platformSettings:{},...Pe&&{media:{url:Pe,type:"image",thumbnailUrl:""}}};await Zg(tt)}r("/my-content-hub")}finally{h(!1)}}},className:"inline-flex items-center px-3 py-1.5 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(il,{className:"h-4 w-4 mr-1.5"}),e("contentCreation.results.saveAll","Save all")]})]})]}),!ir.isPending&&s.jsx(s.Fragment,{children:(Be=F==null?void 0:F.data)!=null&&Be.contents&&F.data.contents.length>0?s.jsx("div",{className:"grid grid-cols-1 gap-6 items-start",children:s.jsx("div",{className:"space-y-6",children:F.data.contents.map((ee,de)=>s.jsx(I4,{platform:ee.platform,content:ee.content,hashtags:ee.hashtags,onCreatePost:(Se,Ue,Pe)=>Dr(Se,Ue,Pe),brandId:D.brandId,format:D.format,imageUrl:F.imageUrl},ee.platform||de))})}):(at=F==null?void 0:F.content)!=null&&at.platforms?s.jsx("div",{className:"grid grid-cols-1 gap-6 items-start",children:s.jsx("div",{className:"space-y-6",children:Object.entries(F.content.platforms).map(([ee,de],Se)=>s.jsx(I4,{platform:ee.toLowerCase(),content:de,hashtags:_e(typeof de=="string"?de:de.text||""),onCreatePost:(Ue,Pe,tt)=>Dr(Ue,Pe,tt),brandId:D.brandId,format:D.format,imageUrl:F.imageUrl},ee))})}):s.jsx("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:s.jsx("p",{className:"text-gray-500 max-w-md",children:e("contentCreation.results.noContent")})})})]})})]})}),s.jsx(cY,{isVisible:ir.isPending,hasImage:!!D.generateImage}),((Ke=F==null?void 0:F.data)==null?void 0:Ke.contents)&&d&&s.jsx(dY,{isOpen:c,onClose:()=>{u(!1),f(null)},onDiscard:K,onSaveAndProceed:ke,totalPosts:F.data.contents.length,isLoadingSave:m}),s.jsx(Hj,{isOpen:m,title:e("contentCreation.modals.savingDrafts.title","Saving Drafts"),message:e("contentCreation.modals.savingDrafts.message","Please wait while we save the other generated posts as drafts..."),videoSrc:"/Panda Riding Horse for GIF.mov",gifUrl:"https://media.socialness.ai/loading/unicorn.gif"}),s.jsx(hY,{isOpen:N,onClose:()=>{S(!1),k(null)},onGenerate:$n,onValidate:Rt,isLoading:z.isPending,currentImageStyle:v||D.imageStyle||"auto",currentImageSize:j||D.imageSize||"4:5",generatedImageUrl:M||(F==null?void 0:F.imageUrl)||null}),s.jsx($Qe,{isOpen:ie,items:pe,onClose:()=>ye(!1),onApply:ee=>{var Ue;if(!F){ye(!1);return}const de=(((Ue=F.data)==null?void 0:Ue.contents)||[]).map(Pe=>{const tt=(Pe.platform||"unknown").toLowerCase();if(ee[tt]==="new"&&xe[tt]){const or=xe[tt];let Nr=or;return Pe&&typeof Pe.content=="object"&&Pe.content!==null&&"text"in Pe.content&&(Nr={...Pe.content,text:or}),{...Pe,content:Nr}}return Pe}),Se={...F,data:{...F.data,contents:de}};$(Se),ye(!1),Ee({})}})]})},bet=()=>s.jsx(ZXe,{children:s.jsx(yet,{})}),vet=()=>({showToast:b.useCallback((t,r,n)=>{console.log(`[Toast: ${t}] ${r}`,n)},[])}),xet={free:3,solo:5,team:10,agency:20},wet=5e3,jet=()=>new Date().toISOString().split("T")[0],j$=(e,t)=>
3917`boost_quota_${e}_${t}`,N$=e=>`boost_cooldown_${e}`,Net=(e,t="free")=>{const{t:r}=Te(),[n,a]=b.useState(Date.now());b.useEffect(()=>{const v=setInterval(()=>{a(Date.now())},1e3);return()=>clearInterval(v)},[]);const i=jet(),o=xet[t],l=b.useMemo(()=>{if(!e)return 0;const v=j$(e,i),x=localStorage.getItem(v);return x?parseInt(x,10):0},[e,i,n]),c=b.useMemo(()=>{if(!e)return 0;const v=N$(e),x=localStorage.getItem(v);return x?parseInt(x,10):0},[e,n]),u=Math.max(0,o-l),d=c+wet,f=n<d,m=Math.max(0,d-n),h=u>0&&!f,p=b.useCallback(()=>r(`boostMode.quota.${t==="free"?"free":"paid"}`,{remaining:u,total:o,defaultValue:`${u}/${o} boosts left today`}),[r,t,u,o]),g=b.useCallback(()=>{if(!f)return"";const v=Math.ceil(m/1e3);return r("boostMode.cooldown.wait",{seconds:v,defaultValue:`Please wait ${v} seconds`})},[r,f,m]),y=b.useCallback(()=>{if(!h||!e)return;const v=Date.now(),x=j$(e,i),j=l+1;localStorage.setItem(x,j.toString());const C=N$(e);localStorage.setItem(C,v.toString()),a(v)},[h,e,i,l]);return{canBoost:h,remainingQuota:u,totalQuota:o,isInCooldown:f,cooldownRemainingMs:m,plan:t,getQuotaMessage:p,getCooldownMessage:g,executeBoost:y}},Cet=({remainingQuota:e,totalQuota:t,plan:r,isInCooldown:n,cooldownRemainingMs:a,getQuotaMessage:i,getCooldownMessage:o,className:l=""})=>{const{t:c}=Te(),u=t-e,d=u/t*100,f=()=>e===0?"text-red-600":e<=t*.2?"text-orange-600":"text-green-600",m=()=>e===0?"border-red-500":"border-green-500",h=()=>e===0?"bg-red-500":e<=t*.2?"bg-orange-500":"bg-green-500",g=e>0||r!=="free"?null:c("boostMode.rateLimiting.upgradeFromFree");return s.jsxs("div",{className:`bg-white rounded-lg border ${m()} p-4 ${l}`,style:{borderWidth:"1px"},children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(dhe,{className:`h-5 w-5 ${f()}`}),s.jsx("span",{className:"font-medium text-gray-900",children:c("boostMode.quotaCard.title")})]}),s.jsx("span",{className:`text-sm font-semibold ${f()}`,children:i()})]}),s.jsxs("div",{className:"mb-3",children:[s.jsxs("div",{className:"flex justify-between text-xs text-gray-600 mb-1",children:[s.jsxs("span",{children:[c("boostMode.quotaCard.used"),": ",u]}),s.jsxs("span",{children:[c("boostMode.quotaCard.total"),": ",t]})]}),s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:s.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${h()}`,style:{width:`${d}%`}})})]}),n&&s.jsxs("div",{className:"flex items-center space-x-2 p-2 bg-blue-50 rounded-md mb-3",children:[s.jsx(ql,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{className:"text-sm text-blue-800",children:o()})]}),e===0&&!n&&s.jsx("div",{className:"p-3 bg-red-50 rounded-md",children:s.jsxs("div",{className:"flex items-start space-x-2",children:[s.jsx(bs,{className:"h-5 w-5 text-red-600 mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-sm font-medium text-red-800",children:c("boostMode.rateLimiting.dailyLimitReached")}),s.jsx("p",{className:"text-sm text-red-700 mt-1",children:c("boostMode.rateLimiting.dailyLimitReachedMessage")}),g&&s.jsxs("p",{className:"text-sm font-medium text-red-800 mt-2",children:["💡 ",g]})]})]})}),e>0&&e<=Math.max(1,t*.2)&&s.jsx("div",{className:"p-2 bg-orange-50 rounded-md",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(bs,{className:"h-4 w-4 text-orange-600"}),s.jsx("span",{className:"text-sm text-orange-800",children:e===1?c("boostMode.quotaCard.lastBoostToday"):c("boostMode.quotaCard.remainingBoosts",{count:e})})]})})]})},ket=async(e=3)=>{for(let t=0;t<e;t++)try{const r=Qe.currentUser;if(!r)throw new Error("No authenticated user");const n=await r.getIdToken(!0);if(!n)throw new Error("Failed to get authentication token");return n}catch(r){const n=r instanceof Error?r.message:String(r);if(console.warn(`Authentication attempt ${t+1} failed:`,n),t===e-1)throw new Error("Authentication failed after multiple attempts");await new Promise(a=>setTimeout(a,1e3*(t+1)))}throw new Error("Authentication failed")},Met=()=>{var Fe,nt,At,Wt,In,ir,Qt,Sn,nn,Lt;const{t:e,i18n:t}=Te(),r=pn(),{showToast:n}=vet(),[a,i]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(new Set),[d,f]=b.useState(""),[m,h]=b.useState(!1),[p,g]=b.useState(null),[y,v]=b.useState(!1),[x,j]=b.useState(0),[C,N]=b.useState(new Set),[S,M]=b.useState(!1),[k,I]=b.useState(!1),[T,L]=b.useState(!1),[R,_]=b.useState(null),[B,z]=b.useState(!1),D=b.useRef(""),A=b.useRef(""),P=b.useRef(null),E=()=>{window.scrollTo({top:0,behavior:"smooth"})};b.useEffect(()=>{D.current===""&&A.current===""&&(D.current=a,A.current=o,console.log("🔧 Initialized refs:",{brandId:a,personaId:o}))},[a,o]),b.useEffect(()=>{k&&P.current&&(document.body.contains(P.current)&&(window.innerWidth>=1024?E():P.current.scrollIntoView({behavior:"smooth",block:"start"})),I(!1))},[k,p]),b.useEffect(()=>{document.title=e("boostMode.title","Boost Mode")},[e]);const{data:F,error:$}=oa(),H=F?F.brands||[]:[],{data:X,error:ue}=hH(a||"");b.useEffect(()=>{$&&Ei($,"brands-fetch")},[$]),b.useEffect(()=>{ue&&Ei(ue,"brand-details-fetch")},[ue]);const{data:le,isLoading:ae,error:te}=Vj(void 0,!1,!1),ne=(le==null?void 0:le.personas)||[];b.useEffect(()=>{te&&Ei(te,"personas-fetch")},[te]);const J=b.useMemo(()=>ne.length?a?ne.filter(_e=>_e.brandId===a):ne:[],[ne,a]),G=b.useMemo(()=>{const et=Math.ceil(J.length/4),ft=x*4,pt=ft+4;return{currentPersonas:J.slice(ft,pt),totalPages:et,currentPage:x,hasNext:x<et-1,hasPrevious:x>0,totalPersonas:J.length}},[J,x]),Q=()=>{G.hasNext&&j(_e=>_e+1)},W=()=>{G.hasPrevious&&j(_e=>_e-1)};b.useEffect(()=>{H&&H.length===1&&!a&&i(H[0].id)},[H,a]),b.useEffect(()=>{a&&J.length>0?J.length===1?l(J[0].id):o&&(J.some(et=>et.id===o)||l("")):a&&J.length===0&&l("")},[a,J,o]),b.useEffect(()=>{const _e=D.current!==a,et=A.current!==o;_e||et?(console.log("🔄 Brand/Persona actually changed, resetting state"),console.log("Brand:",D.current,"->",a),console.log("Persona:",A.current,"->",o),u(new Set),f(""),g(null),j(0)):console.log("⏭️ Skipping reset - no actual change detected"),D.current=a,A.current=o},[a,o]);const Y=b.useMemo(()=>
3917{if(o&&J.length>0){const _e=J.find(et=>et.id===o);if(_e&&Array.isArray(_e.languages)&&_e.languages.length>0)return _e.languages[0]}return t.language||"en"},[o,J,t.language]),[q,Z]=b.useState([]),[me,we]=b.useState(!1),[he,ie]=b.useState(!1),[ye,pe]=b.useState(null),ce=Net(((Fe=Qe.currentUser)==null?void 0:Fe.uid)||"","free"),xe=b.useCallback(async()=>{if(!(he||!a||!o)){if(!ce.canBoost){ce.remainingQuota===0?n(e("boostMode.toasts.rateLimitReached"),"error"):ce.isInCooldown&&n(e("boostMode.toasts.cooldownActive"),"warning");return}ie(!0),pe(null),ce.executeBoost();try{const _e=await ket(),et=q.map(Ft=>typeof Ft=="object"&&Ft!==null?Ft.title:Ft).filter(Boolean),ft={brandId:a,personaId:o,appLanguage:Y||"en"};et.length>0&&(ft.excludeIdeas=et),console.log("📤 API Request payload:",ft);const pt="https://api.socialness.ai",$t=new AbortController,Pt=setTimeout(()=>$t.abort(),3e4);try{const Ft=await fetch(`${pt}/ai-coach/content/ideas`,{method:"POST",headers:{Authorization:`Bearer ${_e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(ft),signal:$t.signal});if(clearTimeout(Pt),!Ft.ok){const K=await Ft.text();console.error("❌ HTTP Error:",Ft.status,Ft.statusText),console.error("❌ Error response body:",K);let ke={};try{ke=JSON.parse(K)}catch{console.warn("⚠️ Could not parse error response as JSON"),ke={error:K}}throw new Error(ke.error||`HTTP ${Ft.status}: ${Ft.statusText}`)}const Dr=await Ft.json();if(console.log("📡 API Response:",Dr),Dr.ideas&&Array.isArray(Dr.ideas)){const K=Dr.ideas;console.log("✅ New ideas received:",K.length,"ideas"),Z(ke=>[...ke,...K])}else throw Dr.error?(console.error("❌ API returned error:",Dr.error),console.error("📄 Full API response:",Dr),new Error(Dr.error||"Failed to generate ideas")):(console.error("❌ Unexpected API response format:",Dr),new Error("Unexpected response format from API"))}catch(Ft){throw clearTimeout(Pt),Ft instanceof Error&&Ft.name==="AbortError"?(console.error("❌ Request timed out after 30 seconds"),new Error("Request timed out. Please try again.")):Ft}}catch(_e){throw console.error("❌ Error generating ideas:",_e),pe(_e),_e}finally{ie(!1)}}},[a,o,Y,q,he]);b.useEffect(()=>{a&&o&&(Z([]),pe(null))},[a,o]),b.useEffect(()=>{ye&&Ei(ye,"content-ideas-fetch")},[ye]),b.useEffect(()=>{const _e=`${a}-${o}`;a&&o&&!he&&!ye&&d!==_e&&(console.log("🚀 Starting initial idea generation for:",_e),f(_e),(async()=>{try{console.log("📝 Generating exactly 10 ideas (2 batches of 5)..."),console.log("📝 Batch 1/2..."),await xe(),await new Promise(ft=>setTimeout(ft,1500)),console.log("📝 Batch 2/2..."),await xe(),console.log("✅ Generated exactly 10 ideas successfully")}catch(ft){console.error("❌ Failed to generate initial ideas:",ft),pe(ft)}})())},[a,o,d,xe]);const Ee=ye==null?void 0:ye.message,Ye=!!ye,fe=_e=>{const et=new Set(c);et.has(_e)?et.delete(_e):et.add(_e),u(et)},je=async()=>{if(!(he||!a||!o)){console.log("🎲 Generating more ideas...");try{await xe(),console.log("✅ More ideas generated successfully")}catch(_e){console.error("❌ Failed to generate more ideas:",_e)}}},We=async()=>{var et,ft;if(console.log("🔄 handleCreatePosts called"),n(e("boostMode.toasts.functionCalled"),"info"),
3917console.log("Selected ideas count:",c.size),console.log("Selected brand ID:",a),console.log("Selected persona ID:",o),console.log("Is creating posts:",m),c.size===0||!a||!o||m){console.log("❌ Early return - missing required data or already creating"),c.size===0?n(e("boostMode.toasts.noIdeasSelected"),"warning"):a?o||n(e("boostMode.toasts.noPersonaSelected"),"warning"):n(e("boostMode.toasts.noBrandSelected"),"warning");return}h(!0),n(e("boostMode.toasts.generatingPosts"),"info");const _e=Array.from(c).map(pt=>q[pt]);if(console.log("🚀 Creating posts with selected ideas:",_e),!X){console.error("❌ Brand data not available"),n(e("boostMode.toasts.brandDataUnavailable"),"error"),h(!1);return}try{const pt=["professional","casual","fun","formal","friendly","authoritative"],$t=(et=X.contentTone)==null?void 0:et.toLowerCase(),Pt=pt.includes($t)?$t:"professional",Ft=["realistic","artistic","modern","ad","auto"],Dr=(ft=X.imageStyle)==null?void 0:ft.toLowerCase(),K=Ft.includes(Dr)?Dr:"auto",ke={language:Y||"en",tone:Pt,contentLength:"long",generateImage:!0,aspect_ratio:"4x5",style_type:K.charAt(0).toUpperCase()+K.slice(1)};console.log("📋 Brand defaults prepared:",ke);const Ze=_e.map((xt,qt)=>{const Gr=typeof xt=="object"&&xt!==null?xt.title:xt,la=typeof xt=="object"&&xt!==null?xt.description:"",$n=typeof xt=="object"&&xt!==null?xt.keywords||[]:[];return{id:`idea-${qt}`,title:Gr||`Idea ${qt+1}`,shortDescription:la||Gr||`Content idea ${qt+1}`,platforms:["instagram"],keywords:$n}});console.log("💡 Ideas prepared for API:",Ze);const bt={brandId:a,personaId:o,defaults:ke,ideas:Ze};console.log("📦 Batch request payload:",JSON.stringify(bt,null,2));const Re=await eet(bt);console.log("📡 API Response:",Re);let dt=[],Et=null;if(Re.success&&Re.results&&Array.isArray(Re.results)&&Re.results.forEach(xt=>{xt.success&&xt.post&&xt.post.generatedContents&&(xt.post.generatedContents.forEach(qt=>{dt.push({platform:qt.platform||"instagram",content:qt.generatedContent||"",hashtags:yt(qt.generatedContent||""),imageUrl:qt.imageUrl||xt.post.imageUrl||xt.post.image||xt.post.imageURL})}),!Et&&xt.post.imageUrl&&(Et=xt.post.imageUrl))}),Re.success&&dt.length>0){console.log("✅ Batch content generated successfully:",dt),n(e("boostMode.toasts.postsGeneratedSuccess",{count:dt.length}),"success"),N(new Set);const xt={success:!0,data:{contents:dt},imageUrl:Et||Re.imageUrl};g(xt),I(!0)}else Re.success&&dt.length===0?(console.warn("⚠️ Batch generation succeeded but no content returned"),n(e("boostMode.toasts.noContentGenerated"),"warning")):(console.error("❌ Batch generation failed:",Re.message),n(e("boostMode.toasts.generationFailed",{message:Re.message||e("common.unknownError")}),"error"))}catch(pt){console.error("❌ Error creating posts:",pt);let $t=e("common.unknownError");pt instanceof Error?pt.message.includes("504")||pt.message.includes("timeout")||pt.message.includes("Request timeout")?n(e("boostMode.toasts.timeoutError"),"warning"):n(`❌ ${pt.message}`,"error"):n(`❌ ${$t}`,"error")}finally{h(!1)}},yt=_e=>{const et=[],ft=/#(\w+)/g;let pt;for(;(pt=ft.exec(_e))!==null;)et.push(`#${pt[1]}`);return et},gt=_e=>{var pt,$t;const et={instagram:{en:"Instagram",fr:"Instagram"},linkedin:{en:"LinkedIn",fr:"LinkedIn"},facebook:{en:"Facebook",fr:"Facebook"},twitter:{en:"Twitter",fr:"Twitter"},youtube:{en:"YouTube",fr:"YouTube"},tiktok:{en:"TikTok",fr:"TikTok"},pinterest:{en:"Pinterest",fr:"Pinterest"},"google-business":{en:"Google Business",fr:"Google Business"}},ft=t.language;return((pt=et[_e])==null?void 0:pt[ft])||(($t=et[_e])==null?void 0:$t.en)||_e},qe=_e=>{const et=typeof _e=="object"&&_e!==null?_e.title:_e,ft=typeof _e=="object"&&_e!==null?_e.description:"",pt=[];return pt.push("instagram"),(et.toLowerCase().includes("business")||et.toLowerCase().includes("professional")||ft.toLowerCase().includes("career"))&&pt.push("linkedin"),(et.toLowerCase().includes("diy")||et.toLowerCase().includes("hack")||ft.toLowerCase().includes("video"))&&pt.push("tiktok"),(ft.toLowerCase().includes("youtube video")||ft.toLowerCase().includes("tutorial"))&&pt.push("youtube"),pt.length===0&&pt.push("instagram"),pt},ze=_e=>({instagram:{bg:"bg-pink-100",text:"text-pink-700"},linkedin:{bg:"bg-blue-100",text:"text-blue-700"},facebook:{bg:"bg-blue-50",text:"text-blue-600"},twitter:{bg:"bg-sky-100",text:"text-sky-700"},youtube:{bg:"bg-red-100",text:"text-red-700"},tiktok:{bg:"bg-gray-200",text:"text-gray-800"},pinterest:{bg:"bg-red-50",text:"text-red-600"},"google-business":{bg:"bg-green-100",text:"text-green-700"}})[_e]||{bg:"bg-gray-100",text:"text-gray-600"},$e=({platforms:_e})=>s.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:_e.map((et,ft)=>{const{bg:pt,text:$t}=ze(et);return s.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs ${pt} ${$t}`,children:[s.jsx(cr,{platform:et,size:12}),s.jsx("span",{className:"font-medium",children:gt(et)})]},`platform-${ft}-${et}`)})}),ct=(_e,et,ft,pt)=>{var Ft,Dr,K,ke,Ze,bt,Re,dt;const $t=_e.toLowerCase();console.log("🔥 handleCreatePost called:",{platform:$t,totalPosts:(Dr=(Ft=p==null?void 0:p.data)==null?void 0:Ft.contents)==null?void 0:Dr.length});const Pt=((ke=(K=p==null?void 0:p.data)==null?void 0:K.contents)==null?void 0:ke.filter(Et=>!(Et.platform.toLowerCase()===$t&&Et.content===et)))||[];console.log("📊 Posts analysis:",{totalPosts:(bt=(Ze=p==null?void 0:p.data)==null?void 0:Ze.contents)==null?void 0:bt.length,currentPlatform:$t,otherPostsCount:Pt.length,allPlatforms:(dt=(Re=p==null?void 0:p.data)==null?void 0:Re.contents)==null?void 0:dt.map(Et=>Et.platform.toLowerCase())}),Pt.length>0?(console.log("✅ Showing modal - multiple posts detected"),_({platform:$t,content:et,hashtags:ft,imageUrl:pt}),L(!0)):(console.log("⚠️ Going directly to edit - no other posts or single post"),r("/posts/new",{state:{content:et,platform:$t,hashtags:ft,brandId:a,imageUrl:pt}}))},oe=async()=>{var pt;if(!((pt=p==null?void 0:p.data)!=null&&pt.contents)||!a){n(e("boostMode.toasts.noContentToSave"),"warning");return}v(!0);const _e=p.data.contents;let et=0,ft=0;try{const $t=_e.map(async Pt=>{try{const Ft={brandId:a,title:"",content:Pt.content,format:"regular",platforms:[Pt.platform],needsReview:!1,reviewerId:"",tags:[],hashtags:Pt.hashtags||[],platformSettings:{},...Pt.imageUrl&&{media:{url:Pt.imageUrl,type:"image",thumbnailUrl:""}}};return await Zg(Ft),et++,{success:!0,platform:Pt.platform}}catch(Ft){return ft++,console.error(`Error saving ${Pt.platform} draft:`,Ft),{success:!1,platform:Pt.platform,error:Ft}}});await Promise.allSettled($t),et===_e.length?n(e("boostMode.toasts.draftsAllSavedSuccess",{count:et}),"success"):et>0?n(e("boostMode.toasts.draftsPartialSuccess",{successCount:et,errorCount:ft}),"warning"):n(e("boostMode.toasts.draftsSaveFailed"),"error")}catch($t){console.error("Error in handleSaveAll:",$t),n(e("boostMode.toasts.saveAllError"),"error")}finally{v(!1)}},Ne=(_e,et)=>{N(ft=>{const pt=new Set(ft);return et?pt.add(_e):pt.delete(_e),pt})},Ae=()=>{var _e,et,ft,pt;if(C.size===((et=(_e=p==null?void 0:p.data)==null?void 0:_e.contents)==null?void 0:et.length))N(new Set);else{const $t=new Set(((pt=(ft=p==null?void 0:p.data)==null?void 0:ft.contents)==null?void 0:pt.map((Pt,Ft)=>Ft))||[]);N($t)}},lt=async()=>{var pt;if(!((pt=p==null?void 0:p.data)!=null&&pt.contents)||C.size===0||!a){n(e("boostMode.toasts.noPostsSelected"),"warning");return}M(!0);const _e=Array.from(C).map($t=>p.data.contents[$t]);let et=0,ft=0;try{const $t=_e.map(async Pt=>{try{const Ft={brandId:a,title:"",content:Pt.content,format:"regular",platforms:[Pt.platform],needsReview:!1,reviewerId:"",tags:[],hashtags:Pt.hashtags||[],platformSettings:{},...Pt.imageUrl&&{media:{url:Pt.imageUrl,type:"image",thumbnailUrl:""}}};return await Zg(Ft),et++,{success:!0,platform:Pt.platform}}catch(Ft){return ft++,console.error(`Error saving ${Pt.platform} draft:`,Ft),{success:!1,platform:Pt.platform,error:Ft}}});await Promise.allSettled($t),et===_e.length?(n(e("boostMode.toasts.selectedPostsSavedSuccess",{successCount:et}),"success"),N(new Set)):et>0?n(e("boostMode.toasts.selectedPostsPartialSuccess",{successCount:et,errorCount:ft}),"warning"):n(e("boostMode.toasts.selectedPostsSaveFailed"),"error")}catch($t){console.error("Error in handleSaveSelected:",$t),n(e("boostMode.toasts.saveSelectedError"),"error")}finally{M(!1)}},Mt=()=>{L(!1),R&&(r("/posts/new",{state:{content:R.content,platform:R.platform,hashtags:R.hashtags,brandId:a,imageUrl:R.imageUrl}}),_(null))},jt=async()=>{var et;if(!((et=p==null?void 0:p.data)!=null&&et.contents)||!R)return;z(!0);const _e=p.data.contents.filter(ft=>ft.platform.toLowerCase()!==(R==null?void 0:R.platform.toLowerCase()));try{for(const ft of _e){const pt={brandId:a,title:"",content:ft.content,format:"regular",platforms:[ft.platform.toLowerCase()],needsReview:!1,reviewerId:"",tags:[],hashtags:ft.hashtags||[],platformSettings:{}};ft.imageUrl&&(pt.media={url:ft.imageUrl,type:"image",thumbnailUrl:""}),await Zg(pt)}Mt()}catch(ft){console.error("Error saving other posts as drafts:",ft),n(e("boostMode.toasts.draftSaveError"),"error"),Mt()}finally{z(!1),L(!1)}},Xe="bg-white rounded-lg shadow-md p-6 border border-black",Bt="flex items-center gap-2 mb-4 pb-2 border-b border-gray-200",ve="text-lg font-semibold text-gray-800";return s.jsxs(rs,{title:e("boostMode.title","Boost Mode"),subtitle:e("boostMode.subtitle","Get instant inspiration with AI-powered content ideas"),children:[s.jsxs("div",{className:"space-y-8",children:[(!((nt=p==null?void 0:p.data)!=null&&nt.contents)||p.data.contents.length===0)&&s.jsx("div",{className:"bg-gradient-to-r from-primary-50 to-purple-50 rounded-lg p-6 border border-primary-200",children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center flex-shrink-0",children:s.jsx(Hn,{className:"h-6 w-6 text-primary-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:e("boostMode.welcomeTitle","Welcome to Boost Mode!")}),s.jsx("p",{className:"text-gray-600 mb-4",children:e("boostMode.welcomeDescription","Get instant inspiration for your content creation. Select a brand and persona to generate AI-
3917powered content ideas that match your audience perfectly.")}),s.jsxs("div",{className:"space-y-2 text-sm text-gray-500",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-primary-400 rounded-full"}),s.jsx("span",{children:e("boostMode.step1","Choose your brand and target persona")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-primary-400 rounded-full"}),s.jsx("span",{children:e("boostMode.step2","Browse through AI-generated content ideas")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-primary-400 rounded-full"}),s.jsx("span",{children:e("boostMode.step3","Click on an idea to start creating content")})]})]})]})]})}),s.jsx(Cet,{remainingQuota:ce.remainingQuota,totalQuota:ce.totalQuota,plan:ce.plan,isInCooldown:ce.isInCooldown,cooldownRemainingMs:ce.cooldownRemainingMs,getQuotaMessage:ce.getQuotaMessage,getCooldownMessage:ce.getCooldownMessage,className:"mb-6"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[s.jsxs("div",{className:Xe,children:[s.jsxs("div",{className:Bt,children:[s.jsx(Fc,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:ve,children:e("boostMode.selectBrand","Select Brand")}),s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:H.map(_e=>s.jsxs("button",{type:"button",onClick:()=>i(_e.id),className:`flex flex-col items-center gap-2 p-3 rounded-lg border border-black ${a===_e.id?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[s.jsx("img",{src:_e.logo,alt:_e.name,className:"w-10 h-10 rounded-lg object-cover",onError:et=>{et.target.style.display="none"}}),s.jsx("span",{className:"text-sm text-gray-700 truncate max-w-full",children:_e.name})]},_e.id))})]}),s.jsxs("div",{className:Xe,children:[s.jsxs("div",{className:Bt,children:[s.jsx(Jr,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:ve,children:e("boostMode.selectPersona","Select Persona")}),s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:ae?Array(4).fill(0).map((_e,et)=>s.jsxs("div",{className:"flex items-start p-3 rounded-lg border border-gray-200 animate-pulse",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-gray-200 flex-shrink-0"}),s.jsxs("div",{className:"ml-3 text-left w-full",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/2 mb-2"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/4"})]})]},et)):G.totalPersonas>0?G.currentPersonas.map(_e=>{const et=ft=>{switch(ft.toLowerCase()){case"en":return"🇬🇧";case"fr":return"🇫🇷";case"es":return"🇪🇸";default:return"🌐"}};return s.jsxs("button",{type:"button",onClick:()=>l(_e.id),className:`flex items-start p-3 rounded-lg border border-black ${o===_e.id?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[_e.avatarUrl?s.jsx("img",{src:_e.avatarUrl,alt:_e.name,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:ft=>{ft.target.style.display="none"}}):s.jsx("div",{className:"w-12 h-12 rounded-lg border border-gray-200 bg-primary-50 flex items-center justify-center flex-shrink-0",children:s.jsx(Fi,{className:"w-6 h-6 text-primary-600"})}),s.jsxs("div",{className:"ml-3 text-left",children:[s.jsx("span",{className:"text-sm font-medium text-gray-800 block",children:_e.name}),s.jsx("span",{className:"text-xs text-gray-500 block",children:_e.jobTitle}),s.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[s.jsx("span",{className:"text-xs text-gray-500",children:_e.age}),_e.languages&&_e.languages.map((ft,pt)=>s.jsx("span",{className:"text-xs",children:et(ft)},pt))]})]})]},_e.id)}):s.jsxs("div",{className:"col-span-2 p-4 border border-dashed border-gray-300 rounded-lg text-center",children:[s.jsx("p",{className:"text-sm text-gray-500 mb-3",children:e("boostMode.noPersonas","No personas available for this brand")}),s.jsx("button",{onClick:()=>r("/ai-personas-builder"),className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:e("boostMode.createPersona","Create a Persona")})]})}),G.totalPages>1&&s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[s.jsx("div",{className:"text-sm text-gray-500",children:e("boostMode.personasPage","Page {{current}} of {{total}} ({{count}} personas total)",{current:G.currentPage+1,total:G.totalPages,count:G.totalPersonas})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:W,disabled:!G.hasPrevious,className:`p-1.5 rounded-md transition-colors ${G.hasPrevious?"hover:bg-gray-200 text-gray-600":"text-gray-300 cursor-not-allowed"}`,children:s.jsx(wE,{className:"w-4 h-4"})}),s.jsx("button",{onClick:Q,disabled:!G.hasNext,className:`p-1.5 rounded-md transition-colors ${G.hasNext?"hover:bg-gray-200 text-gray-600":"text-gray-300 cursor-not-allowed"}`,children:s.jsx(jE,{className:"w-4 h-4"})})]})]})]})]})]}),a&&o&&s.jsxs("div",{className:Xe,children:[s.jsxs("div",{className:Bt,children:[s.jsx(Hn,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:ve,children:e("boostMode.contentIdeas","Content Ideas")}),s.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[q.length>0&&s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[q.length," ",e("boostMode.topicsGenerated","topics generated")]}),s.jsx("button",{onClick:je,disabled:me||he||!ce.canBoost,className:`inline-flex items-center px-3 py-1.5 border border-primary-600 text-primary-600 bg-white rounded-lg hover:bg-primary-50 disabled:opacity-50 disabled:cursor-not-allowed ${me||he||!ce.canBoost?"border-gray-400 text-gray-400 hover:bg-white":""}`,children:me||he?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-1.5 border-2 border-t-transparent border-gray-400 rounded-full animate-spin"}),s.jsx("span",{className:"text-sm font-semibold",children:e("common.generating","Generating...")})]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-1.5"}),s.jsx("span",{className:"text-sm font-semibold",children:e("boostMode.generateMore","Generate 5 more")})]})})]}),s.jsxs("button",{onClick:We,disabled:c.size===0||m,className:`inline-flex items-center px-4 py-2 rounded-lg font-semibold text-sm transition-colors ${c.size>0&&!m?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-300 text-gray-500 cursor-not-allowed"}`,children:[m?s.jsx(Rn,{className:"w-4 h-4 mr-1.5 animate-spin"}):s.jsx(tn,{className:"w-4 h-4 mr-1.5"}),m?e("common.generating","Generating..."):`${e("boostMode.createPosts","Create posts")} ${c.size>0?`(${c.size})`:""}`]})]})]}),c.size>3&&s.jsx("div",{className:"mt-2 text-center",children:s.jsxs("p",{className:"text-xs text-amber-600 bg-amber-50 px-3 py-1 rounded-md inline-block",children:["💡 ",e("boostMode.performanceTip","Tip: Select 1-3 ideas for faster generation")]})}),me?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:Array(10).fill(0).map((_e,et)=>s.jsxs("div",{className:"flex items-center w-full px-4 py-3 rounded-md text-sm border border-gray-200 animate-pulse",children:[s.jsx("div",{className:"h-3 w-3 bg-gray-300 rounded-sm mr-3 flex-shrink-0"}),s.jsx("div",{className:"h-4 bg-gray-300 rounded w-3/4"})]},et))}):Ye?s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-red-500 mb-2",children:Ee?`Error: ${Ee}`:e("boostMode.ideasError","Failed to load content ideas")}),s.jsx("button",{type:"button",onClick:je,className:"text-xs text-primary-600 hover:text-primary-800",children:e("common.retry","Retry")})]}):q.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:q.slice(0,10).map((_e,et)=>
3917{const ft=typeof _e=="object"&&_e!==null?_e.title:_e,pt=typeof _e=="object"&&_e!==null?_e.description:"",$t=c.has(et);return s.jsx("button",{type:"button",onClick:()=>fe(et),className:`relative flex items-center justify-between w-full px-4 py-3 rounded-md text-sm border border-black transition-colors group ${$t?"bg-primary-50":"hover:bg-primary-50"}`,children:s.jsxs("div",{className:"flex items-start min-w-0 flex-1",children:[s.jsx("div",{className:`flex items-center justify-center w-5 h-5 mr-3 mt-0.5 rounded border-2 flex-shrink-0 ${$t?"bg-primary-600 border-primary-600":"border-gray-300 group-hover:border-primary-400"}`,children:$t&&s.jsx(ma,{className:"w-3 h-3 text-white"})}),s.jsxs("div",{className:"text-left w-full min-w-0",children:[s.jsx("div",{className:`font-medium ${$t?"text-primary-700":"text-gray-900 group-hover:text-primary-700"}`,style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:ft}),pt&&s.jsx("div",{className:`text-xs mt-1 ${$t?"text-primary-600":"text-gray-500 group-hover:text-primary-600"}`,style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:pt}),s.jsx($e,{platforms:qe(_e)})]})]})},et)})}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Eu,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),s.jsx("p",{className:"text-sm text-gray-500",children:e("boostMode.noIdeas","No content ideas available yet. Generate some ideas to get started!")})]})]}),((At=p==null?void 0:p.data)==null?void 0:At.contents)&&p.data.contents.length>0&&s.jsxs("div",{ref:P,className:Xe,children:[s.jsxs("div",{className:Bt,children:[s.jsx(Hn,{className:"h-5 w-5 text-primary-600"}),s.jsx("h2",{className:ve,children:e("boostMode.generatedContent")}),s.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:C.size===((In=(Wt=p==null?void 0:p.data)==null?void 0:Wt.contents)==null?void 0:In.length)&&((Qt=(ir=p==null?void 0:p.data)==null?void 0:ir.contents)==null?void 0:Qt.length)>0,onChange:Ae,className:"rounded border-gray-300 text-primary-600 focus:ring-primary-500"}),s.jsxs("span",{children:[e("boostMode.selectAll")," (",C.size,"/",((nn=(Sn=p==null?void 0:p.data)==null?void 0:Sn.contents)==null?void 0:nn.length)||0,")"]})]}),C.size>0&&s.jsxs("button",{onClick:lt,disabled:S,className:`inline-flex items-center px-4 py-2 rounded-lg font-semibold text-sm transition-colors ${S?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:[S?s.jsx(Rn,{className:"w-4 h-4 mr-1.5 animate-spin"}):s.jsx(il,{className:"w-4 h-4 mr-1.5"}),S?e("common.saving","Saving..."):`${e("boostMode.saveSelected")} (${C.size})`]}),s.jsxs("button",{onClick:oe,disabled:y,className:`inline-flex items-center px-4 py-2 rounded-lg font-semibold text-sm transition-colors ${y?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[y?s.jsx(Rn,{className:"w-4 h-4 mr-1.5 animate-spin"}):s.jsx(il,{className:"w-4 h-4 mr-1.5"}),y?e("common.saving","Saving..."):e("boostMode.saveAll","Save all")]})]})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-6",children:p.data.contents.map((_e,et)=>s.jsx(I4,{platform:_e.platform,content:_e.content,hashtags:_e.hashtags,onCreatePost:(ft,pt,$t)=>ct(ft,pt,$t,_e.imageUrl),brandId:a,format:"regular",imageUrl:_e.imageUrl,isSelected:C.has(et),onSelectionChange:ft=>Ne(et,ft)},`content-${et}`))})]})]}),((Lt=p==null?void 0:p.data)==null?void 0:Lt.contents)&&R&&s.jsx(dY,{isOpen:T,onClose:()=>{L(!1),_(null)},onDiscard:Mt,onSaveAndProceed:jt,totalPosts:p.data.contents.length,isLoadingSave:B}),s.jsx(cY,{isVisible:m,hasImage:!0}),s.jsx(Hj,{isOpen:B,title:e("contentCreation.modals.savingDrafts.title","Saving Drafts"),message:e("contentCreation.modals.savingDrafts.message","Please wait while we save the other generated posts as drafts..."),videoSrc:"/Panda Riding Horse for GIF.mov",gifUrl:"https://media.socialness.ai/Panda+-+Riding+Unicorn+-+Small.gif"}),(me||he&&q.length===0)&&s.jsx(Wu,{title:e("boostMode.generatingIdeas","Generating Content Ideas"),currentStep:me?e("boostMode.analyzingBrand","Analyzing your brand and persona to create tailored content ideas..."):e("boostMode.generatingMore","Generating your first set of creative ideas..."),videoSrc:"/Panda Lab.mov"})]})}
3917,Iet=({value:e,onChange:t,placeholder:r,className:n=""})=>s.jsxs("div",{className:`relative ${n}`,children:[s.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:s.jsx($i,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{type:"text",value:e,onChange:a=>t(a.target.value),placeholder:r,className:"block w-full rounded-lg border border-gray-200 bg-white py-2 pl-10 pr-3 text-sm placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),Eet=({options:e,selectedTypeId:t,onTypeSelect:r,className:n=""})=>{const{t:a}=Te(),[i,o]=b.useState(!1),l=b.useRef(null),c=e.find(f=>f.id===t)||e[0],u=()=>o(!i),d=f=>{l.current&&!l.current.contains(f.target)&&o(!1)};return b.useEffect(()=>(document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}),[]),s.jsxs("div",{className:`relative ${n}`,ref:l,children:[s.jsxs("button",{className:"flex items-center justify-between w-full h-10 px-3 py-2 border border-gray-300 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:u,children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(k2,{className:"w-4 h-4 mr-2 text-gray-500"}),s.jsxs("span",{className:"text-sm mr-1",children:[a("mediaGallery.filters.type"),":"]}),s.jsx("span",{className:"text-sm font-medium",children:a(c.label)})]}),s.jsx(Vr,{className:`w-4 h-4 text-gray-500 transition-transform duration-150 ${i?"transform rotate-180":""}`})]}),i&&s.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-auto",children:e.map(f=>{const m=f.icon;return s.jsxs("button",{className:`flex items-center w-full px-3 py-2 text-sm hover:bg-gray-50 ${t===f.id?"bg-blue-50 text-blue-600":"text-gray-700"}`,onClick:()=>{r(f.id),o(!1)},children:[m&&s.jsx(m,{className:"w-4 h-4 mr-2"}),t===f.id&&s.jsx(ma,{className:"w-4 h-4 mr-1 text-blue-600"}),s.jsx("span",{children:a(f.label)})]},f.id)})})]})},Tet=({options:e,selectedOptionId:t,onOptionSelect:r,className:n=""})=>{const{t:a}=Te(),[i,o]=b.useState(!1),l=b.useRef(null),c=e.find(f=>f.id===t)||e[0],u=()=>o(!i),d=f=>{l.current&&!l.current.contains(f.target)&&o(!1)};return b.useEffect(()=>(document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}),[]),s.jsxs("div",{className:`relative ${n}`,ref:l,children:[s.jsxs("button",{className:"flex items-center justify-between w-full h-10 px-3 py-2 border border-gray-300 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:u,children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bme,{className:"w-4 h-4 mr-2 text-gray-500"}),s.jsxs("span",{className:"text-sm mr-1",children:[a("mediaGallery.sort.title"),":"]}),s.jsx("span",{className:"text-sm font-medium",children:a(c.label)})]}),s.jsx(Vr,{className:`w-4 h-4 text-gray-500 transition-transform duration-150 ${i?"transform rotate-180":""}`})]}),i&&s.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-auto",children:e.map(f=>s.jsxs("button",{className:`flex items-center w-full px-3 py-2 text-sm hover:bg-gray-50 ${t===f.id?"bg-blue-50 text-blue-600":"text-gray-700"}`,onClick:()=>{r(f.id),o(!1)},children:[t===f.id&&s.jsx(ma,{className:"w-4 h-4 mr-1 text-blue-600"}),s.jsx("span",{children:a(f.label)})]},f.id))})]})},Aet=wf(e=>({searchQuery:"",viewType:"grid",selectedBrandId:"all",selectedMediaType:"all",sortOption:"newest",setSearchQuery:t=>e({searchQuery:t}),setViewType:t=>e(r=>r.viewType===t?r:{viewType:t}),setSelectedBrandId:t=>e(r=>r.selectedBrandId===t?r:{selectedBrandId:t}),setSelectedMediaType:t=>e(r=>r.selectedMediaType===t?r:{selectedMediaType:t}),setSortOption:t=>e(r=>r.sortOption===t?r:{sortOption:t})}));function Pet(){const e=Aet(),[t,r]=ui(),n=b.useRef(!0),a=b.useRef(!1),i=b.useRef(e);b.useEffect(()=>{i.current=e},[e]),b.useEffect(()=>{let S=!1;const M=new URLSearchParams(t);M.has("platform")&&(M.delete("platform"),S=!0),M.has("tab")&&(M.delete("tab"),S=!0),S&&r(M)},[t,r]);const o=b.useRef({skipSync:!1}).current,l=b.useRef({skipSync:!1}).current,c=b.useRef({skipSync:!1}).current,u=b.useRef({skipSync:!1}).current,[d,f]=fa("view",e.viewType,o),[m,h]=fa("brand",e.selectedBrandId,l),[p,g]=fa("mediaType",e.selectedMediaType,c),[y,v]=fa("sort",e.sortOption,u);b.useEffect(()=>{if(n.current){const S=i.current;
3917d!==S.viewType&&S.setViewType(d),m!==S.selectedBrandId&&S.setSelectedBrandId(m),p!==S.selectedMediaType&&S.setSelectedMediaType(p),y!==S.sortOption&&S.setSortOption(y),n.current=!1}},[]);const x=b.useCallback(S=>{S!==d&&(f(S),a.current=!0,i.current.setViewType(S),a.current=!1)},[d,f]),j=b.useCallback(S=>{S!==m&&(h(S),a.current=!0,i.current.setSelectedBrandId(S),a.current=!1)},[m,h]),C=b.useCallback(S=>{S!==p&&(g(S),a.current=!0,i.current.setSelectedMediaType(S),a.current=!1)},[p,g]),N=b.useCallback(S=>{S!==y&&(v(S),a.current=!0,i.current.setSortOption(S),a.current=!1)},[y,v]);return b.useEffect(()=>{!n.current&&!a.current&&d!==i.current.viewType&&i.current.setViewType(d)},[d]),b.useEffect(()=>{!n.current&&!a.current&&m!==i.current.selectedBrandId&&i.current.setSelectedBrandId(m)},[m]),b.useEffect(()=>{!n.current&&!a.current&&p!==i.current.selectedMediaType&&i.current.setSelectedMediaType(p)},[p]),b.useEffect(()=>{!n.current&&!a.current&&y!==i.current.sortOption&&i.current.setSortOption(y)},[y]),{viewType:d,selectedBrandId:m,selectedMediaType:p,sortOption:y,setViewType:x,setSelectedBrandId:j,setSelectedMediaType:C,setSortOption:N,searchQuery:e.searchQuery,setSearchQuery:e.setSearchQuery}}const _et=[{id:"all",label:"mediaGallery.filters.all",icon:null},{id:"image",label:"mediaGallery.filters.images",icon:rf},{id:"video",label:"mediaGallery.filters.videos",icon:CE},{id:"document",label:"mediaGallery.filters.documents",icon:da}],Let=[{id:"newest",label:"mediaGallery.sort.newest"},{id:"oldest",label:"mediaGallery.sort.oldest"},{id:"nameAZ",label:"mediaGallery.sort.nameAZ"},{id:"nameZA",label:"mediaGallery.sort.nameZA"},{id:"size",label:"mediaGallery.sort.size"}],S$=({item:e,isSelected:t,onSelect:r,onDelete:n,onDownload:a,onCopyUrl:i,onRename:o,viewType:l,isSelectionMode:c})=>{const{t:u}=Te(),[d,f]=b.useState(!1),[m,h]=b.useState(!1),{user:p}=Ps(),g=(p==null?void 0:p.photoURL)&&e.url===p.photoURL,y=()=>{navigator.clipboard.writeText(e.url),i(e.url)},v=()=>{switch(e.mediaType){case"image":return s.jsx(rf,{className:"w-5 h-5 sm:w-6 sm:h-6"});case"video":return s.jsx(CE,{className:"w-5 h-5 sm:w-6 sm:h-6"});case"pdf":case"document":return s.jsx(da,{className:"w-5 h-5 sm:w-6 sm:h-6"});default:return s.jsx(da,{className:"w-5 h-5 sm:w-6 sm:h-6"})}},x=()=>{if(e.name)return e.name;const S=e.key.split("/");return S[S.length-1]},j=()=>{const S=x().toLowerCase();return S.includes("9x16")||S.includes("9-16")||S.includes("vertical")||S.includes("reel")||S.includes("story")?"9/16":S.includes("4x5")||S.includes("4-5")||S.includes("portrait")?"4/5":S.includes("1x1")||S.includes("1-1")||S.includes("square")?"1/1":S.includes("16x9")||S.includes("16-9")||S.includes("landscape")?"16/9":e.mediaType==="video"?e.key.includes("reel")||e.key.includes("tiktok")||e.key.includes("story")||e.key.includes("vertical")?"9/16":"16/9":"1/1"},C=()=>{c?r(e.key):h(!0)},N=S=>S<1024?S+" B":S<1024*1024?(S/1024).toFixed(1)+" KB":(S/(1024*1024)).toFixed(1)+" MB";if(l==="grid"){const S=(()=>{const M=j();return M==="9/16"?"aspect-[9/16]":M==="4/5"?"aspect-[4/5]":M==="1/1"?"aspect-square":M==="16/9"?"aspect-video":"aspect-square"})();return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`group relative overflow-hidden rounded-lg cursor-pointer ${S} h-full w-full min-h-[150px] sm:min-h-[180px]`,onClick:C,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onTouchStart:()=>f(!0),children:[g&&!c&&s.jsx("div",{className:"absolute top-2 left-2 z-20 p-1 bg-primary-500 text-white rounded-full shadow",title:u("mediaGallery.item.profilePictureBadge","Current Profile Picture"),children:s.jsx(Fi,{className:"w-3 h-3"})}),c&&s.jsx("div",{className:`absolute top-2 right-2 z-20 w-5 h-5 rounded-full ${t?"bg-blue-500 border-blue-500":"bg-black/30 hover:bg-black/50"} flex items-center justify-center transition-all duration-150`,children:t&&s.jsx(ma,{className:"w-3 h-3 text-white"})}),e.mediaType==="image"||e.mediaType==="video"?s.jsx("div",{className:"w-full h-full",children:s.jsx(Un,{mediaUrl:e.url,altText:x(),type:e.mediaType,objectFit:"cover",aspectRatio:j(),className:"rounded-lg w-full h-full object-center"})}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-100",children:v()}),s.jsx("div",{className:`absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center ${d?"opacity-100":"opacity-0 sm:group-hover:opacity-100"} transition-opacity duration-200`,children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:M=>{M.stopPropagation(),a(e)},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",title:u("mediaGallery.item.download"),children:s.jsx(yd,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("button",{onClick:M=>{M.stopPropagation(),y()},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",title:u("mediaGallery.item.copyUrl"),children:s.jsx(Ti,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),s.jsx("button",{onClick:M=>{M.stopPropagation(),n(e.key)},className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",title:u("mediaGallery.item.delete"),children:s.jsx(Tg,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]})})]}),m&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-3",onClick:()=>h(!1),children:s.jsxs("div",{className:"relative max-w-4xl max-h-[90vh] w-full bg-white rounded-lg overflow-hidden shadow-xl",onClick:M=>M.stopPropagation(),children:[s.jsx("div",{className:"absolute top-2 right-2 z-10",children:s.jsx("button",{className:"p-1 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",onClick:()=>h(!1),children:s.jsx(_t,{className:"w-5 h-5 sm:w-6 sm:h-6"})})}),s.jsx("div",{className:"p-2 max-h-[80vh] overflow-auto",children:e.mediaType==="image"?s.jsx("img",{src:e.url,alt:x(),className:"max-w-full max-h-[70vh] object-contain mx-auto",style:{aspectRatio:j()}}):e.mediaType==="video"?s.jsx("video",{src:e.url,controls:!0,autoPlay:!0,className:"max-w-full max-h-[70vh] mx-auto",style:{aspectRatio:j()}}):s.jsxs("div",{className:"flex flex-col items-center justify-center p-6 sm:p-12",children:[v(),s.jsx("p",{className:"mt-4 text-gray-700 text-center break-all",children:x()}),s.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"mt-4 px-4 py-2 bg-primary-600 text-white rounded-md",children:u("mediaGallery.item.download")})]})}),s.jsxs("div",{className:"border-t p-3 sm:p-4",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold break-all",children:x()}),s.jsxs("div",{className:"flex items-center mt-2 text-xs sm:text-sm text-gray-500",children:[s.jsx("span",{children:N(e.size)}),s.jsx("span",{className:"mx-2",children:"•"}),s.jsx("span",{children:sr(new Date(e.lastModified),"MMM d, yyyy")})]}),s.jsxs("div",{className:"flex flex-wrap mt-3 sm:mt-4 gap-2 sm:gap-3",children:[s.jsxs("button",{onClick:M=>{M.stopPropagation(),a(e)},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:[s.jsx(yd,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.download")]}),s.jsxs("button",{onClick:M=>{M.stopPropagation(),y()},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:[s.jsx(Ti,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.copyUrl")]}),s.jsxs("button",{onClick:M=>{M.stopPropagation(),n(e.key)},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-red-600 text-white rounded-md hover:bg-red-700",children:[s.jsx(Tg,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.delete")]})]})]})]})})]})}else{const S=s.jsxs(s.Fragment,{children:[g&&s.jsx("div",{className:"mr-2 flex-shrink-0 p-0.5 bg-primary-500 text-white rounded-full shadow",title:u("mediaGallery.item.profilePictureBadge","Current Profile Picture"),children:s.jsx(Fi,{className:"w-3 h-3"})}),s.jsx("div",{className:"flex-shrink-0 w-8 h-8 sm:w-10 sm:h-10 bg-gray-100 rounded-md overflow-hidden flex items-center justify-center text-gray-500 mr-3 sm:mr-4",children:e.mediaType==="image"||e.mediaType==="video"?s.jsx(Un,{mediaUrl:e.url,altText:x(),type:e.mediaType,objectFit:"cover",className:"w-full h-full"}):v()})]});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`relative flex items-center p-2 sm:p-3 border-b ${t?"bg-blue-50":"hover:bg-gray-50"} cursor-pointer transition-colors duration-150`,onClick:C,children:[s.jsxs("div",{className:"flex items-center",children:[c&&s.jsx("div",{className:`w-5 h-5 rounded-md border ${t?"bg-blue-500 border-blue-500":"border-gray-300 bg-white"} flex items-center justify-center mr-3 cursor-pointer`,onClick:M=>{M.stopPropagation(),r(e.key)},children:t&&s.jsx(ma,{className:"w-3 h-3 text-white"})}),S]}),s.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[s.jsx("h3",{className:"font-medium text-xs sm:text-sm truncate",children:x()}),s.jsxs("div",{className:"mt-0.5 sm:mt-1 flex items-center text-xs text-gray-500",children:[s.jsx("span",{children:N(e.size)}),s.jsx("span",{className:"mx-1",children:"•"}),s.jsx("span",{children:sr(new Date(e.lastModified),"MMM d, yyyy")})]})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("button",{className:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 text-gray-500",onClick:M=>{M.stopPropagation(),a(e)},title:u("mediaGallery.item.download"),children:s.jsx(yd,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),s.jsx("button",{className:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 text-gray-500",onClick:M=>{M.stopPropagation(),y()},title:u("mediaGallery.item.copyUrl"),children:s.jsx(Ti,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),s.jsx("button",{className:"p-1.5 sm:p-2 rounded-full text-gray-300 cursor-not-allowed",title:u("mediaGallery.item.renameDisabled","Rename functionality coming soon"),children:s.jsx(S0,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),s.jsx("button",{className:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 text-gray-500",onClick:M=>{M.stopPropagation(),n(e.key)},title:u("mediaGallery.item.delete"),children:s.jsx(Tg,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]}),m&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-3",onClick:()=>h(!1),children:s.jsxs("div",{className:"relative max-w-4xl max-h-[90vh] w-full bg-white rounded-lg overflow-hidden shadow-xl",onClick:M=>M.stopPropagation(),children:[s.jsx("div",{className:"absolute top-2 right-2 z-10",children:s.jsx("button",{className:"p-1 rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors",onClick:()=>h(!1),children:s.jsx(_t,{className:"w-5 h-5 sm:w-6 sm:h-6"})})}),s.jsx("div",{className:"p-2 max-h-[80vh] overflow-auto",children:e.mediaType==="image"?s.jsx("img",{src:e.url,alt:x(),className:"max-w-full max-h-[70vh] object-contain mx-auto",style:{aspectRatio:j()}}):e.mediaType==="video"?s.jsx("video",{src:e.url,controls:!0,autoPlay:!0,className:"max-w-full max-h-[70vh] mx-auto",style:{aspectRatio:j()}}):s.jsxs("div",{className:"flex flex-col items-center justify-center p-6 sm:p-12",children:[v(),s.jsx("p",{className:"mt-4 text-gray-700 text-center break-all",children:x()}),s.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"mt-4 px-4 py-2 bg-primary-600 text-white rounded-md",children:u("mediaGallery.item.download")})]})}),s.jsxs("div",{className:"border-t p-3 sm:p-4",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold break-all",children:x()}),s.jsxs("div",{className:"flex items-center mt-2 text-xs sm:text-sm text-gray-500",children:[s.jsx("span",{children:N(e.size)}),s.jsx("span",{className:"mx-2",children:"•"}),s.jsx("span",{children:sr(new Date(e.lastModified),"MMM d, yyyy")})]}),s.jsxs("div",{className:"flex flex-wrap mt-3 sm:mt-4 gap-2 sm:gap-3",children:[s.jsxs("button",{onClick:M=>{M.stopPropagation(),a(e)},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:[s.jsx(yd,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.download")]}),s.jsxs("button",{onClick:M=>{M.stopPropagation(),y()},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",children:[s.jsx(Ti,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.copyUrl")]}),s.jsxs("button",{className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-gray-100 border border-gray-200 rounded-md text-gray-400 cursor-not-allowed",children:[s.jsx(S0,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.rename")]}),s.jsxs("button",{onClick:M=>{M.stopPropagation(),n(e.key)},className:"flex items-center px-2 sm:px-3 py-1.5 text-xs sm:text-sm bg-red-600 text-white rounded-md hover:bg-red-700",children:[s.jsx(Tg,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-1.5"}),u("mediaGallery.item.delete")]})]})]})]})})]})}},Det=({isOpen:e,onClose:t,onConfirm:r,currentName:n})=>{const{t:a}
3917=Te(),[i,o]=b.useState(n);b.useEffect(()=>{o(n)},[n]);const l=c=>{c.preventDefault(),i.trim()&&r(i.trim())};return e?s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-4 sm:p-6 w-full max-w-md",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:a("mediaGallery.rename.title","Rename File")}),s.jsxs("form",{onSubmit:l,children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{htmlFor:"fileName",className:"block text-sm font-medium text-gray-700 mb-1",children:a("mediaGallery.rename.fileNameLabel","File Name")}),s.jsx("input",{type:"text",id:"fileName",value:i,onChange:c=>o(c.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",autoFocus:!0})]}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{type:"button",className:"px-4 py-2 border rounded-md hover:bg-gray-50",onClick:t,children:a("mediaGallery.rename.cancel","Cancel")}),s.jsx("button",{type:"submit",className:"px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700",disabled:!i.trim()||i.trim()===n,children:a("mediaGallery.rename.confirm","Rename")})]})]})]})}):null},Oet=()=>{var Ye;const{t:e}=Te(),{viewType:t,setViewType:r,selectedBrandId:n,setSelectedBrandId:a,selectedMediaType:i,setSelectedMediaType:o,sortOption:l,setSortOption:c,searchQuery:u,setSearchQuery:d}=Pet(),[f,m]=b.useState([]),[h,p]=b.useState(!1),[g,y]=b.useState(!1),[v,x]=b.useState(null),[j,C]=b.useState(null),[N,S]=b.useState(!1),[M,k]=b.useState(!1),[I,T]=b.useState(null),[L,R]=b.useState(!1),[_,B]=b.useState(!1),[z,D]=b.useState(!1),[A,P]=b.useState(!1),[E,F]=b.useState(null),$=Wj(),{data:H,isLoading:X,error:ue,refetch:le}=$.useMediaQuery(),ae=qr(),{data:te,isLoading:ne}=oa(),J=te?((Ye=te.brands)==null?void 0:Ye.map(fe=>({id:fe.id,name:fe.name,logo:fe.logo})))||[]:[];Ip(e("mediaGallery.title"));const G=(H==null?void 0:H.files)||[],Q=b.useMemo(()=>(G.length,J),[J,G]),Y=[{id:"all",name:e("mediaGallery.filters.allBrands"),logo:"/logo.svg"},...Q];b.useEffect(()=>{if(j){const fe=setTimeout(()=>{C(null)},2e3);return()=>clearTimeout(fe)}},[j]);const q=G.filter(fe=>{const je=fe.key.split("/").pop()||"",We=!u||je.toLowerCase().includes(u.toLowerCase()),yt=i==="all"||fe.mediaType.toLowerCase()===i.toLowerCase();return We&&yt}).sort((fe,je)=>{switch(l){case"newest":return new Date(je.lastModified).getTime()-new Date(fe.lastModified).getTime();case"oldest":return new Date(fe.lastModified).getTime()-new Date(je.lastModified).getTime();case"nameAZ":{const We=fe.key.split("/").pop()||"",yt=je.key.split("/").pop()||"";return We.localeCompare(yt)}case"nameZA":{const We=fe.key.split("/").pop()||"";return(je.key.split("/").pop()||"").localeCompare(We)}case"size":return je.size-fe.size;default:return 0}}),Z=fe=>{N&&(f.includes(fe)?m(f.filter(je=>je!==fe)):m([...f,fe]))},me=()=>{S(!N),N&&m([])},we=fe=>{x(fe),y(!0)},he=async()=>{if(v)try{B(!0),y(!1),console.log("Deleting single file:",v),await $.deleteMediaAsync({key:v}),x(null),console.log("Refetching media data after single delete..."),await le(),D(!0),setTimeout(()=>{D(!1)},3e3)}catch(fe){console.error("Error deleting file:",fe)}finally{B(!1)}},ie=async()=>{if(f.length!==0)try{console.log("Bulk deleting files:",f),B(!0),y(!1);const fe=await $.bulkDeleteMediaAsync({fileNames:f});console.log("Bulk delete operation completed:",fe),m([]),console.log("Refetching media data after bulk delete..."),await le(),ae.removeQueries({queryKey:["media"]}),D(!0),setTimeout(()=>{D(!1)},3e3)}catch(fe){console.error("Error bulk deleting files:",fe)}finally{B(!1)}},ye=fe=>{$.downloadMedia(fe)},pe=fe=>{C(fe)},ce=async fe=>{try{k(!0),T(null),R(!1),await $.uploadMedia({file:fe}),p(!1),R(!0)}catch(je){console.error("Error uploading file:",je),T(je.message)}finally{k(!1)}},xe=(fe,je)=>{F({key:fe,currentName:je}),P(!0)},Ee=async fe=>{if(E)try{P(!1),alert(`File would be renamed from "${E.currentName}" to "${fe}"`),F(null)}catch(je){console.error("Error renaming file:",je),alert("Failed to rename file. Please try again.")}};return s.jsxs(s.Fragment,{children:[s.jsxs(rs,{title:e("mediaGallery.title"),subtitle:e("mediaGallery.subtitle"),actions:s.jsxs("div",{className:"flex flex-wrap w-full sm:w-auto items-center gap-2 sm:gap-3",children:[s.jsxs("button",{className:`flex-1 sm:flex-none inline-flex items-center justify-center px-4 py-2 ${N?"bg-primary-600 text-white":"bg-white text-primary-600 border border-primary-600"} rounded-lg hover:bg-primary-700 hover:text-white transition-colors`,onClick:me,children:[s.jsx(iL,{className:"w-5 h-5 mr-2"}),s.jsx("span",{className:"whitespace-nowrap",children:e(N?"mediaGallery.exitSelection":"mediaGallery.selectMultiple")}
3917)]}),s.jsxs("button",{className:"flex-1 sm:flex-none inline-flex items-center justify-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",onClick:()=>p(!0),children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),s.jsx("span",{className:"whitespace-nowrap",children:e("mediaGallery.upload")})]})]}),children:[N&&f.length>0&&s.jsxs("div",{className:"mb-4 flex flex-col sm:flex-row sm:items-center sm:justify-between bg-primary-50 p-3 rounded-lg",children:[s.jsxs("div",{className:"flex items-center mb-3 sm:mb-0",children:[s.jsx(iL,{className:"w-5 h-5 text-primary-600 mr-2"}),s.jsx("span",{className:"text-sm font-medium",children:e("mediaGallery.selectedCount",{count:f.length})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{className:"px-3 py-1.5 text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",onClick:()=>m([]),children:e("mediaGallery.clearSelection")}),f.length===1&&s.jsxs("button",{className:"px-3 py-1.5 text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",onClick:()=>{const fe=G.find(je=>je.key===f[0]);fe&&pe(fe.url)},children:[s.jsx(Ti,{className:"w-4 h-4 mr-1 inline-block"}),e("mediaGallery.item.copyUrl")]}),f.length===1&&s.jsxs("button",{className:"px-3 py-1.5 text-sm bg-white border border-gray-300 rounded-md hover:bg-gray-50",onClick:()=>{const fe=G.find(je=>je.key===f[0]);fe&&ye(fe)},children:[s.jsx(yd,{className:"w-4 h-4 mr-1 inline-block"}),e("mediaGallery.item.download")]}),s.jsxs("button",{className:"px-3 py-1.5 text-sm bg-red-600 text-white rounded-md hover:bg-red-700",onClick:()=>{f.length===1?we(f[0]):f.length>1&&(x(null),y(!0))},children:[s.jsx(Tg,{className:"w-4 h-4 mr-1 inline-block"}),f.length>1?e("mediaGallery.bulkDelete",{count:f.length}):e("mediaGallery.item.delete")]})]})]}),s.jsx("div",{className:"mt-2 text-sm text-gray-500 text-right",children:e("mediaGallery.totalMedia",{count:G.length})}),s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center space-y-3 sm:space-y-0 sm:gap-3",children:[s.jsx(Iet,{value:u,onChange:d,placeholder:e("mediaGallery.search"),className:"w-full sm:w-auto sm:flex-1"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[s.jsxs("div",{className:"flex items-center space-x-2 border rounded-md p-1 bg-white",children:[s.jsx("button",{className:`p-1.5 rounded-md ${t==="grid"?"bg-primary-50 text-primary-700":"text-gray-500 hover:bg-gray-100"}`,onClick:()=>r("grid"),title:e("mediaGallery.view.grid"),children:s.jsx(P7,{className:"w-5 h-5"})}),s.jsx("button",{className:`p-1.5 rounded-md ${t==="list"?"bg-primary-50 text-primary-700":"text-gray-500 hover:bg-gray-100"}`,onClick:()=>r("list"),title:e("mediaGallery.view.list"),children:s.jsx(_7,{className:"w-5 h-5"})})]}),s.jsx(hl,{brands:Y,selectedBrandId:n,onBrandSelect:a,showRedirectionCard:!1,className:"min-w-[120px] sm:min-w-[140px]"}),s.jsx(Eet,{options:_et,selectedTypeId:i,onTypeSelect:o,className:"min-w-[120px] sm:min-w-[140px]"}),s.jsx(Tet,{options:Let,selectedOptionId:l,onOptionSelect:c,className:"min-w-[120px] sm:min-w-[140px]"})]})]})}),X?s.jsx("div",{className:"animate-pulse",children:s.jsx("div",{className:"grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8 gap-3 sm:gap-4 pb-8 grid-flow-dense",children:[...Array(12)].map((fe,je)=>s.jsx("div",{className:"aspect-square bg-gray-200 rounded-lg"},je))})}):ue?s.jsxs("div",{className:"py-8 sm:py-12 flex flex-col items-center justify-center text-center",children:[s.jsx("div",{className:"text-red-500 text-lg mb-2",children:e("mediaGallery.error")}),s.jsx("p",{className:"text-gray-600",children:ue.message})]}):q.length>0?t==="grid"?s.jsx("div",{className:"grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8 gap-3 sm:gap-4 pb-8 grid-flow-dense",children:q.map((fe,je)=>{const yt=(()=>{const gt=()=>{const ct=fe.key.split("/");return ct[ct.length-1]},ze=(()=>{const ct=gt().toLowerCase();return ct.includes("9x16")||ct.includes("9-16")||ct.includes("vertical")||ct.includes("reel")||ct.includes("story")?"9/16":ct.includes("4x5")||ct.includes("4-5")||ct.includes("portrait")?"4/5":ct.includes("1x1")||ct.includes("1-1")||ct.includes("square")?"1/1":ct.includes("16x9")||ct.includes("16-9")||ct.includes("landscape")?"16/9"
3917:fe.mediaType==="video"?fe.key.includes("reel")||fe.key.includes("tiktok")||fe.key.includes("story")||fe.key.includes("vertical")?"9/16":"16/9":"1/1"})(),$e={classes:"",aspectClass:""};return ze==="9/16"?$e.aspectClass="aspect-[9/16]":ze==="4/5"?$e.aspectClass="aspect-[4/5]":ze==="16/9"?$e.aspectClass="aspect-video":$e.aspectClass="aspect-square",je%24===0||je%24===13?$e.classes="col-span-2 row-span-2":je%24===4||je%24===18?$e.classes="row-span-2":je%24===8||je%24===20?$e.classes="col-span-2":(je%24===11||je%24===22)&&($e.classes="col-span-2 row-span-2"),$e})();return s.jsx("div",{className:`${yt.classes} h-full`,children:s.jsx("div",{className:`h-full w-full ${yt.aspectClass} overflow-hidden`,children:s.jsx(S$,{item:fe,isSelected:f.includes(fe.key),onSelect:Z,onDelete:we,onDownload:ye,onCopyUrl:pe,onRename:xe,viewType:t,isSelectionMode:N})})},fe.key)})}):s.jsx("div",{className:"divide-y border-t border-b overflow-x-auto",children:q.map(fe=>s.jsx(S$,{item:fe,isSelected:f.includes(fe.key),onSelect:Z,onDelete:we,onDownload:ye,onCopyUrl:pe,onRename:xe,viewType:t,isSelectionMode:N},fe.key))}):s.jsxs("div",{className:"py-8 sm:py-12 flex flex-col items-center justify-center text-center",children:[s.jsx(rf,{className:"w-12 h-12 sm:w-16 sm:h-16 text-gray-300 mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-1",children:e("mediaGallery.noResults")}),u&&s.jsx("p",{className:"text-sm text-gray-500",children:e("mediaGallery.filters.all")})]})]}),j&&s.jsxs("div",{className:"fixed bottom-4 right-4 bg-gray-800 text-white px-4 py-2 rounded-md shadow-lg flex items-center space-x-2 z-50",children:[s.jsx(ma,{className:"w-5 h-5"}),s.jsx("span",{children:e("mediaGallery.item.urlCopied")})]}),g&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-4 sm:p-6 w-full max-w-md",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:e(v?"mediaGallery.deleteConfirm.title":"mediaGallery.bulkDeleteConfirm.title")}),s.jsx("p",{className:"text-sm text-gray-500 mb-6",children:v?e("mediaGallery.deleteConfirm.message"):e("mediaGallery.bulkDeleteConfirm.message",{count:f.length})}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{className:"px-4 py-2 border rounded-md hover:bg-gray-50",onClick:()=>y(!1),children:e("mediaGallery.deleteConfirm.cancel")}),s.jsx("button",{className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",onClick:v?he:ie,children:e("mediaGallery.deleteConfirm.confirm")})]})]})}),h&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-4 sm:p-6 w-full max-w-lg",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:e("mediaGallery.upload")}),s.jsx("button",{className:"text-gray-400 hover:text-gray-500",onClick:()=>p(!1),children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-4 sm:p-8 text-center",onDragOver:fe=>{fe.preventDefault(),fe.stopPropagation(),fe.currentTarget.classList.add("border-primary-500","bg-primary-50")},onDragLeave:fe=>{fe.preventDefault(),fe.stopPropagation(),fe.currentTarget.classList.remove("border-primary-500","bg-primary-50")},onDrop:async fe=>{if(fe.preventDefault(),fe.stopPropagation(),fe.currentTarget.classList.remove("border-primary-500","bg-primary-50"),fe.dataTransfer.files&&fe.dataTransfer.files.length>0){const je=fe.dataTransfer.files[0];await ce(je)}},children:s.jsx("div",{className:"flex flex-col items-center",children:M?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-10 w-10 sm:h-12 sm:w-12 border-t-2 border-b-2 border-primary-600 mb-4"}),s.jsx("h4",{className:"text-base font-medium text-gray-900 mb-1",children:e("mediaGallery.uploading")}),s.jsx("p",{className:"text-sm text-gray-500",children:e("mediaGallery.pleaseWait")})]}):I?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-center w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-red-100 text-red-500 mb-4",children:s.jsx(_t,{className:"w-5 h-5 sm:w-6 sm:h-6"})}),s.jsx("h4",{className:"text-base font-medium text-red-500 mb-1",children:e("mediaGallery.uploadError")}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:I}),s.jsx("button",{className:"px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 transition-colors",onClick:()=>T(null),children:e("mediaGallery.tryAgain")})]}):s.jsxs(s.Fragment,{children:[s.jsx(rf,{className:"w-10 h-10 sm:w-12 sm:h-12 text-gray-400 mb-4"}),s.jsx("h4",{className:"text-base font-medium text-gray-900 mb-1",children:e("mediaGallery.dropzone.title")}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:e("mediaGallery.dropzone.subtitle")}),s.jsx("p",{className:"text-xs text-gray-400",children:e("mediaGallery.dropzone.maxSize")}),s.jsx("input",{type:"file",id:"file-upload",className:"hidden",onChange:fe=>{fe.target.files&&fe.target.files[0]&&ce(fe.target.files[0])}}),s.jsxs("label",{htmlFor:"file-upload",className:"mt-6 inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 transition-colors cursor-pointer",children:[s.jsx(tn,{className:"w-4 h-4 mr-2"}),e("mediaGallery.upload")]})]})})}),L&&s.jsxs("div",{className:"mt-4 p-3 bg-green-50 border border-green-200 rounded-md flex items-start",children:[s.jsx("div",{className:"flex-shrink-0 text-green-500 mt-0.5",children:s.jsx(ma,{className:"w-5 h-5"})}),s.jsxs("div",{className:"ml-3",children:[s.jsx("h3",{className:"text-sm font-medium text-green-800",children:e("mediaGallery.uploadSuccess")}),s.jsx("div",{className:"mt-1 text-sm text-green-700",children:e("mediaGallery.fileUploaded")}),s.jsx("div",{className:"mt-3",children:s.jsx("button",{className:"text-sm font-medium text-green-600 hover:text-green-500",onClick:()=>p(!1),children:e("mediaGallery.closeUploadModal")})})]})]})]})}),_&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-4 sm:p-6 w-full max-w-md flex flex-col items-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-10 w-10 sm:h-12 sm:w-12 border-t-2 border-b-2 border-primary-600 mb-4"}),s.jsx("h3",{className:"text-base sm:text-lg font-medium text-gray-900 mb-1 text-center",children:e("mediaGallery.bulkDeleteProgress.title","Deleting media files...")}),s.jsx("p",{className:"text-sm text-gray-500 text-center",children:e("mediaGallery.bulkDeleteProgress.message","Please wait while your files are being deleted")})]})}),z&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-4 sm:p-6 w-full max-w-md flex flex-col items-center",children:[s.jsx("div",{className:"text-green-600 mb-4",children:s.jsx(ma,{className:"w-10 h-10 sm:w-12 sm:h-12"})}),s.jsx("h3",{className:"text-base sm:text-lg font-medium text-gray-900 mb-1 text-center",children:e("mediaGallery.bulkDeleteSuccess","Files successfully deleted")}),s.jsx("p",{className:"text-sm text-gray-500 mb-4 text-center",children:e("mediaGallery.bulkDeleteSuccess.message","Your files have been successfully removed from the media gallery")})]})}),A&&E&&s.jsx(Det,{isOpen:A,onClose:()=>P(!1),onConfirm:Ee,currentName:E.currentName})]})},Jf={en:{auth:{login:"/auth/login",signup:"/auth/signup",forgotPassword:"/auth/forgot-password"}},fr:{auth:{login:"/auth/connexion",signup:"/auth/inscription",forgotPassword:"/auth/mot-de-passe-oublie"}}},eC=(e,t="en")=>{var a,i,o,l,c,u;const r=t.split("-")[0];return{"/auth/login":((i=(a=Jf[r])==null?void 0:a.auth)==null?void 0:i.login)||Jf.en.auth.login,"/auth/signup":((l=(o=Jf[r])==null?void 0:o.auth)==null?void 0:l.signup)||Jf.en.auth.signup,"/auth/forgot-password":((u=(c=Jf[r])==null?void 0:c.auth)==null?void 0:u.forgotPassword)||Jf.en.auth.forgotPassword}[e]||e},hA=()=>{const{i18n:e}=Te(),t=e.language;return{auth:{login:eC("/auth/login",t),signup:eC("/auth/signup",t),forgotPassword:eC("/auth/forgot-password",t)}}},C$=()=>{const e=pn(),t=vs(),{t:r}=Te(),n=hA(),[a,i]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(!1),[m,h]=b.useState(!1),p=async y=>{y.preventDefault(),u(""),f(!0);try{await _le(Qe,a,o),e("/")}catch(v){u(v.message)}finally{f(!1)}},g=async()=>{u(""),f(!0);try{const y=new Fo;await nU(Qe,y),e("/")}catch(y){u(y.message)}finally{f(!1)}};return s.jsxs("div",{className:"min-h-screen flex",children:[s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 bg-gray-50",children:s.jsxs("div",{className:"max-w-md w-full space-y-8",children:[s.jsxs("div",{children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"mx-auto h-16 w-16"}),s.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:r("auth.login.title")})]}),c&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 flex items-center gap-3",children:[s.jsx(bs,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),s.jsx("p",{className:"text-sm text-red-600",children:c})]}),s.jsxs("form",{className:"mt-8 space-y-6",onSubmit:p,children:[s.jsxs("div",{className:"rounded-md shadow-sm space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"sr-only",children:r("auth.login.emailLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(rp,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:a,onChange:y=>i(y.target.value),className:"appearance-none relative block w-full px-3 py-2 pl-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.login.emailPlaceholder")})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"sr-only",children:r("auth.login.passwordLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(N0,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"password",name:"password",type:m?"text":"password",autoComplete:"current-password",required:!0,value:o,onChange:y=>l(y.target.value),className:"appearance-none relative block w-full px-3 py-2 pl-10 pr-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.login.passwordPlaceholder")}),s.jsx("button",{type:"button",onClick:()=>h(!m),className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:m?s.jsx(ch,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}
3917):s.jsx(xa,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"text-sm",children:s.jsx(Us,{to:`${n.auth.signup}${t.search}`,className:"font-medium text-primary-600 hover:text-primary-500",children:r("auth.login.noAccount")})}),s.jsx("div",{className:"text-sm",children:s.jsx(Us,{to:`${n.auth.forgotPassword}${t.search}`,className:"font-medium text-primary-600 hover:text-primary-500",children:r("auth.login.forgotPassword")})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("button",{type:"submit",disabled:d,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r(d?"auth.login.signingIn":"auth.login.signInButton")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("div",{className:"w-full border-t border-gray-300"})}),s.jsx("div",{className:"relative flex justify-center text-sm",children:s.jsx("span",{className:"px-2 bg-gray-50 text-gray-500",children:r("auth.login.orContinueWith")})})]}),s.jsxs("button",{type:"button",onClick:g,disabled:d,className:"w-full flex items-center justify-center gap-3 px-4 py-2 border border-gray-300 rounded-lg shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"w-5 h-5"}),r("auth.login.google")]})]})]})]})}),s.jsxs("div",{className:"hidden lg:block relative flex-1",children:[s.jsx("img",{src:"https://media.socialness.ai/Landing+Page/Marketing+agency+using+Socialness.webp",alt:"Marketing agency using Socialness.ai",className:"absolute inset-0 w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"})]})]})},k$=e=>{try{typeof window<"u"&&typeof window.fpr=="function"&&window.fpr("referral",e)}catch(t){console.warn("FirstPromoter referral tracking failed:",t)}};v2();const bi=["Google","YouTube","Facebook","Instagram","LinkedIn","Word of Mouth","ProductHunt","Email","Invitation","Referral","Affiliate","Other"],M$=()=>{const e=pn(),t=vs(),{t:r}=Te(),n=hA(),[a,i]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(""),[y,v]=b.useState(!1),[x,j]=b.useState(!1),[C,N]=b.useState(!1),[S,M]=b.useState(!1),[k,I]=b.useState(!1);b.useEffect(()=>{const B=new URLSearchParams(t.search),z=B.get("utm_source"),D=B.get("utm_medium");let A="";if(D){const P=D.toLowerCase();P==="affiliate"&&bi.includes("Affiliate")?A="Affiliate":P==="referral"&&bi.includes("Referral")?A="Referral":P==="invitation"&&bi.includes("Invitation")&&(A="Invitation")}if(!A&&z){const P=z.toLowerCase(),E=bi.find(F=>F.toLowerCase()===P);E?A=E:P==="google"&&bi.includes("Google")?A="Google":P==="youtube"&&bi.includes("YouTube")?A="YouTube":P==="facebook"&&bi.includes("Facebook")?A="Facebook":P==="instagram"&&bi.includes("Instagram")?A="Instagram":P==="linkedin"&&bi.includes("LinkedIn")?A="LinkedIn":P==="producthunt"&&bi.includes("ProductHunt")?A="ProductHunt":P==="email"&&bi.includes("Email")&&(A="Email")}A&&h(A)},[t.search]);const T=B=>{N(B.length>=8),M(/[A-Z]/.test(B)),I(/[0-9\W]/.test(B))},L=B=>{const z=B.target.value;f(z),T(z)},R=async B=>{var D;if(B.preventDefault(),g(""),!(C&&S&&k)){g(r("auth.signup.errors.passwordRequirements"));return}if(!m){g(r("auth.signup.errors.referralRequired"));return}if(!a.trim()||!o.trim()){g(r("auth.signup.errors.nameRequired"));return}v(!0);try{console.log("Attempting Firebase user creation...");const P=(await Ple(Qe,c,d)).user;console.log("Firebase user created successfully:",P.uid);const E=`${a.trim()} ${o.trim()}`;console.log("Attempting Firebase profile update..."),await ok(P,{displayName:E}),console.log("Firebase profile updated successfully."),console.log("Attempting to get ID token...");const F=await P.getIdToken();console.log("ID token received.");const $=new URLSearchParams(t.search),H=$.get("utm_source"),X=$.get("utm_medium"),ue=$.get("utm_campaign"),le=$.get("utm_term"),ae=$.get("utm_content");try{const te=typeof document<"u"?document.cookie.match(/(?:^|; )fp_ref=([^;
3917]+)/):null,ne=te?decodeURIComponent(te[1]):void 0;ne&&localStorage.setItem("fp_ref",ne)}catch{}try{const ne="https://api.socialness.ai/firebase";if(!ne)throw new Error("Backend URL could not be constructed.");console.log("Calling backend /check-user-signup...");const J=await fetch(`${ne}/check-user-signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:F,profileData:{email:c,firstName:a.trim(),lastName:o.trim(),password:d,photoURL:P.photoURL||"",returnSecureToken:!0,referralSource:m,utm_source:H,utm_medium:X,utm_campaign:ue,utm_term:le,utm_content:ae,fp_ref:typeof localStorage<"u"&&localStorage.getItem("fp_ref")||typeof document<"u"&&((D=document.cookie.match(/(?:^|; )fp_ref=([^;]+)/))!=null&&D[1]?decodeURIComponent(document.cookie.match(/(?:^|; )fp_ref=([^;]+)/)[1]):"")||""}})}),G=await J.json();if(!J.ok){console.error("Backend signup check failed:",G),g(G.error||r("auth.signup.errors.backendError","Signup process failed. Please try again."));return}console.log("Backend signup check successful:",G),k$({email:c}),await GB(P),alert(r("auth.verification.checkInbox")),e("/")}catch(te){console.error("Error calling backend signup check:",te),g(r("auth.signup.errors.networkError","An error occurred during signup. Please check your connection and try again."));return}}catch(A){console.error("Error during Firebase operations:",A),A.code==="auth/email-already-in-use"?g(r("auth.signup.errors.emailAlreadyInUse","A Socialness account already exists with this email. Please log in or reset your password.")):g(A.message)}finally{v(!1)}},_=async()=>{var B;if(g(""),!m){g(r("auth.signup.errors.referralRequired"));return}v(!0);try{const z=new Fo,A=(await nU(Qe,z)).user,P=await A.getIdToken(),E=new URLSearchParams(t.search),F=E.get("utm_source"),$=E.get("utm_medium"),H=E.get("utm_campaign"),X=E.get("utm_term"),ue=E.get("utm_content");let le="",ae="";if(A.displayName){const te=A.displayName.split(" ");le=te[0]||"",ae=te.slice(1).join(" ")||""}try{const te=typeof document<"u"?document.cookie.match(/(?:^|; )fp_ref=([^;]+)/):null,ne=te?decodeURIComponent(te[1]):void 0;ne&&localStorage.setItem("fp_ref",ne)}catch{}try{const ne="https://api.socialness.ai/firebase";if(!ne)throw new Error("Backend URL could not be constructed.");console.log("Calling backend /check-user-signup via Google...");const J=await fetch(`${ne}/check-user-signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:P,profileData:{email:A.email||"",firstName:le,lastName:ae,photoURL:A.photoURL||"",returnSecureToken:!0,referralSource:m,utm_source:F,utm_medium:$,utm_campaign:H,utm_term:X,utm_content:ue,fp_ref:typeof localStorage<"u"&&localStorage.getItem("fp_ref")||typeof document<"u"&&((B=document.cookie.match(/(?:^|; )fp_ref=([^;]+)/))!=null&&B[1]?decodeURIComponent(document.cookie.match(/(?:^|; )fp_ref=([^;]+)/)[1]):"")||""}})}),G=await J.json();if(!J.ok){console.error("Backend Google signup check failed:",G),g(G.error||r("auth.signup.errors.backendError","Signup process failed. Please try again."));return}console.log("Backend Google signup check successful:",G),k$({email:A.email||void 0}),e("/")}catch(te){console.error("Error calling backend signup check via Google:",te),g(r("auth.signup.errors.networkError","An error occurred during signup. Please check your connection and try again."));return}}catch(z){g(z.message)}finally{v(!1)}};return s.jsxs("div",{className:"min-h-screen flex",children:[s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 bg-gray-50",children:s.jsxs("div",{className:"max-w-md w-full space-y-8",children:[s.jsxs("div",{children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"mx-auto h-16 w-16"}),s.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:r("auth.signup.title")})]}),p&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 flex items-center gap-3",children:[s.jsx(bs,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),s.jsx("p",{className:"text-sm text-red-600",children:p})]}),s.jsxs("form",{className:"mt-8 space-y-6",onSubmit:R,children:[s.jsxs("div",{className:"rounded-md shadow-sm space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"firstName",className:"sr-only",children:r("auth.signup.firstNameLabel")||"First Name"}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(Fi,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"firstName",name:"firstName",type:"text",autoComplete:"given-name",required:!0,value:a,onChange:B=>i(B.target.value),className:"appearance-none relative block w-full px-3 py-2 pl-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.signup.firstNamePlaceholder")||"First Name"})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"lastName",className:"sr-only",children:r("auth.signup.lastNameLabel")||"Last Name"}),s.jsx("div",{className:"relative",children:s.jsx("input",{id:"lastName",name:"lastName",type:"text",autoComplete:"family-name",required:!0,value:o,onChange:B=>l(B.target.value),className:"appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.signup.lastNamePlaceholder")||"Last Name"})})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"sr-only",children:r("auth.signup.emailLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(rp,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:c,onChange:B=>u(B.target.value),className:"appearance-none relative block w-full px-3 py-2 pl-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.signup.emailPlaceholder")})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"sr-only",children:r("auth.signup.passwordLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(N0,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"password",name:"password",type:x?"text":"password",autoComplete:"new-password",required:!0,value:d,onChange:L,className:"appearance-none relative block w-full px-3 py-2 pl-10 pr-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:r("auth.signup.passwordPlaceholder")}),s.jsx("button",{type:"button",onClick:()=>j(!x),className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:x?s.jsx(ch,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}
3917):s.jsx(xa,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),s.jsx("div",{className:"mt-2 text-xs text-gray-600 space-y-1",children:s.jsxs("ul",{className:"space-y-1",children:[s.jsxs("li",{className:`flex items-center ${C?"text-green-600":"text-gray-500"}`,children:[C?s.jsx(Nm,{className:"w-4 h-4 mr-2"}):s.jsx(BN,{className:"w-4 h-4 mr-2 text-gray-400"}),r("auth.signup.passwordRules.minLength")]}),s.jsxs("li",{className:`flex items-center ${S?"text-green-600":"text-gray-500"}`,children:[S?s.jsx(Nm,{className:"w-4 h-4 mr-2"}):s.jsx(BN,{className:"w-4 h-4 mr-2 text-gray-400"}),r("auth.signup.passwordRules.uppercaseLetter")]}),s.jsxs("li",{className:`flex items-center ${k?"text-green-600":"text-gray-500"}`,children:[k?s.jsx(Nm,{className:"w-4 h-4 mr-2"}):s.jsx(BN,{className:"w-4 h-4 mr-2 text-gray-400"}),r("auth.signup.passwordRules.numberOrSymbol")]})]})})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"referral-source",className:"sr-only",children:r("auth.signup.referralLabel")}),s.jsxs("div",{className:"relative",children:[s.jsxs("select",{id:"referral-source",name:"referral-source",required:!0,value:m,onChange:B=>h(B.target.value),className:"appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",children:[s.jsx("option",{value:"",children:r("auth.signup.referralPlaceholder")}),bi.map(B=>s.jsx("option",{value:B,children:B},B))]}),s.jsx("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:s.jsx(Vr,{className:"h-5 w-5 text-gray-400"})})]})]})]}),s.jsx("div",{className:"text-sm",children:s.jsx(Us,{to:`${n.auth.login}${t.search}`,className:"font-medium text-primary-600 hover:text-primary-500",children:r("auth.signup.hasAccount")})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:[r("auth.signup.termsText")," ",s.jsx("a",{href:"https://www.socialness.ai/legal/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-500",children:r("auth.signup.termsLink")})," ",r("auth.signup.andThe")," ",s.jsx("a",{href:"https://www.socialness.ai/legal/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-500",children:r("auth.signup.privacyLink")})]}),s.jsx("button",{type:"submit",disabled:y,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r(y?"auth.signup.creating":"auth.signup.createButton")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("div",{className:"w-full border-t border-gray-300"})}),s.jsx("div",{className:"relative flex justify-center text-sm",children:s.jsx("span",{className:"px-2 bg-gray-50 text-gray-500",children:r("auth.signup.orContinueWith")})})]}),s.jsxs("button",{type:"button",onClick:_,disabled:y,className:"w-full flex items-center justify-center gap-3 px-4 py-2 border border-gray-300 rounded-lg shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"w-5 h-5"}),r("auth.signup.google")]})]})]})]})}),s.jsxs("div",{className:"hidden lg:block relative flex-1",children:[s.jsx("img",{src:"https://media.socialness.ai/Landing+Page/Marketing+agency+using+Socialness.webp",alt:"Marketing agency using Socialness.ai",className:"absolute inset-0 w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"})]})]})},I$=()=>{const e=vs(),{t,i18n:r}=Te(),n=hA(),[a,i]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(!1),[d,f]=b.useState(!1),m=async h=>{h.preventDefault(),l(""),f(!0);try{const p=r.language.split("-")[0],g=await fetch("https://api.socialness.ai/firebase/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a,language:p})});if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);const y=await g.json();console.log("Password reset response:",y),u(!0)}catch(p){console.error("Password reset error:",p),l(t("auth.forgotPassword.error"))}finally{f(!1)}};return c?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-md w-full space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"mx-auto h-16 w-16"}),s.jsx("div",{className:"mt-6 flex justify-center",children:s.jsx("div",{className:"bg-green-100 rounded-full p-3",children:s.jsx(Ba,{className:"h-8 w-8 text-green-600"})})}),s.jsx("h2",{className:"mt-4 text-center text-3xl font-extrabold text-gray-900",children:t("auth.forgotPassword.successTitle")}),s.jsxs("p",{className:"mt-2 text-center text-base text-gray-600",children:[t("auth.forgotPassword.successMessage")," ",s.jsx("span",{className:"font-medium text-primary-600",children:a})]})]}),s.jsx("div",{className:"mt-8",children:s.jsxs(Us,{to:`${n.auth.login}${e.search}`,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:[s.jsx(lh,{className:"w-4 h-4 mr-2"}),t("auth.forgotPassword.backToLogin")]})})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-md w-full space-y-8",children:[s.jsxs("div",{children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"mx-auto h-16 w-16"}),s.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:t("auth.forgotPassword.title")}),s.jsx("p",{className:"mt-2 text-center text-sm text-gray-600",children:t("auth.forgotPassword.subtitle")})]}),o&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 flex items-center gap-3",children:[s.jsx(bs,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),s.jsx("p",{className:"text-sm text-red-600",children:o})]}),s.jsxs("form",{className:"mt-8 space-y-6",onSubmit:m,children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"sr-only",children:t("auth.forgotPassword.emailLabel")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(rp,{className:"h-5 w-5 text-gray-400"})}),s.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:a,onChange:h=>i(h.target.value),className:"appearance-none relative block w-full px-3 py-2 pl-10 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm",placeholder:t("auth.forgotPassword.emailPlaceholder")})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("button",{type:"submit",disabled:d,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:t(d?"auth.forgotPassword.resetting":"auth.forgotPassword.resetButton")}),s.jsxs(Us,{to:`${n.auth.login}${e.search}`,className:"group relative w-full flex justify-center py-2 px-4 border border-gray-300 text-sm font-medium rounded-lg text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:[s.jsx(lh,{className:"w-4 h-4 mr-2"}),t("auth.forgotPassword.backToLogin")]})]})]})]})})},Ret=({isOpen:e,onClose:t,onGoBack:r,onSubmit:n,brands:a,isCreating:i,initialLinkData:o,isEditMode:l,prefilledUrl:c,defaultBrandId:u})=>{const{t:d}=Te(),[f,m]=b.useState(""),[h,p]=b.useState(""),[g,y]=b.useState(""),[v,x]=b.useState(""),[j,C]=b.useState(!1),[N,S]=b.useState(null),[M,k]=b.useState(!1),[I,T]=b.useState(""),[L,R]=b.useState(""),[_,B]=b.useState(""),[z,D]=b.useState(""),[A,P]=b.useState(""),[E,F]=b.useState(""),[$,H]=b.useState(!1),X=b.useCallback(()=>{const Y=Math.random().toString(36).substring(2,8);p(Y),S(null),x(Y)},[]),ue=Y=>{y(Y)},le=b.useCallback(Y=>{const q={};let Z=Y;try{const me=!Y.startsWith("http://")&&!Y.startsWith("https://")&&Y.includes(".")?`https://${Y}`:Y,we=new URL(me);let he=we.pathname;if(we.pathname==="/"&&!we.search&&!we.hash){const pe=we.hostname;let ce="";const xe=me.replace(/^https?:\/\//,""),Ee=xe.indexOf(pe);Ee!==-1&&(ce=xe.substring(Ee+pe.length).split("?")[0].split("#")[0]),(ce===""||ce==="/")&&(he="")}Z=`${we.origin}${he}${we.hash}`;const ie=new URLSearchParams;
3917we.searchParams.forEach((pe,ce)=>{ce.startsWith("utm_")?q[ce]=pe:ie.append(ce,pe)});const ye=ie.toString();ye&&(Z+=`?${ye}`)}catch(me){console.warn("[parseUtmParams] Error parsing URL:",Y,me);const we=Y.indexOf("?");if(we!==-1){Z=Y.substring(0,we);const he=Y.substring(we+1);try{const ie=new URLSearchParams(he),ye=new URLSearchParams;ie.forEach((ce,xe)=>{xe.startsWith("utm_")?q[xe]=ce:ye.append(xe,ce)});const pe=ye.toString();pe&&(Z+=`?${pe}`)}catch{}}else Z=Y}return{baseUrl:Z,utms:q}},[]);b.useEffect(()=>{let Y=f.trim();const q=new URLSearchParams;I&&q.append("utm_source",I),L&&q.append("utm_medium",L),_&&q.append("utm_campaign",_),z&&q.append("utm_term",z),A&&q.append("utm_content",A);const Z=q.toString();if(!Y&&!Z){F("");return}if(!Y&&Z){F(`?${Z}`);return}try{const me=Y.startsWith("http://")||Y.startsWith("https://")||!Y.includes(".")||Y.startsWith("/")?Y:`https://${Y}`,we=new URL(me),he=new URLSearchParams(we.search),ie=new URLSearchParams;he.forEach((ce,xe)=>{xe.startsWith("utm_")||ie.append(xe,ce)}),q.forEach((ce,xe)=>{ie.set(xe,ce)}),we.search=ie.toString();let ye=we.toString();!Y.startsWith("http://")&&!Y.startsWith("https://")&&me.startsWith("https://")&&ye.startsWith("https://")&&(ye=ye.substring(8));const pe=Y.split("?")[0].split("#")[0];we.pathname==="/"&&!pe.endsWith("/")&&!we.search&&!we.hash&&ye.endsWith("/")&&(ye=ye.substring(0,ye.length-1)),ie.toString()===""&&ye.endsWith("?")&&(ye=ye.substring(0,ye.length-1)),F(ye.replace(/&$/,""))}catch(me){console.warn("[useEffect liveUrlToDisplay] Error constructing live URL:",me);const we=Y.includes("?")?"&":"?";F(Z?`${Y}${we}${Z}`:Y)}},[f,I,L,_,z,A]),b.useEffect(()=>{const Y=setTimeout(()=>{x(h.trim())},750);return()=>clearTimeout(Y)},[h]),b.useEffect(()=>{e&&(v||S(null))},[v,e,d]),b.useEffect(()=>{if(e){if(i&&!o&&!l)return;if(S(null),C(!1),k(!1),T(""),R(""),B(""),D(""),P(""),H(!1),o){const{baseUrl:Y,utms:q}=le(o.oldURL);m(Y),Object.keys(q).length>0&&(T(q.utm_source||""),R(q.utm_medium||""),B(q.utm_campaign||""),D(q.utm_term||""),P(q.utm_content||""),k(!0));const Z=o.newURL.split("/"),me=Z[Z.length-1];if(l)p(me||""),x(me||"");else{const we=Math.random().toString(36).substring(2,9),he=me?`${me}-copy`:we;p(he),x(he)}y(o.brandId||"")}else if(c){const{baseUrl:Y,utms:q}=le(c);m(Y),Object.keys(q).length>0&&(T(q.utm_source||""),R(q.utm_medium||""),B(q.utm_campaign||""),D(q.utm_term||""),P(q.utm_content||""),k(!0)),X()}else m(""),X()}},[e,o,l,i,c,le,X]),b.useEffect(()=>{var Y;if(e&&!o&&!g&&a.length>0){const q=u&&a.find(Z=>Z.id===u)?u:(Y=a[0])==null?void 0:Y.id;q&&y(q)}},[e,o,g,a,u]);const ae=async Y=>{if(Y.preventDefault(),!(f.trim()===""||h.trim()==="")){if(!l&&N&&!N.available){alert(d("links.errors.slugTakenOnSubmit"));return}n({destinationUrl:E,shortCode:h.trim(),brandId:g})}},te=()=>{m(""),p(""),y(""),S(null),C(!1),x(""),k(!1),T(""),R(""),B(""),D(""),P(""),F(""),H(!1),t()},ne=()=>{E&&(navigator.clipboard.writeText(E),H(!0),setTimeout(()=>H(!1),2e3))};if(!e)return null;const J=l?d("links.editSmartLink","Edit Smart Link"):d("links.createSmartLink","Create a smart link"),G=l?i?d("common.saving","Saving..."):d("common.saveChanges","Save Changes"):i?d("common.creating","Creating..."):d("links.createLinkButton","Create Link"),Q=f.trim()!==""&&h.trim()!==""&&!i&&(l||j===!1)&&(l||N===null||N.available),W=I||L||_||z||A;return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:te,children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25","aria-hidden":"true"}),s.jsxs("div",{className:"relative bg-white rounded-xl border-2 border-black shadow-xl w-full max-w-lg p-6",onClick:Y=>Y.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-gray-900",children:[s.jsx(j0,{className:"w-5 h-5 text-primary-600"}),J]}),s.jsx("button",{onClick:te,className:"text-gray-400 hover:text-gray-600",children:s.jsx(_t,{size:20})})]}),s.jsxs("form",{onSubmit:ae,className:"space-y-5",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"destination-url-input",className:"flex items-center text-sm font-medium text-gray-700 mb-1",children:[s.jsx(Zs,{className:"w-4 h-4 mr-1.5 text-gray-400"}),d("links.destinationUrlLabel","Destination URL")]}),s.jsxs("div",{className:"relative",children:[s.jsx("textarea",{id:"destination-url-input",value:E,onChange:Y=>{const{baseUrl:q,utms:Z}=le(Y.target.value);m(q),T(Z.utm_source||""),R(Z.utm_medium||""),B(Z.utm_campaign||""),D(Z.utm_term||""),P(Z.utm_content||"")},placeholder:d("links.destinationUrlPlaceholder","https://www.socialness.ai/features/ai-link-builder"),className:`w-full text-sm rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent shadow-sm disabled:opacity-50 disabled:cursor-not-allowed border placeholder-gray-400 resize-none overflow-hidden ${W?"bg-primary-50 !border-primary-600 text-gray-700":"border-gray-300"} ${E?"p-2.5 pr-10":"p-2.5"}`,rows:W?4:1,required:!0,disabled:i}),E&&s.jsx("button",{type:"button",onClick:ne,className:"absolute top-1/2 right-2 transform -translate-y-1/2 p-1 text-primary-600 hover:text-primary-800 focus:outline-none",title:$?d("common.copied","Copied!"):d("common.copy","Copy"),children:$?s.jsx(Ba,{className:"w-5 h-5 text-green-500"}):s.jsx(Iu,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"short-code-input",className:"block text-sm font-medium text-gray-700 mb-1",children:d("links.shortLinkLabel","Short Link")}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"inline-flex items-center px-3 h-[38px] border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm rounded-l-md",children:"go.socialness.ai/"}),s.jsx("input",{type:"text",id:"short-code-input",value:h,onChange:Y=>{p(Y.target.value),N&&S(null)},placeholder:d("links.shortCodePlaceholder","custom-slug"),className:"flex-1 block w-full px-3 h-[38px] border border-gray-300 focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm placeholder-gray-400 disabled:opacity-50 disabled:cursor-not-allowed",required:!0,disabled:i||l,minLength:3}),s.jsx("button",{type:"button",onClick:X,disabled:i||l,className:"inline-flex items-center px-3 h-[38px] border border-l-0 border-gray-300 bg-gray-50 hover:bg-gray-100 text-gray-700 text-sm rounded-r-md disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:d("links.generateButton","Generate")})]}),!l&&(j||N)&&s.jsxs("div",{className:"text-xs px-1 mt-1",children:[j&&s.jsx("p",{className:"text-gray-500",children:d("links.checkingSlug","Checking availability...")}),N&&!j&&s.jsx("p",{className:`${N.isError||!N.available?"text-red-600":"text-green-600"}`,children:N.message})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"brand-select-modal",className:"block text-sm font-medium text-gray-700 mb-1",children:d("links.brandLabel","Brand")}),s.jsx(hl,{brands:a,selectedBrandId:g,onBrandSelect:ue,isLoading:i,className:"h-[38px]"})]}),s.jsx("div",{className:"border-t border-gray-200 pt-4 mt-4",children:s.jsxs("button",{type:"button",onClick:()=>k(!M),className:"flex items-center justify-between w-full text-sm font-medium text-gray-700 hover:text-primary-600",children:[s.jsx("span",{children:d("links.advancedOptions","Advanced Options")}),M?s.jsx(T7,{size:18}):s.jsx(Vr,{size:18})]})}),M&&s.jsxs("div",{className:"pt-3",children:[s.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:d("links.utmParameters","UTM Parameters:")}),s.jsxs("div",{className:"p-3 border border-gray-300 rounded-md bg-gray-50 space-y-2",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-source",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[d("links.source","Source (utm_source)"),":"]}),s.jsx("input",{type:"text",id:"utm-source",value:I,onChange:Y=>T(Y.target.value),placeholder:"e.g., newsletter, google",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:i})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-medium",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[d("links.medium","Medium (utm_medium)"),":"]}),s.jsx("input",{type:"text",id:"utm-medium",value:L,onChange:Y=>R(Y.target.value),placeholder:"e.g., email, cpc",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:i})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-campaign",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[d("links.campaign","Campaign (utm_campaign)"),":"]}
3917),s.jsx("input",{type:"text",id:"utm-campaign",value:_,onChange:Y=>B(Y.target.value),placeholder:"e.g., summer_sale",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:i})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-term",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[d("links.term","Term (utm_term)"),":"]}),s.jsx("input",{type:"text",id:"utm-term",value:z,onChange:Y=>D(Y.target.value),placeholder:"e.g., running+shoes",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:i})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-content",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[d("links.content","Content (utm_content)"),":"]}),s.jsx("input",{type:"text",id:"utm-content",value:A,onChange:Y=>P(Y.target.value),placeholder:"e.g., logolink, textlink",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:i})]})]})]}),s.jsxs("div",{className:"flex justify-end items-center gap-3 pt-5 border-t border-gray-200 mt-1",children:[s.jsx("button",{type:"button",onClick:r||te,disabled:i,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r?d("common.goBack","Go Back"):d("common.cancel","Cancel")}),s.jsx("button",{type:"submit",disabled:!Q,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 border border-transparent rounded-lg hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center",children:i?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2"}),l?d("common.saving","Saving..."):d("common.creating","Creating...")]}):G})]})]})]})]})})},xb={async getLinks(){var r;const e=await((r=Qe.currentUser)==null?void 0:r.getIdToken());if(!e)throw new Error("No authentication token available");const t=await fetch("https://api.socialness.ai/management/links",{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch links");return t.json()},async createLink(e){var n;const t=await((n=Qe.currentUser)==null?void 0:n.getIdToken());if(!t)throw new Error("No authentication token available");const r=await fetch("https://api.socialness.ai/management/links/create",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const a=await r.text();throw console.error("Create link API error:",a),new Error(`Failed to create link: ${r.status}`)}return r.json()},async deleteLink(e){var n;const t=await((n=Qe.currentUser)==null?void 0:n.getIdToken());if(!t)throw new Error("No authentication token available");const r=await fetch(`https://api.socialness.ai/management/links/${e}`,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok){const a=await r.text();throw console.error("Delete link API error:",a),new Error(`Failed to delete link: ${r.status}`)}return r.json()},async checkSlugAvailability(e,t){const r=await fetch(`https://api.socialness.ai/management/links/check-slug/${e}`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok){const n=await r.json().catch(()=>({message:"Failed to check slug and parse error response."}));throw new Error(n.message||`HTTP error ${r.status}: Failed to check slug availability.`)}return r.json()},async updateLinkStatus(e,t){var a;const r=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`https://api.socialness.ai/management/links/${e}?_method=PATCH`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({status:t})});if(!n.ok){const i=await n.json().catch(()=>({message:`Failed to update link status to ${t} and parse error response.`}));throw new Error(i.message||`HTTP error ${n.status}: Failed to update link status to ${t}.`)}return n.json()},async updateLink(e,t){var a;const r=await((a=Qe.currentUser)==null?void 0:a.getIdToken());if(!r)throw new Error("No authentication token available");const n=await fetch(`https://api.socialness.ai/management/links/${e}?_method=PATCH`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const i=await n.text().catch(()=>"Failed to update link and could not parse error response.");console.error("Update link API error:",i);try{const o=JSON.parse(i);throw new Error(o.message||`Failed to update link: ${n.status}`)}catch{throw new Error(`Failed to update link: ${n.status} - ${i}`)}}return n.json()}},$et=()=>Wa({queryKey:["links"],staleTime:5*60*1e3,gcTime:10*60*1e3,queryFn:xb.getLinks}),pY=()=>{const e=qr();return mn({mutationFn:xb.createLink,onSuccess:()=>
3917{e.invalidateQueries({queryKey:["links"]})}})},Fet=()=>{const e=qr();return mn({mutationFn:xb.deleteLink,onSuccess:()=>{e.invalidateQueries({queryKey:["links"]})}})},zet=()=>{const e=qr();return mn({mutationFn:t=>xb.updateLinkStatus(t.linkId,t.status),onSuccess:(t,r,n)=>{e.invalidateQueries({queryKey:["links"]})},onError:(t,r,n)=>{console.error(`Failed to update link status to ${r.status} for link ${r.linkId}:`,t)}})},Bet=()=>{const e=qr();return mn({mutationFn:({linkId:t,payload:r})=>xb.updateLink(t,r),onSuccess:(t,r,n)=>{e.invalidateQueries({queryKey:["links"]})},onError:(t,r,n)=>{console.error(`Failed to update link ${r.linkId}:`,t)}})},ix=119808,ox=119834,lx=120782;function Uet(e){const t=e.charCodeAt(0);return t>=65&&t<=90?String.fromCodePoint(ix+(t-65)):t>=97&&t<=122?String.fromCodePoint(ox+(t-97)):t>=48&&t<=57?String.fromCodePoint(lx+(t-48)):e}function gY(e){return e>=ix&&e<=ix+25?String.fromCharCode(65+(e-ix)):e>=ox&&e<=ox+25?String.fromCharCode(97+(e-ox)):e>=lx&&e<=lx+9?String.fromCharCode(48+(e-lx)):null}function E$(e){return gY(e.codePointAt(0))!==null}const cx=119860,ux=119886,yY=8462;function Vet(e){const t=e.charCodeAt(0);return t>=65&&t<=90?String.fromCodePoint(cx+(t-65)):t>=97&&t<=122?t===104?String.fromCodePoint(yY):String.fromCodePoint(ux+(t-97)):e}function bY(e){return e>=cx&&e<=cx+25?String.fromCharCode(65+(e-cx)):e===yY?"h":e>=ux&&e<=ux+25?String.fromCharCode(97+(e-ux)):null}function T$(e){return bY(e.codePointAt(0))!==null}const Yj="̲";function Wet(e){return/\s/.test(e)?e:e+Yj}function vY(e){return/[\s\p{P}\p{S}]/u.test(e)}function by(e){return[...e.replace(new RegExp(Yj,"g"),"")].map(r=>{const n=r.codePointAt(0);return gY(n)??bY(n)??r}).join("")}function qet(e){return[...e].map(Uet).join("")}function Get(e){return[...e].map(Vet).join("")}function Het(e){return[...e].map(Wet).join("")}function Yet(e){return e.replace(new RegExp(Yj,"g"),"")}function Qet(e){const t=[...e];return t.length>0&&t.every(n=>vY(n)||E$(n))&&t.some(E$)?by(e):qet(by(e))}function Ket(e){const t=[...e];return t.length>0&&t.every(n=>vY(n)||T$(n))&&t.some(T$)?by(e):Get(by(e))}function Jet(e){if(e.includes(Yj))return Yet(e);const r=by(e);return Het(r)}function E4(e){return[].concat(e)}function pA(e){return e.startsWith(":")}function xY(e){return Qj(e)&&(e==="*"||e.length>1&&":>~.+*".includes(e.slice(0,1))||SY(e))}function wY(e,t){return(Qj(t)||typeof t=="number")&&!NY(e)&&!pA(e)&&!jY(e)}function jY(e){return e.startsWith("@media")}function Zet(e){return e==="."}function NY(e){return e==="--"}function Qj(e){return e+""===e}function SY(e){return Qj(e)&&(e.startsWith("&")||pA(e))}function jw(e,t=""){return e.filter(Boolean).join(t)}function CY(e,t){let r=0;if(t.length===0)return r.toString();for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);r=(r<<5)-r+a,r=r&r}return`${e??"cl"}_${r.toString(36)}`}function Xet(e,t){return e==="content"?`"${t}"`:t}function ett(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function A$(e,t){return`${e}:${t}`}function ttt(e){return e?`.${e}`:""}function rtt(e,t){return e?`${e}
3918${t}`:t}var kY=class MY{constructor(t,r,n,a){this.sheet=t,this.property=r,this.value=n,this.selector=a,this.property=r,this.value=n,this.joined=A$(r,n);const i=this.selector.preconditions.concat(this.selector.postconditions);this.hash=this.selector.hasConditions?this.selector.scopeClassName:CY(this.sheet.name,this.joined),this.key=jw([this.joined,i,this.hash])}toString(){let t=T4(this.selector.preconditions,{right:this.hash});return t=T4(this.selector.postconditions,{left:t}),`${t} {${MY.genRule(this.property,this.value)}}`}static genRule(t,r){const n=ett(t);return A$(n,Xet(t,r))+";"}};function T4(e,{left:t="",right:r=""}={}){const n=e.reduce((a,i)=>pA(i)?a+i:SY(i)?a+i.slice(1):jw([a,i]," "),t);return jw([n,ttt(r)]," ")}var ntt=class dx{constructor(t,r=null,{preconditions:n,postconditions:a}={}){this.sheet=t,this.preconditions=[],this.scopeClassName=null,this.scopeName=null,this.postconditions=[],this.preconditions=n?E4(n):[],this.postconditions=a?E4(a):[],this.setScope(r)}setScope(t){return t?(this.scopeClassName||(this.scopeName=t,this.scopeClassName=CY(this.sheet.name,t+this.sheet.count)),this):this}
vendor: 4,642 bytes, lines 3918-3919
3918get hasConditions(){return this.preconditions.length>0||this.postconditions.length>0}addScope(t){return new dx(this.sheet,t,{preconditions:this.preconditions,postconditions:this.postconditions})}addPrecondition(t){return new dx(this.sheet,this.scopeClassName,{postconditions:this.postconditions,preconditions:this.preconditions.concat(t)})}addPostcondition(t){return new dx(this.sheet,this.scopeClassName,{preconditions:this.preconditions,postconditions:this.postconditions.concat(t)})}createRule(t,r){return new kY(this.sheet,t,r,this)}},att=class{constructor(e,t){this.name=e,this.rootNode=t,this.storedStyles={},this.storedClasses={},this.style="",this.count=0,this.id=`flairup-${e}`,this.styleTag=this.createStyleTag()}getStyle(){return this.style}append(e){this.style=rtt(this.style,e)}apply(){this.count++,this.styleTag&&(this.styleTag.innerHTML=this.style)}isApplied(){return!!this.styleTag}createStyleTag(){if(typeof document>"u"||this.isApplied()||this.rootNode===null)return this.styleTag;const e=document.createElement("style");return e.type="text/css",e.id=this.id,(this.rootNode??document.head).appendChild(e),e}addRule(e){const t=this.storedClasses[e.key];return Qj(t)?t:(this.storedClasses[e.key]=e.hash,this.storedStyles[e.hash]=[e.property,e.value],this.append(e.toString()),e.hash)}};function gA(e,t){for(const r in e)t(r.trim(),e[r])}function Lr(...e){const t=e.reduce((r,n)=>(n instanceof Set?r.push(...n):typeof n=="string"?r.push(n):Array.isArray(n)?r.push(Lr(...n)):typeof n=="object"&&Object.entries(n).forEach(([a,i])=>{i&&r.push(a)}),r),[]);return jw(t," ").trim()}function stt(e,t){const r=new att(e,t);return{create:n,getStyle:r.getStyle.bind(r),isApplied:r.isApplied.bind(r)};function n(a){const i={};return IY(r,a,new ntt(r)).forEach(([l,c,u])=>{Kj(r,c,u).forEach(d=>{o(l,d)})}),r.apply(),i;function o(l,c){i[l]=i[l]??new Set,i[l].add(c)}}}function IY(e,t,r){const n=[];return gA(t,(a,i)=>{if(xY(a))return IY(e,i,r.addPrecondition(a)).forEach(o=>n.push(o));n.push([a,t[a],r.addScope(a)])}),n}function Kj(e,t,r){const n=new Set;return gA(t,(a,i)=>{let o=[];if(xY(a))o=Kj(e,i,r.addPostcondition(a));else if(Zet(a))o=E4(i);else if(jY(a))o=ott(e,i,a,r);else if(NY(a))o=itt(e,i,r);else if(wY(a,i)){const l=r.createRule(a,i);e.addRule(l),n.add(l.hash)}return EY(o,n)}),n}function EY(e,t){return e.forEach(r=>t.add(r)),t}function itt(e,t,r){const n=new Set,a=[];if(gA(t,(i,o)=>{if(wY(i,o)){a.push(kY.genRule(i,o));return}const l=Kj(e,o??{},r);EY(l,n)}),!r.scopeClassName)return n;if(a.length){const i=a.join(" ");e.append(`${T4(r.preconditions,{right:r.scopeClassName})} {${i}}`)}return n.add(r.scopeClassName),n}function ott(e,t,r,n){e.append(r+" {");const a=Kj(e,t,n);return e.append("}"),a}function P$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ltt(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=utt(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3919In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mn.apply(null,arguments)}function ctt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A4(e,t)}function TY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function A4(e,t){return A4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},A4(e,t)}function utt(e,t){if(e){if(typeof e=="string")return P$(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P$(e,t):void 0}}var Wr;(function(e){e.hiddenOnSearch="epr-hidden-on-search",e.searchActive="epr-search-active",e.hidden="epr-hidden",e.visible="epr-visible",e.active="epr-active",e.emoji="epr-emoji",e.category="epr-emoji-category",e.label="epr-emoji-category-label",e.categoryContent="epr-emoji-category-content",e.emojiHasVariations="epr-emoji-has-variations",e.scrollBody="epr-body",e.emojiList="epr-emoji-list",e.external="__EmojiPicker__",e.emojiPicker="EmojiPickerReact",e.open="epr-open",e.vertical="epr-vertical",e.horizontal="epr-horizontal",e.variationPicker="epr-emoji-variation-
3919picker",e.darkTheme="epr-dark-theme",e.autoTheme="epr-auto-theme"})(Wr||(Wr={}));function Ui(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.map(function(n){return"."+n}).join("")}var Qn=stt("epr",null),fx={display:"none",opacity:"0",pointerEvents:"none",visibility:"hidden",overflow:"hidden"},yA=Qn.create({hidden:Mn({".":Wr.hidden},fx)}),dtt=b.memo(function(){return b.createElement("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:Qn.getStyle()}})}),Tf=Qn.create({".epr-main":{":has(input:not(:placeholder-shown))":{categoryBtn:{":hover":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"}},hiddenOnSearch:Mn({".":Wr.hiddenOnSearch},fx)},":has(input:placeholder-shown)":{visibleOnSearchOnly:fx}},hiddenOnReactions:{transition:"all 0.5s ease-in-out"},".epr-reactions":{hiddenOnReactions:{height:"0px",width:"0px",opacity:"0",pointerEvents:"none",overflow:"hidden"}},".EmojiPickerReact:not(.epr-search-active)":{categoryBtn:{":hover":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"},"&.epr-active":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"}},visibleOnSearchOnly:Mn({".":"epr-visible-on-search-only"},fx)}});function Ou(e,t){var r,n;return{".epr-dark-theme":(r={},r[e]=t,r),".epr-auto-theme":(n={},n[e]={"@media (prefers-color-scheme: dark)":t},n)}}function AY(e,t){var r,n,a=(r=e.customEmojis)!=null?r:[],i=(n=t.customEmojis)!=null?n:[];return e.open===t.open&&e.emojiVersion===t.emojiVersion&&e.reactionsDefaultOpen===t.reactionsDefaultOpen&&e.searchPlaceHolder===t.searchPlaceHolder&&e.searchPlaceholder===t.searchPlaceholder&&e.searchClearButtonLabel===t.searchClearButtonLabel&&e.defaultSkinTone===t.defaultSkinTone&&e.skinTonesDisabled===t.skinTonesDisabled&&e.autoFocusSearch===t.autoF
vendor: 7,199 bytes, line 3919
3919ocusSearch&&e.emojiStyle===t.emojiStyle&&e.theme===t.theme&&e.suggestedEmojisMode===t.suggestedEmojisMode&&e.lazyLoadEmojis===t.lazyLoadEmojis&&e.className===t.className&&e.height===t.height&&e.width===t.width&&e.style===t.style&&e.searchDisabled===t.searchDisabled&&e.skinTonePickerLocation===t.skinTonePickerLocation&&a.length===i.length&&e.emojiData===t.emojiData}var ftt=["1f44d","2764-fe0f","1f603","1f622","1f64f","1f44e","1f621"],vy;(function(e){e.RECENT="recent",e.FREQUENT="frequent"})(vy||(vy={}));var ti;(function(e){e.NATIVE="native",e.APPLE="apple",e.TWITTER="twitter",e.GOOGLE="google",e.FACEBOOK="facebook"})(ti||(ti={}));var Bh;(function(e){e.DARK="dark",e.LIGHT="light",e.AUTO="auto"})(Bh||(Bh={}));var ao;(function(e){e.NEUTRAL="neutral",e.LIGHT="1f3fb",e.MEDIUM_LIGHT="1f3fc",e.MEDIUM="1f3fd",e.MEDIUM_DARK="1f3fe",e.DARK="1f3ff"})(ao||(ao={}));var xr;(function(e){e.SUGGESTED="suggested",e.CUSTOM="custom",e.SMILEYS_PEOPLE="smileys_people",e.ANIMALS_NATURE="animals_nature",e.FOOD_DRINK="food_drink",e.TRAVEL_PLACES="travel_places",e.ACTIVITIES="activities",e.OBJECTS="objects",e.SYMBOLS="symbols",e.FLAGS="flags"})(xr||(xr={}));var Uh;(function(e){e.SEARCH="SEARCH",e.PREVIEW="PREVIEW"})(Uh||(Uh={}));var mtt="https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/",htt="https://cdn.jsdelivr.net/npm/emoji-datasource-facebook/img/facebook/64/",ptt="https://cdn.jsdelivr.net/npm/emoji-datasource-twitter/img/twitter/64/",gtt="https://cdn.jsdelivr.net/npm/emoji-datasource-google/img/google/64/";function ytt(e){switch(e){case ti.TWITTER:return ptt;case ti.GOOGLE:return gtt;case ti.FACEBOOK:return htt;case ti.APPLE:default:return mtt}}var Nw=[ao.NEUTRAL,ao.LIGHT,ao.MEDIUM_LIGHT,ao.MEDIUM,ao.MEDIUM_DARK,ao.DARK],btt=Object.entries(ao).reduce(function(e,t){var r=t[0],n=t[1];return e[n]=r,e},{}),bA=Nw.reduce(function(e,t){var r;return Object.assign(e,(r={},r[t]=t,r))},{}),$a;(function(e){e.name="n",e.unified="u",e.variations="v",e.added_in="a",e.imgUrl="imgUrl"})($a||($a={}));function PY(e){var t;return(t=e[$a.name])!=null?t:[]}function vtt(e){return parseFloat(e[$a.added_in]||"0")}function xtt(e){if(!e)return"";var t=PY(e);return t[t.length-1]}function _Y(e){var t=e.split("-"),r=t.splice(1,1),n=r[0];return bA[n]?t.join("-"):e}function Af(e,t){var r,n=e[$a.unified];return!t||!wtt(e)?n:(r=jtt(e,t))!=null?r:n}function LY(e,t){return""+ytt(t)+e+".png"}function vA(e){var t;return(t=e[$a.variations])!=null?t:[]}function wtt(e){return vA(e).length>0}function jtt(e,t){return t?vA(e).find(function(r){return r.includes(t)}):Af(e)}function Ntt(e){var t=e.split("-"),r=t[1];return Object.keys(bA).includes(r)?r:null}var vi,Stt=[xr.SUGGESTED,xr.CUSTOM,xr.SMILEYS_PEOPLE,xr.ANIMALS_NATURE,xr.FOOD_DRINK,xr.TRAVEL_PLACES,xr.ACTIVITIES,xr.OBJECTS,xr.SYMBOLS,xr.FLAGS],Ctt={name:"Recently Used",category:xr.SUGGESTED},DY=(vi={},vi[xr.SUGGESTED]={category:xr.SUGGESTED,name:"Frequently Used"},vi[xr.CUSTOM]={category:xr.CUSTOM,name:"Custom Emojis"},vi[xr.SMILEYS_PEOPLE]={category:xr.SMILEYS_PEOPLE,name:"Smileys & People"},vi[xr.ANIMALS_NATURE]={category:xr.ANIMALS_NATURE,name:"Animals & Nature"},vi[xr.FOOD_DRINK]={category:xr.FOOD_DRINK,name:"Food & Drink"},vi[xr.TRAVEL_PLACES]={category:xr.TRAVEL_PLACES,name:"Travel & Places"},vi[xr.ACTIVITIES]={category:xr.ACTIVITIES,name:"Activities"},vi[xr.OBJECTS]={category:xr.OBJECTS,name:"Objects"},vi[xr.SYMBOLS]={category:xr.SYMBOLS,name:"Symbols"},vi[xr.FLAGS]={category:xr.FLAGS,name:"Flags"},vi);function OY(e){return Stt.map(function(t){return Mn({},DY[t],e&&e[t]&&e[t])})}function Jj(e){return e.category}function RY(e){return e.name}function ktt(e,t,r){var n;e===void 0&&(e=[]),t===void 0&&(t={});var a=function(){var o=r!=null&&r.categories?Object.fromEntries(Object.entries(r.categories).filter(function(u){var d=u[1];return!!d})):{};if(t.suggestionMode===vy.RECENT){var l,c=r==null||(l=r.categories)==null?void 0:l.suggested_recent;o[xr.SUGGESTED]=c?{category:xr.SUGGESTED,name:c.name}:Ctt}return o}(),i=OY(a);return(n=e)!=null&&n.length?e.map(function(o){return typeof o=="string"?_$(o,a[o]):Mn({},_$(o.category,a[o.category]),o)}):i}function _$(e,t){return t===void 0&&(t={}),Object.assign(DY[e],t)}var Mtt=["2640-fe0f","2642-fe0f","2695-fe0f"],Sw="Search",$Y="Clear",Itt="No results found",FY=" found. Use up and down arrow keys to navigate.",Ett="1 result"+FY,Ttt="%n results"+FY;function L$(e){var t,r,n,a,i;e===void 0&&(e={});var o=zY(),l=(t=e.emojiData)==null||(r=t.categories)==null||(n=r.preview_mood)==null?void 0:n.name,c=Mn({},o.previewConfig,l&&!((a=e.previewConfig)!=null&&a.defaultCaption)?{defaultCaption:l}:{},(i=e.previewConfig)!=null?i:{}),u=Object.assign(o,e),d=ktt(e.categories,{suggestionMode:u.suggestedEmojisMode},e.emojiData);u.hiddenEmojis.forEach(function(m){u.unicodeToHide.add(m)});var f=u.searchDisabled?Uh.PREVIEW:u.skinTonePickerLocation;return Mn({},u,{categories:d,previewConfig:c,skinTonePickerLocation:f})}function zY(){return{autoFocusSearch:!0,categories:OY(),className:"",customEmojis:[],defaultSkinTone:ao.NEUTRAL,emojiStyle:ti.APPLE,emojiVersion:null,getEmojiUrl:LY,height:450,lazyLoadEmojis:!1,previewConfig:Mn({},Att),searchDisabled:!1,searchPlaceHolder:Sw,searchPlaceholder:Sw,searchClearButtonLabel:$Y,skinTonePickerLocation:Uh.SEARCH,skinTonesDisabled:!1,style:{},suggestedEmojisMode:vy.FREQUENT,theme:Bh.LIGHT,unicodeToHide:new Set(Mtt),width:350,reactionsDefaultOpen:!1,reactions:ftt,open:!0,allowExpandReactions:!0,hiddenEmojis:[],emojiData:void 0,categoryIcons:{}}}var Att={defaultEmoji:"1f60a",defaultCaption:"What's your mood?",showPreview:!0},Ptt=["children"],BY=b.createContext(zY());function _tt(e){var t=e.children,r=TY(e,Ptt),n=Ltt(r);return b.createElement(BY.Provider,{value:n},t)}function Ltt(e){var t,r=b.useState(function(){return L$(e)}),n=r[0],a=r[1];return b.useEffect(function(){AY(n,e)||a(L$(e))},[(t=e.customEmojis)==null?void 0:t.length,e.open,e.emojiVersion,e.reactionsDefaultOpen,e.searchPlaceHolder,e.searchPlaceholder,e.searchClearButtonLabel,e.defaultSkinTone,e.skinTonesDisabled,e.autoFocusSearch,e.emojiStyle,e.theme,e.suggestedEmojisMode,e.lazyLoadEmojis,e.className,e.height,e.width,e.searchDisabled,e.skinTonePickerLocation,e.allowExpandReactions,e.emojiData]),n}function Wn(){return b.useContext(BY)}function D$(e,t){t===void 0&&(t=0);var r=b.useState(e),n=r[0],a=r[1],i=b.useRef(null);function o(l){return new Promise(function(c){var u;i.current&&clearTimeout(i.current),i.current=(u=window)==null?void 0:u.setTimeout(function(){a(l),c(l)},t)})}return[n,o]}var Dtt={smileys_people:{category:"smileys_people",name:"people & body"},animals_nature:{category:"animals_nature",name:"animals & nature"},food_drink:{category:"food_drink",name:"food & drink"},travel_places:{category:"travel_places",name:"travel & places"},activities:{category:"activities",name:"activities"},objects:{category:"objects",name:"objects"},symbols:{category:"symbols",name:"symbols"},flags:{category:"flags",name:"flags"},suggested:{category:"suggested",name:"Frequently Used"},custom:{category:"custom",name:"Custom Emojis"},suggested_recent:{category:"suggested",name:"Recently Used"},preview_mood:{category:"preview_mood",name:"What's your mood?"}},Ott=
vendor: 184,245 bytes, line 3919
3919{custom:[],smileys_people:[{n:["face","grin","grinning face"],u:"1f600",a:"1"},{n:["face","open","mouth","smile","grinning face with big eyes"],u:"1f603",a:"0.6"},{n:["eye","face","open","mouth","smile","grinning face with smiling eyes"],u:"1f604",a:"0.6"},{n:["eye","face","grin","smile","beaming face with smiling eyes"],u:"1f601",a:"0.6"},{n:["face","laugh","mouth","smile","satisfied","grinning squinting face"],u:"1f606",a:"0.6"},{n:["cold","face","open","smile","sweat","grinning face with sweat"],u:"1f605",a:"0.6"},{n:["face","rofl","floor","laugh","rotfl","rolling","rolling on the floor laughing"],u:"1f923",a:"3"},{n:["joy","face","tear","laugh","face with tears of joy"],u:"1f602",a:"0.6"},{n:["face","smile","slightly smiling face"],u:"1f642",a:"1"},{n:["face","upside down","upside down face"],u:"1f643",a:"1"},{n:["melt","liquid","dissolve","disappear","melting face"],u:"1fae0",a:"14"},{n:["face","wink","winking face"],u:"1f609",a:"0.6"},{n:["eye","face","blush","smile","smiling face with smiling eyes"],u:"1f60a",a:"0.6"},{n:["face","halo","angel","fantasy","innocent","smiling face with halo"],u:"1f607",a:"1"},{n:["adore","crush","hearts","in love","smiling face with hearts"],u:"1f970",a:"11"},{n:["eye","face","love","smile","smiling face with heart eyes"],u:"1f60d",a:"0.6"},{n:["eyes","face","star","grinning","star struck"],u:"1f929",a:"5"},{n:["face","kiss","face blowing a kiss"],u:"1f618",a:"0.6"},{n:["face","kiss","kissing face"],u:"1f617",a:"1"},{n:["face","smile","relaxed","outlined","smiling face"],u:"263a-fe0f",a:"0.6"},{n:["eye","face","kiss","closed","kissing face with closed eyes"],u:"1f61a",a:"0.6"},{n:["eye","face","kiss","smile","kissing face with smiling eyes"],u:"1f619",a:"1"},{n:["tear","proud","smiling","touched","grateful","relieved","smiling face with tear"],u:"1f972",a:"13"},{n:["yum","face","smile","delicious","savouring","face savoring food"],u:"1f60b",a:"0.6"},{n:["face","tongue","face with tongue"],u:"1f61b",a:"1"},{n:["eye","face","joke","wink","tongue","winking face with tongue"],u:"1f61c",a:"0.6"},{n:["eye","goofy","large","small","zany face"],u:"1f92a",a:"5"},{n:["eye","face","taste","tongue","horrible","squinting face with tongue"],u:"1f61d",a:"0.6"},{n:["face","money","mouth","money mouth face"],u:"1f911",a:"1"},{n:["hug","face","hugging","open hands","smiling face","smiling face with open hands"],u:"1f917",a:"1"},{n:["whoops","face with hand over mouth"],u:"1f92d",a:"5"},{n:["awe","scared","surprise","amazement","disbelief","embarrass","face with open eyes and hand over mouth"],u:"1fae2",a:"14"},{n:["peep","stare","captivated","face with peeking eye"],u:"1fae3",a:"14"},{n:["quiet","shush","shushing face"],u:"1f92b",a:"5"},{n:["face","thinking","thinking face"],u:"1f914",a:"1"},{n:["ok","yes","sunny","salute","troops","saluting face"],u:"1fae1",a:"14"},{n:["zip","face","mouth","zipper","zipper mouth face"],u:"1f910",a:"1"},{n:["skeptic","distrust","face with raised eyebrow"],u:"1f928",a:"5"},{n:["meh","face","deadpan","neutral","neutral face"],u:"1f610",a:"0.7"},{n:["meh","face","inexpressive","unexpressive","expressionless","expressionless face"],u:"1f611",a:"1"},{n:["face","mouth","quiet","silent","face without mouth"],u:"1f636",a:"1"},{n:["hide","depressed","disappear","introvert","invisible","dotted line face"],u:"1fae5",a:"14"},{n:["absentminded","face in clouds","head in clouds","face in the fog"],u:"1f636-200d-1f32b-fe0f",a:"13.1"},{n:["face","smirk","smirking face"],u:"1f60f",a:"0.6"},{n:["face","unhappy","unamused","unamused face"],u:"1f612",a:"0.6"},{n:["eyes","face","eyeroll","rolling","face with rolling eyes"],u:"1f644",a:"1"},{n:["face","grimace","grimacing face"],u:"1f62c",a:"1"},{n:["gasp","groan","exhale","relief","whisper","whistle","face exhaling"],u:"1f62e-200d-1f4a8",a:"13.1"},{n:["lie","face","pinocchio","lying face"],u:"1f925",a:"3"},{n:["face","shock","shaking","vibrate","earthquake","shaking face"],u:"1fae8",a:"15"},{n:["no","shake","head shaking horizontally"],u:"1f642-200d-2194-fe0f",a:"15.1"},{n:["nod","yes","head shaking vertically"],u:"1f642-200d-2195-fe0f",a:"15.1"},{n:["face","relieved","relieved face"],u:"1f60c",a:"0.6"},{n:["face","pensive","dejected","pensive face"],u:"1f614",a:"0.6"},{n:["face","sleep","good night","sleepy face"],u:"1f62a",a:"0.6"},{n:["face","drooling","drooling face"],u:"1f924",a:"3"},{n:["zzz","face","sleep","good night","sleeping face"],u:"1f634",a:"1"},{n:["cold","face","mask","sick","doctor","face with medical mask"],u:"1f637",a:"0.6"},{n:["ill","face","sick","thermometer","face with thermometer"],u:"1f912",a:"1"},{n:["face","hurt","injury","bandage","face with head bandage"],u:"1f915",a:"1"},{n:["face","vomit","nauseated","nauseated face"],u:"1f922",a:"3"},{n:["puke","sick","vomit","face vomiting"],u:"1f92e",a:"5"},{n:["face","sneeze","gesundheit","sneezing face"],u:"1f927",a:"3"},{n:["hot","hot face","feverish","sweating","red faced","heat stroke"],u:"1f975",a:"11"},{n:["cold","icicles","freezing","cold face","frostbite","blue faced"],u:"1f976",a:"11"},{n:["dizzy","tipsy","woozy face","wavy mouth","intoxicated","uneven eyes"],u:"1f974",a:"11"},{n:["dead","face","knocked out","crossed out eyes","face with crossed out eyes"],u:"1f635",a:"0.6"},{n:["whoa","dizzy","spiral","trouble","hypnotized","face with spiral eyes"],u:"1f635-200d-1f4ab",a:"13.1"},{n:["shocked","mind blown","exploding head"],u:"1f92f",a:"5"},{n:["hat","face","cowboy","cowgirl","cowboy hat face"],u:"1f920",a:"3"},{n:["hat","horn","party","celebration","partying face"],u:"1f973",a:"11"},{n:["face","nose","glasses","disguise","incognito","disguised face"],u:"1f978",a:"13"},{n:["sun","cool","face","bright","sunglasses","smiling face with sunglasses"],u:"1f60e",a:"1"},{n:["face","geek","nerd","nerd face"],u:"1f913",a:"1"},{n:["face","stuffy","monocle","face with monocle"],u:"1f9d0",a:"5"},{n:["meh","face","confused","confused face"],u:"1f615",a:"1"},{n:["meh","unsure","skeptical","disappointed","face with diagonal mouth"],u:"1fae4",a:"14"},{n:["face","worried","worried face"],u:"1f61f",a:"1"},{n:["face","frown","slightly frowning face"],u:"1f641",a:"1"},{n:["face","frown","frowning face"],u:"2639-fe0f",a:"0.7"},{n:["face","open","mouth","sympathy","face with open mouth"],u:"1f62e",a:"1"},{n:["face","hushed","stunned","surprised","hushed face"],u:"1f62f",a:"1"},{n:["face","shocked","totally","astonished","astonished face"],u:"1f632",a:"0.6"},{n:["face","dazed","flushed","flushed face"],u:"1f633",a:"0.6"},{n:["mercy","begging","puppy eyes","pleading face"],u:"1f97a",a:"11"},{n:["cry","sad","angry","proud","resist","face holding back tears"],u:"1f979",a:"14"},{n:["face","open","frown","mouth","frowning face with open mouth"],u:"1f626",a:"1"},{n:["face","anguished","anguished face"],u:"1f627",a:"1"},{n:["face","fear","scared","fearful","fearful face"],u:"1f628",a:"0.6"},{n:["blue","cold","face","sweat","rushed","anxious face with sweat"],u:"1f630",a:"0.6"},{n:["face","whew","relieved","disappointed","sad but relieved face"],u:"1f625",a:"0.6"},{n:["cry","sad","face","tear","crying face"],u:"1f622",a:"0.6"},{n:["cry","sad","sob","face","tear","loudly crying face"],u:"1f62d",a:"0.6"},{n:["face","fear","munch","scared","scream","face screaming in fear"],u:"1f631",a:"0.6"},{n:["face","confounded","confounded face"],u:"1f616",a:"0.6"},{n:["face","persevere","persevering face"],u:"1f623",a:"0.6"},{n:["face","disappointed","disappointed face"],u:"1f61e",a:"0.6"},{n:["cold","face","sweat","downcast face with sweat"],u:"1f613",a:"0.6"},{n:["face","tired","weary","weary face"],u:"1f629",a:"0.6"},{n:["face","tired","tired face"],u:"1f62b",a:"0.6"},{n:["yawn","bored","tired","yawning face"],u:"1f971",a:"12"},{n:["won","face","triumph","face with steam from nose"],u:"1f624",a:"0.6"},{n:["mad","red","face","rage","angry","enraged","pouting","enraged face"],u:"1f621",a:"0.6"},{n:["mad","face","anger","angry","angry face"],u:"1f620",a:"0.6"},{n:["swearing","face with symbols on mouth"],u:"1f92c",a:"5"},{n:["face","horns","smile","fantasy","fairy tale","smiling face with horns"],u:"1f608",a:"1"},{n:["imp","face","demon","devil","fantasy","angry face with horns"],u:"1f47f",a:"0.6"},{n:["face","skull","death","monster","fairy tale"],u:"1f480",a:"0.6"},{n:["face","death","skull","monster","crossbones","skull and crossbones"],u:"2620-fe0f",a:"1"},{n:["poo","dung","face","poop","monster","pile of poo"],u:"1f4a9",a:"0.6"},{n:["face","clown","clown face"],u:"1f921",a:"3"},{n:["ogre","face","fantasy","monster","creature","fairy tale"],u:"1f479",a:"0.6"},{n:["face","goblin","fantasy","monster","creature","fairy tale"],u:"1f47a",a:"0.6"},{n:["face","ghost","fantasy","monster","creature","fairy tale"],u:"1f47b",a:"0.6"},{n:["ufo","face","alien","fantasy","creature","extraterrestrial"],u:"1f47d",a:"0.6"},{n:["ufo","face","alien","monster","creature","alien monster","extraterrestrial"],u:"1f47e",a:"0.6"},{n:["face","robot","monster"],u:"1f916",a:"1"},{n:["cat","face","open","mouth","smile","grinning","grinning cat"],u:"1f63a",a:"0.6"},{n:["cat","eye","face","grin","smile","grinning cat with smiling eyes"],u:"1f638",a:"0.6"},{n:["cat","joy","face","tear","cat with tears of joy"],u:"1f639",a:"0.6"},{n:["cat","eye","face","love","heart","smile","smiling cat with heart eyes"],u:"1f63b",a:"0.6"},{n:["cat","wry","face","smile","ironic","cat with wry smile"],u:"1f63c",a:"0.6"},{n:["cat","eye","face","kiss","kissing cat"],u:"1f63d",a:"0.6"},{n:["oh","cat","face","weary","weary cat","surprised"],u:"1f640",a:"0.6"},{n:["cat","cry","sad","face","tear","crying cat"],u:"1f63f",a:"0.6"},{n:["cat","face","pouting","pouting cat"],u:"1f63e",a:"0.6"},{n:["see","evil","face","monkey","forbidden","see no evil monkey"],u:"1f648",a:"0.6"},{n:["evil","face","hear","monkey","forbidden","hear no evil monkey"],u:"1f649",a:"0.6"},{n:["evil","face","speak","monkey","forbidden","speak no evil monkey"],u:"1f64a",a:"0.6"},{n:["love","mail","heart","letter","love letter"],u:"1f48c",a:"0.6"},{n:["arrow","cupid","heart with arrow"],u:"1f498",a:"0.6"},{n:["ribbon","valentine","heart with ribbon"],u:"1f49d",a:"0.6"},{n:["excited","sparkle","sparkling heart"],u:"1f496",a:"0.6"},{n:["pulse","excited","growing","nervous","growing heart"],u:"1f497",a:"0.6"},{n:["beating","heartbeat","pulsating","beating heart"],u:"1f493",a:"0.6"},{n:["revolving","revolving hearts"],u:"1f49e",a:"0.6"},{n:["love","two hearts"],u:"1f495",a:"0.6"},{n:["heart","heart decoration"],u:"1f49f",a:"0.6"},{n:["mark","exclamation","punctuation","heart exclamation"],u:"2763-fe0f",a:"1"},{n:["break","broken","broken heart"],u:"1f494",a:"0.6"},{n:["burn","love","lust","heart","sacred heart","heart on fire"],u:"2764-fe0f-200d-1f525",a:"13.1"},{n:["well","mending","healthier","improving","recovering","recuperating","mending heart"],u:"2764-fe0f-200d-1fa79",a:"13.1"},{n:["heart","red heart"],u:"2764-fe0f",a:"0.6"},{n:["cute","like","love","pink","heart","pink heart"],u:"1fa77",a:"15"},{n:["orange","orange heart"],u:"1f9e1",a:"5"},{n:["yellow","yellow heart"],u:"1f49b",a:"0.6"},{n:["green","green heart"],u:"1f49a",a:"0.6"},{n:["blue","blue heart"],u:"1f499",a:"0.6"},{n:["cyan","teal","heart","light blue","light blue heart"],u:"1fa75",a:"15"},{n:["purple","purple heart"],u:"1f49c",a:"0.6"},{n:["brown","heart","brown heart"],u:"1f90e",a:"12"},{n:["evil","black","wicked","black heart"],u:"1f5a4",a:"3"},{n:["gray","heart","slate","silver","grey heart"],u:"1fa76",a:"15"},{n:["heart","white","white heart"],u:"1f90d",a:"12"},{n:["kiss","lips","kiss mark"],u:"1f48b",a:"0.6"},{n:["100","full","score","hundred","hundred points"],u:"1f4af",a:"0.6"},{n:["mad","angry","comic","anger symbol"],u:"1f4a2",a:"0.6"},{n:["boom","comic","collision"],u:"1f4a5",a:"0.6"},{n:["star","dizzy","comic"],u:"1f4ab",a:"0.6"},{n:["comic","sweat","splashing","sweat droplets"],u:"1f4a6",a:"0.6"},{n:["dash","comic","running","dashing away"],u:"1f4a8",a:"0.6"},{n:["hole"],u:"1f573-fe0f",a:"0.7"},{n:["comic","bubble","dialog","speech","balloon","speech balloon"],u:"1f4ac",a:"0.6"},{n:["eye","bubble","speech","balloon","witness","eye in speech bubble"],u:"1f441-fe0f-200d-1f5e8-fe0f",a:"2"},{n:["bubble","dialog","speech","balloon","left speech bubble"],u:"1f5e8-fe0f",a:"2"},{n:["mad","angry","bubble","balloon","right anger bubble"],u:"1f5ef-fe0f",a:"0.7"},{n:["comic","bubble","balloon","thought","thought balloon"],u:"1f4ad",a:"1"},{n:["ZZZ","zzz","comic","sleep","good night"],u:"1f4a4",a:"0.6"},{n:["hand","wave","waving","waving hand"],u:"1f44b",v:["1f44b-1f3fb","1f44b-1f3fc","1f44b-1f3fd","1f44b-1f3fe","1f44b-1f3ff"],a:"0.6"},{n:["raised","backhand","raised back of hand"],u:"1f91a",v:["1f91a-1f3fb","1f91a-1f3fc","1f91a-1f3fd","1f91a-1f3fe","1f91a-1f3ff"],a:"3"},{n:["hand","finger","splayed","hand with fingers splayed"],u:"1f590-fe0f",v:["1f590-1f3fb","1f590-1f3fc","1f590-1f3fd","1f590-1f3fe","1f590-1f3ff"],a:"0.7"},{n:["hand","high 5","high five","raised hand"],u:"270b",v:["270b-1f3fb","270b-1f3fc","270b-1f3fd","270b-1f3fe","270b-1f3ff"],a:"0.6"},{n:["hand","spock","finger","vulcan","vulcan salute"],u:"1f596",v:["1f596-1f3fb","1f596-1f3fc","1f596-1f3fd","1f596-1f3fe","1f596-1f3ff"],a:"1"},{n:["hand","right","rightward","rightwards hand"],u:"1faf1",v:["1faf1-1f3fb","1faf1-1f3fc","1faf1-1f3fd","1faf1-1f3fe","1faf1-1f3ff"],a:"14"},{n:["hand","left","leftward","leftwards hand"],u:"1faf2",v:["1faf2-1f3fb","1faf2-1f3fc","1faf2-1f3fd","1faf2-1f3fe","1faf2-1f3ff"],a:"14"},{n:["drop","shoo","dismiss","palm down hand"],u:"1faf3",v:["1faf3-1f3fb","1faf3-1f3fc","1faf3-1f3fd","1faf3-1f3fe","1faf3-1f3ff"],a:"14"},{n:["come","catch","offer","beckon","palm up hand"],u:"1faf4",v:["1faf4-1f3fb","1faf4-1f3fc","1faf4-1f3fd","1faf4-1f3fe","1faf4-1f3ff"],a:"14"},{n:["push","stop","wait","refuse","leftward","high five","leftwards pushing hand"],u:"1faf7",v:["1faf7-1f3fb","1faf7-1f3fc","1faf7-1f3fd","1faf7-1f3fe","1faf7-1f3ff"],a:"15"},{n:["push","stop","wait","refuse","high five","rightward","rightwards pushing hand"],u:"1faf8",v:["1faf8-1f3fb","1faf8-1f3fc","1faf8-1f3fd","1faf8-1f3fe","1faf8-1f3ff"],a:"15"},{n:["ok","hand","OK hand"],u:"1f44c",v:["1f44c-1f3fb","1f44c-1f3fc","1f44c-1f3fd","1f44c-1f3fe","1f44c-1f3ff"],a:"0.6"},{n:["fingers","pinched","sarcastic","hand gesture","interrogation","pinched fingers"],u:"1f90c",v:["1f90c-1f3fb","1f90c-1f3fc","1f90c-1f3fd","1f90c-1f3fe","1f90c-1f3ff"],a:"13"},{n:["small amount","pinching hand"],u:"1f90f",v:["1f90f-1f3fb","1f90f-1f3fc","1f90f-1f3fd","1f90f-1f3fe","1f90f-1f3ff"],a:"12"},{n:["v","hand","victory","victory hand"],u:"270c-fe0f",v:["270c-1f3fb","270c-1f3fc","270c-1f3fd","270c-1f3fe","270c-1f3ff"],a:"0.6"},{n:["hand","luck","cross","finger","crossed fingers"],u:"1f91e",v:["1f91e-1f3fb","1f91e-1f3fc","1f91e-1f3fd","1f91e-1f3fe","1f91e-1f3ff"],a:"3"},{n:["love","snap","heart","money","expensive","hand with index finger and thumb crossed"],u:"1faf0",v:["1faf0-1f3fb","1faf0-1f3fc","1faf0-1f3fd","1faf0-1f3fe","1faf0-1f3ff"],a:"14"},{n:["ily","hand","love you gesture"],u:"1f91f",v:["1f91f-1f3fb","1f91f-1f3fc","1f91f-1f3fd","1f91f-1f3fe","1f91f-1f3ff"],a:"5"},{n:["hand","horns","finger","rock on","sign of the horns"],u:"1f918",v:["1f918-1f3fb","1f918-1f3fc","1f918-1f3fd","1f918-1f3fe","1f918-1f3ff"],a:"1"},{n:["call","hand","shaka","hang loose","call me hand"],u:"1f919",v:["1f919-1f3fb","1f919-1f3fc","1f919-1f3fd","1f919-1f3fe","1f919-1f3ff"],a:"3"},{n:["hand","index","point","finger","backhand","backhand index pointing left"],u:"1f448",v:["1f448-1f3fb","1f448-1f3fc","1f448-1f3fd","1f448-1f3fe","1f448-1f3ff"],a:"0.6"},{n:["hand","index","point","finger","backhand","backhand index pointing right"],u:"1f449",v:["1f449-1f3fb","1f449-1f3fc","1f449-1f3fd","1f449-1f3fe","1f449-1f3ff"],a:"0.6"},{n:["up","hand","point","finger","backhand","backhand index pointing up"],u:"1f446",v:["1f446-1f3fb","1f446-1f3fc","1f446-1f3fd","1f446-1f3fe","1f446-1f3ff"],a:"0.6"},{n:["hand","finger","middle finger"],u:"1f595",v:["1f595-1f3fb","1f595-1f3fc","1f595-1f3fd","1f595-1f3fe","1f595-1f3ff"],a:"1"},{n:["down","hand","point","finger","backhand","backhand index pointing down"],u:"1f447",v:["1f447-1f3fb","1f447-1f3fc","1f447-1f3fd","1f447-1f3fe","1f447-1f3ff"],a:"0.6"},{n:["up","hand","index","point","finger","index pointing up"],u:"261d-fe0f",v:["261d-1f3fb","261d-1f3fc","261d-1f3fd","261d-1f3fe","261d-1f3ff"],a:"0.6"},{n:["you","point","index pointing at the viewer"],u:"1faf5",v:["1faf5-1f3fb","1faf5-1f3fc","1faf5-1f3fd","1faf5-1f3fe","1faf5-1f3ff"],a:"14"},{n:["+1","up","hand","thumb","thumbs up"],u:"1f44d",v:["1f44d-1f3fb","1f44d-1f3fc","1f44d-1f3fd","1f44d-1f3fe","1f44d-1f3ff"],a:"0.6"},{n:[" 1","down","hand","thumb","thumbs down"],u:"1f44e",v:["1f44e-1f3fb","1f44e-1f3fc","1f44e-1f3fd","1f44e-1f3fe","1f44e-1f3ff"],a:"0.6"},{n:["fist","hand","punch","clenched","raised fist"],u:"270a",v:["270a-1f3fb","270a-1f3fc","270a-1f3fd","270a-1f3fe","270a-1f3ff"],a:"0.6"},{n:["fist","hand","punch","clenched","oncoming fist"],u:"1f44a",v:["1f44a-1f3fb","1f44a-1f3fc","1f44a-1f3fd","1f44a-1f3fe","1f44a-1f3ff"],a:"0.6"},{n:["fist","leftwards","left facing fist"],u:"1f91b",v:["1f91b-1f3fb","1f91b-1f3fc","1f91b-1f3fd","1f91b-1f3fe","1f91b-1f3ff"],a:"3"},{n:["fist","rightwards","right facing fist"],u:"1f91c",v:["1f91c-1f3fb","1f91c-1f3fc","1f91c-1f3fd","1f91c-1f3fe","1f91c-1f3ff"],a:"3"},{n:["clap","hand","clapping hands"],u:"1f44f",v:["1f44f-1f3fb","1f44f-1f3fc","1f44f-1f3fd","1f44f-1f3fe","1f44f-1f3ff"],a:"0.6"},{n:["hand","hooray","raised","gesture","celebration","raising hands"],u:"1f64c",v:["1f64c-1f3fb","1f64c-1f3fc","1f64c-1f3fd","1f64c-1f3fe","1f64c-1f3ff"],a:"0.6"},{n:["love","heart hands"],u:"1faf6",v:["1faf6-1f3fb","1faf6-1f3fc","1faf6-1f3fd","1faf6-1f3fe","1faf6-1f3ff"],a:"14"},{n:["hand","open","open hands"],u:"1f450",v:["1f450-1f3fb","1f450-1f3fc","1f450-1f3fd","1f450-1f3fe","1f450-1f3ff"],a:"0.6"},{n:["prayer","palms up together"],u:"1f932",v:["1f932-1f3fb","1f932-1f3fc","1f932-1f3fd","1f932-1f3fe","1f932-1f3ff"],a:"5"},{n:["hand","shake","meeting","handshake","agreement"],u:"1f91d",v:["1f91d-1f3fb","1f91d-1f3fc","1f91d-1f3fd","1f91d-1f3fe","1f91d-1f3ff","1faf1-1f3fb-200d-1faf2-1f3fc","1faf1-1f3fb-200d-1faf2-1f3fd","1faf1-1f3fb-200d-1faf2-1f3fe","1faf1-1f3fb-200d-1faf2-1f3ff","1faf1-1f3fc-200d-1faf2-1f3fb","1faf1-1f3fc-200d-1faf2-1f3fd","1faf1-1f3fc-200d-1faf2-1f3fe","1faf1-1f3fc-200d-1faf2-1f3ff","1faf1-1f3fd-200d-1faf2-1f3fb","1faf1-1f3fd-200d-1faf2-1f3fc","1faf1-1f3fd-200d-1faf2-1f3fe","1faf1-1f3fd-200d-1faf2-1f3ff","1faf1-1f3fe-200d-1faf2-1f3fb","1faf1-1f3fe-200d-1faf2-1f3fc","1faf1-1f3fe-200d-1faf2-1f3fd","1faf1-1f3fe-200d-1faf2-1f3ff","1faf1-1f3ff-200d-1faf2-1f3fb","1faf1-1f3ff-200d-1faf2-1f3fc","1faf1-1f3ff-200d-1faf2-1f3fd","1faf1-1f3ff-200d-1faf2-1f3fe"],a:"3"},{n:["ask","hand","pray","high 5","please","thanks","high five","folded hands"],u:"1f64f",v:["1f64f-1f3fb","1f64f-1f3fc","1f64f-1f3fd","1f64f-1f3fe","1f64f-1f3ff"],a:"0.6"},{n:["hand","write","writing hand"],u:"270d-fe0f",v:["270d-1f3fb","270d-1f3fc","270d-1f3fd","270d-1f3fe","270d-1f3ff"],a:"0.7"},{n:["care","nail","polish","manicure","cosmetics","nail polish"],u:"1f485",v:["1f485-1f3fb","1f485-1f3fc","1f485-1f3fd","1f485-1f3fe","1f485-1f3ff"],a:"0.6"},{n:["phone","selfie","camera"],u:"1f933",v:["1f933-1f3fb","1f933-1f3fc","1f933-1f3fd","1f933-1f3fe","1f933-1f3ff"],a:"3"},{n:["flex","comic","biceps","muscle","flexed biceps"],u:"1f4aa",v:["1f4aa-1f3fb","1f4aa-1f3fc","1f4aa-1f3fd","1f4aa-1f3fe","1f4aa-1f3ff"],a:"0.6"},{n:["prosthetic","accessibility","mechanical arm"],u:"1f9be",a:"12"},{n:["prosthetic","accessibility","mechanical leg"],u:"1f9bf",a:"12"},{n:["leg","kick","limb"],u:"1f9b5",v:["1f9b5-1f3fb","1f9b5-1f3fc","1f9b5-1f3fd","1f9b5-1f3fe","1f9b5-1f3ff"],a:"11"},{n:["foot","kick","stomp"],u:"1f9b6",v:["1f9b6-1f3fb","1f9b6-1f3fc","1f9b6-1f3fd","1f9b6-1f3fe","1f9b6-1f3ff"],a:"11"},{n:["ear","body"],u:"1f442",v:["1f442-1f3fb","1f442-1f3fc","1f442-1f3fd","1f442-1f3fe","1f442-1f3ff"],a:"0.6"},{n:["accessibility","hard of hearing","ear with hearing aid"],u:"1f9bb",v:["1f9bb-1f3fb","1f9bb-1f3fc","1f9bb-1f3fd","1f9bb-1f3fe","1f9bb-1f3ff"],a:"12"},{n:["nose","body"],u:"1f443",v:["1f443-1f3fb","1f443-1f3fc","1f443-1f3fd","1f443-1f3fe","1f443-1f3ff"],a:"0.6"},{n:["brain","intelligent"],u:"1f9e0",a:"5"},{n:["heart","organ","pulse","anatomical","cardiology","anatomical heart"],u:"1fac0",a:"13"},{n:["lungs","organ","breath","exhalation","inhalation","respiration"],u:"1fac1",a:"13"},{n:["tooth","dentist"],u:"1f9b7",a:"11"},{n:["bone","skeleton"],u:"1f9b4",a:"11"},{n:["eye","eyes","face"],u:"1f440",a:"0.6"},{n:["eye","body"],u:"1f441-fe0f",a:"0.7"},{n:["body","tongue"],u:"1f445",a:"0.6"},{n:["lips","mouth"],u:"1f444",a:"0.6"},{n:["fear","anxious","nervous","worried","flirting","biting lip","uncomfortable"],u:"1fae6",a:"14"},{n:["baby","young"],u:"1f476",v:["1f476-1f3fb","1f476-1f3fc","1f476-1f3fd","1f476-1f3fe","1f476-1f3ff"],a:"0.6"},{n:["child","young","gender neutral","unspecified gender"],u:"1f9d2",v:["1f9d2-1f3fb","1f9d2-1f3fc","1f9d2-1f3fd","1f9d2-1f3fe","1f9d2-1f3ff"],a:"5"},{n:["boy","young"],u:"1f466",v:["1f466-1f3fb","1f466-1f3fc","1f466-1f3fd","1f466-1f3fe","1f466-1f3ff"],a:"0.6"},{n:["girl","virgo","young","zodiac"],u:"1f467",v:["1f467-1f3fb","1f467-1f3fc","1f467-1f3fd","1f467-1f3fe","1f467-1f3ff"],a:"0.6"},{n:["adult","person","gender neutral","unspecified gender"],u:"1f9d1",v:["1f9d1-1f3fb","1f9d1-1f3fc","1f9d1-1f3fd","1f9d1-1f3fe","1f9d1-1f3ff"],a:"5"},{n:["hair","blond","person: blond hair","blond haired person"],u:"1f471",v:["1f471-1f3fb","1f471-1f3fc","1f471-1f3fd","1f471-1f3fe","1f471-1f3ff"],a:"0.6"},{n:["man","adult"],u:"1f468",v:["1f468-1f3fb","1f468-1f3fc","1f468-1f3fd","1f468-1f3fe","1f468-1f3ff"],a:"0.6"},{n:["beard","person","person: beard"],u:"1f9d4",v:["1f9d4-1f3fb","1f9d4-1f3fc","1f9d4-1f3fd","1f9d4-1f3fe","1f9d4-1f3ff"],a:"5"},{n:["man","beard","man: beard"],u:"1f9d4-200d-2642-fe0f",v:["1f9d4-1f3fb-200d-2642-fe0f","1f9d4-1f3fc-200d-2642-fe0f","1f9d4-1f3fd-200d-2642-fe0f","1f9d4-1f3fe-200d-2642-fe0f","1f9d4-1f3ff-200d-2642-fe0f"],a:"13.1"},{n:["beard","woman","woman: beard"],u:"1f9d4-200d-2640-fe0f",v:["1f9d4-1f3fb-200d-2640-fe0f","1f9d4-1f3fc-200d-2640-fe0f","1f9d4-1f3fd-200d-2640-fe0f","1f9d4-1f3fe-200d-2640-fe0f","1f9d4-1f3ff-200d-2640-fe0f"],a:"13.1"},{n:["man","adult","red hair","man: red hair"],u:"1f468-200d-1f9b0",v:["1f468-1f3fb-200d-1f9b0","1f468-1f3fc-200d-1f9b0","1f468-1f3fd-200d-1f9b0","1f468-1f3fe-200d-1f9b0","1f468-1f3ff-200d-1f9b0"],a:"11"},{n:["man","adult","curly hair","man: curly hair"],u:"1f468-200d-1f9b1",v:["1f468-1f3fb-200d-1f9b1","1f468-1f3fc-200d-1f9b1","1f468-1f3fd-200d-1f9b1","1f468-1f3fe-200d-1f9b1","1f468-1f3ff-200d-1f9b1"],a:"11"},{n:["man","adult","white hair","man: white hair"],u:"1f468-200d-1f9b3",v:["1f468-1f3fb-200d-1f9b3","1f468-1f3fc-200d-1f9b3","1f468-1f3fd-200d-1f9b3","1f468-1f3fe-200d-1f9b3","1f468-1f3ff-200d-1f9b3"],a:"11"},{n:["man","bald","adult","man: bald"],u:"1f468-200d-1f9b2",v:["1f468-1f3fb-200d-1f9b2","1f468-1f3fc-200d-1f9b2","1f468-1f3fd-200d-1f9b2","1f468-1f3fe-200d-1f9b2","1f468-1f3ff-200d-1f9b2"],a:"11"},{n:["woman","adult"],u:"1f469",v:["1f469-1f3fb","1f469-1f3fc","1f469-1f3fd","1f469-1f3fe","1f469-1f3ff"],a:"0.6"},{n:["adult","woman","red hair","woman: red hair"],u:"1f469-200d-1f9b0",v:["1f469-1f3fb-200d-1f9b0","1f469-1f3fc-200d-1f9b0","1f469-1f3fd-200d-1f9b0","1f469-1f3fe-200d-1f9b0","1f469-1f3ff-200d-1f9b0"],a:"11"},{n:["adult","person","red hair","gender neutral","person: red hair","unspecified gender"],u:"1f9d1-200d-1f9b0",v:["1f9d1-1f3fb-200d-1f9b0","1f9d1-1f3fc-200d-1f9b0","1f9d1-1f3fd-200d-1f9b0","1f9d1-1f3fe-200d-1f9b0","1f9d1-1f3ff-200d-1f9b0"],a:"12.1"},{n:["adult","woman","curly hair","woman: curly hair"],u:"1f469-200d-1f9b1",v:["1f469-1f3fb-200d-1f9b1","1f469-1f3fc-200d-1f9b1","1f469-1f3fd-200d-1f9b1","1f469-1f3fe-200d-1f9b1","1f469-1f3ff-200d-1f9b1"],a:"11"},{n:["adult","person","curly hair","gender neutral","person: curly hair","unspecified gender"],u:"1f9d1-200d-1f9b1",v:["1f9d1-1f3fb-200d-1f9b1","1f9d1-1f3fc-200d-1f9b1","1f9d1-1f3fd-200d-1f9b1","1f9d1-1f3fe-200d-1f9b1","1f9d1-1f3ff-200d-1f9b1"],a:"12.1"},{n:["adult","woman","white hair","woman: white hair"],u:"1f469-200d-1f9b3",v:["1f469-1f3fb-200d-1f9b3","1f469-1f3fc-200d-1f9b3","1f469-1f3fd-200d-1f9b3","1f469-1f3fe-200d-1f9b3","1f469-1f3ff-200d-1f9b3"],a:"11"},{n:["adult","person","white hair","gender neutral","person: white hair","unspecified gender"],u:"1f9d1-200d-1f9b3",v:["1f9d1-1f3fb-200d-1f9b3","1f9d1-1f3fc-200d-1f9b3","1f9d1-1f3fd-200d-1f9b3","1f9d1-1f3fe-200d-1f9b3","1f9d1-1f3ff-200d-1f9b3"],a:"12.1"},{n:["bald","adult","woman","woman: bald"],u:"1f469-200d-1f9b2",v:["1f469-1f3fb-200d-1f9b2","1f469-1f3fc-200d-1f9b2","1f469-1f3fd-200d-1f9b2","1f469-1f3fe-200d-1f9b2","1f469-1f3ff-200d-1f9b2"],a:"11"},{n:["bald","adult","person","person: bald","gender neutral","unspecified gender"],u:"1f9d1-200d-1f9b2",v:["1f9d1-1f3fb-200d-1f9b2","1f9d1-1f3fc-200d-1f9b2","1f9d1-1f3fd-200d-1f9b2","1f9d1-1f3fe-200d-1f9b2","1f9d1-1f3ff-200d-1f9b2"],a:"12.1"},{n:["hair","woman","blonde","woman: blond hair","blond haired woman"],u:"1f471-200d-2640-fe0f",v:["1f471-1f3fb-200d-2640-fe0f","1f471-1f3fc-200d-2640-fe0f","1f471-1f3fd-200d-2640-fe0f","1f471-1f3fe-200d-2640-fe0f","1f471-1f3ff-200d-2640-fe0f"],a:"4"},{n:["man","hair","blond","man: blond hair","blond haired man"],u:"1f471-200d-2642-fe0f",v:["1f471-1f3fb-200d-2642-fe0f","1f471-1f3fc-200d-2642-fe0f","1f471-1f3fd-200d-2642-fe0f","1f471-1f3fe-200d-2642-fe0f","1f471-1f3ff-200d-2642-fe0f"],a:"4"},{n:["old","adult","older person","gender neutral","unspecified gender"],u:"1f9d3",v:["1f9d3-1f3fb","1f9d3-1f3fc","1f9d3-1f3fd","1f9d3-1f3fe","1f9d3-1f3ff"],a:"5"},{n:["man","old","adult","old man"],u:"1f474",v:["1f474-1f3fb","1f474-1f3fc","1f474-1f3fd","1f474-1f3fe","1f474-1f3ff"],a:"0.6"},{n:["old","adult","woman","old woman"],u:"1f475",v:["1f475-1f3fb","1f475-1f3fc","1f475-1f3fd","1f475-1f3fe","1f475-1f3ff"],a:"0.6"},{n:["frown","gesture","person frowning"],u:"1f64d",v:["1f64d-1f3fb","1f64d-1f3fc","1f64d-1f3fd","1f64d-1f3fe","1f64d-1f3ff"],a:"0.6"},{n:["man","gesture","frowning","man frowning"],u:"1f64d-200d-2642-fe0f",v:["1f64d-1f3fb-200d-2642-fe0f","1f64d-1f3fc-200d-2642-fe0f","1f64d-1f3fd-200d-2642-fe0f","1f64d-1f3fe-200d-2642-fe0f","1f64d-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","gesture","frowning","woman frowning"],u:"1f64d-200d-2640-fe0f",v:["1f64d-1f3fb-200d-2640-fe0f","1f64d-1f3fc-200d-2640-fe0f","1f64d-1f3fd-200d-2640-fe0f","1f64d-1f3fe-200d-2640-fe0f","1f64d-1f3ff-200d-2640-fe0f"],a:"4"},{n:["gesture","pouting","person pouting"],u:"1f64e",v:["1f64e-1f3fb","1f64e-1f3fc","1f64e-1f3fd","1f64e-1f3fe","1f64e-1f3ff"],a:"0.6"},{n:["man","gesture","pouting","man pouting"],u:"1f64e-200d-2642-fe0f",v:["1f64e-1f3fb-200d-2642-fe0f","1f64e-1f3fc-200d-2642-fe0f","1f64e-1f3fd-200d-2642-fe0f","1f64e-1f3fe-200d-2642-fe0f","1f64e-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","gesture","pouting","woman pouting"],u:"1f64e-200d-2640-fe0f",v:["1f64e-1f3fb-200d-2640-fe0f","1f64e-1f3fc-200d-2640-fe0f","1f64e-1f3fd-200d-2640-fe0f","1f64e-1f3fe-200d-2640-fe0f","1f64e-1f3ff-200d-2640-fe0f"],a:"4"},{n:["hand","gesture","forbidden","prohibited","person gesturing NO","person gesturing no"],u:"1f645",v:["1f645-1f3fb","1f645-1f3fc","1f645-1f3fd","1f645-1f3fe","1f645-1f3ff"],a:"0.6"},{n:["man","hand","gesture","forbidden","prohibited","man gesturing NO","man gesturing no"],u:"1f645-200d-2642-fe0f",v:["1f645-1f3fb-200d-2642-fe0f","1f645-1f3fc-200d-2642-fe0f","1f645-1f3fd-200d-2642-fe0f","1f645-1f3fe-200d-2642-fe0f","1f645-1f3ff-200d-2642-fe0f"],a:"4"},{n:["hand","woman","gesture","forbidden","prohibited","woman gesturing NO","woman gesturing no"],u:"1f645-200d-2640-fe0f",v:["1f645-1f3fb-200d-2640-fe0f","1f645-1f3fc-200d-2640-fe0f","1f645-1f3fd-200d-2640-fe0f","1f645-1f3fe-200d-2640-fe0f","1f645-1f3ff-200d-2640-fe0f"],a:"4"},{n:["ok","hand","gesture","person gesturing OK","person gesturing ok"],u:"1f646",v:["1f646-1f3fb","1f646-1f3fc","1f646-1f3fd","1f646-1f3fe","1f646-1f3ff"],a:"0.6"},{n:["ok","man","hand","gesture","man gesturing OK","man gesturing ok"],u:"1f646-200d-2642-fe0f",v:["1f646-1f3fb-200d-2642-fe0f","1f646-1f3fc-200d-2642-fe0f","1f646-1f3fd-200d-2642-fe0f","1f646-1f3fe-200d-2642-fe0f","1f646-1f3ff-200d-2642-fe0f"],a:"4"},{n:["ok","hand","woman","gesture","woman gesturing OK","woman gesturing ok"],u:"1f646-200d-2640-fe0f",v:["1f646-1f3fb-200d-2640-fe0f","1f646-1f3fc-200d-2640-fe0f","1f646-1f3fd-200d-2640-fe0f","1f646-1f3fe-200d-2640-fe0f","1f646-1f3ff-200d-2640-fe0f"],a:"4"},{n:["hand","help","sassy","tipping","information","person tipping hand"],u:"1f481",v:["1f481-1f3fb","1f481-1f3fc","1f481-1f3fd","1f481-1f3fe","1f481-1f3ff"],a:"0.6"},{n:["man","sassy","tipping hand","man tipping hand"],u:"1f481-200d-2642-fe0f",v:["1f481-1f3fb-200d-2642-fe0f","1f481-1f3fc-200d-2642-fe0f","1f481-1f3fd-200d-2642-fe0f","1f481-1f3fe-200d-2642-fe0f","1f481-1f3ff-200d-2642-fe0f"],a:"4"},{n:["sassy","woman","tipping hand","woman tipping hand"],u:"1f481-200d-2640-fe0f",v:["1f481-1f3fb-200d-2640-fe0f","1f481-1f3fc-200d-2640-fe0f","1f481-1f3fd-200d-2640-fe0f","1f481-1f3fe-200d-2640-fe0f","1f481-1f3ff-200d-2640-fe0f"],a:"4"},{n:["hand","happy","raised","gesture","person raising hand"],u:"1f64b",v:["1f64b-1f3fb","1f64b-1f3fc","1f64b-1f3fd","1f64b-1f3fe","1f64b-1f3ff"],a:"0.6"},{n:["man","gesture","raising hand","man raising hand"],u:"1f64b-200d-2642-fe0f",v:["1f64b-1f3fb-200d-2642-fe0f","1f64b-1f3fc-200d-2642-fe0f","1f64b-1f3fd-200d-2642-fe0f","1f64b-1f3fe-200d-2642-fe0f","1f64b-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","gesture","raising hand","woman raising hand"],u:"1f64b-200d-2640-fe0f",v:["1f64b-1f3fb-200d-2640-fe0f","1f64b-1f3fc-200d-2640-fe0f","1f64b-1f3fd-200d-2640-fe0f","1f64b-1f3fe-200d-2640-fe0f","1f64b-1f3ff-200d-2640-fe0f"],a:"4"},{n:["ear","deaf","hear","deaf person","accessibility"],u:"1f9cf",v:["1f9cf-1f3fb","1f9cf-1f3fc","1f9cf-1f3fd","1f9cf-1f3fe","1f9cf-1f3ff"],a:"12"},{n:["man","deaf","deaf man"],u:"1f9cf-200d-2642-fe0f",v:["1f9cf-1f3fb-200d-2642-fe0f","1f9cf-1f3fc-200d-2642-fe0f","1f9cf-1f3fd-200d-2642-fe0f","1f9cf-1f3fe-200d-2642-fe0f","1f9cf-1f3ff-200d-2642-fe0f"],a:"12"},{n:["deaf","woman","deaf woman"],u:"1f9cf-200d-2640-fe0f",v:["1f9cf-1f3fb-200d-2640-fe0f","1f9cf-1f3fc-200d-2640-fe0f","1f9cf-1f3fd-200d-2640-fe0f","1f9cf-1f3fe-200d-2640-fe0f","1f9cf-1f3ff-200d-2640-fe0f"],a:"12"},{n:["bow","sorry","apology","gesture","person bowing"],u:"1f647",v:["1f647-1f3fb","1f647-1f3fc","1f647-1f3fd","1f647-1f3fe","1f647-1f3ff"],a:"0.6"},{n:["man","favor","sorry","bowing","apology","gesture","man bowing"],u:"1f647-200d-2642-fe0f",v:["1f647-1f3fb-200d-2642-fe0f","1f647-1f3fc-200d-2642-fe0f","1f647-1f3fd-200d-2642-fe0f","1f647-1f3fe-200d-2642-fe0f","1f647-1f3ff-200d-2642-fe0f"],a:"4"},{n:["favor","sorry","woman","bowing","apology","gesture","woman bowing"],u:"1f647-200d-2640-fe0f",v:["1f647-1f3fb-200d-2640-fe0f","1f647-1f3fc-200d-2640-fe0f","1f647-1f3fd-200d-2640-fe0f","1f647-1f3fe-200d-2640-fe0f","1f647-1f3ff-200d-2640-fe0f"],a:"4"},{n:["face","palm","disbelief","exasperation","person facepalming"],u:"1f926",v:["1f926-1f3fb","1f926-1f3fc","1f926-1f3fd","1f926-1f3fe","1f926-1f3ff"],a:"3"},{n:["man","facepalm","disbelief","exasperation","man facepalming"],u:"1f926-200d-2642-fe0f",v:["1f926-1f3fb-200d-2642-fe0f","1f926-1f3fc-200d-2642-fe0f","1f926-1f3fd-200d-2642-fe0f","1f926-1f3fe-200d-2642-fe0f","1f926-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","facepalm","disbelief","exasperation","woman facepalming"],u:"1f926-200d-2640-fe0f",v:["1f926-1f3fb-200d-2640-fe0f","1f926-1f3fc-200d-2640-fe0f","1f926-1f3fd-200d-2640-fe0f","1f926-1f3fe-200d-2640-fe0f","1f926-1f3ff-200d-2640-fe0f"],a:"4"},{n:["doubt","shrug","ignorance","indifference","person shrugging"],u:"1f937",v:["1f937-1f3fb","1f937-1f3fc","1f937-1f3fd","1f937-1f3fe","1f937-1f3ff"],a:"3"},{n:["man","doubt","shrug","ignorance","indifference","man shrugging"],u:"1f937-200d-2642-fe0f",v:["1f937-1f3fb-200d-2642-fe0f","1f937-1f3fc-200d-2642-fe0f","1f937-1f3fd-200d-2642-fe0f","1f937-1f3fe-200d-2642-fe0f","1f937-1f3ff-200d-2642-fe0f"],a:"4"},{n:["doubt","shrug","woman","ignorance","indifference","woman shrugging"],u:"1f937-200d-2640-fe0f",v:["1f937-1f3fb-200d-2640-fe0f","1f937-1f3fc-200d-2640-fe0f","1f937-1f3fd-200d-2640-fe0f","1f937-1f3fe-200d-2640-fe0f","1f937-1f3ff-200d-2640-fe0f"],a:"4"},{n:["nurse","doctor","therapist","healthcare","health worker"],u:"1f9d1-200d-2695-fe0f",v:["1f9d1-1f3fb-200d-2695-fe0f","1f9d1-1f3fc-200d-2695-fe0f","1f9d1-1f3fd-200d-2695-fe0f","1f9d1-1f3fe-200d-2695-fe0f","1f9d1-1f3ff-200d-2695-fe0f"],a:"12.1"},{n:["man","nurse","doctor","therapist","healthcare","man health worker"],u:"1f468-200d-2695-fe0f",v:["1f468-1f3fb-200d-2695-fe0f","1f468-1f3fc-200d-2695-fe0f","1f468-1f3fd-200d-2695-fe0f","1f468-1f3fe-200d-2695-fe0f","1f468-1f3ff-200d-2695-fe0f"],a:"4"},{n:["nurse","woman","doctor","therapist","healthcare","woman health worker"],u:"1f469-200d-2695-fe0f",v:["1f469-1f3fb-200d-2695-fe0f","1f469-1f3fc-200d-2695-fe0f","1f469-1f3fd-200d-2695-fe0f","1f469-1f3fe-200d-2695-fe0f","1f469-1f3ff-200d-2695-fe0f"],a:"4"},{n:["student","graduate"],u:"1f9d1-200d-1f393",v:["1f9d1-1f3fb-200d-1f393","1f9d1-1f3fc-200d-1f393","1f9d1-1f3fd-200d-1f393","1f9d1-1f3fe-200d-1f393","1f9d1-1f3ff-200d-1f393"],a:"12.1"},{n:["man","student","graduate","man student"],u:"1f468-200d-1f393",v:["1f468-1f3fb-200d-1f393","1f468-1f3fc-200d-1f393","1f468-1f3fd-200d-1f393","1f468-1f3fe-200d-1f393","1f468-1f3ff-200d-1f393"],a:"4"},{n:["woman","student","graduate","woman student"],u:"1f469-200d-1f393",v:["1f469-1f3fb-200d-1f393","1f469-1f3fc-200d-1f393","1f469-1f3fd-200d-1f393","1f469-1f3fe-200d-1f393","1f469-1f3ff-200d-1f393"],a:"4"},{n:["teacher","lecturer","professor","instructor"],u:"1f9d1-200d-1f3eb",v:["1f9d1-1f3fb-200d-1f3eb","1f9d1-1f3fc-200d-1f3eb","1f9d1-1f3fd-200d-1f3eb","1f9d1-1f3fe-200d-1f3eb","1f9d1-1f3ff-200d-1f3eb"],a:"12.1"},{n:["man","teacher","lecturer","professor","instructor","man teacher"],u:"1f468-200d-1f3eb",v:["1f468-1f3fb-200d-1f3eb","1f468-1f3fc-200d-1f3eb","1f468-1f3fd-200d-1f3eb","1f468-1f3fe-200d-1f3eb","1f468-1f3ff-200d-1f3eb"],a:"4"},{n:["woman","teacher","lecturer","professor","instructor","woman teacher"],u:"1f469-200d-1f3eb",v:["1f469-1f3fb-200d-1f3eb","1f469-1f3fc-200d-1f3eb","1f469-1f3fd-200d-1f3eb","1f469-1f3fe-200d-1f3eb","1f469-1f3ff-200d-1f3eb"],a:"4"},{n:["law","judge","scales","justice"],u:"1f9d1-200d-2696-fe0f",v:["1f9d1-1f3fb-200d-2696-fe0f","1f9d1-1f3fc-200d-2696-fe0f","1f9d1-1f3fd-200d-2696-fe0f","1f9d1-1f3fe-200d-2696-fe0f","1f9d1-1f3ff-200d-2696-fe0f"],a:"12.1"},{n:["law","man","judge","scales","justice","man judge"],u:"1f468-200d-2696-fe0f",v:["1f468-1f3fb-200d-2696-fe0f","1f468-1f3fc-200d-2696-fe0f","1f468-1f3fd-200d-2696-fe0f","1f468-1f3fe-200d-2696-fe0f","1f468-1f3ff-200d-2696-fe0f"],a:"4"},{n:["law","judge","woman","scales","justice","woman judge"],u:"1f469-200d-2696-fe0f",v:["1f469-1f3fb-200d-2696-fe0f","1f469-1f3fc-200d-2696-fe0f","1f469-1f3fd-200d-2696-fe0f","1f469-1f3fe-200d-2696-fe0f","1f469-1f3ff-200d-2696-fe0f"],a:"4"},{n:["farmer","rancher","gardener"],u:"1f9d1-200d-1f33e",v:["1f9d1-1f3fb-200d-1f33e","1f9d1-1f3fc-200d-1f33e","1f9d1-1f3fd-200d-1f33e","1f9d1-1f3fe-200d-1f33e","1f9d1-1f3ff-200d-1f33e"],a:"12.1"},{n:["man","farmer","rancher","gardener","man farmer"],u:"1f468-200d-1f33e",v:["1f468-1f3fb-200d-1f33e","1f468-1f3fc-200d-1f33e","1f468-1f3fd-200d-1f33e","1f468-1f3fe-200d-1f33e","1f468-1f3ff-200d-1f33e"],a:"4"},{n:["woman","farmer","rancher","gardener","woman farmer"],u:"1f469-200d-1f33e",v:["1f469-1f3fb-200d-1f33e","1f469-1f3fc-200d-1f33e","1f469-1f3fd-200d-1f33e","1f469-1f3fe-200d-1f33e","1f469-1f3ff-200d-1f33e"],a:"4"},{n:["cook","chef"],u:"1f9d1-200d-1f373",v:["1f9d1-1f3fb-200d-1f373","1f9d1-1f3fc-200d-1f373","1f9d1-1f3fd-200d-1f373","1f9d1-1f3fe-200d-1f373","1f9d1-1f3ff-200d-1f373"],a:"12.1"},{n:["man","chef","cook","man cook"],u:"1f468-200d-1f373",v:["1f468-1f3fb-200d-1f373","1f468-1f3fc-200d-1f373","1f468-1f3fd-200d-1f373","1f468-1f3fe-200d-1f373","1f468-1f3ff-200d-1f373"],a:"4"},{n:["chef","cook","woman","woman cook"],u:"1f469-200d-1f373",v:["1f469-1f3fb-200d-1f373","1f469-1f3fc-200d-1f373","1f469-1f3fd-200d-1f373","1f469-1f3fe-200d-1f373","1f469-1f3ff-200d-1f373"],a:"4"},{n:["plumber","mechanic","electrician","tradesperson"],u:"1f9d1-200d-1f527",v:["1f9d1-1f3fb-200d-1f527","1f9d1-1f3fc-200d-1f527","1f9d1-1f3fd-200d-1f527","1f9d1-1f3fe-200d-1f527","1f9d1-1f3ff-200d-1f527"],a:"12.1"},{n:["man","plumber","mechanic","electrician","man mechanic","tradesperson"],u:"1f468-200d-1f527",v:["1f468-1f3fb-200d-1f527","1f468-1f3fc-200d-1f527","1f468-1f3fd-200d-1f527","1f468-1f3fe-200d-1f527","1f468-1f3ff-200d-1f527"],a:"4"},{n:["woman","plumber","mechanic","electrician","tradesperson","woman mechanic"],u:"1f469-200d-1f527",v:["1f469-1f3fb-200d-1f527","1f469-1f3fc-200d-1f527","1f469-1f3fd-200d-1f527","1f469-1f3fe-200d-1f527","1f469-1f3ff-200d-1f527"],a:"4"},{n:["worker","factory","assembly","industrial","factory worker"],u:"1f9d1-200d-1f3ed",v:["1f9d1-1f3fb-200d-1f3ed","1f9d1-1f3fc-200d-1f3ed","1f9d1-1f3fd-200d-1f3ed","1f9d1-1f3fe-200d-1f3ed","1f9d1-1f3ff-200d-1f3ed"],a:"12.1"},{n:["man","worker","factory","assembly","industrial","man factory worker"],u:"1f468-200d-1f3ed",v:["1f468-1f3fb-200d-1f3ed","1f468-1f3fc-200d-1f3ed","1f468-1f3fd-200d-1f3ed","1f468-1f3fe-200d-1f3ed","1f468-1f3ff-200d-1f3ed"],a:"4"},{n:["woman","worker","factory","assembly","industrial","woman factory worker"],u:"1f469-200d-1f3ed",v:["1f469-1f3fb-200d-1f3ed","1f469-1f3fc-200d-1f3ed","1f469-1f3fd-200d-1f3ed","1f469-1f3fe-200d-1f3ed","1f469-1f3ff-200d-1f3ed"],a:"4"},{n:["manager","business","architect","white collar","office worker"],u:"1f9d1-200d-1f4bc",v:["1f9d1-1f3fb-200d-1f4bc","1f9d1-1f3fc-200d-1f4bc","1f9d1-1f3fd-200d-1f4bc","1f9d1-1f3fe-200d-1f4bc","1f9d1-1f3ff-200d-1f4bc"],a:"12.1"},{n:["man","manager","business","architect","white collar","man office worker"],u:"1f468-200d-1f4bc",v:["1f468-1f3fb-200d-1f4bc","1f468-1f3fc-200d-1f4bc","1f468-1f3fd-200d-1f4bc","1f468-1f3fe-200d-1f4bc","1f468-1f3ff-200d-1f4bc"],a:"4"},{n:["woman","manager","business","architect","white collar","woman office worker"],u:"1f469-200d-1f4bc",v:["1f469-1f3fb-200d-1f4bc","1f469-1f3fc-200d-1f4bc","1f469-1f3fd-200d-1f4bc","1f469-1f3fe-200d-1f4bc","1f469-1f3ff-200d-1f4bc"],a:"4"},{n:["chemist","engineer","scientist","biologist","physicist"],u:"1f9d1-200d-1f52c",v:["1f9d1-1f3fb-200d-1f52c","1f9d1-1f3fc-200d-1f52c","1f9d1-1f3fd-200d-1f52c","1f9d1-1f3fe-200d-1f52c","1f9d1-1f3ff-200d-1f52c"],a:"12.1"},{n:["man","chemist","engineer","biologist","physicist","scientist","man scientist"],u:"1f468-200d-1f52c",v:["1f468-1f3fb-200d-1f52c","1f468-1f3fc-200d-1f52c","1f468-1f3fd-200d-1f52c","1f468-1f3fe-200d-1f52c","1f468-1f3ff-200d-1f52c"],a:"4"},{n:["woman","chemist","engineer","biologist","physicist","scientist","woman scientist"],u:"1f469-200d-1f52c",v:["1f469-1f3fb-200d-1f52c","1f469-1f3fc-200d-1f52c","1f469-1f3fd-200d-1f52c","1f469-1f3fe-200d-1f52c","1f469-1f3ff-200d-1f52c"],a:"4"},{n:["coder","inventor","software","developer","technologist"],u:"1f9d1-200d-1f4bb",v:["1f9d1-1f3fb-200d-1f4bb","1f9d1-1f3fc-200d-1f4bb","1f9d1-1f3fd-200d-1f4bb","1f9d1-1f3fe-200d-1f4bb","1f9d1-1f3ff-200d-1f4bb"],a:"12.1"},{n:["man","coder","inventor","software","developer","technologist","man technologist"],u:"1f468-200d-1f4bb",v:["1f468-1f3fb-200d-1f4bb","1f468-1f3fc-200d-1f4bb","1f468-1f3fd-200d-1f4bb","1f468-1f3fe-200d-1f4bb","1f468-1f3ff-200d-1f4bb"],a:"4"},{n:["coder","woman","inventor","software","developer","technologist","woman technologist"],u:"1f469-200d-1f4bb",v:["1f469-1f3fb-200d-1f4bb","1f469-1f3fc-200d-1f4bb","1f469-1f3fd-200d-1f4bb","1f469-1f3fe-200d-1f4bb","1f469-1f3ff-200d-1f4bb"],a:"4"},{n:["rock","star","actor","singer","entertainer"],u:"1f9d1-200d-1f3a4",v:["1f9d1-1f3fb-200d-1f3a4","1f9d1-1f3fc-200d-1f3a4","1f9d1-1f3fd-200d-1f3a4","1f9d1-1f3fe-200d-1f3a4","1f9d1-1f3ff-200d-1f3a4"],a:"12.1"},{n:["man","rock","star","actor","singer","man singer","entertainer"],u:"1f468-200d-1f3a4",v:["1f468-1f3fb-200d-1f3a4","1f468-1f3fc-200d-1f3a4","1f468-1f3fd-200d-1f3a4","1f468-1f3fe-200d-1f3a4","1f468-1f3ff-200d-1f3a4"],a:"4"},{n:["rock","star","actor","woman","singer","entertainer","woman singer"],u:"1f469-200d-1f3a4",v:["1f469-1f3fb-200d-1f3a4","1f469-1f3fc-200d-1f3a4","1f469-1f3fd-200d-1f3a4","1f469-1f3fe-200d-1f3a4","1f469-1f3ff-200d-1f3a4"],a:"4"},{n:["artist","palette"],u:"1f9d1-200d-1f3a8",v:["1f9d1-1f3fb-200d-1f3a8","1f9d1-1f3fc-200d-1f3a8","1f9d1-1f3fd-200d-1f3a8","1f9d1-1f3fe-200d-1f3a8","1f9d1-1f3ff-200d-1f3a8"],a:"12.1"},{n:["man","artist","palette","man artist"],u:"1f468-200d-1f3a8",v:["1f468-1f3fb-200d-1f3a8","1f468-1f3fc-200d-1f3a8","1f468-1f3fd-200d-1f3a8","1f468-1f3fe-200d-1f3a8","1f468-1f3ff-200d-1f3a8"],a:"4"},{n:["woman","artist","palette","woman artist"],u:"1f469-200d-1f3a8",v:["1f469-1f3fb-200d-1f3a8","1f469-1f3fc-200d-1f3a8","1f469-1f3fd-200d-1f3a8","1f469-1f3fe-200d-1f3a8","1f469-1f3ff-200d-1f3a8"],a:"4"},{n:["pilot","plane"],u:"1f9d1-200d-2708-fe0f",v:["1f9d1-1f3fb-200d-2708-fe0f","1f9d1-1f3fc-200d-2708-fe0f","1f9d1-1f3fd-200d-2708-fe0f","1f9d1-1f3fe-200d-2708-fe0f","1f9d1-1f3ff-200d-2708-fe0f"],a:"12.1"},{n:["man","pilot","plane","man pilot"],u:"1f468-200d-2708-fe0f",v:["1f468-1f3fb-200d-2708-fe0f","1f468-1f3fc-200d-2708-fe0f","1f468-1f3fd-200d-2708-fe0f","1f468-1f3fe-200d-2708-fe0f","1f468-1f3ff-200d-2708-fe0f"],a:"4"},{n:["pilot","plane","woman","woman pilot"],u:"1f469-200d-2708-fe0f",v:["1f469-1f3fb-200d-2708-fe0f","1f469-1f3fc-200d-2708-fe0f","1f469-1f3fd-200d-2708-fe0f","1f469-1f3fe-200d-2708-fe0f","1f469-1f3ff-200d-2708-fe0f"],a:"4"},{n:["rocket","astronaut"],u:"1f9d1-200d-1f680",v:["1f9d1-1f3fb-200d-1f680","1f9d1-1f3fc-200d-1f680","1f9d1-1f3fd-200d-1f680","1f9d1-1f3fe-200d-1f680","1f9d1-1f3ff-200d-1f680"],a:"12.1"},{n:["man","rocket","astronaut","man astronaut"],u:"1f468-200d-1f680",v:["1f468-1f3fb-200d-1f680","1f468-1f3fc-200d-1f680","1f468-1f3fd-200d-1f680","1f468-1f3fe-200d-1f680","1f468-1f3ff-200d-1f680"],a:"4"},{n:["woman","rocket","astronaut","woman astronaut"],u:"1f469-200d-1f680",v:["1f469-1f3fb-200d-1f680","1f469-1f3fc-200d-1f680","1f469-1f3fd-200d-1f680","1f469-1f3fe-200d-1f680","1f469-1f3ff-200d-1f680"],a:"4"},{n:["fire","firetruck","firefighter"],u:"1f9d1-200d-1f692",v:["1f9d1-1f3fb-200d-1f692","1f9d1-1f3fc-200d-1f692","1f9d1-1f3fd-200d-1f692","1f9d1-1f3fe-200d-1f692","1f9d1-1f3ff-200d-1f692"],a:"12.1"},{n:["man","firetruck","firefighter","man firefighter"],u:"1f468-200d-1f692",v:["1f468-1f3fb-200d-1f692","1f468-1f3fc-200d-1f692","1f468-1f3fd-200d-1f692","1f468-1f3fe-200d-1f692","1f468-1f3ff-200d-1f692"],a:"4"},{n:["woman","firetruck","firefighter","woman firefighter"],u:"1f469-200d-1f692",v:["1f469-1f3fb-200d-1f692","1f469-1f3fc-200d-1f692","1f469-1f3fd-200d-1f692","1f469-1f3fe-200d-1f692","1f469-1f3ff-200d-1f692"],a:"4"},{n:["cop","police","officer","police officer"],u:"1f46e",v:["1f46e-1f3fb","1f46e-1f3fc","1f46e-1f3fd","1f46e-1f3fe","1f46e-1f3ff"],a:"0.6"},{n:["cop","man","police","officer","man police officer"],u:"1f46e-200d-2642-fe0f",v:["1f46e-1f3fb-200d-2642-fe0f","1f46e-1f3fc-200d-2642-fe0f","1f46e-1f3fd-200d-2642-fe0f","1f46e-1f3fe-200d-2642-fe0f","1f46e-1f3ff-200d-2642-fe0f"],a:"4"},{n:["cop","woman","police","officer","woman police officer"],u:"1f46e-200d-2640-fe0f",v:["1f46e-1f3fb-200d-2640-fe0f","1f46e-1f3fc-200d-2640-fe0f","1f46e-1f3fd-200d-2640-fe0f","1f46e-1f3fe-200d-2640-fe0f","1f46e-1f3ff-200d-2640-fe0f"],a:"4"},{n:["spy","sleuth","detective"],u:"1f575-fe0f",v:["1f575-1f3fb","1f575-1f3fc","1f575-1f3fd","1f575-1f3fe","1f575-1f3ff"],a:"0.7"},{n:["man","spy","sleuth","detective","man detective"],u:"1f575-fe0f-200d-2642-fe0f",v:["1f575-1f3fb-200d-2642-fe0f","1f575-1f3fc-200d-2642-fe0f","1f575-1f3fd-200d-2642-fe0f","1f575-1f3fe-200d-2642-fe0f","1f575-1f3ff-200d-2642-fe0f"],a:"4"},{n:["spy","woman","sleuth","detective","woman detective"],u:"1f575-fe0f-200d-2640-fe0f",v:["1f575-1f3fb-200d-2640-fe0f","1f575-1f3fc-200d-2640-fe0f","1f575-1f3fd-200d-2640-fe0f","1f575-1f3fe-200d-2640-fe0f","1f575-1f3ff-200d-2640-fe0f"],a:"4"},{n:["guard"],u:"1f482",v:["1f482-1f3fb","1f482-1f3fc","1f482-1f3fd","1f482-1f3fe","1f482-1f3ff"],a:"0.6"},{n:["man","guard","man guard"],u:"1f482-200d-2642-fe0f",v:["1f482-1f3fb-200d-2642-fe0f","1f482-1f3fc-200d-2642-fe0f","1f482-1f3fd-200d-2642-fe0f","1f482-1f3fe-200d-2642-fe0f","1f482-1f3ff-200d-2642-fe0f"],a:"4"},{n:["guard","woman","woman guard"],u:"1f482-200d-2640-fe0f",v:["1f482-1f3fb-200d-2640-fe0f","1f482-1f3fc-200d-2640-fe0f","1f482-1f3fd-200d-2640-fe0f","1f482-1f3fe-200d-2640-fe0f","1f482-1f3ff-200d-2640-fe0f"],a:"4"},{n:["ninja","hidden","fighter","stealth"],u:"1f977",v:["1f977-1f3fb","1f977-1f3fc","1f977-1f3fd","1f977-1f3fe","1f977-1f3ff"],a:"13"},{n:["hat","worker","construction","construction worker"],u:"1f477",v:["1f477-1f3fb","1f477-1f3fc","1f477-1f3fd","1f477-1f3fe","1f477-1f3ff"],a:"0.6"},{n:["man","worker","construction","man construction worker"],u:"1f477-200d-2642-fe0f",v:["1f477-1f3fb-200d-2642-fe0f","1f477-1f3fc-200d-2642-fe0f","1f477-1f3fd-200d-2642-fe0f","1f477-1f3fe-200d-2642-fe0f","1f477-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","worker","construction","woman construction worker"],u:"1f477-200d-2640-fe0f",v:["1f477-1f3fb-200d-2640-fe0f","1f477-1f3fc-200d-2640-fe0f","1f477-1f3fd-200d-2640-fe0f","1f477-1f3fe-200d-2640-fe0f","1f477-1f3ff-200d-2640-fe0f"],a:"4"},{n:["noble","regal","monarch","royalty","person with crown"],u:"1fac5",v:["1fac5-1f3fb","1fac5-1f3fc","1fac5-1f3fd","1fac5-1f3fe","1fac5-1f3ff"],a:"14"},{n:["prince"],u:"1f934",v:["1f934-1f3fb","1f934-1f3fc","1f934-1f3fd","1f934-1f3fe","1f934-1f3ff"],a:"3"},{n:["fantasy","princess","fairy tale"],u:"1f478",v:["1f478-1f3fb","1f478-1f3fc","1f478-1f3fd","1f478-1f3fe","1f478-1f3ff"],a:"0.6"},{n:["turban","person wearing turban"],u:"1f473",v:["1f473-1f3fb","1f473-1f3fc","1f473-1f3fd","1f473-1f3fe","1f473-1f3ff"],a:"0.6"},{n:["man","turban","man wearing turban"],u:"1f473-200d-2642-fe0f",v:["1f473-1f3fb-200d-2642-fe0f","1f473-1f3fc-200d-2642-fe0f","1f473-1f3fd-200d-2642-fe0f","1f473-1f3fe-200d-2642-fe0f","1f473-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","turban","woman wearing turban"],u:"1f473-200d-2640-fe0f",v:["1f473-1f3fb-200d-2640-fe0f","1f473-1f3fc-200d-2640-fe0f","1f473-1f3fd-200d-2640-fe0f","1f473-1f3fe-200d-2640-fe0f","1f473-1f3ff-200d-2640-fe0f"],a:"4"},{n:["cap","hat","person","skullcap","gua pi mao","person with skullcap"],u:"1f472",v:["1f472-1f3fb","1f472-1f3fc","1f472-1f3fd","1f472-1f3fe","1f472-1f3ff"],a:"0.6"},{n:["hijab","tichel","mantilla","headscarf","woman with headscarf"],u:"1f9d5",v:["1f9d5-1f3fb","1f9d5-1f3fc","1f9d5-1f3fd","1f9d5-1f3fe","1f9d5-1f3ff"],a:"5"},{n:["groom","person","tuxedo","person in tuxedo"],u:"1f935",v:["1f935-1f3fb","1f935-1f3fc","1f935-1f3fd","1f935-1f3fe","1f935-1f3ff"],a:"3"},{n:["man","tuxedo","man in tuxedo"],u:"1f935-200d-2642-fe0f",v:["1f935-1f3fb-200d-2642-fe0f","1f935-1f3fc-200d-2642-fe0f","1f935-1f3fd-200d-2642-fe0f","1f935-1f3fe-200d-2642-fe0f","1f935-1f3ff-200d-2642-fe0f"],a:"13"},{n:["woman","tuxedo","woman in tuxedo"],u:"1f935-200d-2640-fe0f",v:["1f935-1f3fb-200d-2640-fe0f","1f935-1f3fc-200d-2640-fe0f","1f935-1f3fd-200d-2640-fe0f","1f935-1f3fe-200d-2640-fe0f","1f935-1f3ff-200d-2640-fe0f"],a:"13"},{n:["veil","bride","person","wedding","person with veil"],u:"1f470",v:["1f470-1f3fb","1f470-1f3fc","1f470-1f3fd","1f470-1f3fe","1f470-1f3ff"],a:"0.6"},{n:["man","veil","man with veil"],u:"1f470-200d-2642-fe0f",v:["1f470-1f3fb-200d-2642-fe0f","1f470-1f3fc-200d-2642-fe0f","1f470-1f3fd-200d-2642-fe0f","1f470-1f3fe-200d-2642-fe0f","1f470-1f3ff-200d-2642-fe0f"],a:"13"},{n:["veil","woman","woman with veil"],u:"1f470-200d-2640-fe0f",v:["1f470-1f3fb-200d-2640-fe0f","1f470-1f3fc-200d-2640-fe0f","1f470-1f3fd-200d-2640-fe0f","1f470-1f3fe-200d-2640-fe0f","1f470-1f3ff-200d-2640-fe0f"],a:"13"},{n:["woman","pregnant","pregnant woman"],u:"1f930",v:["1f930-1f3fb","1f930-1f3fc","1f930-1f3fd","1f930-1f3fe","1f930-1f3ff"],a:"3"},{n:["full","belly","bloated","pregnant","pregnant man"],u:"1fac3",v:["1fac3-1f3fb","1fac3-1f3fc","1fac3-1f3fd","1fac3-1f3fe","1fac3-1f3ff"],a:"14"},{n:["full","belly","bloated","pregnant","pregnant person"],u:"1fac4",v:["1fac4-1f3fb","1fac4-1f3fc","1fac4-1f3fd","1fac4-1f3fe","1fac4-1f3ff"],a:"14"},{n:["baby","breast","nursing","breast feeding"],u:"1f931",v:["1f931-1f3fb","1f931-1f3fc","1f931-1f3fd","1f931-1f3fe","1f931-1f3ff"],a:"5"},{n:["baby","woman","feeding","nursing","woman feeding baby"],u:"1f469-200d-1f37c",v:["1f469-1f3fb-200d-1f37c","1f469-1f3fc-200d-1f37c","1f469-1f3fd-200d-1f37c","1f469-1f3fe-200d-1f37c","1f469-1f3ff-200d-1f37c"],a:"13"},{n:["man","baby","feeding","nursing","man feeding baby"],u:"1f468-200d-1f37c",v:["1f468-1f3fb-200d-1f37c","1f468-1f3fc-200d-1f37c","1f468-1f3fd-200d-1f37c","1f468-1f3fe-200d-1f37c","1f468-1f3ff-200d-1f37c"],a:"13"},{n:["baby","person","feeding","nursing","person feeding baby"],u:"1f9d1-200d-1f37c",v:["1f9d1-1f3fb-200d-1f37c","1f9d1-1f3fc-200d-1f37c","1f9d1-1f3fd-200d-1f37c","1f9d1-1f3fe-200d-1f37c","1f9d1-1f3ff-200d-1f37c"],a:"13"},{n:["baby","face","angel","fantasy","baby angel","fairy tale"],u:"1f47c",v:["1f47c-1f3fb","1f47c-1f3fc","1f47c-1f3fd","1f47c-1f3fe","1f47c-1f3ff"],a:"0.6"},{n:["claus","santa","father","christmas","Santa Claus","celebration"],u:"1f385",v:["1f385-1f3fb","1f385-1f3fc","1f385-1f3fd","1f385-1f3fe","1f385-1f3ff"],a:"0.6"},{n:["mrs.","claus","mother","christmas","Mrs. Claus","celebration"],u:"1f936",v:["1f936-1f3fb","1f936-1f3fc","1f936-1f3fd","1f936-1f3fe","1f936-1f3ff"],a:"3"},{n:["claus","mx claus","christmas"],u:"1f9d1-200d-1f384",v:["1f9d1-1f3fb-200d-1f384","1f9d1-1f3fc-200d-1f384","1f9d1-1f3fd-200d-1f384","1f9d1-1f3fe-200d-1f384","1f9d1-1f3ff-200d-1f384"],a:"13"},{n:["good","hero","heroine","superhero","superpower"],u:"1f9b8",v:["1f9b8-1f3fb","1f9b8-1f3fc","1f9b8-1f3fd","1f9b8-1f3fe","1f9b8-1f3ff"],a:"11"},{n:["man","good","hero","superpower","man superhero"],u:"1f9b8-200d-2642-fe0f",v:["1f9b8-1f3fb-200d-2642-fe0f","1f9b8-1f3fc-200d-2642-fe0f","1f9b8-1f3fd-200d-2642-fe0f","1f9b8-1f3fe-200d-2642-fe0f","1f9b8-1f3ff-200d-2642-fe0f"],a:"11"},{n:["good","hero","woman","heroine","superpower","woman superhero"],u:"1f9b8-200d-2640-fe0f",v:["1f9b8-1f3fb-200d-2640-fe0f","1f9b8-1f3fc-200d-2640-fe0f","1f9b8-1f3fd-200d-2640-fe0f","1f9b8-1f3fe-200d-2640-fe0f","1f9b8-1f3ff-200d-2640-fe0f"],a:"11"},{n:["evil","villain","criminal","superpower","supervillain"],u:"1f9b9",v:["1f9b9-1f3fb","1f9b9-1f3fc","1f9b9-1f3fd","1f9b9-1f3fe","1f9b9-1f3ff"],a:"11"},{n:["man","evil","villain","criminal","superpower","man supervillain"],u:"1f9b9-200d-2642-fe0f",v:["1f9b9-1f3fb-200d-2642-fe0f","1f9b9-1f3fc-200d-2642-fe0f","1f9b9-1f3fd-200d-2642-fe0f","1f9b9-1f3fe-200d-2642-fe0f","1f9b9-1f3ff-200d-2642-fe0f"],a:"11"},{n:["evil","woman","villain","criminal","superpower","woman supervillain"],u:"1f9b9-200d-2640-fe0f",v:["1f9b9-1f3fb-200d-2640-fe0f","1f9b9-1f3fc-200d-2640-fe0f","1f9b9-1f3fd-200d-2640-fe0f","1f9b9-1f3fe-200d-2640-fe0f","1f9b9-1f3ff-200d-2640-fe0f"],a:"11"},{n:["mage","witch","wizard","sorcerer","sorceress"],u:"1f9d9",v:["1f9d9-1f3fb","1f9d9-1f3fc","1f9d9-1f3fd","1f9d9-1f3fe","1f9d9-1f3ff"],a:"5"},{n:["wizard","man mage","sorcerer"],u:"1f9d9-200d-2642-fe0f",v:["1f9d9-1f3fb-200d-2642-fe0f","1f9d9-1f3fc-200d-2642-fe0f","1f9d9-1f3fd-200d-2642-fe0f","1f9d9-1f3fe-200d-2642-fe0f","1f9d9-1f3ff-200d-2642-fe0f"],a:"5"},{n:["witch","sorceress","woman mage"],u:"1f9d9-200d-2640-fe0f",v:["1f9d9-1f3fb-200d-2640-fe0f","1f9d9-1f3fc-200d-2640-fe0f","1f9d9-1f3fd-200d-2640-fe0f","1f9d9-1f3fe-200d-2640-fe0f","1f9d9-1f3ff-200d-2640-fe0f"],a:"5"},{n:["puck","fairy","oberon","titania"],u:"1f9da",v:["1f9da-1f3fb","1f9da-1f3fc","1f9da-1f3fd","1f9da-1f3fe","1f9da-1f3ff"],a:"5"},{n:["puck","oberon","man fairy"],u:"1f9da-200d-2642-fe0f",v:["1f9da-1f3fb-200d-2642-fe0f","1f9da-1f3fc-200d-2642-fe0f","1f9da-1f3fd-200d-2642-fe0f","1f9da-1f3fe-200d-2642-fe0f","1f9da-1f3ff-200d-2642-fe0f"],a:"5"},{n:["titania","woman fairy"],u:"1f9da-200d-2640-fe0f",v:["1f9da-1f3fb-200d-2640-fe0f","1f9da-1f3fc-200d-2640-fe0f","1f9da-1f3fd-200d-2640-fe0f","1f9da-1f3fe-200d-2640-fe0f","1f9da-1f3ff-200d-2640-fe0f"],a:"5"},{n:["undead","vampire","dracula"],u:"1f9db",v:["1f9db-1f3fb","1f9db-1f3fc","1f9db-1f3fd","1f9db-1f3fe","1f9db-1f3ff"],a:"5"},{n:["undead","dracula","man vampire"],u:"1f9db-200d-2642-fe0f",v:["1f9db-1f3fb-200d-2642-fe0f","1f9db-1f3fc-200d-2642-fe0f","1f9db-1f3fd-200d-2642-fe0f","1f9db-1f3fe-200d-2642-fe0f","1f9db-1f3ff-200d-2642-fe0f"],a:"5"},{n:["undead","woman vampire"],u:"1f9db-200d-2640-fe0f",v:["1f9db-1f3fb-200d-2640-fe0f","1f9db-1f3fc-200d-2640-fe0f","1f9db-1f3fd-200d-2640-fe0f","1f9db-1f3fe-200d-2640-fe0f","1f9db-1f3ff-200d-2640-fe0f"],a:"5"},{n:["merman","mermaid","merwoman","merperson"],u:"1f9dc",v:["1f9dc-1f3fb","1f9dc-1f3fc","1f9dc-1f3fd","1f9dc-1f3fe","1f9dc-1f3ff"],a:"5"},{n:["merman","triton"],u:"1f9dc-200d-2642-fe0f",v:["1f9dc-1f3fb-200d-2642-fe0f","1f9dc-1f3fc-200d-2642-fe0f","1f9dc-1f3fd-200d-2642-fe0f","1f9dc-1f3fe-200d-2642-fe0f","1f9dc-1f3ff-200d-2642-fe0f"],a:"5"},{n:["mermaid","merwoman"],u:"1f9dc-200d-2640-fe0f",v:["1f9dc-1f3fb-200d-2640-fe0f","1f9dc-1f3fc-200d-2640-fe0f","1f9dc-1f3fd-200d-2640-fe0f","1f9dc-1f3fe-200d-2640-fe0f","1f9dc-1f3ff-200d-2640-fe0f"],a:"5"},{n:["elf","magical"],u:"1f9dd",v:["1f9dd-1f3fb","1f9dd-1f3fc","1f9dd-1f3fd","1f9dd-1f3fe","1f9dd-1f3ff"],a:"5"},{n:["man elf","magical"],u:"1f9dd-200d-2642-fe0f",v:["1f9dd-1f3fb-200d-2642-fe0f","1f9dd-1f3fc-200d-2642-fe0f","1f9dd-1f3fd-200d-2642-fe0f","1f9dd-1f3fe-200d-2642-fe0f","1f9dd-1f3ff-200d-2642-fe0f"],a:"5"},{n:["magical","woman elf"],u:"1f9dd-200d-2640-fe0f",v:["1f9dd-1f3fb-200d-2640-fe0f","1f9dd-1f3fc-200d-2640-fe0f","1f9dd-1f3fd-200d-2640-fe0f","1f9dd-1f3fe-200d-2640-fe0f","1f9dd-1f3ff-200d-2640-fe0f"],a:"5"},{n:["genie","djinn"],u:"1f9de",a:"5"},{n:["djinn","man genie"],u:"1f9de-200d-2642-fe0f",a:"5"},{n:["djinn","woman genie"],u:"1f9de-200d-2640-fe0f",a:"5"},{n:["zombie","undead","walking dead"],u:"1f9df",a:"5"},{n:["undead","man zombie","walking dead"],u:"1f9df-200d-2642-fe0f",a:"5"},{n:["undead","woman zombie","walking dead"],u:"1f9df-200d-2640-fe0f",a:"5"},{n:["troll","fantasy","monster","fairy tale"],u:"1f9cc",a:"14"},{n:["face","salon","massage","person getting massage"],u:"1f486",v:["1f486-1f3fb","1f486-1f3fc","1f486-1f3fd","1f486-1f3fe","1f486-1f3ff"],a:"0.6"},{n:["man","face","massage","man getting massage"],u:"1f486-200d-2642-fe0f",v:["1f486-1f3fb-200d-2642-fe0f","1f486-1f3fc-200d-2642-fe0f","1f486-1f3fd-200d-2642-fe0f","1f486-1f3fe-200d-2642-fe0f","1f486-1f3ff-200d-2642-fe0f"],a:"4"},{n:["face","woman","massage","woman getting massage"],u:"1f486-200d-2640-fe0f",v:["1f486-1f3fb-200d-2640-fe0f","1f486-1f3fc-200d-2640-fe0f","1f486-1f3fd-200d-2640-fe0f","1f486-1f3fe-200d-2640-fe0f","1f486-1f3ff-200d-2640-fe0f"],a:"4"},{n:["barber","beauty","parlor","haircut","person getting haircut"],u:"1f487",v:["1f487-1f3fb","1f487-1f3fc","1f487-1f3fd","1f487-1f3fe","1f487-1f3ff"],a:"0.6"},{n:["man","haircut","man getting haircut"],u:"1f487-200d-2642-fe0f",v:["1f487-1f3fb-200d-2642-fe0f","1f487-1f3fc-200d-2642-fe0f","1f487-1f3fd-200d-2642-fe0f","1f487-1f3fe-200d-2642-fe0f","1f487-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","haircut","woman getting haircut"],u:"1f487-200d-2640-fe0f",v:["1f487-1f3fb-200d-2640-fe0f","1f487-1f3fc-200d-2640-fe0f","1f487-1f3fd-200d-2640-fe0f","1f487-1f3fe-200d-2640-fe0f","1f487-1f3ff-200d-2640-fe0f"],a:"4"},{n:["hike","walk","walking","person walking"],u:"1f6b6",v:["1f6b6-1f3fb","1f6b6-1f3fc","1f6b6-1f3fd","1f6b6-1f3fe","1f6b6-1f3ff"],a:"0.6"},{n:["man","hike","walk","man walking"],u:"1f6b6-200d-2642-fe0f",v:["1f6b6-1f3fb-200d-2642-fe0f","1f6b6-1f3fc-200d-2642-fe0f","1f6b6-1f3fd-200d-2642-fe0f","1f6b6-1f3fe-200d-2642-fe0f","1f6b6-1f3ff-200d-2642-fe0f"],a:"4"},{n:["hike","walk","woman","woman walking"],u:"1f6b6-200d-2640-fe0f",v:["1f6b6-1f3fb-200d-2640-fe0f","1f6b6-1f3fc-200d-2640-fe0f","1f6b6-1f3fd-200d-2640-fe0f","1f6b6-1f3fe-200d-2640-fe0f","1f6b6-1f3ff-200d-2640-fe0f"],a:"4"},{n:["hike","walk","walking","person walking","person walking facing right"],u:"1f6b6-200d-27a1-fe0f",v:["1f6b6-1f3fb-200d-27a1-fe0f","1f6b6-1f3fc-200d-27a1-fe0f","1f6b6-1f3fd-200d-27a1-fe0f","1f6b6-1f3fe-200d-27a1-fe0f","1f6b6-1f3ff-200d-27a1-fe0f"],a:"15.1"},{n:["hike","walk","woman","woman walking","woman walking facing right"],u:"1f6b6-200d-2640-fe0f-200d-27a1-fe0f",v:["1f6b6-1f3fb-200d-2640-fe0f-200d-27a1-fe0f","1f6b6-1f3fc-200d-2640-fe0f-200d-27a1-fe0f","1f6b6-1f3fd-200d-2640-fe0f-200d-27a1-fe0f","1f6b6-1f3fe-200d-2640-fe0f-200d-27a1-fe0f","1f6b6-1f3ff-200d-2640-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["man","hike","walk","man walking","man walking facing right"],u:"1f6b6-200d-2642-fe0f-200d-27a1-fe0f",v:["1f6b6-1f3fb-200d-2642-fe0f-200d-27a1-fe0f","1f6b6-1f3fc-200d-2642-fe0f-200d-27a1-fe0f","1f6b6-1f3fd-200d-2642-fe0f-200d-27a1-fe0f","1f6b6-1f3fe-200d-2642-fe0f-200d-27a1-fe0f","1f6b6-1f3ff-200d-2642-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["stand","standing","person standing"],u:"1f9cd",v:["1f9cd-1f3fb","1f9cd-1f3fc","1f9cd-1f3fd","1f9cd-1f3fe","1f9cd-1f3ff"],a:"12"},{n:["man","standing","man standing"],u:"1f9cd-200d-2642-fe0f",v:["1f9cd-1f3fb-200d-2642-fe0f","1f9cd-1f3fc-200d-2642-fe0f","1f9cd-1f3fd-200d-2642-fe0f","1f9cd-1f3fe-200d-2642-fe0f","1f9cd-1f3ff-200d-2642-fe0f"],a:"12"},{n:["woman","standing","woman standing"],u:"1f9cd-200d-2640-fe0f",v:["1f9cd-1f3fb-200d-2640-fe0f","1f9cd-1f3fc-200d-2640-fe0f","1f9cd-1f3fd-200d-2640-fe0f","1f9cd-1f3fe-200d-2640-fe0f","1f9cd-1f3ff-200d-2640-fe0f"],a:"12"},{n:["kneel","kneeling","person kneeling"],u:"1f9ce",v:["1f9ce-1f3fb","1f9ce-1f3fc","1f9ce-1f3fd","1f9ce-1f3fe","1f9ce-1f3ff"],a:"12"},{n:["man","kneeling","man kneeling"],u:"1f9ce-200d-2642-fe0f",v:["1f9ce-1f3fb-200d-2642-fe0f","1f9ce-1f3fc-200d-2642-fe0f","1f9ce-1f3fd-200d-2642-fe0f","1f9ce-1f3fe-200d-2642-fe0f","1f9ce-1f3ff-200d-2642-fe0f"],a:"12"},{n:["woman","kneeling","woman kneeling"],u:"1f9ce-200d-2640-fe0f",v:["1f9ce-1f3fb-200d-2640-fe0f","1f9ce-1f3fc-200d-2640-fe0f","1f9ce-1f3fd-200d-2640-fe0f","1f9ce-1f3fe-200d-2640-fe0f","1f9ce-1f3ff-200d-2640-fe0f"],a:"12"},{n:["kneel","kneeling","person kneeling","person kneeling facing right"],u:"1f9ce-200d-27a1-fe0f",v:["1f9ce-1f3fb-200d-27a1-fe0f","1f9ce-1f3fc-200d-27a1-fe0f","1f9ce-1f3fd-200d-27a1-fe0f","1f9ce-1f3fe-200d-27a1-fe0f","1f9ce-1f3ff-200d-27a1-fe0f"],a:"15.1"},{n:["woman","kneeling","woman kneeling facing right"],u:"1f9ce-200d-2640-fe0f-200d-27a1-fe0f",v:["1f9ce-1f3fb-200d-2640-fe0f-200d-27a1-fe0f","1f9ce-1f3fc-200d-2640-fe0f-200d-27a1-fe0f","1f9ce-1f3fd-200d-2640-fe0f-200d-27a1-fe0f","1f9ce-1f3fe-200d-2640-fe0f-200d-27a1-fe0f","1f9ce-1f3ff-200d-2640-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["man","kneeling","man kneeling facing right"],u:"1f9ce-200d-2642-fe0f-200d-27a1-fe0f",v:["1f9ce-1f3fb-200d-2642-fe0f-200d-27a1-fe0f","1f9ce-1f3fc-200d-2642-fe0f-200d-27a1-fe0f","1f9ce-1f3fd-200d-2642-fe0f-200d-27a1-fe0f","1f9ce-1f3fe-200d-2642-fe0f-200d-27a1-fe0f","1f9ce-1f3ff-200d-2642-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["blind","accessibility","person with white cane"],u:"1f9d1-200d-1f9af",v:["1f9d1-1f3fb-200d-1f9af","1f9d1-1f3fc-200d-1f9af","1f9d1-1f3fd-200d-1f9af","1f9d1-1f3fe-200d-1f9af","1f9d1-1f3ff-200d-1f9af"],a:"12.1"},{n:["blind","accessibility","person with white cane","person with white cane facing right"],u:"1f9d1-200d-1f9af-200d-27a1-fe0f",v:["1f9d1-1f3fb-200d-1f9af-200d-27a1-fe0f","1f9d1-1f3fc-200d-1f9af-200d-27a1-fe0f","1f9d1-1f3fd-200d-1f9af-200d-27a1-fe0f","1f9d1-1f3fe-200d-1f9af-200d-27a1-fe0f","1f9d1-1f3ff-200d-1f9af-200d-27a1-fe0f"],a:"15.1"},{n:["man","blind","accessibility","man with white cane"],u:"1f468-200d-1f9af",v:["1f468-1f3fb-200d-1f9af","1f468-1f3fc-200d-1f9af","1f468-1f3fd-200d-1f9af","1f468-1f3fe-200d-1f9af","1f468-1f3ff-200d-1f9af"],a:"12"},{n:["man","blind","accessibility","man with white cane","man with white cane facing right"],u:"1f468-200d-1f9af-200d-27a1-fe0f",v:["1f468-1f3fb-200d-1f9af-200d-27a1-fe0f","1f468-1f3fc-200d-1f9af-200d-27a1-fe0f","1f468-1f3fd-200d-1f9af-200d-27a1-fe0f","1f468-1f3fe-200d-1f9af-200d-27a1-fe0f","1f468-1f3ff-200d-1f9af-200d-27a1-fe0f"],a:"15.1"},{n:["blind","woman","accessibility","woman with white cane"],u:"1f469-200d-1f9af",v:["1f469-1f3fb-200d-1f9af","1f469-1f3fc-200d-1f9af","1f469-1f3fd-200d-1f9af","1f469-1f3fe-200d-1f9af","1f469-1f3ff-200d-1f9af"],a:"12"},{n:["blind","woman","accessibility","woman with white cane","woman with white cane facing right"],u:"1f469-200d-1f9af-200d-27a1-fe0f",v:["1f469-1f3fb-200d-1f9af-200d-27a1-fe0f","1f469-1f3fc-200d-1f9af-200d-27a1-fe0f","1f469-1f3fd-200d-1f9af-200d-27a1-fe0f","1f469-1f3fe-200d-1f9af-200d-27a1-fe0f","1f469-1f3ff-200d-1f9af-200d-27a1-fe0f"],a:"15.1"},{n:["wheelchair","accessibility","person in motorized wheelchair"],u:"1f9d1-200d-1f9bc",v:["1f9d1-1f3fb-200d-1f9bc","1f9d1-1f3fc-200d-1f9bc","1f9d1-1f3fd-200d-1f9bc","1f9d1-1f3fe-200d-1f9bc","1f9d1-1f3ff-200d-1f9bc"],a:"12.1"},{n:["wheelchair","accessibility","person in motorized wheelchair","person in motorized wheelchair facing right"],u:"1f9d1-200d-1f9bc-200d-27a1-fe0f",v:["1f9d1-1f3fb-200d-1f9bc-200d-27a1-fe0f","1f9d1-1f3fc-200d-1f9bc-200d-27a1-fe0f","1f9d1-1f3fd-200d-1f9bc-200d-27a1-fe0f","1f9d1-1f3fe-200d-1f9bc-200d-27a1-fe0f","1f9d1-1f3ff-200d-1f9bc-200d-27a1-fe0f"],a:"15.1"},{n:["man","wheelchair","accessibility","man in motorized wheelchair"],u:"1f468-200d-1f9bc",v:["1f468-1f3fb-200d-1f9bc","1f468-1f3fc-200d-1f9bc","1f468-1f3fd-200d-1f9bc","1f468-1f3fe-200d-1f9bc","1f468-1f3ff-200d-1f9bc"],a:"12"},{n:["man","wheelchair","accessibility","man in motorized wheelchair","man in motorized wheelchair facing right"],u:"1f468-200d-1f9bc-200d-27a1-fe0f",v:["1f468-1f3fb-200d-1f9bc-200d-27a1-fe0f","1f468-1f3fc-200d-1f9bc-200d-27a1-fe0f","1f468-1f3fd-200d-1f9bc-200d-27a1-fe0f","1f468-1f3fe-200d-1f9bc-200d-27a1-fe0f","1f468-1f3ff-200d-1f9bc-200d-27a1-fe0f"],a:"15.1"},{n:["woman","wheelchair","accessibility","woman in motorized wheelchair"],u:"1f469-200d-1f9bc",v:["1f469-1f3fb-200d-1f9bc","1f469-1f3fc-200d-1f9bc","1f469-1f3fd-200d-1f9bc","1f469-1f3fe-200d-1f9bc","1f469-1f3ff-200d-1f9bc"],a:"12"},{n:["woman","wheelchair","accessibility","woman in motorized wheelchair","woman in motorized wheelchair facing right"],u:"1f469-200d-1f9bc-200d-27a1-fe0f",v:["1f469-1f3fb-200d-1f9bc-200d-27a1-fe0f","1f469-1f3fc-200d-1f9bc-200d-27a1-fe0f","1f469-1f3fd-200d-1f9bc-200d-27a1-fe0f","1f469-1f3fe-200d-1f9bc-200d-27a1-fe0f","1f469-1f3ff-200d-1f9bc-200d-27a1-fe0f"],a:"15.1"},{n:["wheelchair","accessibility","person in manual wheelchair"],u:"1f9d1-200d-1f9bd",v:["1f9d1-1f3fb-200d-1f9bd","1f9d1-1f3fc-200d-1f9bd","1f9d1-1f3fd-200d-1f9bd","1f9d1-1f3fe-200d-1f9bd","1f9d1-1f3ff-200d-1f9bd"],a:"12.1"},{n:["wheelchair","accessibility","person in manual wheelchair","person in manual wheelchair facing right"],u:"1f9d1-200d-1f9bd-200d-27a1-fe0f",v:["1f9d1-1f3fb-200d-1f9bd-200d-27a1-fe0f","1f9d1-1f3fc-200d-1f9bd-200d-27a1-fe0f","1f9d1-1f3fd-200d-1f9bd-200d-27a1-fe0f","1f9d1-1f3fe-200d-1f9bd-200d-27a1-fe0f","1f9d1-1f3ff-200d-1f9bd-200d-27a1-fe0f"],a:"15.1"},{n:["man","wheelchair","accessibility","man in manual wheelchair"],u:"1f468-200d-1f9bd",v:["1f468-1f3fb-200d-1f9bd","1f468-1f3fc-200d-1f9bd","1f468-1f3fd-200d-1f9bd","1f468-1f3fe-200d-1f9bd","1f468-1f3ff-200d-1f9bd"],a:"12"},{n:["man","wheelchair","accessibility","man in manual wheelchair","man in manual wheelchair facing right"],u:"1f468-200d-1f9bd-200d-27a1-fe0f",v:["1f468-1f3fb-200d-1f9bd-200d-27a1-fe0f","1f468-1f3fc-200d-1f9bd-200d-27a1-fe0f","1f468-1f3fd-200d-1f9bd-200d-27a1-fe0f","1f468-1f3fe-200d-1f9bd-200d-27a1-fe0f","1f468-1f3ff-200d-1f9bd-200d-27a1-fe0f"],a:"15.1"},{n:["woman","wheelchair","accessibility","woman in manual wheelchair"],u:"1f469-200d-1f9bd",v:["1f469-1f3fb-200d-1f9bd","1f469-1f3fc-200d-1f9bd","1f469-1f3fd-200d-1f9bd","1f469-1f3fe-200d-1f9bd","1f469-1f3ff-200d-1f9bd"],a:"12"},{n:["woman","wheelchair","accessibility","woman in manual wheelchair","woman in manual wheelchair facing right"],u:"1f469-200d-1f9bd-200d-27a1-fe0f",v:["1f469-1f3fb-200d-1f9bd-200d-27a1-fe0f","1f469-1f3fc-200d-1f9bd-200d-27a1-fe0f","1f469-1f3fd-200d-1f9bd-200d-27a1-fe0f","1f469-1f3fe-200d-1f9bd-200d-27a1-fe0f","1f469-1f3ff-200d-1f9bd-200d-27a1-fe0f"],a:"15.1"},{n:["running","marathon","person running"],u:"1f3c3",v:["1f3c3-1f3fb","1f3c3-1f3fc","1f3c3-1f3fd","1f3c3-1f3fe","1f3c3-1f3ff"],a:"0.6"},{n:["man","racing","running","marathon","man running"],u:"1f3c3-200d-2642-fe0f",v:["1f3c3-1f3fb-200d-2642-fe0f","1f3c3-1f3fc-200d-2642-fe0f","1f3c3-1f3fd-200d-2642-fe0f","1f3c3-1f3fe-200d-2642-fe0f","1f3c3-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","racing","running","marathon","woman running"],u:"1f3c3-200d-2640-fe0f",v:["1f3c3-1f3fb-200d-2640-fe0f","1f3c3-1f3fc-200d-2640-fe0f","1f3c3-1f3fd-200d-2640-fe0f","1f3c3-1f3fe-200d-2640-fe0f","1f3c3-1f3ff-200d-2640-fe0f"],a:"4"},{n:["running","marathon","person running","person running facing right"],u:"1f3c3-200d-27a1-fe0f",v:["1f3c3-1f3fb-200d-27a1-fe0f","1f3c3-1f3fc-200d-27a1-fe0f","1f3c3-1f3fd-200d-27a1-fe0f","1f3c3-1f3fe-200d-27a1-fe0f","1f3c3-1f3ff-200d-27a1-fe0f"],a:"15.1"},{n:["woman","racing","running","marathon","woman running facing right"],u:"1f3c3-200d-2640-fe0f-200d-27a1-fe0f",v:["1f3c3-1f3fb-200d-2640-fe0f-200d-27a1-fe0f","1f3c3-1f3fc-200d-2640-fe0f-200d-27a1-fe0f","1f3c3-1f3fd-200d-2640-fe0f-200d-27a1-fe0f","1f3c3-1f3fe-200d-2640-fe0f-200d-27a1-fe0f","1f3c3-1f3ff-200d-2640-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["man","racing","running","marathon","man running facing right"],u:"1f3c3-200d-2642-fe0f-200d-27a1-fe0f",v:["1f3c3-1f3fb-200d-2642-fe0f-200d-27a1-fe0f","1f3c3-1f3fc-200d-2642-fe0f-200d-27a1-fe0f","1f3c3-1f3fd-200d-2642-fe0f-200d-27a1-fe0f","1f3c3-1f3fe-200d-2642-fe0f-200d-27a1-fe0f","1f3c3-1f3ff-200d-2642-fe0f-200d-27a1-fe0f"],a:"15.1"},{n:["dance","woman","dancing","woman dancing"],u:"1f483",v:["1f483-1f3fb","1f483-1f3fc","1f483-1f3fd","1f483-1f3fe","1f483-1f3ff"],a:"0.6"},{n:["man","dance","dancing","man dancing"],u:"1f57a",v:["1f57a-1f3fb","1f57a-1f3fc","1f57a-1f3fd","1f57a-1f3fe","1f57a-1f3ff"],a:"3"},{n:["suit","person","business","person in suit levitating"],u:"1f574-fe0f",v:["1f574-1f3fb","1f574-1f3fc","1f574-1f3fd","1f574-1f3fe","1f574-1f3ff"],a:"0.7"},{n:["dancer","partying","bunny ear","people with bunny ears"],u:"1f46f",a:"0.6"},{n:["men","dancer","partying","bunny ear","men with bunny ears"],u:"1f46f-200d-2642-fe0f",a:"4"},{n:["women","dancer","partying","bunny ear","women with bunny ears"],u:"1f46f-200d-2640-fe0f",a:"4"},{n:["sauna","steam room","person in steamy room"],u:"1f9d6",v:["1f9d6-1f3fb","1f9d6-1f3fc","1f9d6-1f3fd","1f9d6-1f3fe","1f9d6-1f3ff"],a:"5"},{n:["sauna","steam room","man in steamy room"],u:"1f9d6-200d-2642-fe0f",v:["1f9d6-1f3fb-200d-2642-fe0f","1f9d6-1f3fc-200d-2642-fe0f","1f9d6-1f3fd-200d-2642-fe0f","1f9d6-1f3fe-200d-2642-fe0f","1f9d6-1f3ff-200d-2642-fe0f"],a:"5"},{n:["sauna","steam room","woman in steamy room"],u:"1f9d6-200d-2640-fe0f",v:["1f9d6-1f3fb-200d-2640-fe0f","1f9d6-1f3fc-200d-2640-fe0f","1f9d6-1f3fd-200d-2640-fe0f","1f9d6-1f3fe-200d-2640-fe0f","1f9d6-1f3ff-200d-2640-fe0f"],a:"5"},{n:["climber","person climbing"],u:"1f9d7",v:["1f9d7-1f3fb","1f9d7-1f3fc","1f9d7-1f3fd","1f9d7-1f3fe","1f9d7-1f3ff"],a:"5"},{n:["climber","man climbing"],u:"1f9d7-200d-2642-fe0f",v:["1f9d7-1f3fb-200d-2642-fe0f","1f9d7-1f3fc-200d-2642-fe0f","1f9d7-1f3fd-200d-2642-fe0f","1f9d7-1f3fe-200d-2642-fe0f","1f9d7-1f3ff-200d-2642-fe0f"],a:"5"},{n:["climber","woman climbing"],u:"1f9d7-200d-2640-fe0f",v:["1f9d7-1f3fb-200d-2640-fe0f","1f9d7-1f3fc-200d-2640-fe0f","1f9d7-1f3fd-200d-2640-fe0f","1f9d7-1f3fe-200d-2640-fe0f","1f9d7-1f3ff-200d-2640-fe0f"],a:"5"},{n:["sword","fencer","fencing","person fencing"],u:"1f93a",a:"3"},{n:["horse","jockey","racing","racehorse","horse racing"],u:"1f3c7",v:["1f3c7-1f3fb","1f3c7-1f3fc","1f3c7-1f3fd","1f3c7-1f3fe","1f3c7-1f3ff"],a:"1"},{n:["ski","snow","skier"],u:"26f7-fe0f",a:"0.7"},{n:["ski","snow","snowboard","snowboarder"],u:"1f3c2",v:["1f3c2-1f3fb","1f3c2-1f3fc","1f3c2-1f3fd","1f3c2-1f3fe","1f3c2-1f3ff"],a:"0.6"},{n:["ball","golf","person golfing"],u:"1f3cc-fe0f",v:["1f3cc-1f3fb","1f3cc-1f3fc","1f3cc-1f3fd","1f3cc-1f3fe","1f3cc-1f3ff"],a:"0.7"},{n:["man","golf","man golfing"],u:"1f3cc-fe0f-200d-2642-fe0f",v:["1f3cc-1f3fb-200d-2642-fe0f","1f3cc-1f3fc-200d-2642-fe0f","1f3cc-1f3fd-200d-2642-fe0f","1f3cc-1f3fe-200d-2642-fe0f","1f3cc-1f3ff-200d-2642-fe0f"],a:"4"},{n:["golf","woman","woman golfing"],u:"1f3cc-fe0f-200d-2640-fe0f",v:["1f3cc-1f3fb-200d-2640-fe0f","1f3cc-1f3fc-200d-2640-fe0f","1f3cc-1f3fd-200d-2640-fe0f","1f3cc-1f3fe-200d-2640-fe0f","1f3cc-1f3ff-200d-2640-fe0f"],a:"4"},{n:["surfing","person surfing"],u:"1f3c4",v:["1f3c4-1f3fb","1f3c4-1f3fc","1f3c4-1f3fd","1f3c4-1f3fe","1f3c4-1f3ff"],a:"0.6"},{n:["man","surfing","man surfing"],u:"1f3c4-200d-2642-fe0f",v:["1f3c4-1f3fb-200d-2642-fe0f","1f3c4-1f3fc-200d-2642-fe0f","1f3c4-1f3fd-200d-2642-fe0f","1f3c4-1f3fe-200d-2642-fe0f","1f3c4-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","surfing","woman surfing"],u:"1f3c4-200d-2640-fe0f",v:["1f3c4-1f3fb-200d-2640-fe0f","1f3c4-1f3fc-200d-2640-fe0f","1f3c4-1f3fd-200d-2640-fe0f","1f3c4-1f3fe-200d-2640-fe0f","1f3c4-1f3ff-200d-2640-fe0f"],a:"4"},{n:["boat","rowboat","person rowing boat"],u:"1f6a3",v:["1f6a3-1f3fb","1f6a3-1f3fc","1f6a3-1f3fd","1f6a3-1f3fe","1f6a3-1f3ff"],a:"1"},{n:["man","boat","rowboat","man rowing boat"],u:"1f6a3-200d-2642-fe0f",v:["1f6a3-1f3fb-200d-2642-fe0f","1f6a3-1f3fc-200d-2642-fe0f","1f6a3-1f3fd-200d-2642-fe0f","1f6a3-1f3fe-200d-2642-fe0f","1f6a3-1f3ff-200d-2642-fe0f"],a:"4"},{n:["boat","woman","rowboat","woman rowing boat"],u:"1f6a3-200d-2640-fe0f",v:["1f6a3-1f3fb-200d-2640-fe0f","1f6a3-1f3fc-200d-2640-fe0f","1f6a3-1f3fd-200d-2640-fe0f","1f6a3-1f3fe-200d-2640-fe0f","1f6a3-1f3ff-200d-2640-fe0f"],a:"4"},{n:["swim","person swimming"],u:"1f3ca",v:["1f3ca-1f3fb","1f3ca-1f3fc","1f3ca-1f3fd","1f3ca-1f3fe","1f3ca-1f3ff"],a:"0.6"},{n:["man","swim","man swimming"],u:"1f3ca-200d-2642-fe0f",v:["1f3ca-1f3fb-200d-2642-fe0f","1f3ca-1f3fc-200d-2642-fe0f","1f3ca-1f3fd-200d-2642-fe0f","1f3ca-1f3fe-200d-2642-fe0f","1f3ca-1f3ff-200d-2642-fe0f"],a:"4"},{n:["swim","woman","woman swimming"],u:"1f3ca-200d-2640-fe0f",v:["1f3ca-1f3fb-200d-2640-fe0f","1f3ca-1f3fc-200d-2640-fe0f","1f3ca-1f3fd-200d-2640-fe0f","1f3ca-1f3fe-200d-2640-fe0f","1f3ca-1f3ff-200d-2640-fe0f"],a:"4"},{n:["ball","person bouncing ball"],u:"26f9-fe0f",v:["26f9-1f3fb","26f9-1f3fc","26f9-1f3fd","26f9-1f3fe","26f9-1f3ff"],a:"0.7"},{n:["man","ball","man bouncing ball"],u:"26f9-fe0f-200d-2642-fe0f",v:["26f9-1f3fb-200d-2642-fe0f","26f9-1f3fc-200d-2642-fe0f","26f9-1f3fd-200d-2642-fe0f","26f9-1f3fe-200d-2642-fe0f","26f9-1f3ff-200d-2642-fe0f"],a:"4"},{n:["ball","woman","woman bouncing ball"],u:"26f9-fe0f-200d-2640-fe0f",v:["26f9-1f3fb-200d-2640-fe0f","26f9-1f3fc-200d-2640-fe0f","26f9-1f3fd-200d-2640-fe0f","26f9-1f3fe-200d-2640-fe0f","26f9-1f3ff-200d-2640-fe0f"],a:"4"},{n:["lifter","weight","person lifting weights"],u:"1f3cb-fe0f",v:["1f3cb-1f3fb","1f3cb-1f3fc","1f3cb-1f3fd","1f3cb-1f3fe","1f3cb-1f3ff"],a:"0.7"},{n:["man","weight lifter","man lifting weights"],u:"1f3cb-fe0f-200d-2642-fe0f",v:["1f3cb-1f3fb-200d-2642-fe0f","1f3cb-1f3fc-200d-2642-fe0f","1f3cb-1f3fd-200d-2642-fe0f","1f3cb-1f3fe-200d-2642-fe0f","1f3cb-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","weight lifter","woman lifting weights"],u:"1f3cb-fe0f-200d-2640-fe0f",v:["1f3cb-1f3fb-200d-2640-fe0f","1f3cb-1f3fc-200d-2640-fe0f","1f3cb-1f3fd-200d-2640-fe0f","1f3cb-1f3fe-200d-2640-fe0f","1f3cb-1f3ff-200d-2640-fe0f"],a:"4"},{n:["biking","bicycle","cyclist","person biking"],u:"1f6b4",v:["1f6b4-1f3fb","1f6b4-1f3fc","1f6b4-1f3fd","1f6b4-1f3fe","1f6b4-1f3ff"],a:"1"},{n:["man","biking","bicycle","cyclist","man biking"],u:"1f6b4-200d-2642-fe0f",v:["1f6b4-1f3fb-200d-2642-fe0f","1f6b4-1f3fc-200d-2642-fe0f","1f6b4-1f3fd-200d-2642-fe0f","1f6b4-1f3fe-200d-2642-fe0f","1f6b4-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","biking","bicycle","cyclist","woman biking"],u:"1f6b4-200d-2640-fe0f",v:["1f6b4-1f3fb-200d-2640-fe0f","1f6b4-1f3fc-200d-2640-fe0f","1f6b4-1f3fd-200d-2640-fe0f","1f6b4-1f3fe-200d-2640-fe0f","1f6b4-1f3ff-200d-2640-fe0f"],a:"4"},{n:["bike","bicycle","cyclist","mountain","bicyclist","person mountain biking"],u:"1f6b5",v:["1f6b5-1f3fb","1f6b5-1f3fc","1f6b5-1f3fd","1f6b5-1f3fe","1f6b5-1f3ff"],a:"1"},{n:["man","bike","bicycle","cyclist","mountain","man mountain biking"],u:"1f6b5-200d-2642-fe0f",v:["1f6b5-1f3fb-200d-2642-fe0f","1f6b5-1f3fc-200d-2642-fe0f","1f6b5-1f3fd-200d-2642-fe0f","1f6b5-1f3fe-200d-2642-fe0f","1f6b5-1f3ff-200d-2642-fe0f"],a:"4"},{n:["bike","woman","biking","bicycle","cyclist","mountain","woman mountain biking"],u:"1f6b5-200d-2640-fe0f",v:["1f6b5-1f3fb-200d-2640-fe0f","1f6b5-1f3fc-200d-2640-fe0f","1f6b5-1f3fd-200d-2640-fe0f","1f6b5-1f3fe-200d-2640-fe0f","1f6b5-1f3ff-200d-2640-fe0f"],a:"4"},{n:["cartwheel","gymnastics","person cartwheeling"],u:"1f938",v:["1f938-1f3fb","1f938-1f3fc","1f938-1f3fd","1f938-1f3fe","1f938-1f3ff"],a:"3"},{n:["man","cartwheel","gymnastics","man cartwheeling"],u:"1f938-200d-2642-fe0f",v:["1f938-1f3fb-200d-2642-fe0f","1f938-1f3fc-200d-2642-fe0f","1f938-1f3fd-200d-2642-fe0f","1f938-1f3fe-200d-2642-fe0f","1f938-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","cartwheel","gymnastics","woman cartwheeling"],u:"1f938-200d-2640-fe0f",v:["1f938-1f3fb-200d-2640-fe0f","1f938-1f3fc-200d-2640-fe0f","1f938-1f3fd-200d-2640-fe0f","1f938-1f3fe-200d-2640-fe0f","1f938-1f3ff-200d-2640-fe0f"],a:"4"},{n:["wrestle","wrestler","people wrestling"],u:"1f93c",a:"3"},{n:["men","wrestle","men wrestling"],u:"1f93c-200d-2642-fe0f",a:"4"},{n:["women","wrestle","women wrestling"],u:"1f93c-200d-2640-fe0f",a:"4"},{n:["polo","water","person playing water polo"],u:"1f93d",v:["1f93d-1f3fb","1f93d-1f3fc","1f93d-1f3fd","1f93d-1f3fe","1f93d-1f3ff"],a:"3"},{n:["man","water polo","man playing water polo"],u:"1f93d-200d-2642-fe0f",v:["1f93d-1f3fb-200d-2642-fe0f","1f93d-1f3fc-200d-2642-fe0f","1f93d-1f3fd-200d-2642-fe0f","1f93d-1f3fe-200d-2642-fe0f","1f93d-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","water polo","woman playing water polo"],u:"1f93d-200d-2640-fe0f",v:["1f93d-1f3fb-200d-2640-fe0f","1f93d-1f3fc-200d-2640-fe0f","1f93d-1f3fd-200d-2640-fe0f","1f93d-1f3fe-200d-2640-fe0f","1f93d-1f3ff-200d-2640-fe0f"],a:"4"},{n:["ball","handball","person playing handball"],u:"1f93e",v:["1f93e-1f3fb","1f93e-1f3fc","1f93e-1f3fd","1f93e-1f3fe","1f93e-1f3ff"],a:"3"},{n:["man","handball","man playing handball"],u:"1f93e-200d-2642-fe0f",v:["1f93e-1f3fb-200d-2642-fe0f","1f93e-1f3fc-200d-2642-fe0f","1f93e-1f3fd-200d-2642-fe0f","1f93e-1f3fe-200d-2642-fe0f","1f93e-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","handball","woman playing handball"],u:"1f93e-200d-2640-fe0f",v:["1f93e-1f3fb-200d-2640-fe0f","1f93e-1f3fc-200d-2640-fe0f","1f93e-1f3fd-200d-2640-fe0f","1f93e-1f3fe-200d-2640-fe0f","1f93e-1f3ff-200d-2640-fe0f"],a:"4"},{n:["skill","juggle","balance","multitask","person juggling"],u:"1f939",v:["1f939-1f3fb","1f939-1f3fc","1f939-1f3fd","1f939-1f3fe","1f939-1f3ff"],a:"3"},{n:["man","juggling","multitask","man juggling"],u:"1f939-200d-2642-fe0f",v:["1f939-1f3fb-200d-2642-fe0f","1f939-1f3fc-200d-2642-fe0f","1f939-1f3fd-200d-2642-fe0f","1f939-1f3fe-200d-2642-fe0f","1f939-1f3ff-200d-2642-fe0f"],a:"4"},{n:["woman","juggling","multitask","woman juggling"],u:"1f939-200d-2640-fe0f",v:["1f939-1f3fb-200d-2640-fe0f","1f939-1f3fc-200d-2640-fe0f","1f939-1f3fd-200d-2640-fe0f","1f939-1f3fe-200d-2640-fe0f","1f939-1f3ff-200d-2640-fe0f"],a:"4"},{n:["yoga","meditation","person in lotus position"],u:"1f9d8",v:["1f9d8-1f3fb","1f9d8-1f3fc","1f9d8-1f3fd","1f9d8-1f3fe","1f9d8-1f3ff"],a:"5"},{n:["yoga","meditation","man in lotus position"],u:"1f9d8-200d-2642-fe0f",v:["1f9d8-1f3fb-200d-2642-fe0f","1f9d8-1f3fc-200d-2642-fe0f","1f9d8-1f3fd-200d-2642-fe0f","1f9d8-1f3fe-200d-2642-fe0f","1f9d8-1f3ff-200d-2642-fe0f"],a:"5"},{n:["yoga","meditation","woman in lotus position"],u:"1f9d8-200d-2640-fe0f",v:["1f9d8-1f3fb-200d-2640-fe0f","1f9d8-1f3fc-200d-2640-fe0f","1f9d8-1f3fd-200d-2640-fe0f","1f9d8-1f3fe-200d-2640-fe0f","1f9d8-1f3ff-200d-2640-fe0f"],a:"5"},{n:["bath","bathtub","person taking bath"],u:"1f6c0",v:["1f6c0-1f3fb","1f6c0-1f3fc","1f6c0-1f3fd","1f6c0-1f3fe","1f6c0-1f3ff"],a:"0.6"},{n:["hotel","sleep","good night","person in bed"],u:"1f6cc",v:["1f6cc-1f3fb","1f6cc-1f3fc","1f6cc-1f3fd","1f6cc-1f3fe","1f6cc-1f3ff"],a:"1"},{n:["hand","hold","couple","person","holding hands","people holding hands"],u:"1f9d1-200d-1f91d-200d-1f9d1",v:["1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb","1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc","1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd","1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe","1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff","1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb","1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc","1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd","1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe","1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff","1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb","1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc","1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd","1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe","1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff","1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb","1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc","1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd","1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe","1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff","1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb","1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc","1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd","1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe","1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff"],a:"12"},{n:["hand","women","couple","holding hands","women holding hands"],u:"1f46d",v:["1f46d-1f3fb","1f46d-1f3fc","1f46d-1f3fd","1f46d-1f3fe","1f46d-1f3ff","1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc","1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd","1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe","1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff","1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb","1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd","1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe","1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff","1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb","1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc","1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe","1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff","1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb","1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc","1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd","1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff","1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb","1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc","1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd","1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe"],a:"1"},{n:["man","hand","hold","woman","couple","holding hands","woman and man holding hands"],u:"1f46b",v:["1f46b-1f3fb","1f46b-1f3fc","1f46b-1f3fd","1f46b-1f3fe","1f46b-1f3ff","1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc","1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd","1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe","1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff","1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb","1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd","1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe","1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff","1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb","1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc","1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe","1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff","1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb","1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc","1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd","1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff","1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb","1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc","1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd","1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe"],a:"0.6"},{n:["man","men","twins","couple","gemini","zodiac","holding hands","men holding hands"],u:"1f46c",v:["1f46c-1f3fb","1f46c-1f3fc","1f46c-1f3fd","1f46c-1f3fe","1f46c-1f3ff","1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc","1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd","1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe","1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff","1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb","1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd","1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe","1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff","1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb","1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc","1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe","1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff","1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb","1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc","1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd","1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff","1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb","1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc","1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd","1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe"],a:"1"},{n:["kiss","couple"],u:"1f48f",v:["1f48f-1f3fb","1f48f-1f3fc","1f48f-1f3fd","1f48f-1f3fe","1f48f-1f3ff","1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc","1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd","1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe","1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff","1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb","1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd","1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe","1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff","1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb","1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc","1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe","1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff","1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb","1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc","1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd","1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff","1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb","1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc","1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd","1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe"],a:"0.6"},{n:["man","kiss","woman","couple","kiss: woman, man"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f468",v:["1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff"],a:"2"},{n:["man","kiss","couple","kiss: man, man"],u:"1f468-200d-2764-fe0f-200d-1f48b-200d-1f468",v:["1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff","1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb","1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc","1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd","1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe","1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff"],a:"2"},{n:["kiss","woman","couple","kiss: woman, woman"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f469",v:["1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe","1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe","1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe","1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe","1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe","1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff"],a:"2"},{n:["love","couple","couple with heart"],u:"1f491",v:["1f491-1f3fb","1f491-1f3fc","1f491-1f3fd","1f491-1f3fe","1f491-1f3ff","1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fc","1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fd","1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fe","1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3ff","1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fb","1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fd","1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fe","1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3ff","1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fb","1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fc","1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fe","1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3ff","1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fb","1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fc","1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fd","1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3ff","1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fb","1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fc","1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fd","1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fe"],a:"0.6"},{n:["man","love","woman","couple","couple with heart","couple with heart: woman, man"],u:"1f469-200d-2764-fe0f-200d-1f468",v:["1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb","1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc","1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd","1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe","1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff","1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb","1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc","1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd","1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe","1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff","1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb","1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc","1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd","1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe","1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff","1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb","1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc","1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd","1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe","1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff","1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb","1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc","1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd","1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe","1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff"],a:"2"},{n:["man","love","couple","couple with heart","couple with heart: man, man"],u:"1f468-200d-2764-fe0f-200d-1f468",v:["1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb","1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc","1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd","1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe","1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff","1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb","1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc","1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd","1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe","1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff","1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb","1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc","1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd","1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe","1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff","1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb","1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc","1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd","1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe","1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff","1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb","1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc","1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd","1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe","1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff"],a:"2"},{n:["love","woman","couple","couple with heart","couple with heart: woman, woman"],u:"1f469-200d-2764-fe0f-200d-1f469",v:["1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fb","1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fc","1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fd","1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fe","1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3ff","1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fb","1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fc","1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fd","1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fe","1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3ff","1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fb","1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fc","1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fd","1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fe","1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3ff","1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fb","1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fc","1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fd","1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fe","1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3ff","1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fb","1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fc","1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fd","1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fe","1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3ff"],a:"2"},{n:["boy","man","woman","family","family: man, woman, boy"],u:"1f468-200d-1f469-200d-1f466",a:"2"},{n:["man","girl","woman","family","family: man, woman, girl"],u:"1f468-200d-1f469-200d-1f467",a:"2"},{n:["boy","man","girl","woman","family","family: man, woman, girl, boy"],u:"1f468-200d-1f469-200d-1f467-200d-1f466",a:"2"},{n:["boy","man","woman","family","family: man, woman, boy, boy"],u:"1f468-200d-1f469-200d-1f466-200d-1f466",a:"2"},{n:["man","girl","woman","family","family: man, woman, girl, girl"],u:"1f468-200d-1f469-200d-1f467-200d-1f467",a:"2"},{n:["boy","man","family","family: man, man, boy"],u:"1f468-200d-1f468-200d-1f466",a:"2"},{n:["man","girl","family","family: man, man, girl"],u:"1f468-200d-1f468-200d-1f467",a:"2"},{n:["boy","man","girl","family","family: man, man, girl, boy"],u:"1f468-200d-1f468-200d-1f467-200d-1f466",a:"2"},{n:["boy","man","family","family: man, man, boy, boy"],u:"1f468-200d-1f468-200d-1f466-200d-1f466",a:"2"},{n:["man","girl","family","family: man, man, girl, girl"],u:"1f468-200d-1f468-200d-1f467-200d-1f467",a:"2"},{n:["boy","woman","family","family: woman, woman, boy"],u:"1f469-200d-1f469-200d-1f466",a:"2"},{n:["girl","woman","family","family: woman, woman, girl"],u:"1f469-200d-1f469-200d-1f467",a:"2"},{n:["boy","girl","woman","family","family: woman, woman, girl, boy"],u:"1f469-200d-1f469-200d-1f467-200d-1f466",a:"2"},{n:["boy","woman","family","family: woman, woman, boy, boy"],u:"1f469-200d-1f469-200d-1f466-200d-1f466",a:"2"},{n:["girl","woman","family","family: woman, woman, girl, girl"],u:"1f469-200d-1f469-200d-1f467-200d-1f467",a:"2"},{n:["boy","man","family","family: man, boy"],u:"1f468-200d-1f466",a:"4"},{n:["boy","man","family","family: man, boy, boy"],u:"1f468-200d-1f466-200d-1f466",a:"4"},{n:["man","girl","family","family: man, girl"],u:"1f468-200d-1f467",a:"4"},{n:["boy","man","girl","family","family: man, girl, boy"],u:"1f468-200d-1f467-200d-1f466",a:"4"},{n:["man","girl","family","family: man, girl, girl"],u:"1f468-200d-1f467-200d-1f467",a:"4"},{n:["boy","woman","family","family: woman, boy"],u:"1f469-200d-1f466",a:"4"},{n:["boy","woman","family","family: woman, boy, boy"],u:"1f469-200d-1f466-200d-1f466",a:"4"},{n:["girl","woman","family","family: woman, girl"],u:"1f469-200d-1f467",a:"4"},{n:["boy","girl","woman","family","family: woman, girl, boy"],u:"1f469-200d-1f467-200d-1f466",a:"4"},{n:["girl","woman","family","family: woman, girl, girl"],u:"1f469-200d-1f467-200d-1f467",a:"4"},{n:["face","head","speak","speaking","silhouette","speaking head"],u:"1f5e3-fe0f",a:"0.7"},{n:["bust","silhouette","bust in silhouette"],u:"1f464",a:"0.6"},{n:["bust","silhouette","busts in silhouette"],u:"1f465",a:"1"},{n:["hug","hello","thanks","goodbye","people hugging"],u:"1fac2",a:"13"},{n:["family"],u:"1f46a",a:"0.6"},{n:["family: adult, adult, child"],u:"1f9d1-200d-1f9d1-200d-1f9d2",a:"15.1"},{n:["family: adult, adult, child, child"],u:"1f9d1-200d-1f9d1-200d-1f9d2-200d-1f9d2",a:"15.1"},{n:["family: adult, child"],u:"1f9d1-200d-1f9d2",a:"15.1"},{n:["family: adult, child, child"],u:"1f9d1-200d-1f9d2-200d-1f9d2",a:"15.1"},{n:["print","clothing","footprint","footprints"],u:"1f463",a:"0.6"}],animals_nature:[{n:["face","monkey","monkey face"],u:"1f435",a:"0.6"},{n:["monkey"],u:"1f412",a:"0.6"},{n:["gorilla"],u:"1f98d",a:"3"},{n:["ape","orangutan"],u:"1f9a7",a:"12"},{n:["dog","pet","face","dog face"],u:"1f436",a:"0.6"},{n:["dog","pet"],u:"1f415",a:"0.7"},{n:["blind","guide","guide dog","accessibility"],u:"1f9ae",a:"12"},{n:["dog","service","assistance","service dog","accessibility"],u:"1f415-200d-1f9ba",a:"12"},{n:["dog","poodle"],u:"1f429",a:"0.6"},{n:["wolf","face"],u:"1f43a",a:"0.6"},{n:["fox","face"],u:"1f98a",a:"3"},{n:["sly","raccoon","curious"],u:"1f99d",a:"11"},{n:["cat","pet","face","cat face"],u:"1f431",a:"0.6"},{n:["cat","pet"],u:"1f408",a:"0.7"},{n:["cat","black","unlucky","black cat"],u:"1f408-200d-2b1b",a:"13"},{n:["leo","lion","face","zodiac"],u:"1f981",a:"1"},{n:["face","tiger","tiger face"],u:"1f42f",a:"0.6"},{n:["tiger"],u:"1f405",a:"1"},{n:["leopard"],u:"1f406",a:"1"},{n:["face","horse","horse face"],u:"1f434",a:"0.6"},{n:["elk","moose","animal","mammal","antlers"],u:"1face",a:"15"},{n:["ass","mule","burro","donkey","animal","mammal","stubborn"],u:"1facf",a:"15"},{n:["horse","racing","racehorse","equestrian"],u:"1f40e",a:"0.6"},{n:["face","unicorn"],u:"1f984",a:"1"},{n:["zebra","stripe"],u:"1f993",a:"5"},{n:["deer"],u:"1f98c",a:"3"},{n:["herd","bison","wisent","buffalo"],u:"1f9ac",a:"13"},{n:["cow","face","cow face"],u:"1f42e",a:"0.6"},{n:["ox","bull","taurus","zodiac"],u:"1f402",a:"1"},{n:["water","buffalo","water buffalo"],u:"1f403",a:"1"},{n:["cow"],u:"1f404",a:"1"},{n:["pig","face","pig face"],u:"1f437",a:"0.6"},{n:["pig","sow"],u:"1f416",a:"1"},{n:["pig","boar"],u:"1f417",a:"0.6"},{n:["pig","face","nose","pig nose"],u:"1f43d",a:"0.6"},{n:["ram","male","aries","sheep","zodiac"],u:"1f40f",a:"1"},{n:["ewe","sheep","female"],u:"1f411",a:"0.6"},{n:["goat","zodiac","capricorn"],u:"1f410",a:"1"},{n:["hump","camel","dromedary"],u:"1f42a",a:"1"},{n:["hump","camel","bactrian","two hump camel"],u:"1f42b",a:"0.6"},{n:["wool","llama","alpaca","vicuña","guanaco"],u:"1f999",a:"11"},{n:["spots","giraffe"],u:"1f992",a:"5"},{n:["elephant"],u:"1f418",a:"0.6"},{n:["tusk","large","woolly","mammoth","extinction"],u:"1f9a3",a:"13"},{n:["rhinoceros"],u:"1f98f",a:"3"},{n:["hippo","hippopotamus"],u:"1f99b",a:"11"},{n:["face","mouse","mouse face"],u:"1f42d",a:"0.6"},{n:["mouse"],u:"1f401",a:"1"},{n:["rat"],u:"1f400",a:"1"},{n:["pet","face","hamster"],u:"1f439",a:"0.6"},{n:["pet","face","bunny","rabbit","rabbit face"],u:"1f430",a:"0.6"},{n:["pet","bunny","rabbit"],u:"1f407",a:"1"},{n:["chipmunk","squirrel"],u:"1f43f-fe0f",a:"0.7"},{n:["dam","beaver"],u:"1f9ab",a:"13"},{n:["spiny","hedgehog"],u:"1f994",a:"5"},{n:["bat","vampire"],u:"1f987",a:"3"},{n:["bear","face"],u:"1f43b",a:"0.6"},{n:["bear","white","arctic","polar bear"],u:"1f43b-200d-2744-fe0f",a:"13"},{n:["face","koala","marsupial"],u:"1f428",a:"0.6"},{n:["face","panda"],u:"1f43c",a:"0.6"},{n:["lazy","slow","sloth"],u:"1f9a5",a:"12"},{n:["otter","fishing","playful"],u:"1f9a6",a:"12"},{n:["skunk","stink"],u:"1f9a8",a:"12"},{n:["joey","jump","kangaroo","marsupial"],u:"1f998",a:"11"},{n:["badger","pester","honey badger"],u:"1f9a1",a:"11"},{n:["paw","feet","print","paw prints"],u:"1f43e",a:"0.6"},{n:["bird","turkey"],u:"1f983",a:"1"},{n:["bird","chicken"],u:"1f414",a:"0.6"},{n:["bird","rooster"],u:"1f413",a:"1"},{n:["baby","bird","chick","hatching","hatching chick"],u:"1f423",a:"0.6"},{n:["baby","bird","chick","baby chick"],u:"1f424",a:"0.6"},{n:["baby","bird","chick","front facing baby chick"],u:"1f425",a:"0.6"},{n:["bird"],u:"1f426",a:"0.6"},{n:["bird","penguin"],u:"1f427",a:"0.6"},{n:["fly","dove","bird","peace"],u:"1f54a-fe0f",a:"0.7"},{n:["bird","eagle"],u:"1f985",a:"3"},{n:["duck","bird"],u:"1f986",a:"3"},{n:["swan","bird","cygnet","ugly duckling"],u:"1f9a2",a:"11"},{n:["owl","bird","wise"],u:"1f989",a:"3"},{n:["dodo","large","mauritius","extinction"],u:"1f9a4",a:"13"},{n:["bird","light","flight","feather","plumage"],u:"1fab6",a:"13"},{n:["flamingo","tropical","flamboyant"],u:"1f9a9",a:"12"},{n:["bird","proud","peahen","peacock","ostentatious"],u:"1f99a",a:"11"},{n:["bird","talk","parrot","pirate"],u:"1f99c",a:"11"},{n:["wing","bird","flying","angelic","aviation","mythology"],u:"1fabd",a:"15"},{n:["bird","crow","rook","black","raven","black bird"],u:"1f426-200d-2b1b",a:"15"},{n:["bird","fowl","honk","goose","silly"],u:"1fabf",a:"15"},{n:["phoenix","fantasy","rebirth","firebird","reincarnation"],u:"1f426-200d-1f525",a:"15.1"},{n:["frog","face"],u:"1f438",a:"0.6"},{n:["crocodile"],u:"1f40a",a:"1"},{n:["turtle","terrapin","tortoise"],u:"1f422",a:"0.6"},{n:["lizard","reptile"],u:"1f98e",a:"3"},{n:["snake","bearer","zodiac","serpent","ophiuchus"],u:"1f40d",a:"0.6"},{n:["face","dragon","fairy tale","dragon face"],u:"1f432",a:"0.6"},{n:["dragon","fairy tale"],u:"1f409",a:"1"},{n:["sauropod","diplodocus","brontosaurus","brachiosaurus"],u:"1f995",a:"5"},{n:["T Rex","t rex","tyrannosaurus rex"],u:"1f996",a:"5"},{n:["face","whale","spouting","spouting whale"],u:"1f433",a:"0.6"},{n:["whale"],u:"1f40b",a:"1"},{n:["dolphin","flipper"],u:"1f42c",a:"0.6"},{n:["seal","sea lion"],u:"1f9ad",a:"13"},{n:["fish","pisces","zodiac"],u:"1f41f",a:"0.6"},{n:["fish","tropical","tropical fish"],u:"1f420",a:"0.6"},{n:["fish","blowfish"],u:"1f421",a:"0.6"},{n:["fish","shark"],u:"1f988",a:"3"},{n:["octopus"],u:"1f419",a:"0.6"},{n:["shell","spiral","spiral shell"],u:"1f41a",a:"0.6"},{n:["reef","coral","ocean"],u:"1fab8",a:"14"},{n:["burn","ouch","jelly","marine","stinger","jellyfish","invertebrate"],u:"1fabc",a:"15"},{n:["snail"],u:"1f40c",a:"0.6"},{n:["insect","pretty","butterfly"],u:"1f98b",a:"3"},{n:["bug","insect"],u:"1f41b",a:"0.6"},{n:["ant","insect"],u:"1f41c",a:"0.6"},{n:["bee","insect","honeybee"],u:"1f41d",a:"0.6"},{n:["bug","beetle","insect"],u:"1fab2",a:"13"},{n:["beetle","insect","ladybug","ladybird","lady beetle"],u:"1f41e",a:"0.6"},{n:["cricket","grasshopper"],u:"1f997",a:"5"},{n:["pest","roach","insect","cockroach"],u:"1fab3",a:"13"},{n:["spider","insect"],u:"1f577-fe0f",a:"0.7"},{n:["web","spider","spider web"],u:"1f578-fe0f",a:"0.7"},{n:["zodiac","scorpio","scorpion"],u:"1f982",a:"1"},{n:["pest","fever","virus","disease","malaria","mosquito"],u:"1f99f",a:"11"},{n:["fly","pest","maggot","disease","rotting"],u:"1fab0",a:"13"},{n:["worm","annelid","parasite","earthworm"],u:"1fab1",a:"13"},{n:["virus","amoeba","microbe","bacteria"],u:"1f9a0",a:"11"},{n:["flower","bouquet"],u:"1f490",a:"0.6"},{n:["cherry","flower","blossom","cherry blossom"],u:"1f338",a:"0.6"},{n:["flower","white flower"],u:"1f4ae",a:"0.6"},{n:["lotus","flower","purity","buddhism","hinduism"],u:"1fab7",a:"14"},{n:["plant","rosette"],u:"1f3f5-fe0f",a:"0.7"},{n:["rose","flower"],u:"1f339",a:"0.6"},{n:["flower","wilted","wilted flower"],u:"1f940",a:"3"},{n:["flower","hibiscus"],u:"1f33a",a:"0.6"},{n:["sun","flower","sunflower"],u:"1f33b",a:"0.6"},{n:["flower","blossom"],u:"1f33c",a:"0.6"},{n:["tulip","flower"],u:"1f337",a:"0.6"},{n:["flower","lupine","hyacinth","lavender","bluebonnet","snapdragon"],u:"1fabb",a:"15"},{n:["young","seedling"],u:"1f331",a:"0.6"},{n:["grow","house","plant","boring","useless","nurturing","potted plant"],u:"1fab4",a:"13"},{n:["tree","evergreen tree"],u:"1f332",a:"1"},{n:["tree","shedding","deciduous","deciduous tree"],u:"1f333",a:"1"},{n:["palm","tree","palm tree"],u:"1f334",a:"0.6"},{n:["plant","cactus"],u:"1f335",a:"0.6"},{n:["ear","rice","grain","sheaf of rice"],u:"1f33e",a:"0.6"},{n:["herb","leaf"],u:"1f33f",a:"0.6"},{n:["plant","shamrock"],u:"2618-fe0f",a:"1"},{n:["4","four","leaf","clover","four leaf clover"],u:"1f340",a:"0.6"},{n:["leaf","maple","falling","maple leaf"],u:"1f341",a:"0.6"},{n:["leaf","falling","fallen leaf"],u:"1f342",a:"0.6"},{n:["blow","leaf","wind","flutter","leaf fluttering in wind"],u:"1f343",a:"0.6"},{n:["nesting","empty nest"],u:"1fab9",a:"14"},{n:["nesting","nest with eggs"],u:"1faba",a:"14"},{n:["mushroom","toadstool"],u:"1f344",a:"0.6"}],food_drink:[{n:["fruit","grape","grapes"],u:"1f347",a:"0.6"},{n:["melon","fruit"],u:"1f348",a:"0.6"},{n:["fruit","watermelon"],u:"1f349",a:"0.6"},{n:["fruit","orange","tangerine"],u:"1f34a",a:"0.6"},{n:["lemon","fruit","citrus"],u:"1f34b",a:"1"},{n:["lime","fruit","citrus","tropical"],u:"1f34b-200d-1f7e9",a:"15.1"},{n:["fruit","banana"],u:"1f34c",a:"0.6"},{n:["fruit","pineapple"],u:"1f34d",a:"0.6"},{n:["mango","fruit","tropical"],u:"1f96d",a:"11"},{n:["red","apple","fruit","red apple"],u:"1f34e",a:"0.6"},{n:["apple","fruit","green","green apple"],u:"1f34f",a:"0.6"},{n:["pear","fruit"],u:"1f350",a:"1"},{n:["peach","fruit"],u:"1f351",a:"0.6"},{n:["red","fruit","cherry","berries","cherries"],u:"1f352",a:"0.6"},{n:["berry","fruit","strawberry"],u:"1f353",a:"0.6"},{n:["blue","berry","bilberry","blueberry","blueberries"],u:"1fad0",a:"13"},{n:["food","kiwi","fruit","kiwi fruit"],u:"1f95d",a:"3"},{n:["fruit","tomato","vegetable"],u:"1f345",a:"0.6"},{n:["food","olive"],u:"1fad2",a:"13"},{n:["palm","coconut","piña colada"],u:"1f965",a:"5"},{n:["food","fruit","avocado"],u:"1f951",a:"3"},{n:["eggplant","aubergine","vegetable"],u:"1f346",a:"0.6"},{n:["food","potato","vegetable"],u:"1f954",a:"3"},{n:["food","carrot","vegetable"],u:"1f955",a:"3"},{n:["ear","corn","maze","maize","ear of corn"],u:"1f33d",a:"0.6"},{n:["hot","pepper","hot pepper"],u:"1f336-fe0f",a:"0.7"},{n:["pepper","capsicum","vegetable","bell pepper"],u:"1fad1",a:"13"},{n:["food","pickle","cucumber","vegetable"],u:"1f952",a:"3"},{n:["kale","cabbage","lettuce","bok choy","leafy green"],u:"1f96c",a:"11"},{n:["broccoli","wild cabbage"],u:"1f966",a:"5"},{n:["garlic","flavoring"],u:"1f9c4",a:"12"},{n:["onion","flavoring"],u:"1f9c5",a:"12"},{n:["nut","food","peanut","peanuts","vegetable"],u:"1f95c",a:"3"},{n:["food","beans","kidney","legume"],u:"1fad8",a:"14"},{n:["plant","chestnut"],u:"1f330",a:"0.6"},{n:["beer","root","spice","ginger root"],u:"1fada",a:"15"},{n:["pea","pod","beans","legume","pea pod","edamame","vegetable"],u:"1fadb",a:"15"},{n:["food","fungus","nature","vegetable","brown mushroom"],u:"1f344-200d-1f7eb",a:"15.1"},{n:["loaf","bread"],u:"1f35e",a:"0.6"},{n:["food","roll","bread","french","croissant","breakfast"],u:"1f950",a:"3"},{n:["food","bread","french","baguette","baguette bread"],u:"1f956",a:"3"},{n:["naan","pita","arepa","lavash","flatbread"],u:"1fad3",a:"13"},{n:["pretzel","twisted"],u:"1f968",a:"5"},{n:["bagel","bakery","schmear","breakfast"],u:"1f96f",a:"11"},{n:["food","crêpe","hotcake","pancake","pancakes","breakfast"],u:"1f95e",a:"3"},{n:["iron","waffle","breakfast","indecisive"],u:"1f9c7",a:"12"},{n:["cheese","cheese wedge"],u:"1f9c0",a:"1"},{n:["bone","meat","meat on bone"],u:"1f356",a:"0.6"},{n:["leg","bone","chicken","poultry","drumstick","poultry leg"],u:"1f357",a:"0.6"},{n:["chop","steak","lambchop","porkchop","cut of meat"],u:"1f969",a:"5"},{n:["food","meat","bacon","breakfast"],u:"1f953",a:"3"},{n:["burger","hamburger"],u:"1f354",a:"0.6"},{n:["fries","french","french fries"],u:"1f35f",a:"0.6"},{n:["pizza","slice","cheese"],u:"1f355",a:"0.6"},{n:["hotdog","hot dog","sausage","frankfurter"],u:"1f32d",a:"1"},{n:["bread","sandwich"],u:"1f96a",a:"5"},{n:["taco","mexican"],u:"1f32e",a:"1"},{n:["wrap","burrito","mexican"],u:"1f32f",a:"1"},{n:["tamale","mexican","wrapped"],u:"1fad4",a:"13"},{n:["food","gyro","kebab","falafel","stuffed","flatbread","stuffed flatbread"],u:"1f959",a:"3"},{n:["falafel","chickpea","meatball"],u:"1f9c6",a:"12"},{n:["egg","food","breakfast"],u:"1f95a",a:"3"},{n:["egg","pan","frying","cooking","breakfast"],u:"1f373",a:"0.6"},{n:["pan","food","paella","shallow","casserole","shallow pan of food"],u:"1f958",a:"3"},{n:["pot","stew","pot of food"],u:"1f372",a:"0.6"},{n:["pot","swiss","fondue","cheese","melted","chocolate"],u:"1fad5",a:"13"},{n:["cereal","congee","breakfast","bowl with spoon"],u:"1f963",a:"5"},{n:["food","green","salad","green salad"],u:"1f957",a:"3"},{n:["popcorn"],u:"1f37f",a:"1"},{n:["dairy","butter"],u:"1f9c8",a:"12"},{n:["salt","shaker","condiment"],u:"1f9c2",a:"11"},{n:["can","canned food"],u:"1f96b",a:"5"},{n:["box","bento","bento box"],u:"1f371",a:"0.6"},{n:["rice","cracker","rice cracker"],u:"1f358",a:"0.6"},{n:["ball","rice","japanese","rice ball"],u:"1f359",a:"0.6"},{n:["rice","cooked","cooked rice"],u:"1f35a",a:"0.6"},{n:["rice","curry","curry rice"],u:"1f35b",a:"0.6"},{n:["bowl","ramen","noodle","steaming","steaming bowl"],u:"1f35c",a:"0.6"},{n:["pasta","spaghetti"],u:"1f35d",a:"0.6"},{n:["sweet","potato","roasted","roasted sweet potato"],u:"1f360",a:"0.6"},{n:["oden","kebab","stick","skewer","seafood"],u:"1f362",a:"0.6"},{n:["sushi"],u:"1f363",a:"0.6"},{n:["fried","prawn","shrimp","tempura","fried shrimp"],u:"1f364",a:"0.6"},{n:["cake","fish","swirl","pastry","fish cake with swirl"],u:"1f365",a:"0.6"},{n:["autumn","yuèbǐng","festival","moon cake"],u:"1f96e",a:"11"},{n:["dango","stick","sweet","skewer","dessert","japanese"],u:"1f361",a:"0.6"},{n:["gyōza","jiaozi","pierogi","dumpling","empanada","potsticker"],u:"1f95f",a:"5"},{n:["prophecy","fortune cookie"],u:"1f960",a:"5"},{n:["takeout box","oyster pail"],u:"1f961",a:"5"},{n:["crab","cancer","zodiac"],u:"1f980",a:"1"},{n:["claws","bisque","lobster","seafood"],u:"1f99e",a:"11"},{n:["food","small","shrimp","shellfish"],u:"1f990",a:"3"},{n:["food","squid","molusc"],u:"1f991",a:"3"},{n:["pearl","oyster","diving"],u:"1f9aa",a:"12"},{n:["ice","soft","cream","sweet","dessert","icecream","soft ice cream"],u:"1f366",a:"0.6"},{n:["ice","sweet","shaved","dessert","shaved ice"],u:"1f367",a:"0.6"},{n:["ice","cream","sweet","dessert","ice cream"],u:"1f368",a:"0.6"},{n:["donut","sweet","dessert","doughnut","breakfast"],u:"1f369",a:"0.6"},{n:["sweet","cookie","dessert"],u:"1f36a",a:"0.6"},{n:["cake","sweet","pastry","dessert","birthday","celebration","birthday cake"],u:"1f382",a:"0.6"},{n:["cake","slice","sweet","pastry","dessert","shortcake"],u:"1f370",a:"0.6"},{n:["sweet","bakery","cupcake"],u:"1f9c1",a:"11"},{n:["pie","pastry","filling"],u:"1f967",a:"5"},{n:["bar","sweet","dessert","chocolate","chocolate bar"],u:"1f36b",a:"0.6"},{n:["candy","sweet","dessert"],u:"1f36c",a:"0.6"},{n:["candy","sweet","dessert","lollipop"],u:"1f36d",a:"0.6"},{n:["sweet","custard","dessert","pudding"],u:"1f36e",a:"0.6"},{n:["pot","honey","sweet","honeypot","honey pot"],u:"1f36f",a:"0.6"},{n:["baby","milk","drink","bottle","baby bottle"],u:"1f37c",a:"1"},{n:["milk","drink","glass","glass of milk"],u:"1f95b",a:"3"},{n:["hot","tea","drink","coffee","beverage","steaming","hot beverage"],u:"2615",a:"0.6"},{n:["pot","tea","drink","teapot"],u:"1fad6",a:"13"},{n:["cup","tea","drink","teacup","beverage","teacup without handle"],u:"1f375",a:"0.6"},{n:["bar","cup","sake","drink","bottle","beverage"],u:"1f376",a:"0.6"},{n:["bar","cork","drink","bottle","popping","bottle with popping cork"],u:"1f37e",a:"1"},{n:["bar","wine","drink","glass","beverage","wine glass"],u:"1f377",a:"0.6"},{n:["bar","drink","glass","cocktail","cocktail glass"],u:"1f378",a:"0.6"},{n:["bar","drink","tropical","tropical drink"],u:"1f379",a:"0.6"},{n:["bar","mug","beer","drink","beer mug"],u:"1f37a",a:"0.6"},{n:["bar","mug","beer","clink","drink","clinking beer mugs"],u:"1f37b",a:"0.6"},{n:["clink","drink","glass","celebrate","clinking glasses"],u:"1f942",a:"3"},{n:["shot","glass","liquor","whisky","tumbler","tumbler glass"],u:"1f943",a:"3"},{n:["drink","empty","glass","spill","pouring liquid"],u:"1fad7",a:"14"},{n:["soda","juice","cup with straw"],u:"1f964",a:"5"},{n:["tea","milk","pearl","bubble","bubble tea"],u:"1f9cb",a:"13"},{n:["box","juice","straw","sweet","beverage","beverage box"],u:"1f9c3",a:"12"},{n:["mate","drink"],u:"1f9c9",a:"12"},{n:["ice","cold","iceberg","ice cube"],u:"1f9ca",a:"12"},{n:["hashi","chopsticks"],u:"1f962",a:"5"},{n:["fork","knife","plate","cooking","fork and knife with plate"],u:"1f37d-fe0f",a:"0.7"},{n:["fork","knife","cooking","cutlery","fork and knife"],u:"1f374",a:"0.6"},{n:["spoon","tableware"],u:"1f944",a:"3"},{n:["tool","hocho","knife","weapon","cooking","kitchen knife"],u:"1f52a",a:"0.6"},{n:["jar","empty","sauce","store","condiment","container"],u:"1fad9",a:"14"},{n:["jug","drink","zodiac","amphora","cooking","aquarius"],u:"1f3fa",a:"1"}],travel_places:[{n:["earth","globe","world","africa","europe","globe showing Europe Africa","globe showing europe africa"],u:"1f30d",a:"0.7"},{n:["earth","globe","world","americas","globe showing Americas","globe showing americas"],u:"1f30e",a:"0.7"},{n:["asia","earth","globe","world","australia","globe showing Asia Australia","globe showing asia australia"],u:"1f30f",a:"0.6"},{n:["earth","globe","world","meridians","globe with meridians"],u:"1f310",a:"1"},{n:["map","world","world map"],u:"1f5fa-fe0f",a:"0.7"},{n:["map","japan","map of Japan","map of japan"],u:"1f5fe",a:"0.6"},{n:["compass","magnetic","navigation","orienteering"],u:"1f9ed",a:"11"},{n:["cold","snow","mountain","snow capped mountain"],u:"1f3d4-fe0f",a:"0.7"},{n:["mountain"],u:"26f0-fe0f",a:"0.7"},{n:["volcano","eruption","mountain"],u:"1f30b",a:"0.6"},{n:["fuji","mountain","mount fuji"],u:"1f5fb",a:"0.6"},{n:["camping"],u:"1f3d5-fe0f",a:"0.7"},{n:["beach","umbrella","beach with umbrella"],u:"1f3d6-fe0f",a:"0.7"},{n:["desert"],u:"1f3dc-fe0f",a:"0.7"},{n:["desert","island","desert island"],u:"1f3dd-fe0f",a:"0.7"},{n:["park","national park"],u:"1f3de-fe0f",a:"0.7"},{n:["stadium"],u:"1f3df-fe0f",a:"0.7"},{n:["classical","classical building"],u:"1f3db-fe0f",a:"0.7"},{n:["construction","building construction"],u:"1f3d7-fe0f",a:"0.7"},{n:["clay","wall","brick","bricks","mortar"],u:"1f9f1",a:"11"},{n:["rock","heavy","solid","stone","boulder"],u:"1faa8",a:"13"},{n:["log","wood","lumber","timber"],u:"1fab5",a:"13"},{n:["hut","yurt","house","roundhouse"],u:"1f6d6",a:"13"},{n:["houses"],u:"1f3d8-fe0f",a:"0.7"},{n:["house","derelict","derelict house"],u:"1f3da-fe0f",a:"0.7"},{n:["home","house"],u:"1f3e0",a:"0.6"},{n:["home","house","garden","house with garden"],u:"1f3e1",a:"0.6"},{n:["building","office building"],u:"1f3e2",a:"0.6"},{n:["post","japanese","Japanese post office","japanese post office"],u:"1f3e3",a:"0.6"},{n:["post","european","post office"],u:"1f3e4",a:"1"},{n:["doctor","hospital","medicine"],u:"1f3e5",a:"0.6"},{n:["bank","building"],u:"1f3e6",a:"0.6"},{n:["hotel","building"],u:"1f3e8",a:"0.6"},{n:["love","hotel","love hotel"],u:"1f3e9",a:"0.6"},{n:["store","convenience","convenience store"],u:"1f3ea",a:"0.6"},{n:["school","building"],u:"1f3eb",a:"0.6"},{n:["store","department","department store"],u:"1f3ec",a:"0.6"},{n:["factory","building"],u:"1f3ed",a:"0.6"},{n:["castle","japanese","Japanese castle"],u:"1f3ef",a:"0.6"},{n:["castle","european"],u:"1f3f0",a:"0.6"},{n:["chapel","wedding","romance"],u:"1f492",a:"0.6"},{n:["tokyo","tower","Tokyo tower"],u:"1f5fc",a:"0.6"},{n:["statue","liberty","Statue of Liberty","statue of liberty"],u:"1f5fd",a:"0.6"},{n:["cross","church","religion","christian"],u:"26ea",a:"0.6"},{n:["islam","mosque","muslim","religion"],u:"1f54c",a:"1"},{n:["hindu","temple","hindu temple"],u:"1f6d5",a:"12"},{n:["jew","jewish","temple","religion","synagogue"],u:"1f54d",a:"1"},{n:["shinto","shrine","religion","shinto shrine"],u:"26e9-fe0f",a:"0.7"},{n:["kaaba","islam","muslim","religion"],u:"1f54b",a:"1"},{n:["fountain"],u:"26f2",a:"0.6"},{n:["tent","camping"],u:"26fa",a:"0.6"},{n:["fog","foggy"],u:"1f301",a:"0.6"},{n:["star","night","night with stars"],u:"1f303",a:"0.6"},{n:["city","cityscape"],u:"1f3d9-fe0f",a:"0.7"},{n:["sun","morning","sunrise","mountain","sunrise over mountains"],u:"1f304",a:"0.6"},{n:["sun","sunrise","morning"],u:"1f305",a:"0.6"},{n:["city","dusk","sunset","evening","landscape","cityscape at dusk"],u:"1f306",a:"0.6"},{n:["sun","dusk","sunset"],u:"1f307",a:"0.6"},{n:["night","bridge","bridge at night"],u:"1f309",a:"0.6"},{n:["hot","springs","steaming","hotsprings","hot springs"],u:"2668-fe0f",a:"0.6"},{n:["horse","carousel","carousel horse"],u:"1f3a0",a:"0.6"},{n:["play","theme park","amusement park","playground slide"],u:"1f6dd",a:"14"},{n:["wheel","ferris","theme park","ferris wheel","amusement park"],u:"1f3a1",a:"0.6"},{n:["roller","coaster","theme park","roller coaster","amusement park"],u:"1f3a2",a:"0.6"},{n:["pole","barber","haircut","barber pole"],u:"1f488",a:"0.6"},{n:["tent","circus","circus tent"],u:"1f3aa",a:"0.6"},{n:["steam","train","engine","railway","locomotive"],u:"1f682",a:"1"},{n:["car","tram","train","railway","electric","trolleybus","railway car"],u:"1f683",a:"0.6"},{n:["speed","train","railway","shinkansen","high speed train"],u:"1f684",a:"0.6"},{n:["speed","train","bullet","railway","shinkansen","bullet train"],u:"1f685",a:"0.6"},{n:["train","railway"],u:"1f686",a:"1"},{n:["metro","subway"],u:"1f687",a:"0.6"},{n:["railway","light rail"],u:"1f688",a:"1"},{n:["train","station","railway"],u:"1f689",a:"0.6"},{n:["tram","trolleybus"],u:"1f68a",a:"1"},{n:["vehicle","monorail"],u:"1f69d",a:"1"},{n:["car","railway","mountain","mountain railway"],u:"1f69e",a:"1"},{n:["car","tram","tram car","trolleybus"],u:"1f68b",a:"1"},{n:["bus","vehicle"],u:"1f68c",a:"0.6"},{n:["bus","oncoming","oncoming bus"],u:"1f68d",a:"0.7"},{n:["bus","tram","trolley","trolleybus"],u:"1f68e",a:"1"},{n:["bus","minibus"],u:"1f690",a:"1"},{n:["vehicle","ambulance"],u:"1f691",a:"0.6"},{n:["fire","truck","engine","fire engine"],u:"1f692",a:"0.6"},{n:["car","patrol","police","police car"],u:"1f693",a:"0.6"},{n:["car","police","oncoming","oncoming police car"],u:"1f694",a:"0.7"},{n:["taxi","vehicle"],u:"1f695",a:"0.6"},{n:["taxi","oncoming","oncoming taxi"],u:"1f696",a:"1"},{n:["car","automobile"],u:"1f697",a:"0.6"},{n:["car","oncoming","automobile","oncoming automobile"],u:"1f698",a:"0.7"},{n:["recreational","sport utility","sport utility vehicle"],u:"1f699",a:"0.6"},{n:["truck","pickup","pick up","pickup truck"],u:"1f6fb",a:"13"},{n:["truck","delivery","delivery truck"],u:"1f69a",a:"0.6"},{n:["semi","lorry","truck","articulated lorry"],u:"1f69b",a:"1"},{n:["tractor","vehicle"],u:"1f69c",a:"1"},{n:["car","racing","racing car"],u:"1f3ce-fe0f",a:"0.7"},{n:["racing","motorcycle"],u:"1f3cd-fe0f",a:"0.7"},{n:["motor","scooter","motor scooter"],u:"1f6f5",a:"3"},{n:["accessibility","manual wheelchair"],u:"1f9bd",a:"12"},{n:["accessibility","motorized wheelchair"],u:"1f9bc",a:"12"},{n:["tuk tuk","auto rickshaw"],u:"1f6fa",a:"12"},{n:["bike","bicycle"],u:"1f6b2",a:"0.6"},{n:["kick","scooter","kick scooter"],u:"1f6f4",a:"3"},{n:["board","skateboard"],u:"1f6f9",a:"11"},{n:["skate","roller","roller skate"],u:"1f6fc",a:"13"},{n:["bus","stop","bus stop"],u:"1f68f",a:"0.6"},{n:["road","highway","motorway"],u:"1f6e3-fe0f",a:"0.7"},{n:["train","railway","railway track"],u:"1f6e4-fe0f",a:"0.7"},{n:["oil","drum","oil drum"],u:"1f6e2-fe0f",a:"0.7"},{n:["gas","fuel","pump","diesel","station","fuelpump","fuel pump"],u:"26fd",a:"0.6"},{n:["tire","turn","wheel","circle"],u:"1f6de",a:"14"},{n:["car","light","beacon","police","revolving","police car light"],u:"1f6a8",a:"0.6"},{n:["light","signal","traffic","horizontal traffic light"],u:"1f6a5",a:"0.6"},{n:["light","signal","traffic","vertical traffic light"],u:"1f6a6",a:"1"},{n:["sign","stop","stop sign","octagonal"],u:"1f6d1",a:"3"},{n:["barrier","construction"],u:"1f6a7",a:"0.6"},{n:["ship","tool","anchor"],u:"2693",a:"0.6"},{n:["float","rescue","safety","ring buoy","life saver","life preserver"],u:"1f6df",a:"14"},{n:["sea","boat","yacht","resort","sailboat"],u:"26f5",a:"0.6"},{n:["boat","canoe"],u:"1f6f6",a:"3"},{n:["boat","speedboat"],u:"1f6a4",a:"0.6"},{n:["ship","passenger","passenger ship"],u:"1f6f3-fe0f",a:"0.7"},{n:["boat","ferry","passenger"],u:"26f4-fe0f",a:"0.7"},{n:["boat","motorboat","motor boat"],u:"1f6e5-fe0f",a:"0.7"},{n:["ship","boat","passenger"],u:"1f6a2",a:"0.6"},{n:["airplane","aeroplane"],u:"2708-fe0f",a:"0.6"},{n:["airplane","aeroplane","small airplane"],u:"1f6e9-fe0f",a:"0.7"},{n:["airplane","check in","aeroplane","departure","departures","airplane departure"],u:"1f6eb",a:"1"},{n:["landing","airplane","arrivals","arriving","aeroplane","airplane arrival"],u:"1f6ec",a:"1"},{n:["skydive","parasail","parachute","hang glide"],u:"1fa82",a:"12"},{n:["seat","chair"],u:"1f4ba",a:"0.6"},{n:["vehicle","helicopter"],u:"1f681",a:"1"},{n:["railway","suspension","suspension railway"],u:"1f69f",a:"1"},{n:["cable","gondola","mountain","mountain cableway"],u:"1f6a0",a:"1"},{n:["car","cable","aerial","gondola","tramway","aerial tramway"],u:"1f6a1",a:"1"},{n:["space","satellite"],u:"1f6f0-fe0f",a:"0.7"},{n:["space","rocket"],u:"1f680",a:"0.6"},{n:["ufo","flying saucer"],u:"1f6f8",a:"5"},{n:["bell","hotel","bellhop","bellhop bell"],u:"1f6ce-fe0f",a:"0.7"},{n:["travel","luggage","packing"],u:"1f9f3",a:"11"},{n:["sand","timer","hourglass done"],u:"231b",a:"0.6"},{n:["sand","timer","hourglass","hourglass not done"],u:"23f3",a:"0.6"},{n:["watch","clock"],u:"231a",a:"0.6"},{n:["alarm","clock","alarm clock"],u:"23f0",a:"0.6"},{n:["clock","stopwatch"],u:"23f1-fe0f",a:"1"},{n:["clock","timer","timer clock"],u:"23f2-fe0f",a:"1"},{n:["clock","mantelpiece clock"],u:"1f570-fe0f",a:"0.7"},{n:["00","12","12:00","clock","twelve","o’clock","twelve o’clock"],u:"1f55b",a:"0.6"},{n:["12","12:30","clock","thirty","twelve","twelve thirty"],u:"1f567",a:"0.7"},{n:["1","00","one","1:00","clock","o’clock","one o’clock"],u:"1f550",a:"0.6"},{n:["1","one","1:30","clock","thirty","one thirty"],u:"1f55c",a:"0.7"},{n:["2","00","two","2:00","clock","o’clock","two o’clock"],u:"1f551",a:"0.6"},{n:["2","two","2:30","clock","thirty","two thirty"],u:"1f55d",a:"0.7"},{n:["3","00","3:00","clock","three","o’clock","three o’clock"],u:"1f552",a:"0.6"},{n:["3","3:30","clock","three","thirty","three thirty"],u:"1f55e",a:"0.7"},{n:["4","00","4:00","four","clock","o’clock","four o’clock"],u:"1f553",a:"0.6"},{n:["4","4:30","four","clock","thirty","four thirty"],u:"1f55f",a:"0.7"},{n:["5","00","5:00","five","clock","o’clock","five o’clock"],u:"1f554",a:"0.6"},{n:["5","5:30","five","clock","thirty","five thirty"],u:"1f560",a:"0.7"},{n:["6","00","six","6:00","clock","o’clock","six o’clock"],u:"1f555",a:"0.6"},{n:["6","six","6:30","clock","thirty","six thirty"],u:"1f561",a:"0.7"},{n:["7","00","7:00","clock","seven","o’clock","seven o’clock"],u:"1f556",a:"0.6"},{n:["7","7:30","clock","seven","thirty","seven thirty"],u:"1f562",a:"0.7"},{n:["8","00","8:00","clock","eight","o’clock","eight o’clock"],u:"1f557",a:"0.6"},{n:["8","8:30","clock","eight","thirty","eight thirty"],u:"1f563",a:"0.7"},{n:["9","00","9:00","nine","clock","o’clock","nine o’clock"],u:"1f558",a:"0.6"},{n:["9","9:30","nine","clock","thirty","nine thirty"],u:"1f564",a:"0.7"},{n:["00","10","ten","10:00","clock","o’clock","ten o’clock"],u:"1f559",a:"0.6"},{n:["10","ten","10:30","clock","thirty","ten thirty"],u:"1f565",a:"0.7"},{n:["00","11","11:00","clock","eleven","o’clock","eleven o’clock"],u:"1f55a",a:"0.6"},{n:["11","11:30","clock","eleven","thirty","eleven thirty"],u:"1f566",a:"0.7"},{n:["dark","moon","new moon"],u:"1f311",a:"0.6"},{n:["moon","waxing","crescent","waxing crescent moon"],u:"1f312",a:"1"},{n:["moon","quarter","first quarter moon"],u:"1f313",a:"0.6"},{n:["moon","waxing","gibbous","waxing gibbous moon"],u:"1f314",a:"0.6"},{n:["full","moon","full moon"],u:"1f315",a:"0.6"},{n:["moon","waning","gibbous","waning gibbous moon"],u:"1f316",a:"1"},{n:["moon","quarter","last quarter moon"],u:"1f317",a:"1"},{n:["moon","waning","crescent","waning crescent moon"],u:"1f318",a:"1"},{n:["moon","crescent","crescent moon"],u:"1f319",a:"0.6"},{n:["face","moon","new moon face"],u:"1f31a",a:"1"},{n:["face","moon","quarter","first quarter moon face"],u:"1f31b",a:"0.6"},{n:["face","moon","quarter","last quarter moon face"],u:"1f31c",a:"0.7"},{n:["weather","thermometer"],u:"1f321-fe0f",a:"0.7"},{n:["sun","rays","sunny","bright"],u:"2600-fe0f",a:"0.6"},{n:["face","full","moon","bright","full moon face"],u:"1f31d",a:"1"},{n:["sun","face","bright","sun with face"],u:"1f31e",a:"1"},{n:["saturn","saturnine","ringed planet"],u:"1fa90",a:"12"},{n:["star"],u:"2b50",a:"0.6"},{n:["glow","star","shining","sparkle","glittery","glowing star"],u:"1f31f",a:"0.6"},{n:["star","falling","shooting","shooting star"],u:"1f320",a:"0.6"},{n:["space","milky way"],u:"1f30c",a:"0.6"},{n:["cloud","weather"],u:"2601-fe0f",a:"0.6"},{n:["sun","cloud","sun behind cloud"],u:"26c5",a:"0.6"},{n:["rain","cloud","thunder","cloud with lightning and rain"],u:"26c8-fe0f",a:"0.7"},{n:["sun","cloud","sun behind small cloud"],u:"1f324-fe0f",a:"0.7"},{n:["sun","cloud","sun behind large cloud"],u:"1f325-fe0f",a:"0.7"},{n:["sun","rain","cloud","sun behind rain cloud"],u:"1f326-fe0f",a:"0.7"},{n:["rain","cloud","cloud with rain"],u:"1f327-fe0f",a:"0.7"},{n:["cold","snow","cloud","cloud with snow"],u:"1f328-fe0f",a:"0.7"},{n:["cloud","lightning","cloud with lightning"],u:"1f329-fe0f",a:"0.7"},{n:["cloud","tornado","whirlwind"],u:"1f32a-fe0f",a:"0.7"},{n:["fog","cloud"],u:"1f32b-fe0f",a:"0.7"},{n:["blow","face","wind","cloud","wind face"],u:"1f32c-fe0f",a:"0.7"},{n:["dizzy","cyclone","twister","typhoon","hurricane"],u:"1f300",a:"0.6"},{n:["rain","rainbow"],u:"1f308",a:"0.6"},{n:["rain","clothing","umbrella","closed umbrella"],u:"1f302",a:"0.6"},{n:["rain","umbrella","clothing"],u:"2602-fe0f",a:"0.7"},{n:["drop","rain","clothing","umbrella","umbrella with rain drops"],u:"2614",a:"0.6"},{n:["sun","rain","umbrella","umbrella on ground"],u:"26f1-fe0f",a:"0.7"},{n:["zap","danger","voltage","electric","lightning","high voltage"],u:"26a1",a:"0.6"},{n:["cold","snow","snowflake"],u:"2744-fe0f",a:"0.6"},{n:["cold","snow","snowman"],u:"2603-fe0f",a:"0.7"},{n:["cold","snow","snowman","snowman without snow"],u:"26c4",a:"0.6"},{n:["comet","space"],u:"2604-fe0f",a:"1"},{n:["fire","tool","flame"],u:"1f525",a:"0.6"},{n:["cold","drop","comic","sweat","droplet"],u:"1f4a7",a:"0.6"},{n:["wave","ocean","water","water wave"],u:"1f30a",a:"0.6"}],activities:[{n:["jack","lantern","halloween","celebration","jack o lantern"],u:"1f383",a:"0.6"},{n:["tree","christmas","celebration","Christmas tree"],u:"1f384",a:"0.6"},{n:["fireworks","celebration"],u:"1f386",a:"0.6"},{n:["sparkle","sparkler","fireworks","celebration"],u:"1f387",a:"0.6"},{n:["dynamite","explosive","fireworks","firecracker"],u:"1f9e8",a:"11"},{n:["*","star","sparkle","sparkles"],u:"2728",a:"0.6"},{n:["balloon","celebration"],u:"1f388",a:"0.6"},{n:["tada","party","popper","celebration","party popper"],u:"1f389",a:"0.6"},{n:["ball","confetti","celebration","confetti ball"],u:"1f38a",a:"0.6"},{n:["tree","banner","japanese","celebration","tanabata tree"],u:"1f38b",a:"0.6"},{n:["pine","bamboo","japanese","celebration","pine decoration"],u:"1f38d",a:"0.6"},{n:["doll","festival","japanese","celebration","Japanese dolls","japanese dolls"],u:"1f38e",a:"0.6"},{n:["carp","streamer","celebration","carp streamer"],u:"1f38f",a:"0.6"},{n:["bell","wind","chime","wind chime","celebration"],u:"1f390",a:"0.6"},{n:["moon","ceremony","celebration","moon viewing ceremony"],u:"1f391",a:"0.6"},{n:["gift","money","hóngbāo","lai see","good luck","red envelope"],u:"1f9e7",a:"11"},{n:["ribbon","celebration"],u:"1f380",a:"0.6"},{n:["box","gift","present","wrapped","celebration","wrapped gift"],u:"1f381",a:"0.6"},{n:["ribbon","reminder","celebration","reminder ribbon"],u:"1f397-fe0f",a:"0.7"},{n:["ticket","admission","admission tickets"],u:"1f39f-fe0f",a:"0.7"},{n:["ticket","admission"],u:"1f3ab",a:"0.6"},{n:["medal","military","celebration","military medal"],u:"1f396-fe0f",a:"0.7"},{n:["prize","trophy"],u:"1f3c6",a:"0.6"},{n:["medal","sports medal"],u:"1f3c5",a:"1"},{n:["gold","first","medal","1st place medal"],u:"1f947",a:"3"},{n:["medal","second","silver","2nd place medal"],u:"1f948",a:"3"},{n:["medal","third","bronze","3rd place medal"],u:"1f949",a:"3"},{n:["ball","soccer","football","soccer ball"],u:"26bd",a:"0.6"},{n:["ball","baseball"],u:"26be",a:"0.6"},{n:["ball","glove","softball","underarm"],u:"1f94e",a:"11"},{n:["ball","hoop","basketball"],u:"1f3c0",a:"0.6"},{n:["ball","game","volleyball"],u:"1f3d0",a:"1"},{n:["ball","american","football","american football"],u:"1f3c8",a:"0.6"},{n:["ball","rugby","football","rugby football"],u:"1f3c9",a:"1"},{n:["ball","tennis","racquet"],u:"1f3be",a:"0.6"},{n:["ultimate","flying disc"],u:"1f94f",a:"11"},{n:["ball","game","bowling"],u:"1f3b3",a:"0.6"},{n:["bat","ball","game","cricket game"],u:"1f3cf",a:"1"},{n:["ball","game","field","stick","hockey","field hockey"],u:"1f3d1",a:"1"},{n:["ice","game","puck","stick","hockey","ice hockey"],u:"1f3d2",a:"1"},{n:["ball","goal","stick","lacrosse"],u:"1f94d",a:"11"},{n:["bat","ball","game","paddle","ping pong","table tennis"],u:"1f3d3",a:"1"},{n:["game","birdie","racquet","badminton","shuttlecock"],u:"1f3f8",a:"1"},{n:["glove","boxing","boxing glove"],u:"1f94a",a:"3"},{n:["judo","karate","uniform","taekwondo","martial arts","martial arts uniform"],u:"1f94b",a:"3"},{n:["net","goal","goal net"],u:"1f945",a:"3"},{n:["golf","hole","flag in hole"],u:"26f3",a:"0.6"},{n:["ice","skate","ice skate"],u:"26f8-fe0f",a:"0.7"},{n:["fish","pole","fishing pole"],u:"1f3a3",a:"0.6"},{n:["scuba","diving","snorkeling","diving mask"],u:"1f93f",a:"12"},{n:["sash","shirt","running","athletics","running shirt"],u:"1f3bd",a:"0.6"},{n:["ski","skis","snow"],u:"1f3bf",a:"0.6"},{n:["sled","sledge","sleigh"],u:"1f6f7",a:"5"},{n:["game","rock","curling stone"],u:"1f94c",a:"5"},{n:["hit","dart","game","target","bullseye","direct hit"],u:"1f3af",a:"0.6"},{n:["toy","yo yo","fluctuate"],u:"1fa80",a:"12"},{n:["fly","kite","soar"],u:"1fa81",a:"12"},{n:["gun","tool","water","pistol","weapon","handgun","revolver","water pistol"],u:"1f52b",a:"0.6"},{n:["8","ball","game","eight","billiard","pool 8 ball"],u:"1f3b1",a:"0.6"},{n:["ball","tool","crystal","fantasy","fortune","fairy tale","crystal ball"],u:"1f52e",a:"0.6"},{n:["magic","witch","wizard","magic wand"],u:"1fa84",a:"13"},{n:["game","video game","controller"],u:"1f3ae",a:"0.6"},{n:["game","joystick","video game"],u:"1f579-fe0f",a:"0.7"},{n:["game","slot","slot machine"],u:"1f3b0",a:"0.6"},{n:["die","dice","game","game die"],u:"1f3b2",a:"0.6"},{n:["clue","piece","jigsaw","puzzle","puzzle piece","interlocking"],u:"1f9e9",a:"11"},{n:["toy","plush","stuffed","plaything","teddy bear"],u:"1f9f8",a:"11"},{n:["party","piñata","celebration"],u:"1fa85",a:"13"},{n:["dance","disco","party","glitter","mirror ball"],u:"1faa9",a:"14"},{n:["doll","russia","nesting","nesting dolls"],u:"1fa86",a:"13"},{n:["card","game","spade suit"],u:"2660-fe0f",a:"0.6"},{n:["card","game","heart suit"],u:"2665-fe0f",a:"0.6"},{n:["card","game","diamond suit"],u:"2666-fe0f",a:"0.6"},{n:["card","game","club suit"],u:"2663-fe0f",a:"0.6"},{n:["dupe","chess","chess pawn","expendable"],u:"265f-fe0f",a:"11"},{n:["card","game","joker","wildcard"],u:"1f0cf",a:"0.6"},{n:["red","game","mahjong","mahjong red dragon"],u:"1f004",a:"0.6"},{n:["card","game","flower","playing","japanese","flower playing cards"],u:"1f3b4",a:"0.6"},{n:["art","mask","theater","theatre","performing","performing arts"],u:"1f3ad",a:"0.6"},{n:["art","frame","museum","picture","painting","framed picture"],u:"1f5bc-fe0f",a:"0.7"},{n:["art","museum","palette","painting","artist palette"],u:"1f3a8",a:"0.6"},{n:["spool","thread","needle","sewing","string"],u:"1f9f5",a:"11"},{n:["needle","sewing","sutures","stitches","tailoring","embroidery","sewing needle"],u:"1faa1",a:"13"},{n:["yarn","ball","knit","crochet"],u:"1f9f6",a:"11"},{n:["tie","knot","rope","twine","twist","tangled"],u:"1faa2",a:"13"}],objects:[{n:["eye","glasses","eyewear","clothing","eyeglasses"],u:"1f453",a:"0.6"},{n:["eye","dark","eyewear","glasses","sunglasses"],u:"1f576-fe0f",a:"0.7"},{n:["goggles","welding","swimming","eye protection"],u:"1f97d",a:"11"},{n:["doctor","lab coat","scientist","experiment"],u:"1f97c",a:"11"},{n:["vest","safety","emergency","safety vest"],u:"1f9ba",a:"12"},{n:["tie","necktie","clothing"],u:"1f454",a:"0.6"},{n:["shirt","tshirt","t shirt","clothing"],u:"1f455",a:"0.6"},{n:["jeans","pants","clothing","trousers"],u:"1f456",a:"0.6"},{n:["neck","scarf"],u:"1f9e3",a:"5"},{n:["hand","gloves"],u:"1f9e4",a:"5"},{n:["coat","jacket"],u:"1f9e5",a:"5"},{n:["socks","stocking"],u:"1f9e6",a:"5"},{n:["dress","clothing"],u:"1f457",a:"0.6"},{n:["kimono","clothing"],u:"1f458",a:"0.6"},{n:["sari","dress","clothing"],u:"1f97b",a:"12"},{n:["bathing suit","one piece swimsuit"],u:"1fa71",a:"12"},{n:["briefs","swimsuit","one piece","underwear","bathing suit"],u:"1fa72",a:"12"},{n:["pants","shorts","underwear","bathing suit"],u:"1fa73",a:"12"},{n:["swim","bikini","clothing"],u:"1f459",a:"0.6"},{n:["woman","clothing","woman’s clothes"],u:"1f45a",a:"0.6"},{n:["fan","hot","shy","dance","cooling","flutter","folding hand fan"],u:"1faad",a:"15"},{n:["coin","purse","clothing"],u:"1f45b",a:"0.6"},{n:["bag","purse","handbag","clothing"],u:"1f45c",a:"0.6"},{n:["bag","pouch","clothing","clutch bag"],u:"1f45d",a:"0.6"},{n:["bag","hotel","shopping","shopping bags"],u:"1f6cd-fe0f",a:"0.7"},{n:["bag","school","satchel","backpack","rucksack"],u:"1f392",a:"0.6"},{n:["zōri","thongs","sandals","thong sandal","beach sandals","thong sandals"],u:"1fa74",a:"13"},{n:["man","shoe","clothing","man’s shoe"],u:"1f45e",a:"0.6"},{n:["shoe","sneaker","athletic","clothing","running shoe"],u:"1f45f",a:"0.6"},{n:["boot","hiking","camping","hiking boot","backpacking"],u:"1f97e",a:"11"},{n:["slip on","slipper","flat shoe","ballet flat"],u:"1f97f",a:"11"},{n:["heel","shoe","woman","clothing","high heeled shoe"],u:"1f460",a:"0.6"},{n:["shoe","woman","sandal","clothing","woman’s sandal"],u:"1f461",a:"0.6"},{n:["dance","ballet","ballet shoes"],u:"1fa70",a:"12"},{n:["boot","shoe","woman","clothing","woman’s boot"],u:"1f462",a:"0.6"},{n:["afro","comb","hair","pick","hair pick"],u:"1faae",a:"15"},{n:["king","crown","queen","clothing"],u:"1f451",a:"0.6"},{n:["hat","woman","clothing","woman’s hat"],u:"1f452",a:"0.6"},{n:["hat","top","tophat","top hat","clothing"],u:"1f3a9",a:"0.6"},{n:["cap","hat","clothing","graduation","celebration","graduation cap"],u:"1f393",a:"0.6"},{n:["billed cap","baseball cap"],u:"1f9e2",a:"5"},{n:["army","helmet","soldier","warrior","military","military helmet"],u:"1fa96",a:"13"},{n:["aid","hat","face","cross","helmet","rescue worker’s helmet"],u:"26d1-fe0f",a:"0.7"},{n:["beads","prayer","clothing","necklace","religion","prayer beads"],u:"1f4ff",a:"1"},{n:["makeup","lipstick","cosmetics"],u:"1f484",a:"0.6"},{n:["ring","diamond"],u:"1f48d",a:"0.6"},{n:["gem","jewel","diamond","gem stone"],u:"1f48e",a:"0.6"},{n:["mute","quiet","silent","speaker","muted speaker"],u:"1f507",a:"1"},{n:["soft","speaker low volume"],u:"1f508",a:"0.7"},{n:["medium","speaker medium volume"],u:"1f509",a:"1"},{n:["loud","speaker high volume"],u:"1f50a",a:"0.6"},{n:["loud","loudspeaker","public address"],u:"1f4e2",a:"0.6"},{n:["cheering","megaphone"],u:"1f4e3",a:"0.6"},{n:["horn","post","postal","postal horn"],u:"1f4ef",a:"1"},{n:["bell"],u:"1f514",a:"0.6"},{n:["bell","mute","quiet","silent","forbidden","bell with slash"],u:"1f515",a:"1"},{n:["music","score","musical score"],u:"1f3bc",a:"0.6"},{n:["note","music","musical note"],u:"1f3b5",a:"0.6"},{n:["note","music","notes","musical notes"],u:"1f3b6",a:"0.6"},{n:["mic","music","studio","microphone","studio microphone"],u:"1f399-fe0f",a:"0.7"},{n:["level","music","slider","level slider"],u:"1f39a-fe0f",a:"0.7"},{n:["knobs","music","control","control knobs"],u:"1f39b-fe0f",a:"0.7"},{n:["mic","karaoke","microphone"],u:"1f3a4",a:"0.6"},{n:["earbud","headphone"],u:"1f3a7",a:"0.6"},{n:["radio","video"],u:"1f4fb",a:"0.6"},{n:["sax","music","saxophone","instrument"],u:"1f3b7",a:"0.6"},{n:["accordion","concertina","squeeze box"],u:"1fa97",a:"13"},{n:["music","guitar","instrument"],u:"1f3b8",a:"0.6"},{n:["music","piano","keyboard","instrument","musical keyboard"],u:"1f3b9",a:"0.6"},{n:["music","trumpet","instrument"],u:"1f3ba",a:"0.6"},{n:["music","violin","instrument"],u:"1f3bb",a:"0.6"},{n:["banjo","music","stringed"],u:"1fa95",a:"12"},{n:["drum","music","drumsticks"],u:"1f941",a:"3"},{n:["beat","drum","conga","rhythm","long drum"],u:"1fa98",a:"13"},{n:["music","shake","rattle","maracas","instrument","percussion"],u:"1fa87",a:"15"},{n:["fife","pipe","flute","music","recorder","woodwind"],u:"1fa88",a:"15"},{n:["cell","phone","mobile","telephone","mobile phone"],u:"1f4f1",a:"0.6"},{n:["cell","arrow","phone","mobile","receive","mobile phone with arrow"],u:"1f4f2",a:"0.6"},{n:["phone","telephone"],u:"260e-fe0f",a:"0.6"},{n:["phone","receiver","telephone","telephone receiver"],u:"1f4de",a:"0.6"},{n:["pager"],u:"1f4df",a:"0.6"},{n:["fax","fax machine"],u:"1f4e0",a:"0.6"},{n:["battery"],u:"1f50b",a:"0.6"},{n:["electronic","low energy","low battery"],u:"1faab",a:"14"},{n:["plug","electric","electricity","electric plug"],u:"1f50c",a:"0.6"},{n:["pc","laptop","computer","personal"],u:"1f4bb",a:"0.6"},{n:["desktop","computer","desktop computer"],u:"1f5a5-fe0f",a:"0.7"},{n:["printer","computer"],u:"1f5a8-fe0f",a:"0.7"},{n:["keyboard","computer"],u:"2328-fe0f",a:"1"},{n:["computer","computer mouse"],u:"1f5b1-fe0f",a:"0.7"},{n:["computer","trackball"],u:"1f5b2-fe0f",a:"0.7"},{n:["disk","optical","computer","minidisk","computer disk"],u:"1f4bd",a:"0.6"},{n:["disk","floppy","computer","floppy disk"],u:"1f4be",a:"0.6"},{n:["cd","disk","optical","computer","optical disk"],u:"1f4bf",a:"0.6"},{n:["dvd","disk","blu ray","optical","computer"],u:"1f4c0",a:"0.6"},{n:["abacus","calculation"],u:"1f9ee",a:"11"},{n:["movie","camera","cinema","movie camera"],u:"1f3a5",a:"0.6"},{n:["film","movie","cinema","frames","film frames"],u:"1f39e-fe0f",a:"0.7"},{n:["film","movie","video","cinema","projector","film projector"],u:"1f4fd-fe0f",a:"0.7"},{n:["movie","clapper","clapper board"],u:"1f3ac",a:"0.6"},{n:["tv","video","television"],u:"1f4fa",a:"0.6"},{n:["video","camera"],u:"1f4f7",a:"0.6"},{n:["flash","video","camera","camera with flash"],u:"1f4f8",a:"1"},{n:["video","camera","video camera"],u:"1f4f9",a:"0.6"},{n:["vhs","tape","video","videocassette"],u:"1f4fc",a:"0.6"},{n:["tool","glass","search","magnifying","magnifying glass tilted left"],u:"1f50d",a:"0.6"},{n:["tool","glass","search","magnifying","magnifying glass tilted right"],u:"1f50e",a:"0.6"},{n:["light","candle"],u:"1f56f-fe0f",a:"0.7"},{n:["bulb","idea","comic","light","electric","light bulb"],u:"1f4a1",a:"0.6"},{n:["tool","light","torch","electric","flashlight"],u:"1f526",a:"0.6"},{n:["bar","red","light","lantern","red paper lantern"],u:"1f3ee",a:"0.6"},{n:["oil","diya","lamp","diya lamp"],u:"1fa94",a:"12"},{n:["book","cover","notebook","decorated","notebook with decorative cover"],u:"1f4d4",a:"0.6"},{n:["book","closed","closed book"],u:"1f4d5",a:"0.6"},{n:["book","open","open book"],u:"1f4d6",a:"0.6"},{n:["book","green","green book"],u:"1f4d7",a:"0.6"},{n:["blue","book","blue book"],u:"1f4d8",a:"0.6"},{n:["book","orange","orange book"],u:"1f4d9",a:"0.6"},{n:["book","books"],u:"1f4da",a:"0.6"},{n:["notebook"],u:"1f4d3",a:"0.6"},{n:["ledger","notebook"],u:"1f4d2",a:"0.6"},{n:["curl","page","document","page with curl"],u:"1f4c3",a:"0.6"},{n:["paper","scroll"],u:"1f4dc",a:"0.6"},{n:["page","document","page facing up"],u:"1f4c4",a:"0.6"},{n:["news","paper","newspaper"],u:"1f4f0",a:"0.6"},{n:["news","paper","rolled","newspaper","rolled up newspaper"],u:"1f5de-fe0f",a:"0.7"},{n:["mark","tabs","marker","bookmark","bookmark tabs"],u:"1f4d1",a:"0.6"},{n:["mark","bookmark"],u:"1f516",a:"0.6"},{n:["label"],u:"1f3f7-fe0f",a:"0.7"},{n:["bag","money","dollar","moneybag","money bag"],u:"1f4b0",a:"0.6"},{n:["coin","gold","metal","money","silver","treasure"],u:"1fa99",a:"13"},{n:["yen","bill","note","money","banknote","currency","yen banknote"],u:"1f4b4",a:"0.6"},{n:["bill","note","money","dollar","banknote","currency","dollar banknote"],u:"1f4b5",a:"0.6"},{n:["bill","euro","note","money","banknote","currency","euro banknote"],u:"1f4b6",a:"1"},{n:["bill","note","money","pound","banknote","currency","pound banknote"],u:"1f4b7",a:"1"},{n:["fly","bill","money","wings","banknote","money with wings"],u:"1f4b8",a:"0.6"},{n:["card","money","credit","credit card"],u:"1f4b3",a:"0.6"},{n:["proof","receipt","evidence","accounting","bookkeeping"],u:"1f9fe",a:"11"},{n:["yen","chart","graph","money","growth","chart increasing with yen"],u:"1f4b9",a:"0.6"},{n:["email","letter","envelope"],u:"2709-fe0f",a:"0.6"},{n:["mail","email","e mail","letter"],u:"1f4e7",a:"0.6"},{n:["email","e mail","letter","receive","envelope","incoming","incoming envelope"],u:"1f4e8",a:"0.6"},{n:["arrow","email","e mail","envelope","outgoing","envelope with arrow"],u:"1f4e9",a:"0.6"},{n:["box","mail","sent","tray","letter","outbox","outbox tray"],u:"1f4e4",a:"0.6"},{n:["box","mail","tray","inbox","letter","receive","inbox tray"],u:"1f4e5",a:"0.6"},{n:["box","parcel","package"],u:"1f4e6",a:"0.6"},{n:["mail","closed","mailbox","postbox","closed mailbox with raised flag"],u:"1f4eb",a:"0.6"},{n:["mail","closed","lowered","mailbox","postbox","closed mailbox with lowered flag"],u:"1f4ea",a:"0.6"},{n:["mail","open","mailbox","postbox","open mailbox with raised flag"],u:"1f4ec",a:"0.7"},{n:["mail","open","lowered","mailbox","postbox","open mailbox with lowered flag"],u:"1f4ed",a:"0.7"},{n:["mail","postbox","mailbox"],u:"1f4ee",a:"0.6"},{n:["box","ballot","ballot box with ballot"],u:"1f5f3-fe0f",a:"0.7"},{n:["pencil"],u:"270f-fe0f",a:"0.6"},{n:["nib","pen","black nib"],u:"2712-fe0f",a:"0.6"},{n:["pen","fountain","fountain pen"],u:"1f58b-fe0f",a:"0.7"},{n:["pen","ballpoint"],u:"1f58a-fe0f",a:"0.7"},{n:["painting","paintbrush"],u:"1f58c-fe0f",a:"0.7"},{n:["crayon"],u:"1f58d-fe0f",a:"0.7"},{n:["memo","pencil"],u:"1f4dd",a:"0.6"},{n:["briefcase"],u:"1f4bc",a:"0.6"},{n:["file","folder","file folder"],u:"1f4c1",a:"0.6"},{n:["file","open","folder","open file folder"],u:"1f4c2",a:"0.6"},{n:["card","index","dividers","card index dividers"],u:"1f5c2-fe0f",a:"0.7"},{n:["date","calendar"],u:"1f4c5",a:"0.6"},{n:["calendar","tear off calendar"],u:"1f4c6",a:"0.6"},{n:["pad","note","spiral","spiral notepad"],u:"1f5d2-fe0f",a:"0.7"},{n:["pad","spiral","calendar","spiral calendar"],u:"1f5d3-fe0f",a:"0.7"},{n:["card","index","rolodex","card index"],u:"1f4c7",a:"0.6"},{n:["chart","graph","trend","growth","upward","chart increasing"],u:"1f4c8",a:"0.6"},{n:["down","chart","graph","trend","chart decreasing"],u:"1f4c9",a:"0.6"},{n:["bar","chart","graph","bar chart"],u:"1f4ca",a:"0.6"},{n:["clipboard"],u:"1f4cb",a:"0.6"},{n:["pin","pushpin"],u:"1f4cc",a:"0.6"},{n:["pin","pushpin","round pushpin"],u:"1f4cd",a:"0.6"},{n:["paperclip"],u:"1f4ce",a:"0.6"},{n:["link","paperclip","linked paperclips"],u:"1f587-fe0f",a:"0.7"},{n:["ruler","straight edge","straight ruler"],u:"1f4cf",a:"0.6"},{n:["set","ruler","triangle","triangular ruler"],u:"1f4d0",a:"0.6"},{n:["tool","cutting","scissors"],u:"2702-fe0f",a:"0.6"},{n:["box","card","file","card file box"],u:"1f5c3-fe0f",a:"0.7"},{n:["file","filing","cabinet","file cabinet"],u:"1f5c4-fe0f",a:"0.7"},{n:["wastebasket"],u:"1f5d1-fe0f",a:"0.7"},{n:["locked","closed"],u:"1f512",a:"0.6"},{n:["lock","open","unlock","unlocked"],u:"1f513",a:"0.6"},{n:["ink","nib","pen","lock","privacy","locked with pen"],u:"1f50f",a:"0.6"},{n:["key","lock","closed","secure","locked with key"],u:"1f510",a:"0.6"},{n:["key","lock","password"],u:"1f511",a:"0.6"},{n:["key","old","clue","lock","old key"],u:"1f5dd-fe0f",a:"0.7"},{n:["tool","hammer"],u:"1f528",a:"0.6"},{n:["axe","chop","wood","split","hatchet"],u:"1fa93",a:"12"},{n:["pick","tool","mining"],u:"26cf-fe0f",a:"0.7"},{n:["pick","tool","hammer","hammer and pick"],u:"2692-fe0f",a:"1"},{n:["tool","hammer","wrench","spanner","hammer and wrench"],u:"1f6e0-fe0f",a:"0.7"},{n:["knife","dagger","weapon"],u:"1f5e1-fe0f",a:"0.7"},{n:["swords","weapon","crossed","crossed swords"],u:"2694-fe0f",a:"1"},{n:["bomb","comic"],u:"1f4a3",a:"0.6"},{n:["rebound","boomerang","repercussion"],u:"1fa83",a:"13"},{n:["bow","arrow","archer","zodiac","sagittarius","bow and arrow"],u:"1f3f9",a:"1"},{n:["shield","weapon"],u:"1f6e1-fe0f",a:"0.7"},{n:["saw","tool","lumber","carpenter","carpentry saw"],u:"1fa9a",a:"13"},{n:["tool","wrench","spanner"],u:"1f527",a:"0.6"},{n:["tool","screw","screwdriver"],u:"1fa9b",a:"13"},{n:["nut","bolt","tool","nut and bolt"],u:"1f529",a:"0.6"},{n:["cog","gear","tool","cogwheel"],u:"2699-fe0f",a:"1"},{n:["tool","vice","clamp","compress"],u:"1f5dc-fe0f",a:"0.7"},{n:["libra","scale","zodiac","balance","justice","balance scale"],u:"2696-fe0f",a:"1"},{n:["blind","white cane","accessibility"],u:"1f9af",a:"12"},{n:["link"],u:"1f517",a:"0.6"},{n:["break","chain","cuffs","freedom","breaking","broken chain"],u:"26d3-fe0f-200d-1f4a5",a:"15.1"},{n:["chain","chains"],u:"26d3-fe0f",a:"0.7"},{n:["hook","catch","crook","curve","ensnare","selling point"],u:"1fa9d",a:"13"},{n:["tool","chest","toolbox","mechanic"],u:"1f9f0",a:"11"},{n:["magnet","magnetic","horseshoe","attraction"],u:"1f9f2",a:"11"},{n:["rung","step","climb","ladder"],u:"1fa9c",a:"13"},{n:["tool","alembic","chemistry"],u:"2697-fe0f",a:"1"},{n:["lab","chemist","science","test tube","chemistry","experiment"],u:"1f9ea",a:"11"},{n:["lab","biology","culture","bacteria","biologist","petri dish"],u:"1f9eb",a:"11"},{n:["dna","gene","life","genetics","biologist","evolution"],u:"1f9ec",a:"11"},{n:["tool","science","microscope"],u:"1f52c",a:"1"},{n:["tool","science","telescope"],u:"1f52d",a:"1"},{n:["dish","antenna","satellite","satellite antenna"],u:"1f4e1",a:"0.6"},{n:["shot","sick","needle","syringe","medicine"],u:"1f489",a:"0.6"},{n:["bleed","injury","medicine","menstruation","drop of blood","blood donation"],u:"1fa78",a:"12"},{n:["pill","sick","doctor","medicine"],u:"1f48a",a:"0.6"},{n:["bandage","adhesive bandage"],u:"1fa79",a:"12"},{n:["cane","hurt","stick","crutch","disability","mobility aid"],u:"1fa7c",a:"14"},{n:["heart","doctor","medicine","stethoscope"],u:"1fa7a",a:"12"},{n:["x ray","bones","doctor","medical","skeleton"],u:"1fa7b",a:"14"},{n:["door"],u:"1f6aa",a:"0.6"},{n:["lift","hoist","elevator","accessibility"],u:"1f6d7",a:"13"},{n:["mirror","speculum","reflector","reflection"],u:"1fa9e",a:"13"},{n:["view","frame","window","opening","fresh air","transparent"],u:"1fa9f",a:"13"},{n:["bed","hotel","sleep"],u:"1f6cf-fe0f",a:"0.7"},{n:["lamp","couch","hotel","couch and lamp"],u:"1f6cb-fe0f",a:"0.7"},{n:["sit","seat","chair"],u:"1fa91",a:"12"},{n:["toilet"],u:"1f6bd",a:"0.6"},{n:["toilet","plunger","plumber","suction","force cup"],u:"1faa0",a:"13"},{n:["water","shower"],u:"1f6bf",a:"1"},{n:["bath","bathtub"],u:"1f6c1",a:"1"},{n:["bait","trap","snare","mousetrap","mouse trap"],u:"1faa4",a:"13"},{n:["razor","sharp","shave"],u:"1fa92",a:"12"},{n:["lotion","shampoo","sunscreen","moisturizer","lotion bottle"],u:"1f9f4",a:"11"},{n:["diaper","punk rock","safety pin"],u:"1f9f7",a:"11"},{n:["broom","witch","cleaning","sweeping"],u:"1f9f9",a:"11"},{n:["basket","picnic","farming","laundry"],u:"1f9fa",a:"11"},{n:["paper towels","toilet paper","roll of paper"],u:"1f9fb",a:"11"},{n:["vat","cask","pail","bucket"],u:"1faa3",a:"13"},{n:["bar","soap","lather","bathing","cleaning","soapdish"],u:"1f9fc",a:"11"},{n:["burp","soap","clean","bubbles","underwater"],u:"1fae7",a:"14"},{n:["brush","clean","teeth","dental","hygiene","bathroom","toothbrush"],u:"1faa5",a:"13"},{n:["sponge","porous","cleaning","absorbing"],u:"1f9fd",a:"11"},{n:["fire","quench","extinguish","fire extinguisher"],u:"1f9ef",a:"11"},{n:["cart","trolley","shopping","shopping cart"],u:"1f6d2",a:"3"},{n:["smoking","cigarette"],u:"1f6ac",a:"0.6"},{n:["death","coffin"],u:"26b0-fe0f",a:"1"},{n:["grave","cemetery","headstone","graveyard","tombstone"],u:"1faa6",a:"13"},{n:["urn","ashes","death","funeral","funeral urn"],u:"26b1-fe0f",a:"1"},{n:["bead","charm","nazar","evil eye","talisman","nazar amulet"],u:"1f9ff",a:"11"},{n:["hand","mary","hamsa","amulet","fatima","miriam","protection"],u:"1faac",a:"14"},{n:["moai","face","moyai","statue"],u:"1f5ff",a:"0.6"},{n:["sign","picket","placard","protest","demonstration"],u:"1faa7",a:"13"},{n:["id","license","security","credentials","identification card"],u:"1faaa",a:"14"}],symbols:[{n:["atm","bank","teller","ATM sign","atm sign","automated"],u:"1f3e7",a:"0.6"},{n:["litter","litter bin","litter in bin sign"],u:"1f6ae",a:"1"},{n:["water","potable","drinking","potable water"],u:"1f6b0",a:"1"},{n:["access","wheelchair symbol"],u:"267f",a:"0.6"},{n:["wc","man","toilet","bathroom","lavatory","restroom","men’s room"],u:"1f6b9",a:"0.6"},{n:["wc","woman","toilet","bathroom","lavatory","restroom","women’s room"],u:"1f6ba",a:"0.6"},{n:["wc","toilet","restroom","bathroom","lavatory"],u:"1f6bb",a:"0.6"},{n:["baby","changing","baby symbol"],u:"1f6bc",a:"0.6"},{n:["wc","water","closet","toilet","bathroom","lavatory","restroom","water closet"],u:"1f6be",a:"0.6"},{n:["control","passport","passport control"],u:"1f6c2",a:"1"},{n:["customs"],u:"1f6c3",a:"1"},{n:["claim","baggage","baggage claim"],u:"1f6c4",a:"1"},{n:["locker","baggage","luggage","left luggage"],u:"1f6c5",a:"1"},{n:["warning"],u:"26a0-fe0f",a:"0.6"},{n:["child","traffic","crossing","pedestrian","children crossing"],u:"1f6b8",a:"1"},{n:["no","not","entry","traffic","no entry","forbidden","prohibited"],u:"26d4",a:"0.6"},{n:["no","not","entry","forbidden","prohibited"],u:"1f6ab",a:"0.6"},{n:["no","bike","bicycle","forbidden","prohibited","no bicycles"],u:"1f6b3",a:"1"},{n:["no","not","smoking","forbidden","no smoking","prohibited"],u:"1f6ad",a:"0.6"},{n:["no","not","litter","forbidden","prohibited","no littering"],u:"1f6af",a:"1"},{n:["water","non potable","non drinking","non potable water"],u:"1f6b1",a:"1"},{n:["no","not","forbidden","pedestrian","prohibited","no pedestrians"],u:"1f6b7",a:"1"},{n:["no","cell","phone","mobile","forbidden","no mobile phones"],u:"1f4f5",a:"1"},{n:["18","eighteen","underage","prohibited","age restriction","no one under eighteen"],u:"1f51e",a:"0.6"},{n:["sign","radioactive"],u:"2622-fe0f",a:"1"},{n:["sign","biohazard"],u:"2623-fe0f",a:"1"},{n:["arrow","north","up arrow","cardinal","direction"],u:"2b06-fe0f",a:"0.6"},{n:["arrow","direction","northeast","intercardinal","up right arrow"],u:"2197-fe0f",a:"0.6"},{n:["east","arrow","cardinal","direction","right arrow"],u:"27a1-fe0f",a:"0.6"},{n:["arrow","direction","southeast","intercardinal","down right arrow"],u:"2198-fe0f",a:"0.6"},{n:["down","arrow","south","cardinal","direction","down arrow"],u:"2b07-fe0f",a:"0.6"},{n:["arrow","direction","southwest","intercardinal","down left arrow"],u:"2199-fe0f",a:"0.6"},{n:["west","arrow","cardinal","direction","left arrow"],u:"2b05-fe0f",a:"0.6"},{n:["arrow","direction","northwest","up left arrow","intercardinal"],u:"2196-fe0f",a:"0.6"},{n:["arrow","up down arrow"],u:"2195-fe0f",a:"0.6"},{n:["arrow","left right arrow"],u:"2194-fe0f",a:"0.6"},{n:["arrow","right arrow curving left"],u:"21a9-fe0f",a:"0.6"},{n:["arrow","left arrow curving right"],u:"21aa-fe0f",a:"0.6"},{n:["arrow","right arrow curving up"],u:"2934-fe0f",a:"0.6"},{n:["down","arrow","right arrow curving down"],u:"2935-fe0f",a:"0.6"},{n:["arrow","reload","clockwise","clockwise vertical arrows"],u:"1f503",a:"0.6"},{n:["arrow","withershins","anticlockwise","counterclockwise","counterclockwise arrows button"],u:"1f504",a:"1"},{n:["back","arrow","BACK arrow"],u:"1f519",a:"0.6"},{n:["end","arrow","END arrow"],u:"1f51a",a:"0.6"},{n:["on","on!","mark","arrow","ON! arrow"],u:"1f51b",a:"0.6"},{n:["soon","arrow","SOON arrow"],u:"1f51c",a:"0.6"},{n:["up","top","arrow","TOP arrow"],u:"1f51d",a:"0.6"},{n:["worship","religion","place of worship"],u:"1f6d0",a:"1"},{n:["atom","atheist","atom symbol"],u:"269b-fe0f",a:"1"},{n:["om","hindu","religion"],u:"1f549-fe0f",a:"0.7"},{n:["jew","star","david","jewish","religion","star of David","star of david"],u:"2721-fe0f",a:"0.7"},{n:["wheel","dharma","buddhist","religion","wheel of dharma"],u:"2638-fe0f",a:"0.7"},{n:["tao","yin","yang","taoist","yin yang","religion"],u:"262f-fe0f",a:"0.7"},{n:["cross","religion","christian","latin cross"],u:"271d-fe0f",a:"0.7"},{n:["cross","religion","christian","orthodox cross"],u:"2626-fe0f",a:"1"},{n:["islam","muslim","religion","star and crescent"],u:"262a-fe0f",a:"0.7"},{n:["peace","peace symbol"],u:"262e-fe0f",a:"1"},{n:["menorah","religion","candelabrum","candlestick"],u:"1f54e",a:"1"},{n:["star","fortune","dotted six pointed star"],u:"1f52f",a:"0.6"},{n:["sikh","khanda","religion"],u:"1faaf",a:"15"},{n:["ram","Aries","aries","zodiac"],u:"2648",a:"0.6"},{n:["ox","bull","Taurus","taurus","zodiac"],u:"2649",a:"0.6"},{n:["twins","Gemini","gemini","zodiac"],u:"264a",a:"0.6"},{n:["crab","Cancer","cancer","zodiac"],u:"264b",a:"0.6"},{n:["Leo","leo","lion","zodiac"],u:"264c",a:"0.6"},{n:["Virgo","virgo","zodiac"],u:"264d",a:"0.6"},{n:["Libra","libra","scales","zodiac","balance","justice"],u:"264e",a:"0.6"},{n:["zodiac","Scorpio","scorpio","scorpion","scorpius"],u:"264f",a:"0.6"},{n:["archer","zodiac","Sagittarius","sagittarius"],u:"2650",a:"0.6"},{n:["goat","zodiac","Capricorn","capricorn"],u:"2651",a:"0.6"},{n:["water","bearer","zodiac","Aquarius","aquarius"],u:"2652",a:"0.6"},{n:["fish","Pisces","pisces","zodiac"],u:"2653",a:"0.6"},{n:["snake","bearer","zodiac","serpent","Ophiuchus","ophiuchus"],u:"26ce",a:"0.6"},{n:["arrow","crossed","shuffle tracks button"],u:"1f500",a:"1"},{n:["arrow","repeat","clockwise","repeat button"],u:"1f501",a:"1"},{n:["once","arrow","clockwise","repeat single button"],u:"1f502",a:"1"},{n:["play","arrow","right","triangle","play button"],u:"25b6-fe0f",a:"0.6"},{n:["fast","arrow","double","forward","fast forward button"],u:"23e9",a:"0.6"},{n:["arrow","triangle","next scene","next track","next track button"],u:"23ed-fe0f",a:"0.7"},{n:["play","arrow","pause","right","triangle","play or pause button"],u:"23ef-fe0f",a:"1"},{n:["left","arrow","reverse","triangle","reverse button"],u:"25c0-fe0f",a:"0.6"},{n:["arrow","double","rewind","fast reverse button"],u:"23ea",a:"0.6"},{n:["arrow","triangle","previous scene","previous track","last track button"],u:"23ee-fe0f",a:"0.7"},{n:["arrow","button","upwards button"],u:"1f53c",a:"0.6"},{n:["arrow","double","fast up button"],u:"23eb",a:"0.6"},{n:["down","arrow","button","downwards button"],u:"1f53d",a:"0.6"},{n:["down","arrow","double","fast down button"],u:"23ec",a:"0.6"},{n:["bar","pause","double","vertical","pause button"],u:"23f8-fe0f",a:"0.7"},{n:["stop","square","stop button"],u:"23f9-fe0f",a:"0.7"},{n:["circle","record","record button"],u:"23fa-fe0f",a:"0.7"},{n:["eject","eject button"],u:"23cf-fe0f",a:"1"},{n:["film","movie","cinema","camera"],u:"1f3a6",a:"0.6"},{n:["dim","low","dim button","brightness"],u:"1f505",a:"1"},{n:["bright","brightness","bright button"],u:"1f506",a:"1"},{n:["bar","cell","phone","mobile","antenna","antenna bars"],u:"1f4f6",a:"0.6"},{n:["wifi","wi fi","network","wireless","computer","internet"],u:"1f6dc",a:"15"},{n:["cell","mode","phone","mobile","telephone","vibration","vibration mode"],u:"1f4f3",a:"0.6"},{n:["off","cell","phone","mobile","telephone","mobile phone off"],u:"1f4f4",a:"0.6"},{n:["woman","female sign"],u:"2640-fe0f",a:"4"},{n:["man","male sign"],u:"2642-fe0f",a:"4"},{n:["transgender","transgender symbol"],u:"26a7-fe0f",a:"13"},{n:["x","×","sign","cancel","multiply","multiplication"],u:"2716-fe0f",a:"0.6"},{n:["+","plus","math","sign"],u:"2795",a:"0.6"},{n:[" ","−","math","sign","minus"],u:"2796",a:"0.6"},{n:["÷","math","sign","divide","division"],u:"2797",a:"0.6"},{n:["math","equality","heavy equals sign"],u:"1f7f0",a:"14"},{n:["forever","infinity","unbounded","universal"],u:"267e-fe0f",a:"11"},{n:["!","!!","mark","bangbang","exclamation","double exclamation mark"],u:"203c-fe0f",a:"0.6"},{n:["!","?","!?","mark","question","exclamation","interrobang","punctuation","exclamation question mark"],u:"2049-fe0f",a:"0.6"},{n:["?","mark","question","punctuation","red question mark"],u:"2753",a:"0.6"},{n:["?","mark","outlined","question","punctuation","white question mark"],u:"2754",a:"0.6"},{n:["!","mark","outlined","exclamation","punctuation","white exclamation mark"],u:"2755",a:"0.6"},{n:["!","mark","exclamation","punctuation","red exclamation mark"],u:"2757",a:"0.6"},{n:["dash","wavy","wavy dash","punctuation"],u:"3030-fe0f",a:"0.6"},{n:["bank","money","currency","exchange","currency exchange"],u:"1f4b1",a:"0.6"},{n:["money","dollar","currency","heavy dollar sign"],u:"1f4b2",a:"0.6"},{n:["staff","medicine","aesculapius","medical symbol"],u:"2695-fe0f",a:"4"},{n:["recycle","recycling symbol"],u:"267b-fe0f",a:"0.6"},{n:["fleur de lis"],u:"269c-fe0f",a:"1"},{n:["ship","tool","anchor","emblem","trident","trident emblem"],u:"1f531",a:"0.6"},{n:["name","badge","name badge"],u:"1f4db",a:"0.6"},{n:["leaf","chevron","beginner","japanese","Japanese symbol for beginner","japanese symbol for beginner"],u:"1f530",a:"0.6"},{n:["o","red","large","circle","hollow red circle"],u:"2b55",a:"0.6"},{n:["✓","mark","check","button","check mark button"],u:"2705",a:"0.6"},{n:["✓","box","check","check box with check"],u:"2611-fe0f",a:"0.6"},{n:["✓","mark","check","check mark"],u:"2714-fe0f",a:"0.6"},{n:["x","×","mark","cross","cancel","multiply","cross mark","multiplication"],u:"274c",a:"0.6"},{n:["x","×","mark","square","cross mark button"],u:"274e",a:"0.6"},{n:["curl","loop","curly loop"],u:"27b0",a:"0.6"},{n:["curl","loop","double","double curly loop"],u:"27bf",a:"1"},{n:["mark","part","part alternation mark"],u:"303d-fe0f",a:"0.6"},{n:["*","asterisk","eight spoked asterisk"],u:"2733-fe0f",a:"0.6"},{n:["*","star","eight pointed star"],u:"2734-fe0f",a:"0.6"},{n:["*","sparkle"],u:"2747-fe0f",a:"0.6"},{n:["c","copyright"],u:"00a9-fe0f",a:"0.6"},{n:["r","registered"],u:"00ae-fe0f",a:"0.6"},{n:["tm","mark","trademark","trade mark"],u:"2122-fe0f",a:"0.6"},{n:["keycap","keycap: #"],u:"0023-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: *"],u:"002a-fe0f-20e3",a:"2"},{n:["keycap","keycap: 0"],u:"0030-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 1"],u:"0031-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 2"],u:"0032-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 3"],u:"0033-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 4"],u:"0034-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 5"],u:"0035-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 6"],u:"0036-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 7"],u:"0037-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 8"],u:"0038-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 9"],u:"0039-fe0f-20e3",a:"0.6"},{n:["keycap","keycap: 10"],u:"1f51f",a:"0.6"},{n:["abcd","input","latin","letters","uppercase","input latin uppercase"],u:"1f520",a:"0.6"},{n:["abcd","input","latin","letters","lowercase","input latin lowercase"],u:"1f521",a:"0.6"},{n:["1234","input","numbers","input numbers"],u:"1f522",a:"0.6"},{n:["〒♪&%","input","input symbols"],u:"1f523",a:"0.6"},{n:["abc","input","latin","letters","alphabet","input latin letters"],u:"1f524",a:"0.6"},{n:["a","blood type","A button (blood type)","a button (blood type)"],u:"1f170-fe0f",a:"0.6"},{n:["ab","blood type","AB button (blood type)","ab button (blood type)"],u:"1f18e",a:"0.6"},{n:["b","blood type","B button (blood type)","b button (blood type)"],u:"1f171-fe0f",a:"0.6"},{n:["cl","CL button","cl button"],u:"1f191",a:"0.6"},{n:["cool","COOL button","cool button"],u:"1f192",a:"0.6"},{n:["free","FREE button","free button"],u:"1f193",a:"0.6"},{n:["i","information"],u:"2139-fe0f",a:"0.6"},{n:["id","identity","ID button","id button"],u:"1f194",a:"0.6"},{n:["m","circle","circled M","circled m"],u:"24c2-fe0f",a:"0.6"},{n:["new","NEW button","new button"],u:"1f195",a:"0.6"},{n:["ng","NG button","ng button"],u:"1f196",a:"0.6"},{n:["o","blood type","O button (blood type)","o button (blood type)"],u:"1f17e-fe0f",a:"0.6"},{n:["ok","OK button","ok button"],u:"1f197",a:"0.6"},{n:["p","parking","P button","p button"],u:"1f17f-fe0f",a:"0.6"},{n:["sos","help","SOS button","sos button"],u:"1f198",a:"0.6"},{n:["up","up!","mark","UP! button","up! button"],u:"1f199",a:"0.6"},{n:["vs","versus","VS button","vs button"],u:"1f19a",a:"0.6"},{n:["ココ","“here”","japanese","katakana","Japanese “here” button","japanese “here” button"],u:"1f201",a:"0.6"},{n:["サ","japanese","katakana","“service charge”","Japanese “service charge” button","japanese “service charge” button"],u:"1f202-fe0f",a:"0.6"},{n:["月","japanese","ideograph","“monthly amount”","Japanese “monthly amount” button","japanese “monthly amount” button"],u:"1f237-fe0f",a:"0.6"},{n:["有","japanese","ideograph","“not free of charge”","Japanese “not free of charge” button","japanese “not free of charge” button"],u:"1f236",a:"0.6"},{n:["指","japanese","ideograph","“reserved”","Japanese “reserved” button","japanese “reserved” button"],u:"1f22f",a:"0.6"},{n:["得","japanese","ideograph","“bargain”","Japanese “bargain” button","japanese “bargain” button"],u:"1f250",a:"0.6"},{n:["割","japanese","ideograph","“discount”","Japanese “discount” button","japanese “discount” button"],u:"1f239",a:"0.6"},{n:["無","japanese","ideograph","“free of charge”","Japanese “free of charge” button","japanese “free of charge” button"],u:"1f21a",a:"0.6"},{n:["禁","japanese","ideograph","“prohibited”","Japanese “prohibited” button","japanese “prohibited” button"],u:"1f232",a:"0.6"},{n:["可","japanese","ideograph","“acceptable”","Japanese “acceptable” button","japanese “acceptable” button"],u:"1f251",a:"0.6"},{n:["申","japanese","ideograph","“application”","Japanese “application” button","japanese “application” button"],u:"1f238",a:"0.6"},{n:["合","japanese","ideograph","“passing grade”","Japanese “passing grade” button","japanese “passing grade” button"],u:"1f234",a:"0.6"},{n:["空","japanese","ideograph","“vacancy”","Japanese “vacancy” button","japanese “vacancy” button"],u:"1f233",a:"0.6"},{n:["祝","japanese","ideograph","“congratulations”","Japanese “congratulations” button","japanese “congratulations” button"],u:"3297-fe0f",a:"0.6"},{n:["秘","japanese","“secret”","ideograph","Japanese “secret” button","japanese “secret” button"],u:"3299-fe0f",a:"0.6"},{n:["営","japanese","ideograph","“open for business”","Japanese “open for business” button","japanese “open for business” button"],u:"1f23a",a:"0.6"},{n:["満","japanese","ideograph","“no vacancy”","Japanese “no vacancy” button","japanese “no vacancy” button"],u:"1f235",a:"0.6"},{n:["red","circle","geometric","red circle"],u:"1f534",a:"0.6"},{n:["circle","orange","orange circle"],u:"1f7e0",a:"12"},{n:["circle","yellow","yellow circle"],u:"1f7e1",a:"12"},{n:["green","circle","green circle"],u:"1f7e2",a:"12"},{n:["blue","circle","geometric","blue circle"],u:"1f535",a:"0.6"},{n:["circle","purple","purple circle"],u:"1f7e3",a:"12"},{n:["brown","circle","brown circle"],u:"1f7e4",a:"12"},{n:["circle","geometric","black circle"],u:"26ab",a:"0.6"},{n:["circle","geometric","white circle"],u:"26aa",a:"0.6"},{n:["red","square","red square"],u:"1f7e5",a:"12"},{n:["orange","square","orange square"],u:"1f7e7",a:"12"},{n:["square","yellow","yellow square"],u:"1f7e8",a:"12"},{n:["green","square","green square"],u:"1f7e9",a:"12"},{n:["blue","square","blue square"],u:"1f7e6",a:"12"},{n:["purple","square","purple square"],u:"1f7ea",a:"12"},{n:["brown","square","brown square"],u:"1f7eb",a:"12"},{n:["square","geometric","black large square"],u:"2b1b",a:"0.6"},{n:["square","geometric","white large square"],u:"2b1c",a:"0.6"},{n:["square","geometric","black medium square"],u:"25fc-fe0f",a:"0.6"},{n:["square","geometric","white medium square"],u:"25fb-fe0f",a:"0.6"},{n:["square","geometric","black medium small square"],u:"25fe",a:"0.6"},{n:["square","geometric","white medium small square"],u:"25fd",a:"0.6"},{n:["square","geometric","black small square"],u:"25aa-fe0f",a:"0.6"},{n:["square","geometric","white small square"],u:"25ab-fe0f",a:"0.6"},{n:["orange","diamond","geometric","large orange diamond"],u:"1f536",a:"0.6"},{n:["blue","diamond","geometric","large blue diamond"],u:"1f537",a:"0.6"},{n:["orange","diamond","geometric","small orange diamond"],u:"1f538",a:"0.6"},{n:["blue","diamond","geometric","small blue diamond"],u:"1f539",a:"0.6"},{n:["red","geometric","red triangle pointed up"],u:"1f53a",a:"0.6"},{n:["red","down","geometric","red triangle pointed down"],u:"1f53b",a:"0.6"},{n:["comic","inside","diamond","geometric","diamond with a dot"],u:"1f4a0",a:"0.6"},{n:["radio","button","geometric","radio button"],u:"1f518",a:"0.6"},{n:["button","square","outlined","geometric","white square button"],u:"1f533",a:"0.6"},{n:["button","square","geometric","black square button"],u:"1f532",a:"0.6"}],flags:[{n:["racing","checkered","chequered","chequered flag"],u:"1f3c1",a:"0.6"},{n:["post","triangular flag"],u:"1f6a9",a:"0.6"},{n:["cross","crossed","japanese","celebration","crossed flags"],u:"1f38c",a:"0.6"},{n:["waving","black flag"],u:"1f3f4",a:"1"},{n:["waving","white flag"],u:"1f3f3-fe0f",a:"0.7"},{n:["pride","rainbow","rainbow flag"],u:"1f3f3-fe0f-200d-1f308",a:"4"},{n:["flag","pink","white","light blue","transgender","transgender flag"],u:"1f3f3-fe0f-200d-26a7-fe0f",a:"13"},{n:["pirate","plunder","treasure","pirate flag","jolly roger"],u:"1f3f4-200d-2620-fe0f",a:"11"},{n:["AC","flag","flag: Ascension Island","flag: ascension island"],u:"1f1e6-1f1e8",a:"2"},{n:["AD","flag","flag: Andorra","flag: andorra"],u:"1f1e6-1f1e9",a:"2"},{n:["AE","flag","flag: United Arab Emirates","flag: united arab emirates"],u:"1f1e6-1f1ea",a:"2"},{n:["AF","flag","flag: Afghanistan","flag: afghanistan"],u:"1f1e6-1f1eb",a:"2"},{n:["AG","flag","flag: Antigua & Barbuda","flag: antigua & barbuda"],u:"1f1e6-1f1ec",a:"2"},{n:["AI","flag","flag: Anguilla","flag: anguilla"],u:"1f1e6-1f1ee",a:"2"},{n:["AL","flag","flag: Albania","flag: albania"],u:"1f1e6-1f1f1",a:"2"},{n:["AM","flag","flag: Armenia","flag: armenia"],u:"1f1e6-1f1f2",a:"2"},{n:["AO","flag","flag: Angola","flag: angola"],u:"1f1e6-1f1f4",a:"2"},{n:["AQ","flag","flag: Antarctica","flag: antarctica"],u:"1f1e6-1f1f6",a:"2"},{n:["AR","flag","flag: Argentina","flag: argentina"],u:"1f1e6-1f1f7",a:"2"},{n:["AS","flag","flag: American Samoa","flag: american samoa"],u:"1f1e6-1f1f8",a:"2"},{n:["AT","flag","flag: Austria","flag: austria"],u:"1f1e6-1f1f9",a:"2"},{n:["AU","flag","flag: Australia","flag: australia"],u:"1f1e6-1f1fa",a:"2"},{n:["AW","flag","flag: Aruba","flag: aruba"],u:"1f1e6-1f1fc",a:"2"},{n:["AX","flag","flag: Åland Islands","flag: åland islands"],u:"1f1e6-1f1fd",a:"2"},{n:["AZ","flag","flag: Azerbaijan","flag: azerbaijan"],u:"1f1e6-1f1ff",a:"2"},{n:["BA","flag","flag: Bosnia & Herzegovina","flag: bosnia & herzegovina"],u:"1f1e7-1f1e6",a:"2"},{n:["BB","flag","flag: Barbados","flag: barbados"],u:"1f1e7-1f1e7",a:"2"},{n:["BD","flag","flag: Bangladesh","flag: bangladesh"],u:"1f1e7-1f1e9",a:"2"},{n:["BE","flag","flag: Belgium","flag: belgium"],u:"1f1e7-1f1ea",a:"2"},{n:["BF","flag","flag: Burkina Faso","flag: burkina faso"],u:"1f1e7-1f1eb",a:"2"},{n:["BG","flag","flag: Bulgaria","flag: bulgaria"],u:"1f1e7-1f1ec",a:"2"},{n:["BH","flag","flag: Bahrain","flag: bahrain"],u:"1f1e7-1f1ed",a:"2"},{n:["BI","flag","flag: Burundi","flag: burundi"],u:"1f1e7-1f1ee",a:"2"},{n:["BJ","flag","flag: Benin","flag: benin"],u:"1f1e7-1f1ef",a:"2"},{n:["BL","flag","flag: St. Barthélemy","flag: st. barthélemy"],u:"1f1e7-1f1f1",a:"2"},{n:["BM","flag","flag: Bermuda","flag: bermuda"],u:"1f1e7-1f1f2",a:"2"},{n:["BN","flag","flag: Brunei","flag: brunei"],u:"1f1e7-1f1f3",a:"2"},{n:["BO","flag","flag: Bolivia","flag: bolivia"],u:"1f1e7-1f1f4",a:"2"},{n:["BQ","flag","flag: Caribbean Netherlands","flag: caribbean netherlands"],u:"1f1e7-1f1f6",a:"2"},{n:["BR","flag","flag: Brazil","flag: brazil"],u:"1f1e7-1f1f7",a:"2"},{n:["BS","flag","flag: Bahamas","flag: bahamas"],u:"1f1e7-1f1f8",a:"2"},{n:["BT","flag","flag: Bhutan","flag: bhutan"],u:"1f1e7-1f1f9",a:"2"},{n:["BV","flag","flag: Bouvet Island","flag: bouvet island"],u:"1f1e7-1f1fb",a:"2"},{n:["BW","flag","flag: Botswana","flag: botswana"],u:"1f1e7-1f1fc",a:"2"},{n:["BY","flag","flag: Belarus","flag: belarus"],u:"1f1e7-1f1fe",a:"2"},{n:["BZ","flag","flag: Belize","flag: belize"],u:"1f1e7-1f1ff",a:"2"},{n:["CA","flag","flag: Canada","flag: canada"],u:"1f1e8-1f1e6",a:"2"},{n:["CC","flag","flag: Cocos (Keeling) Islands","flag: cocos (keeling) islands"],u:"1f1e8-1f1e8",a:"2"},{n:["CD","flag","flag: Congo   Kinshasa","flag: congo   kinshasa"],u:"1f1e8-1f1e9",a:"2"},{n:["CF","flag","flag: Central African Republic","flag: central african republic"],u:"1f1e8-1f1eb",a:"2"},{n:["CG","flag","flag: Congo   Brazzaville","flag: congo   brazzaville"],u:"1f1e8-1f1ec",a:"2"},{n:["CH","flag","flag: Switzerland","flag: switzerland"],u:"1f1e8-1f1ed",a:"2"},{n:["CI","flag","flag: Côte d’Ivoire","flag: côte d’ivoire"],u:"1f1e8-1f1ee",a:"2"},{n:["CK","flag","flag: Cook Islands","flag: cook islands"],u:"1f1e8-1f1f0",a:"2"},{n:["CL","flag","flag: Chile","flag: chile"],u:"1f1e8-1f1f1",a:"2"},{n:["CM","flag","flag: Cameroon","flag: cameroon"],u:"1f1e8-1f1f2",a:"2"},{n:["CN","flag","flag: China","flag: china"],u:"1f1e8-1f1f3",a:"0.6"},{n:["CO","flag","flag: Colombia","flag: colombia"],u:"1f1e8-1f1f4",a:"2"},{n:["CP","flag","flag: Clipperton Island","flag: clipperton island"],u:"1f1e8-1f1f5",a:"2"},{n:["CR","flag","flag: Costa Rica","flag: costa rica"],u:"1f1e8-1f1f7",a:"2"},{n:["CU","flag","flag: Cuba","flag: cuba"],u:"1f1e8-1f1fa",a:"2"},{n:["CV","flag","flag: Cape Verde","flag: cape verde"],u:"1f1e8-1f1fb",a:"2"},{n:["CW","flag","flag: Curaçao","flag: curaçao"],u:"1f1e8-1f1fc",a:"2"},{n:["CX","flag","flag: Christmas Island","flag: christmas island"],u:"1f1e8-1f1fd",a:"2"},{n:["CY","flag","flag: Cyprus","flag: cyprus"],u:"1f1e8-1f1fe",a:"2"},{n:["CZ","flag","flag: Czechia","flag: czechia"],u:"1f1e8-1f1ff",a:"2"},{n:["DE","flag","flag: Germany","flag: germany"],u:"1f1e9-1f1ea",a:"0.6"},{n:["DG","flag","flag: Diego Garcia","flag: diego garcia"],u:"1f1e9-1f1ec",a:"2"},{n:["DJ","flag","flag: Djibouti","flag: djibouti"],u:"1f1e9-1f1ef",a:"2"},{n:["DK","flag","flag: Denmark","flag: denmark"],u:"1f1e9-1f1f0",a:"2"},{n:["DM","flag","flag: Dominica","flag: dominica"],u:"1f1e9-1f1f2",a:"2"},{n:["DO","flag","flag: Dominican Republic","flag: dominican republic"],u:"1f1e9-1f1f4",a:"2"},{n:["DZ","flag","flag: Algeria","flag: algeria"],u:"1f1e9-1f1ff",a:"2"},{n:["EA","flag","flag: Ceuta & Melilla","flag: ceuta & melilla"],u:"1f1ea-1f1e6",a:"2"},{n:["EC","flag","flag: Ecuador","flag: ecuador"],u:"1f1ea-1f1e8",a:"2"},{n:["EE","flag","flag: Estonia","flag: estonia"],u:"1f1ea-1f1ea",a:"2"},{n:["EG","flag","flag: Egypt","flag: egypt"],u:"1f1ea-1f1ec",a:"2"},{n:["EH","flag","flag: Western Sahara","flag: western sahara"],u:"1f1ea-1f1ed",a:"2"},{n:["ER","flag","flag: Eritrea","flag: eritrea"],u:"1f1ea-1f1f7",a:"2"},{n:["ES","flag","flag: Spain","flag: spain"],u:"1f1ea-1f1f8",a:"0.6"},{n:["ET","flag","flag: Ethiopia","flag: ethiopia"],u:"1f1ea-1f1f9",a:"2"},{n:["EU","flag","flag: European Union","flag: european union"],u:"1f1ea-1f1fa",a:"2"},{n:["FI","flag","flag: Finland","flag: finland"],u:"1f1eb-1f1ee",a:"2"},{n:["FJ","flag","flag: Fiji","flag: fiji"],u:"1f1eb-1f1ef",a:"2"},{n:["FK","flag","flag: Falkland Islands","flag: falkland islands"],u:"1f1eb-1f1f0",a:"2"},{n:["FM","flag","flag: Micronesia","flag: micronesia"],u:"1f1eb-1f1f2",a:"2"},{n:["FO","flag","flag: Faroe Islands","flag: faroe islands"],u:"1f1eb-1f1f4",a:"2"},{n:["FR","flag","flag: France","flag: france"],u:"1f1eb-1f1f7",a:"0.6"},{n:["GA","flag","flag: Gabon","flag: gabon"],u:"1f1ec-1f1e6",a:"2"},{n:["GB","flag","flag: United Kingdom","flag: united kingdom"],u:"1f1ec-1f1e7",a:"0.6"},{n:["GD","flag","flag: Grenada","flag: grenada"],u:"1f1ec-1f1e9",a:"2"},{n:["GE","flag","flag: Georgia","flag: georgia"],u:"1f1ec-1f1ea",a:"2"},{n:["GF","flag","flag: French Guiana","flag: french guiana"],u:"1f1ec-1f1eb",a:"2"},{n:["GG","flag","flag: Guernsey","flag: guernsey"],u:"1f1ec-1f1ec",a:"2"},{n:["GH","flag","flag: Ghana","flag: ghana"],u:"1f1ec-1f1ed",a:"2"},{n:["GI","flag","flag: Gibraltar","flag: gibraltar"],u:"1f1ec-1f1ee",a:"2"},{n:["GL","flag","flag: Greenland","flag: greenland"],u:"1f1ec-1f1f1",a:"2"},{n:["GM","flag","flag: Gambia","flag: gambia"],u:"1f1ec-1f1f2",a:"2"},{n:["GN","flag","flag: Guinea","flag: guinea"],u:"1f1ec-1f1f3",a:"2"},{n:["GP","flag","flag: Guadeloupe","flag: guadeloupe"],u:"1f1ec-1f1f5",a:"2"},{n:["GQ","flag","flag: Equatorial Guinea","flag: equatorial guinea"],u:"1f1ec-1f1f6",a:"2"},{n:["GR","flag","flag: Greece","flag: greece"],u:"1f1ec-1f1f7",a:"2"},{n:["GS","flag","flag: South Georgia & South Sandwich Islands","flag: south georgia & south sandwich islands"],u:"1f1ec-1f1f8",a:"2"},{n:["GT","flag","flag: Guatemala","flag: guatemala"],u:"1f1ec-1f1f9",a:"2"},{n:["GU","flag","flag: Guam","flag: guam"],u:"1f1ec-1f1fa",a:"2"},{n:["GW","flag","flag: Guinea Bissau","flag: guinea bissau"],u:"1f1ec-1f1fc",a:"2"},{n:["GY","flag","flag: Guyana","flag: guyana"],u:"1f1ec-1f1fe",a:"2"},{n:["HK","flag","flag: Hong Kong SAR China","flag: hong kong sar china"],u:"1f1ed-1f1f0",a:"2"},{n:["HM","flag","flag: Heard & McDonald Islands","flag: heard & mcdonald islands"],u:"1f1ed-1f1f2",a:"2"},{n:["HN","flag","flag: Honduras","flag: honduras"],u:"1f1ed-1f1f3",a:"2"},{n:["HR","flag","flag: Croatia","flag: croatia"],u:"1f1ed-1f1f7",a:"2"},{n:["HT","flag","flag: Haiti","flag: haiti"],u:"1f1ed-1f1f9",a:"2"},{n:["HU","flag","flag: Hungary","flag: hungary"],u:"1f1ed-1f1fa",a:"2"},{n:["IC","flag","flag: Canary Islands","flag: canary islands"],u:"1f1ee-1f1e8",a:"2"},{n:["ID","flag","flag: Indonesia","flag: indonesia"],u:"1f1ee-1f1e9",a:"2"},{n:["IE","flag","flag: Ireland","flag: ireland"],u:"1f1ee-1f1ea",a:"2"},{n:["IL","flag","flag: Israel","flag: israel"],u:"1f1ee-1f1f1",a:"2"},{n:["IM","flag","flag: Isle of Man","flag: isle of man"],u:"1f1ee-1f1f2",a:"2"},{n:["IN","flag","flag: India","flag: india"],u:"1f1ee-1f1f3",a:"2"},{n:["IO","flag","flag: British Indian Ocean Territory","flag: british indian ocean territory"],u:"1f1ee-1f1f4",a:"2"},{n:["IQ","flag","flag: Iraq","flag: iraq"],u:"1f1ee-1f1f6",a:"2"},{n:["IR","flag","flag: Iran","flag: iran"],u:"1f1ee-1f1f7",a:"2"},{n:["IS","flag","flag: Iceland","flag: iceland"],u:"1f1ee-1f1f8",a:"2"},{n:["IT","flag","flag: Italy","flag: italy"],u:"1f1ee-1f1f9",a:"0.6"},{n:["JE","flag","flag: Jersey","flag: jersey"],u:"1f1ef-1f1ea",a:"2"},{n:["JM","flag","flag: Jamaica","flag: jamaica"],u:"1f1ef-1f1f2",a:"2"},{n:["JO","flag","flag: Jordan","flag: jordan"],u:"1f1ef-1f1f4",a:"2"},{n:["JP","flag","flag: Japan","flag: japan"],u:"1f1ef-1f1f5",a:"0.6"},{n:["KE","flag","flag: Kenya","flag: kenya"],u:"1f1f0-1f1ea",a:"2"},{n:["KG","flag","flag: Kyrgyzstan","flag: kyrgyzstan"],u:"1f1f0-1f1ec",a:"2"},{n:["KH","flag","flag: Cambodia","flag: cambodia"],u:"1f1f0-1f1ed",a:"2"},{n:["KI","flag","flag: Kiribati","flag: kiribati"],u:"1f1f0-1f1ee",a:"2"},{n:["KM","flag","flag: Comoros","flag: comoros"],u:"1f1f0-1f1f2",a:"2"},{n:["KN","flag","flag: St. Kitts & Nevis","flag: st. kitts & nevis"],u:"1f1f0-1f1f3",a:"2"},{n:["KP","flag","flag: North Korea","flag: north korea"],u:"1f1f0-1f1f5",a:"2"},{n:["KR","flag","flag: South Korea","flag: south korea"],u:"1f1f0-1f1f7",a:"0.6"},{n:["KW","flag","flag: Kuwait","flag: kuwait"],u:"1f1f0-1f1fc",a:"2"},{n:["KY","flag","flag: Cayman Islands","flag: cayman islands"],u:"1f1f0-1f1fe",a:"2"},{n:["KZ","flag","flag: Kazakhstan","flag: kazakhstan"],u:"1f1f0-1f1ff",a:"2"},{n:["LA","flag","flag: Laos","flag: laos"],u:"1f1f1-1f1e6",a:"2"},{n:["LB","flag","flag: Lebanon","flag: lebanon"],u:"1f1f1-1f1e7",a:"2"},{n:["LC","flag","flag: St. Lucia","flag: st. lucia"],u:"1f1f1-1f1e8",a:"2"},{n:["LI","flag","flag: Liechtenstein","flag: liechtenstein"],u:"1f1f1-1f1ee",a:"2"},{n:["LK","flag","flag: Sri Lanka","flag: sri lanka"],u:"1f1f1-1f1f0",a:"2"},{n:["LR","flag","flag: Liberia","flag: liberia"],u:"1f1f1-1f1f7",a:"2"},{n:["LS","flag","flag: Lesotho","flag: lesotho"],u:"1f1f1-1f1f8",a:"2"},{n:["LT","flag","flag: Lithuania","flag: lithuania"],u:"1f1f1-1f1f9",a:"2"},{n:["LU","flag","flag: Luxembourg","flag: luxembourg"],u:"1f1f1-1f1fa",a:"2"},{n:["LV","flag","flag: Latvia","flag: latvia"],u:"1f1f1-1f1fb",a:"2"},{n:["LY","flag","flag: Libya","flag: libya"],u:"1f1f1-1f1fe",a:"2"},{n:["MA","flag","flag: Morocco","flag: morocco"],u:"1f1f2-1f1e6",a:"2"},{n:["MC","flag","flag: Monaco","flag: monaco"],u:"1f1f2-1f1e8",a:"2"},{n:["MD","flag","flag: Moldova","flag: moldova"],u:"1f1f2-1f1e9",a:"2"},{n:["ME","flag","flag: Montenegro","flag: montenegro"],u:"1f1f2-1f1ea",a:"2"},{n:["MF","flag","flag: St. Martin","flag: st. martin"],u:"1f1f2-1f1eb",a:"2"},{n:["MG","flag","flag: Madagascar","flag: madagascar"],u:"1f1f2-1f1ec",a:"2"},{n:["MH","flag","flag: Marshall Islands","flag: marshall islands"],u:"1f1f2-1f1ed",a:"2"},{n:["MK","flag","flag: North Macedonia","flag: north macedonia"],u:"1f1f2-1f1f0",a:"2"},{n:["ML","flag","flag: Mali","flag: mali"],u:"1f1f2-1f1f1",a:"2"},{n:["MM","flag","flag: Myanmar (Burma)","flag: myanmar (burma)"],u:"1f1f2-1f1f2",a:"2"},{n:["MN","flag","flag: Mongolia","flag: mongolia"],u:"1f1f2-1f1f3",a:"2"},{n:["MO","flag","flag: Macao SAR China","flag: macao sar china"],u:"1f1f2-1f1f4",a:"2"},{n:["MP","flag","flag: Northern Mariana Islands","flag: northern mariana islands"],u:"1f1f2-1f1f5",a:"2"},{n:["MQ","flag","flag: Martinique","flag: martinique"],u:"1f1f2-1f1f6",a:"2"},{n:["MR","flag","flag: Mauritania","flag: mauritania"],u:"1f1f2-1f1f7",a:"2"},{n:["MS","flag","flag: Montserrat","flag: montserrat"],u:"1f1f2-1f1f8",a:"2"},{n:["MT","flag","flag: Malta","flag: malta"],u:"1f1f2-1f1f9",a:"2"},{n:["MU","flag","flag: Mauritius","flag: mauritius"],u:"1f1f2-1f1fa",a:"2"},{n:["MV","flag","flag: Maldives","flag: maldives"],u:"1f1f2-1f1fb",a:"2"},{n:["MW","flag","flag: Malawi","flag: malawi"],u:"1f1f2-1f1fc",a:"2"},{n:["MX","flag","flag: Mexico","flag: mexico"],u:"1f1f2-1f1fd",a:"2"},{n:["MY","flag","flag: Malaysia","flag: malaysia"],u:"1f1f2-1f1fe",a:"2"},{n:["MZ","flag","flag: Mozambique","flag: mozambique"],u:"1f1f2-1f1ff",a:"2"},{n:["NA","flag","flag: Namibia","flag: namibia"],u:"1f1f3-1f1e6",a:"2"},{n:["NC","flag","flag: New Caledonia","flag: new caledonia"],u:"1f1f3-1f1e8",a:"2"},{n:["NE","flag","flag: Niger","flag: niger"],u:"1f1f3-1f1ea",a:"2"},{n:["NF","flag","flag: Norfolk Island","flag: norfolk island"],u:"1f1f3-1f1eb",a:"2"},{n:["NG","flag","flag: Nigeria","flag: nigeria"],u:"1f1f3-1f1ec",a:"2"},{n:["NI","flag","flag: Nicaragua","flag: nicaragua"],u:"1f1f3-1f1ee",a:"2"},{n:["NL","flag","flag: Netherlands","flag: netherlands"],u:"1f1f3-1f1f1",a:"2"},{n:["NO","flag","flag: Norway","flag: norway"],u:"1f1f3-1f1f4",a:"2"},{n:["NP","flag","flag: Nepal","flag: nepal"],u:"1f1f3-1f1f5",a:"2"},{n:["NR","flag","flag: Nauru","flag: nauru"],u:"1f1f3-1f1f7",a:"2"},{n:["NU","flag","flag: Niue","flag: niue"],u:"1f1f3-1f1fa",a:"2"},{n:["NZ","flag","flag: New Zealand","flag: new zealand"],u:"1f1f3-1f1ff",a:"2"},{n:["OM","flag","flag: Oman","flag: oman"],u:"1f1f4-1f1f2",a:"2"},{n:["PA","flag","flag: Panama","flag: panama"],u:"1f1f5-1f1e6",a:"2"},{n:["PE","flag","flag: Peru","flag: peru"],u:"1f1f5-1f1ea",a:"2"},{n:["PF","flag","flag: French Polynesia","flag: french polynesia"],u:"1f1f5-1f1eb",a:"2"},{n:["PG","flag","flag: Papua New Guinea","flag: papua new guinea"],u:"1f1f5-1f1ec",a:"2"},{n:["PH","flag","flag: Philippines","flag: philippines"],u:"1f1f5-1f1ed",a:"2"},{n:["PK","flag","flag: Pakistan","flag: pakistan"],u:"1f1f5-1f1f0",a:"2"},{n:["PL","flag","flag: Poland","flag: poland"],u:"1f1f5-1f1f1",a:"2"},{n:["PM","flag","flag: St. Pierre & Miquelon","flag: st. pierre & miquelon"],u:"1f1f5-1f1f2",a:"2"},{n:["PN","flag","flag: Pitcairn Islands","flag: pitcairn islands"],u:"1f1f5-1f1f3",a:"2"},{n:["PR","flag","flag: Puerto Rico","flag: puerto rico"],u:"1f1f5-1f1f7",a:"2"},{n:["PS","flag","flag: Palestinian Territories","flag: palestinian territories"],u:"1f1f5-1f1f8",a:"2"},{n:["PT","flag","flag: Portugal","flag: portugal"],u:"1f1f5-1f1f9",a:"2"},{n:["PW","flag","flag: Palau","flag: palau"],u:"1f1f5-1f1fc",a:"2"},{n:["PY","flag","flag: Paraguay","flag: paraguay"],u:"1f1f5-1f1fe",a:"2"},{n:["QA","flag","flag: Qatar","flag: qatar"],u:"1f1f6-1f1e6",a:"2"},{n:["RE","flag","flag: Réunion","flag: réunion"],u:"1f1f7-1f1ea",a:"2"},{n:["RO","flag","flag: Romania","flag: romania"],u:"1f1f7-1f1f4",a:"2"},{n:["RS","flag","flag: Serbia","flag: serbia"],u:"1f1f7-1f1f8",a:"2"},{n:["RU","flag","flag: Russia","flag: russia"],u:"1f1f7-1f1fa",a:"0.6"},{n:["RW","flag","flag: Rwanda","flag: rwanda"],u:"1f1f7-1f1fc",a:"2"},{n:["SA","flag","flag: Saudi Arabia","flag: saudi arabia"],u:"1f1f8-1f1e6",a:"2"},{n:["SB","flag","flag: Solomon Islands","flag: solomon islands"],u:"1f1f8-1f1e7",a:"2"},{n:["SC","flag","flag: Seychelles","flag: seychelles"],u:"1f1f8-1f1e8",a:"2"},{n:["SD","flag","flag: Sudan","flag: sudan"],u:"1f1f8-1f1e9",a:"2"},{n:["SE","flag","flag: Sweden","flag: sweden"],u:"1f1f8-1f1ea",a:"2"},{n:["SG","flag","flag: Singapore","flag: singapore"],u:"1f1f8-1f1ec",a:"2"},{n:["SH","flag","flag: St. Helena","flag: st. helena"],u:"1f1f8-1f1ed",a:"2"},{n:["SI","flag","flag: Slovenia","flag: slovenia"],u:"1f1f8-1f1ee",a:"2"},{n:["SJ","flag","flag: Svalbard & Jan Mayen","flag: svalbard & jan mayen"],u:"1f1f8-1f1ef",a:"2"},{n:["SK","flag","flag: Slovakia","flag: slovakia"],u:"1f1f8-1f1f0",a:"2"},{n:["SL","flag","flag: Sierra Leone","flag: sierra leone"],u:"1f1f8-1f1f1",a:"2"},{n:["SM","flag","flag: San Marino","flag: san marino"],u:"1f1f8-1f1f2",a:"2"},{n:["SN","flag","flag: Senegal","flag: senegal"],u:"1f1f8-1f1f3",a:"2"},{n:["SO","flag","flag: Somalia","flag: somalia"],u:"1f1f8-1f1f4",a:"2"},{n:["SR","flag","flag: Suriname","flag: suriname"],u:"1f1f8-1f1f7",a:"2"},{n:["SS","flag","flag: South Sudan","flag: south sudan"],u:"1f1f8-1f1f8",a:"2"},{n:["ST","flag","flag: São Tomé & Príncipe","flag: são tomé & príncipe"],u:"1f1f8-1f1f9",a:"2"},{n:["SV","flag","flag: El Salvador","flag: el salvador"],u:"1f1f8-1f1fb",a:"2"},{n:["SX","flag","flag: Sint Maarten","flag: sint maarten"],u:"1f1f8-1f1fd",a:"2"},{n:["SY","flag","flag: Syria","flag: syria"],u:"1f1f8-1f1fe",a:"2"},{n:["SZ","flag","flag: Eswatini","flag: eswatini"],u:"1f1f8-1f1ff",a:"2"},{n:["TA","flag","flag: Tristan da Cunha","flag: tristan da cunha"],u:"1f1f9-1f1e6",a:"2"},{n:["TC","flag","flag: Turks & Caicos Islands","flag: turks & caicos islands"],u:"1f1f9-1f1e8",a:"2"},{n:["TD","flag","flag: Chad","flag: chad"],u:"1f1f9-1f1e9",a:"2"},{n:["TF","flag","flag: French Southern Territories","flag: french southern territories"],u:"1f1f9-1f1eb",a:"2"},{n:["TG","flag","flag: Togo","flag: togo"],u:"1f1f9-1f1ec",a:"2"},{n:["TH","flag","flag: Thailand","flag: thailand"],u:"1f1f9-1f1ed",a:"2"},{n:["TJ","flag","flag: Tajikistan","flag: tajikistan"],u:"1f1f9-1f1ef",a:"2"},{n:["TK","flag","flag: Tokelau","flag: tokelau"],u:"1f1f9-1f1f0",a:"2"},{n:["TL","flag","flag: Timor Leste","flag: timor leste"],u:"1f1f9-1f1f1",a:"2"},{n:["TM","flag","flag: Turkmenistan","flag: turkmenistan"],u:"1f1f9-1f1f2",a:"2"},{n:["TN","flag","flag: Tunisia","flag: tunisia"],u:"1f1f9-1f1f3",a:"2"},{n:["TO","flag","flag: Tonga","flag: tonga"],u:"1f1f9-1f1f4",a:"2"},{n:["TR","flag","flag: Türkiye","flag: türkiye"],u:"1f1f9-1f1f7",a:"2"},{n:["TT","flag","flag: Trinidad & Tobago","flag: trinidad & tobago"],u:"1f1f9-1f1f9",a:"2"},{n:["TV","flag","flag: Tuvalu","flag: tuvalu"],u:"1f1f9-1f1fb",a:"2"},{n:["TW","flag","flag: Taiwan","flag: taiwan"],u:"1f1f9-1f1fc",a:"2"},{n:["TZ","flag","flag: Tanzania","flag: tanzania"],u:"1f1f9-1f1ff",a:"2"},{n:["UA","flag","flag: Ukraine","flag: ukraine"],u:"1f1fa-1f1e6",a:"2"},{n:["UG","flag","flag: Uganda","flag: uganda"],u:"1f1fa-1f1ec",a:"2"},{n:["UM","flag","flag: U.S. Outlying Islands","flag: u.s. outlying islands"],u:"1f1fa-1f1f2",a:"2"},{n:["UN","flag","flag: United Nations","flag: united nations"],u:"1f1fa-1f1f3",a:"4"},{n:["US","flag","flag: United States","flag: united states"],u:"1f1fa-1f1f8",a:"0.6"},{n:["UY","flag","flag: Uruguay","flag: uruguay"],u:"1f1fa-1f1fe",a:"2"},{n:["UZ","flag","flag: Uzbekistan","flag: uzbekistan"],u:"1f1fa-1f1ff",a:"2"},{n:["VA","flag","flag: Vatican City","flag: vatican city"],u:"1f1fb-1f1e6",a:"2"},{n:["VC","flag","flag: St. Vincent & Grenadines","flag: st. vincent & grenadines"],u:"1f1fb-1f1e8",a:"2"},{n:["VE","flag","flag: Venezuela","flag: venezuela"],u:"1f1fb-1f1ea",a:"2"},{n:["VG","flag","flag: British Virgin Islands","flag: british virgin islands"],u:"1f1fb-1f1ec",a:"2"},{n:["VI","flag","flag: U.S. Virgin Islands","flag: u.s. virgin islands"],u:"1f1fb-1f1ee",a:"2"},{n:["VN","flag","flag: Vietnam","flag: vietnam"],u:"1f1fb-1f1f3",a:"2"},{n:["VU","flag","flag: Vanuatu","flag: vanuatu"],u:"1f1fb-1f1fa",a:"2"},{n:["WF","flag","flag: Wallis & Futuna","flag: wallis & futuna"],u:"1f1fc-1f1eb",a:"2"},{n:["WS","flag","flag: Samoa","flag: samoa"],u:"1f1fc-1f1f8",a:"2"},{n:["XK","flag","flag: Kosovo","flag: kosovo"],u:"1f1fd-1f1f0",a:"2"},{n:["YE","flag","flag: Yemen","flag: yemen"],u:"1f1fe-1f1ea",a:"2"},{n:["YT","flag","flag: Mayotte","flag: mayotte"],u:"1f1fe-1f1f9",a:"2"},{n:["ZA","flag","flag: South Africa","flag: south africa"],u:"1f1ff-1f1e6",a:"2"},{n:["ZM","flag","flag: Zambia","flag: zambia"],u:"1f1ff-1f1f2",a:"2"},{n:["ZW","flag","flag: Zimbabwe","flag: zimbabwe"],u:"1f1ff-1f1fc",a:"2"},{n:["flag","gbeng","flag: England","flag: england"],u:"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",a:"5"},{n:["flag","gbsct","flag: Scotland","flag: scotland"],u:"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",a:"5"},{n:["flag","gbwls","flag: Wales","flag: wales"],u:"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f",a:"5"}]}
vendor: 21,511 bytes, line 3919
3919,xA={categories:Dtt,emojis:Ott},UY="epr_suggested";function wA(e){try{var t,r,n;if(!((t=window)!=null&&t.localStorage))return[];var a=JSON.parse((r=(n=window)==null?void 0:n.localStorage.getItem(UY))!=null?r:"[]");return e===vy.FREQUENT?a.sort(function(i,o){return o.count-i.count}):a}catch{return[]}}function Rtt(e,t){var r=wA(),n=rl(e,t),a=rl(e),i=r.find(function(c){var u=c.unified;return u===n}),o;i?o=[i].concat(r.filter(function(c){return c!==i})):(i={unified:n,original:a,count:0},o=[i].concat(r)),i.count++,o.length=Math.min(o.length,14);try{var l;(l=window)==null||l.localStorage.setItem(UY,JSON.stringify(o))}catch{}}function jA(e){var t;return(t=e[$a.name])!=null?t:[]}function O$(e){if(!e)return"";var t=jA(e);return t[t.length-1]}function VY(e){var t=e.split("-"),r=t.splice(1,1),n=r[0];return bA[n]?t.join("-"):e}function rl(e,t){var r,n=e[$a.unified];return!t||!Ep(e)?n:(r=Ftt(e,t))!=null?r:n}function $tt(){var e=XY(),t=kA(),r=t[0],n=U.useMemo(function(){var a,i=(a=wA(e))!=null?a:[];return i.map(function(o){return Xj(o.unified)}).filter(Boolean)},[r,e]);return function(i){var o;return i===xr.SUGGESTED?n:(o=xA.emojis[i])!=null?o:[]}}function Zj(e){var t;return(t=e[$a.variations])!=null?t:[]}function Ep(e){return Zj(e).length>0}function Ftt(e,t){return t?Zj(e).find(function(r){return r.includes(t)}):rl(e)}function Xj(e){if(e){if(mx[e])return mx[e];var t=VY(e);return mx[t]}}var ztt=Object.values(xA.emojis).flat(),mx={};ztt.reduce(function(e,t){return e[rl(t)]=t,Ep(t)&&Zj(t).forEach(function(r){e[r]=t}),e},mx);function Btt(e){var t=e.split("-"),r=t[1];return Nw.includes(r)?r:null}var WY=U.createContext({emojiData:{},allEmojis:[],allEmojisByUnified:{},searchIndex:{},emojiByUnified:Xj,activeVariationFromUnified:function(){return null}});function Utt(e){var t=e.children,r=Wn(),n=r.customEmojis,a=r.emojiData,i=U.useMemo(function(){var l=a||xA,c=JSON.parse(JSON.stringify(l));n&&n.length>0&&(c.emojis[xr.CUSTOM]=n.map(Wtt));var u=c.emojis||{},d=Object.values(u).flat(),f={},m={};return d.forEach(function(h){var p=h[$a.unified];if(f[p]=h,h[$a.variations]){var g;(g=h[$a.variations])==null||g.forEach(function(v){f[v]=h})}var y=(h[$a.name]||[]).join("").toLowerCase().split("");y.forEach(function(v){var x;m[v]=(x=m[v])!=null?x:{},m[v][p]=h})}),{emojiData:c,allEmojis:d,allEmojisByUnified:f,searchIndex:m}},[a,n]),o=U.useCallback(function(l){var c;if(l){var u=(c=i.allEmojisByUnified[l])!=null?c:i.allEmojisByUnified[_Y(l)];return u}},[i.allEmojisByUnified]);return U.createElement(WY.Provider,{value:Mn({},i,{emojiByUnified:o,activeVariationFromUnified:Ntt})},t)}function Tp(){return U.useContext(WY)}function Vtt(){var e=Tp(),t=e.emojiData,r=e.emojiByUnified,n=XY(),a=kA(),i=a[0],o=U.useMemo(function(){var l,c=(l=wA(n))!=null?l:[];return c.map(function(u){var d,f=r(u.unified);if(f)return Mn({},f,(d={},d[$a.unified]=u.unified,d))}).filter(Boolean)},[i,n,r]);return function(c){var u,d;return c===xr.SUGGESTED?o:(u=(d=t.emojis)==null?void 0:d[c])!=null?u:[]}}function Wtt(e){var t;return t={},t[$a.name]=e.names.map(function(r){return r.toLowerCase()}),t[$a.unified]=e.id.toLowerCase(),t[$a.added_in]="0",t[$a.imgUrl]=e.imgUrl,t}function qtt(){var e=frt();return function(t){return e.has(t)}}function qY(){var e=b.useRef({}),t=drt(),r=Tp(),n=r.allEmojis;return b.useMemo(function(){var a=parseFloat(""+t);return!t||Number.isNaN(a)?e.current:n.reduce(function(i,o){return Htt(o,a)&&(i[Af(o)]=!0),i},e.current)},[t,n])}function Gtt(){var e=qY(),t=qtt();return function(n){var a=_Y(Af(n));return!!(e[a]||t(a))}}function Htt(e,t){return vtt(e)>t}function Ytt(e){b.useEffect(function(){e(!0)},[e])}function Qtt(e){var t=e.children,r=qY(),n=ert(),a=urt(),i=Tp(),o=i.searchIndex,l=b.useRef(o);b.useEffect(function(){l.current=o},[o]);var c=b.useRef(!1),u=b.useRef(!1),d=b.useRef(r),f=D$(Date.now(),200),m=D$("",100),h=b.useState(!1),p=b.useState(n),g=b.useState(null),y=b.useState(new Set),v=b.useState(null),x=b.useState(a),j=b.useState(!1),C=j[0],N=j[1],S=b.useState([]),M=b.useState(null);return Ytt(N),b.createElement(fi.Provider,{value:{activeCategoryState:g,activeSkinTone:p,disallowClickRef:c,disallowMouseRef:u,disallowedEmojisRef:d,emojiVariationPickerState:v,emojisThatFailedToLoadState:y,filterRef:l,isPastInitialLoad:C,searchTerm:m,skinToneFanOpenState:h,suggestedUpdateState:f,reactionsModeState:x,visibleCategoriesState:S,emojiSizeState:M}},t)}var fi=b.createContext({activeCategoryState:[null,function(){}],activeSkinTone:[ao.NEUTRAL,function(){}],disallowClickRef:{current:!1},disallowMouseRef:{current:!1},disallowedEmojisRef:{current:{}},emojiVariationPickerState:[null,function(){}],emojisThatFailedToLoadState:[new Set,function(){}],filterRef:{current:{}},isPastInitialLoad:!0,searchTerm:["",function(){return new Promise(function(){})}],skinToneFanOpenState:[!1,function(){}],suggestedUpdateState:[Date.now(),function(){}],reactionsModeState:[!1,function(){}],visibleCategoriesState:[[],function(){return[]}],emojiSizeState:[null,function(){}]});function NA(){var e=b.useContext(fi),t=e.filterRef;return t}function Ktt(){var e=b.useContext(fi),t=e.disallowClickRef;return t}function SA(){var e=b.useContext(fi),t=e.disallowMouseRef;return t}function Pf(){var e=b.useContext(fi),t=e.reactionsModeState;return t}function eN(){var e=b.useContext(fi),t=e.searchTerm;return t}function tN(){var e=b.useContext(fi),t=e.activeSkinTone;return t}function GY(){var e=b.useContext(fi),t=e.emojisThatFailedToLoadState;return t}function Ap(){var e=b.useContext(fi),t=e.emojiVariationPickerState;return t}function wb(){var e=b.useContext(fi),t=e.skinToneFanOpenState;return t}function CA(){var e=b.useContext(fi),t=e.visibleCategoriesState;return t}function HY(){var e=b.useContext(fi),t=e.emojiSizeState;return t}function kA(){var e=b.useContext(fi),t=e.suggestedUpdateState,r=t[0],n=t[1];return[r,function(){n(Date.now())}]}var YY=U.createContext({});function QY(){var e=U.useContext(YY);return e}function Jtt(e){var t=U.useRef({onEmojiClick:e.onEmojiClick||Ev,onReactionClick:e.onReactionClick||e.onEmojiClick,onSkinToneChange:e.onSkinToneChange||Ev});return U.useEffect(function(){t.current.onEmojiClick=e.onEmojiClick||Ev,t.current.onReactionClick=e.onReactionClick||e.onEmojiClick},[e.onEmojiClick,e.onReactionClick]),U.useEffect(function(){t.current.onSkinToneChange=e.onSkinToneChange||Ev},[e.onSkinToneChange]),t}function Ev(){}var xy;(function(e){e.REACTIONS="reactions",e.PICKER="picker"})(xy||(xy={}));function Ztt(){var e,t=Wn(),r=t.searchPlaceHolder,n=t.searchPlaceholder;return(e=[r,n].find(function(a){return a!==Sw}))!=null?e:Sw}function Xtt(){var e=Wn(),t=e.searchClearButtonLabel;return t??$Y}function ert(){var e=Wn(),t=e.defaultSkinTone;return t}function KY(){var e=Wn(),t=e.allowExpandReactions;return t}function JY(){var e=Wn(),t=e.skinTonesDisabled;return t}function _f(){var e=Wn(),t=e.emojiStyle;return t}function trt(){var e=Wn(),t=e.autoFocusSearch;return t}function MA(){var e=Wn(),t=e.categories;return t}function rrt(){var e=Wn(),t=e.categoryIcons;return t}function nrt(){var e=Wn(),t=e.customEmojis;return t}function art(){var e=Wn(),t=e.open;return t}function srt(e){var t=QY(),r=t.current,n=Pf(),a=n[1],i=r.onEmojiClick||function(){},o=r.onReactionClick;return e===xy.REACTIONS&&o?function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return o.apply(void 0,c.concat([{collapseToReactions:function(){a(function(f){return f})}}]))}:function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];i.apply(void 0,c.concat([{collapseToReactions:function(){a(!0)}}]))}}function irt(){var e=QY(),t=e.current;return t.onSkinToneChange||function(){}}function ZY(){var e=Wn(),t=e.previewConfig;return t}function ort(){var e=Wn(),t=e.theme;return t}function XY(){var e=Wn(),t=e.suggestedEmojisMode;return t}function eQ(){var e=Wn(),t=e.lazyLoadEmojis;return t}function lrt(){var e=Wn(),t=e.className;return t}function crt(){var e=Wn(),t=e.height,r=e.width,n=e.style;return Mn({height:R$(t),width:R$(r)},n)}function urt(){var e=Wn(),t=e.reactionsDefaultOpen;return t}function drt(){var e=Wn(),t=e.emojiVersion;return t}function tQ(){var e=Wn(),t=e.searchDisabled;return t}function rQ(){var e=Wn(),t=e.skinTonePickerLocation;return t}function frt(){var e=Wn(),t=e.unicodeToHide;return t}function mrt(){var e=Wn(),t=e.reactions;return t}function Lf(){var e=Wn(),t=e.getEmojiUrl;return t}function R$(e){return typeof e=="number"?e+"px":e}function hrt(e){var t=e>0,r=e>1;return t?r?Ttt.replace("%n",e.toString()):Ett:Itt}function rN(){var e=eN(),t=e[0];return!!t}function mi(e){e&&requestAnimationFrame(function(){e.focus()})}function nQ(e){if(e){var t=e.previousElementSibling;mi(t)}}function aQ(e){if(e){var t=e.nextElementSibling;mi(t)}}function sQ(e){if(e){var t=e.firstElementChild;mi(t)}}function wy(){return document.activeElement}function prt(e){var t=e.children,r=b.useRef(null),n=b.useRef(null),a=b.useRef(null),i=b.useRef(null),o=b.useRef(null),l=b.useRef(null),c=b.useRef(null),u=b.useRef(null),d=b.useRef(null);return b.createElement(iQ.Provider,{value:{AnchoredEmojiRef:n,BodyRef:a,EmojiListRef:i,CategoryNavigationRef:c,PickerMainRef:r,SearchInputRef:o,SkinTonePickerRef:l,VariationPickerRef:u,ReactionsRef:d}},t)}var iQ=b.createContext({AnchoredEmojiRef:b.createRef(),BodyRef:b.createRef(),CategoryNavigationRef:b.createRef(),EmojiListRef:b.createRef(),PickerMainRef:b.createRef(),SearchInputRef:b.createRef(),SkinTonePickerRef:b.createRef(),VariationPickerRef:b.createRef(),ReactionsRef:b.createRef()});function Sc(){return b.useContext(iQ)}function oQ(){return Sc().EmojiListRef}function Pp(){return Sc().PickerMainRef}function nN(){return Sc().AnchoredEmojiRef}function lQ(){var e=nN();return function(t){t===null&&e.current!==null&&mi(e.current),e.current=t}}function hi(){return Sc().BodyRef}function grt(){return Sc().ReactionsRef}function qu(){return Sc().SearchInputRef}function IA(){return Sc().SkinTonePickerRef}function EA(){return Sc().CategoryNavigationRef}function yrt(){return Sc().VariationPickerRef}function cQ(e,t){t===void 0&&(t=0);var r=NQ(e);r&&requestAnimationFrame(function(){r.scrollTop=t})}function brt(e,t){var r=NQ(e);r&&requestAnimationFrame(function(){r.scrollTop=r.scrollTop+t})}function vrt(){var e=hi();return b.useCallback(function(t){requestAnimationFrame(function(){e.current&&(e.current.scrollTop=t)})},[e])}function aN(e){if(!(!e||!ant(e))&&!e.closest(Ui(Wr.variationPicker))){var t=CQ(e),r=SQ(e);brt(t,-(_A(Gu(e))-r))}}function sN(e){var t=$A(e);mi(t),aN(t)}function xrt(e){var t=$A(e);mi(t),t==null||t.click()}function wrt(e){mi(IQ(e))}function jrt(e){if(e){var t=EQ(e);if(!t)return sN(oN(e));mi(t),aN(t)}}function Nrt(e){if(e){var t=RA(e);if(!t)return wrt(iN(e));mi(t),aN(t)}}function Srt(e,t){if(e){var r=krt(e);if(!r)return t();mi(r),aN(r)}}function Crt(e){if(e){var t=Mrt(e);return mi(t)}}function krt(e){if(!e)return null;var t=TQ(e),r=Gu(t),n=vQ(t,e),a=Vh(r),i=a.indexOf(e),o=i%n;if(i===-1)return null;if(a[i-n])return a[i-n];var l=iN(r);if(!l)return null;var c=Vh(l),u=c.length%n-1;if(o>u)return c.at(-1);for(var d=c.length-1;d>=0;d--)if(d%n===o)return c[d];return c.at(-1)}function Mrt(e){var t;if(!e)return null;var r=TQ(e),n=Gu(r),a=vQ(r,e),i=Vh(n),o=i.indexOf(e);if(o===-1)return null;var l=a-o%a-1,c=o+l+1;if(i[c]){for(var u=o+a;u%a>=0;u--)if(i[u])return i[u]}var d=o%a,f=oN(n),m=Vh(f);return m[d]?m[d]:(t=m.at(0))!=null?t:null}function Df(){var e=Ap(),t=e[0],r=e[1],n=wb(),a=n[0],i=n[1],o=b.useCallback(function(){t&&r(null),a&&i(!1)},[t,a,r,i]);return o}function uQ(){var e=Ap(),t=e[0],r=wb(),n=r[0];return function(){return!!t||n}}function Irt(){var e=SA();return function(){e.current=!0}}function dQ(){var e=SA();return function(){e.current=!1}}function fQ(){var e=SA();return function(){return e.current}}function Ert(){var e=hi(),t=dQ(),r=fQ();b.useEffect(function(){var n=e.current;n==null||n.addEventListener("mousemove",a,{passive:!0});function a(){r()&&t()}return function(){n==null||n.removeEventListener("mousemove",a)}},[e,t,r])}function Of(){var e=qu();return b.useCallback(function(){mi(e.current)},[e])}function Trt(){var e=IA();return b.useCallback(function(){e.current&&sQ(e.current)},[e])}function mQ(){var e=EA();return b.useCallback(function(){e.current&&sQ(e.current)},[e])}function Art(){var e=NA();return function t(r){if(typeof r=="function")return t(r(e.current));e.current=r}}function hQ(){var e=TA(),t=qu(),r=Of();return function(){t.current&&(t.current.value=""),e(""),r()}}function Prt(){var e=qu(),t=TA();return function(n){e.current?(e.current.value=""+e.current.value+n,t($$(e.current.value))):t($$(n))}}function _rt(){var e=qu(),t=NA(),r=Art(),n=TA(),a=eN(),i=a[0],o=Frt(t.current,i);return{onChange:l,searchTerm:i,SearchInputRef:e,statusSearchResults:o};function l(c){var u=t.current,d=c.toLowerCase();if(u!=null&&u[d]||d.length<=1)return n(d);var f=$rt(d,u);if(!f)return n(d);r(function(m){var h;return Object.assign(m,(h={},h[d]=Lrt(f,d),h))}),n(d)}}function TA(){var e=eN(),t=e[1],r=Pp();return function(a){requestAnimationFrame(function(){t(a&&(a==null?void 0:a.toLowerCase())).then(function(){cQ(r.current,0)})})}}function Lrt(e,t){var r={};for(var n in e){var a=e[n];Drt(a,t)&&(r[n]=a)}return r}function Drt(e,t){return PY(e).some(function(r){return r.includes(t)})}function Ort(){var e=NA(),t=e.current,r=eN(),n=r[0];return function(a){return Rrt(a,t,n)}}function Rrt(e,t,r){var n;return!t||!r?!1:!((n=t[r])!=null&&n[e])}function $rt(e,t){if(!t)return null;if(t[e])return t[e];var r=Object.keys(t).sort(function(n,a){return a.length-n.length}).find(function(n){return e.includes(n)});return r?t[r]:null}function $$(e){return!e||typeof e!="string"?"":e.trim().toLowerCase()}function Frt(e,t){var r;if(!(e!=null&&e[t]))return"";var n=((r=Object.entries(e==null?void 0:e[t]))==null?void 0:r.length)||0;return hrt(n)}function pQ(){var e=lQ(),t=Ap(),r=t[1];return function(a){var i=wQ(a),o=i[0];o&&(e(a),r(o))}}function AA(){var e=rQ();return e===Uh.SEARCH}function gQ(){var e=rQ();return e===Uh.PREVIEW}var wa;(function(e){e.ArrowDown="ArrowDown",e.ArrowUp="ArrowUp",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Escape="Escape",e.Enter="Enter",e.Space=" "})(wa||(wa={}));function zrt(){Brt(),Urt(),Vrt(),Wrt(),qrt()}function Brt(){var e=Pp(),t=hQ(),r=vrt(),n=qu(),a=Of(),i=uQ(),o=Irt(),l=Df(),c=b.useMemo(function(){return function(d){var f=d.key;switch(o(),f){case wa.Escape:if(d.preventDefault(),i()){l();return}t(),r(0),a();break}}},[r,t,l,a,i,o]);b.useEffect(function(){var u=e.current;if(u)return u.addEventListener("keydown",c),function(){u.removeEventListener("keydown",c)}},[e,n,r,c])}function Urt(){var e=Trt(),t=Pp(),r=hi(),n=qu(),a=wb(),i=a[1],o=yQ(),l=AA(),c=b.useMemo(function(){return function(d){var f=d.key;switch(f){case wa.ArrowRight:if(!l)return;d.preventDefault(),i(!0),e();break;case wa.ArrowDown:d.preventDefault(),o();break;case wa.Enter:d.preventDefault(),xrt(r.current);break}}},[e,o,i,r,l]);b.useEffect(function(){var u=n.current;if(u)return u.addEventListener("keydown",c),function(){u.removeEventListener("keydown",c)}},[t,n,c])}function Vrt(){var e=IA(),t=Of(),r=qu(),n=yQ(),a=wb(),i=a[0],o=a[1],l=gQ(),c=AA(),u=PA(),d=b.useMemo(function(){return function(m){var h=m.key;if(c)switch(h){case wa.ArrowLeft:if(m.preventDefault(),!i)return t();F$(t);break;case wa.ArrowRight:if(m.preventDefault(),!i)return t();z$();break;case wa.ArrowDown:m.preventDefault(),i&&o(!1),n();break;default:u(m);break}if(l)switch(h){case wa.ArrowUp:if(m.preventDefault(),!i)return t();F$(t);break;case wa.ArrowDown:if(m.preventDefault(),!i)return t();z$();break;default:u(m);break}}},[i,t,o,n,u,l,c]);b.useEffect(function(){var f=e.current;if(f)return f.addEventListener("keydown",d),function(){f.removeEventListener("keydown",d)}},[e,r,i,d])}function Wrt(){var e=Of(),t=EA(),r=hi(),n=PA(),a=b.useMemo(function(){return function(o){var l=o.key;switch(l){case wa.ArrowUp:o.preventDefault(),e();break;case wa.ArrowRight:o.preventDefault(),aQ(wy());break;case wa.ArrowLeft:o.preventDefault(),nQ(wy());break;case wa.ArrowDown:o.preventDefault(),sN(r.current);break;default:n(o);break}}},[r,e,n]);b.useEffect(function(){var i=t.current;if(i)return i.addEventListener("keydown",a),function(){i.removeEventListener("keydown",a)}},[t,r,a])}function qrt(){var e=hi(),t=Grt(),r=pQ(),n=uQ(),a=Df(),i=PA(),o=b.useMemo(function(){return function(c){var u=c.key,d=bo(wy());switch(u){case wa.ArrowRight:c.preventDefault(),jrt(d);break;case wa.ArrowLeft:c.preventDefault(),Nrt(d);break;case wa.ArrowDown:if(c.preventDefault(),n()){a();break}Crt(d);break;case wa.ArrowUp:if(c.preventDefault(),n()){a();break}Srt(d,t);break;case wa.Space:c.preventDefault(),r(c.target);break;default:i(c);break}}},[t,i,r,n,a]);b.useEffect(function(){var l=e.current;if(l)return l.addEventListener("keydown",o),function(){l.removeEventListener("keydown",o)}},[e,o])}function yQ(){var e=mQ(),t=rN(),r=hi();return b.useCallback(function(){return t?sN(r.current):e()},[r,e,t])}function Grt(){var e=Of(),t=mQ(),r=rN();return b.useCallback(function(){return r?e():t()},[e,r,t])}function F$(e){var t=wy();t&&(tnt(t)||e(),aQ(t))}function z$(){var e=wy();e&&nQ(e)}function PA(){var e=Prt(),t=Of(),r=tQ(),n=Df();return function(i){var o=i.key;Hrt(i)||r||o.match(/(^[a-zA-Z0-9]$){1}/)&&(i.preventDefault(),n(),t(),e(o))}}function Hrt(e){var t=e.metaKey,r=e.ctrlKey,n=e.altKey;return t||r||n}function Yrt(e,t,r,n,a,i,o,l){if(e&&t!==ti.NATIVE){var c=Af(e);P4.has(c)||!i||!o||setTimeout(function(){var u=a+i.top,d=r+n,f=u>=d&&u<d+o.emojiSize*2;f&&bQ(l,e,t)})}}function bQ(e,t,r){if(t){var n=Af(t);P4.has(n)||(P4.add(n),vA(t).concat(n).forEach(function(a){var i=e(a,r);Qrt(i)}))}}var P4=new Set;function Qrt(e){var t=new Image;t.src=e}function Krt(){var e=hi(),t=_f(),r=Lf();b.useEffect(function(){if(t===ti.NATIVE)return;var n=e.current;return n==null||n.addEventListener("focusin",a),function(){n==null||n.removeEventListener("focusin",a)};function a(i){var o=bo(i.target);if(o){var l=wQ(o),c=l[0];c&&Ep(c)&&bQ(r,c,t)}}},[e,t,r])}var Jrt=["width","height"],_4=40;function Zrt(e){var t=e.children;return b.createElement(Qtt,null,b.createElement(Xrt,null,t))}function Xrt(e){var t,r=e.children,n=Pf(),a=n[0],i=ort(),o=rN(),l=Pp(),c=lrt(),u=crt();zrt(),Krt();var d=u||{},f=d.width,m=d.height,h=TY(d,Jrt);return b.createElement("aside",{className:Lr(yg.main,yg.baseVariables,i===Bh.DARK&&yg.darkTheme,i===Bh.AUTO&&yg.autoThemeDark,(t={},t[Wr.searchActive]=o,t),a&&yg.reactionsMenu,c),ref:l,style:Mn({},h,!a&&{height:m,width:f})},r)}var B$={"--epr-emoji-variation-picker-bg-color":"var(--epr-dark-emoji-variation-picker-bg-color)","--epr-hover-bg-color-reduced-opacity":"var(--epr-dark-hover-bg-color-reduced-opacity)","--epr-highlight-color":"var(--epr-dark-highlight-color)","--epr-text-color":"var(--epr-dark-text-color)","--epr-hover-bg-color":"var(--epr-dark-hover-bg-color)","--epr-focus-bg-color":"var(--epr-dark-focus-bg-color)","--epr-search-input-bg-color":"var(--epr-dark-search-input-bg-color)","--epr-category-label-bg-color":"var(--epr-dark-category-label-bg-color)","--epr-picker-border-color":"var(--epr-dark-picker-border-color)","--epr-bg-color":"var(--epr-dark-bg-color)","--epr-reactions-bg-color":"var(--epr-dark-reactions-bg-color)","--epr-search-input-bg-color-active":"var(--epr-dark-search-input-bg-color-active)","--epr-emoji-variation-indicator-color":"var(--epr-dark-emoji-variation-indicator-color)","--epr-category-icon-active-color":"var(--epr-dark-category-icon-active-color)","--epr-skin-tone-picker-menu-color":"var(--epr-dark-skin-tone-picker-menu-color)","--epr-skin-tone-outer-border-color":"var(--epr-dark-skin-tone-outer-border-color)","--epr-skin-tone-inner-border-color":"var(--epr-dark-skin-tone-inner-border-color)"},yg=Qn.create({main:{".":["epr-main",Wr.emojiPicker],position:"relative",display:"flex",flexDirection:"column",borderWidth:"1px",borderStyle:"solid",borderRadius:"var(--epr-picker-border-radius)",borderColor:"var(--epr-picker-border-color)",backgroundColor:"var(--epr-bg-color)",overflow:"hidden",transition:"height 0.3s ease-in-out, background-color 0.1s ease-in-out","*":{boxSizing:"border-box",fontFamily:"sans-serif"}},baseVariables:{"--":{"--epr-highlight-color":"#007aeb","--epr-hover-bg-color":"#e5f0fa","--epr-hover-bg-color-reduced-opacity":"#e5f0fa80","--epr-focus-bg-color":"#e0f0ff","--epr-text-color":"#858585","--epr-search-input-bg-color":"#f6f6f6","--epr-picker-border-color":"#e7e7e7","--epr-bg-color":"#fff","--epr-reactions-bg-color":"#ffffff90","--epr-category-icon-active-color":"#6aa8de","--epr-skin-tone-picker-menu-color":"#ffffff95","--epr-skin-tone-outer-border-color":"#555555","--epr-skin-tone-inner-border-color":"var(--epr-bg-color)","--epr-horizontal-padding":"10px","--epr-picker-border-radius":"8px","--epr-header-padding":"15px var(--epr-horizontal-padding)","--epr-active-skin-tone-indicator-border-color":"var(--epr-highlight-color)","--epr-active-skin-hover-color":"var(--epr-hover-bg-color)","--epr-search-input-bg-color-active":"var(--epr-search-input-bg-color)","--epr-search-input-padding":"0 30px","--epr-search-input-border-radius":"8px","--epr-search-input-height":"40px","--epr-search-input-text-color":"var(--epr-text-color)","--epr-search-input-placeholder-color":"var(--epr-text-color)","--epr-search-bar-inner-padding":"var(--epr-horizontal-padding)","--epr-search-border-color":"var(--epr-search-input-bg-color)","--epr-search-border-color-active":"var(--epr-highlight-color)","--epr-category-navigation-button-size":"30px","--epr-emoji-variation-
3919picker-height":"45px","--epr-emoji-variation-picker-bg-color":"var(--epr-bg-color)","--epr-preview-height":"70px","--epr-preview-text-size":"14px","--epr-preview-text-padding":"0 var(--epr-horizontal-padding)","--epr-preview-border-color":"var(--epr-picker-border-color)","--epr-preview-text-color":"var(--epr-text-color)","--epr-category-padding":"0 var(--epr-horizontal-padding)","--epr-category-label-bg-color":"#ffffffe6","--epr-category-label-text-color":"var(--epr-text-color)","--epr-category-label-padding":"0 var(--epr-horizontal-padding)","--epr-category-label-height":_4+"px","--epr-emoji-size":"30px","--epr-emoji-padding":"5px","--epr-emoji-fullsize":"calc(var(--epr-emoji-size) + var(--epr-emoji-padding) * 2)","--epr-emoji-hover-color":"var(--epr-hover-bg-color)","--epr-emoji-variation-indicator-color":"var(--epr-picker-border-color)","--epr-emoji-variation-indicator-color-hover":"var(--epr-text-color)","--epr-header-overlay-z-index":"3","--epr-emoji-variations-indictator-z-index":"1","--epr-category-label-z-index":"2","--epr-skin-variation-picker-z-index":"5","--epr-preview-z-index":"6","--epr-dark":"#000","--epr-dark-emoji-variation-picker-bg-color":"var(--epr-dark)","--epr-dark-highlight-color":"#c0c0c0","--epr-dark-text-color":"var(--epr-highlight-color)","--epr-dark-hover-bg-color":"#363636f6","--epr-dark-hover-bg-color-reduced-opacity":"#36363680","--epr-dark-focus-bg-color":"#474747","--epr-dark-search-input-bg-color":"#333333","--epr-dark-category-label-bg-color":"#222222e6","--epr-dark-picker-border-color":"#151617","--epr-dark-bg-color":"#222222","--epr-dark-reactions-bg-color":"#22222290","--epr-dark-search-input-bg-color-active":"var(--epr-dark)","--epr-dark-emoji-variation-indicator-color":"#444","--epr-dark-category-icon-active-color":"#3271b7","--epr-dark-skin-tone-picker-menu-color":"#22222295","--epr-dark-skin-tone-outer-border-color":"var(--epr-dark-picker-border-color)","--epr-dark-skin-tone-inner-border-color":"#00000000"}},autoThemeDark:{".":Wr.autoTheme,"@media (prefers-color-scheme: dark)":{"--":B$}},darkTheme:{".":Wr.darkTheme,"--":B$},reactionsMenu:{".":"epr-reactions",height:"50px",display:"inline-flex",backgroundColor:"var(--epr-reactions-bg-color)",backdropFilter:"blur(8px)","--":{"--epr-picker-border-radius":"50px"}}});function vQ(e,t){if(!e||!t)return 0;var r=e.getBoundingClientRect().width,n=t.getBoundingClientRect().width;return Math.floor(r/n)}function ent(e,t,r){if(!e||!t.length)return null;var n=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom,i=n+xQ(e),o=t.find(function(l){var c=l.getBoundingClientRect().top,u=l.getBoundingClientRect().bottom,d=l.clientHeight*r,f=c+d,m=u-d;return f<i?!1:f>=n&&f<=a||m>=n&&m<=a});return o||null}function tnt(e){return!!e.nextElementSibling}function xQ(e){if(!e)return _4;var t=e.querySelector(Ui(Wr.label));if(t){var r=t.getBoundingClientRect().height;if(r>0)return r}return _4}var jy="button"+Ui(Wr.emoji),rnt=[jy,Ui(Wr.visible),":not("+Ui(Wr.hidden)+")"].join("");function bo(e){var t;return(t=e==null?void 0:e.closest(jy))!=null?t:null}function wQ(e){var t=kQ(e),r=LA(e);if(!t)return[];var n=Xj(r??t);return n?[n,r]:[]}function nnt(e){var t;return!!(e!=null&&e.matches(jy)||!(e==null||(t=e.parentElement)==null)&&t.matches(jy))}function U$(e){var t;return(t=e==null?void 0:e.clientHeight)!=null?t:0}function jQ(e){if(!e)return 0;var t=bo(e),r=Gu(t),n=_A(r);return V$(t)+V$(r)+n}function _A(e){var t,r;if(!e)return 0;var n=e.querySelector(Ui(Wr.categoryContent));return((t=e==null?void 0:e.clientHeight)!=null?t:0)-((r=n==null?void 0:n.clientHeight)!=null?r:0)}function ant(e){return e?SQ(e)<_A(Gu(e)):!1}function NQ(e){return e?e.matches(Ui(Wr.scrollBody))?e:e.querySelector(Ui(Wr.scrollBody)):null}function SQ(e){var t,r;return e?jQ(e)-((t=(r=CQ(e))==null?void 0:r.scrollTop)!=null?t:0):0}function CQ(e){var t;return e&&(t=e.closest(Ui(Wr.scrollBody)))!=null?t:null}function snt(e){var t=bo(e),r=Gu(t);return W$(t)+W$(r)}function V$(e){var t;return(t=e==null?void 0:e.offsetTop)!=null?t:0}function W$(e){var t;return(t=e==null?void 0:e.offsetLeft)!=null?t:0}function LA(e){var t;return(t=int(bo(e),"unified"))!=null?t:null}function kQ(e){var t=LA(e);return t?VY(t):null}function DA(e){return e?{unified:LA(e),originalUnified:kQ(e)}:{unified:null,originalUnified:null}}function int(e,t){var r;return(r=ont(e)[t])!=null?r:null}function ont(e){var t;return(t=e==null?void 0:e.dataset)!=null?t:{}}function OA(e){return e.classList.contains(Wr.visible)}function MQ(e){return e?e.classList.contains(Wr.hidden):!0}function Vh(e){return e?Array.from(e.querySelectorAll(rnt)):[]}function IQ(e){if(!e)return null;var t=Vh(e),r=t.slice(-1),n=r[0];return n?OA(n)?n:RA(n):null}function EQ(e){var t=e.nextElementSibling;
vendor: 6,107 bytes, line 3919
3919return t?OA(t)?t:EQ(t):$A(oN(e))}function RA(e){var t=e.previousElementSibling;return t?OA(t)?t:RA(t):IQ(iN(e))}function $A(e){if(!e)return null;var t=Vh(e);return ent(e,t,.1)}function iN(e){var t=Gu(e);if(!t)return null;var r=t.previousElementSibling;return r?MQ(r)?iN(r):r:null}function oN(e){var t=Gu(e);if(!t)return null;var r=t.nextElementSibling;return r?MQ(r)?oN(r):r:null}function Gu(e){return e?e.closest(Ui(Wr.category)):null}function TQ(e){return e?e.closest(Ui(Wr.categoryContent)):null}function AQ(e){return e.split("-").map(function(t){return String.fromCodePoint(parseInt(t,16))}).join("")}function lnt(e){return e.category===xr.CUSTOM}function PQ(e){return e.imgUrl!==void 0}function _Q(e,t){var r=b.useRef(),n=pQ(),a=Ktt(),i=Ap(),o=i[1],l=Df(),c=tN(),u=c[0],d=srt(t),f=kA(),m=f[1],h=Lf(),p=_f(),g=Tp(),y=g.emojiByUnified,v=b.useCallback(function(N){if(!a.current){l();var S=q$(N,y),M=S[0],k=S[1];if(!(!M||!k)){var I=Btt(k)||u;m(),Rtt(M,I),d(cnt(M,I,p,h),N)}}},[u,l,a,y,d,m,h,p]),x=b.useCallback(function(N){var S;r.current&&clearTimeout(r.current);var M=q$(N,y),k=M[0];!k||!Ep(k)||(r.current=(S=window)==null?void 0:S.setTimeout(function(){a.current=!0,r.current=void 0,l(),n(N.target),o(k)},500))},[a,y,l,n,o]),j=b.useCallback(function(){r.current?(clearTimeout(r.current),r.current=void 0):a.current&&requestAnimationFrame(function(){a.current=!1})},[a]);b.useEffect(function(){if(e.current){var C=e.current;return C.addEventListener("click",v,{passive:!0}),C.addEventListener("mousedown",x,{passive:!0}),C.addEventListener("mouseup",j,{passive:!0}),function(){C==null||C.removeEventListener("click",v),C==null||C.removeEventListener("mousedown",x),C==null||C.removeEventListener("mouseup",j)}}},[e,v,x,j])}function q$(e,t){var r=e==null?void 0:e.target;if(!nnt(r))return[];var n=DA(r),a=n.unified,i=n.originalUnified,o=a??i;if(!o)return[];var l=t(o);return l?[l,a??o]:[]}function cnt(e,t,r,n){var a=jA(e);if(PQ(e)){var i=rl(e);return{activeSkinTone:t,emoji:i,getImageUrl:function(){return e.imgUrl},imageUrl:e.imgUrl,isCustom:!0,names:a,unified:i,unifiedWithoutSkinTone:i}}var o=rl(e,t);return{activeSkinTone:t,emoji:AQ(o),getImageUrl:function(c){return c===void 0&&(c=r??ti.APPLE),n(o,c)},imageUrl:n(o,r??ti.APPLE),isCustom:!1,names:a,unified:o,unifiedWithoutSkinTone:rl(e)}}function jb(e){return b.createElement("button",Object.assign({type:"button"},e,{className:Lr(unt.button,e.className)}),e.children)}var unt=Qn.create({button:{".":"epr-btn",cursor:"pointer",border:"0",background:"none",outline:"none"}});function dnt(e){var t,r=e.emojiNames,n=e.unified,a=e.hidden,i=e.hiddenOnSearch,o=e.showVariations,l=o===void 0?!0:o,c=e.hasVariations,u=e.children,d=e.className,f=e.noBackground,m=f===void 0?!1:f,h=e.style;return b.createElement(jb,{className:Lr(tC.emoji,a&&yA.hidden,i&&Tf.hiddenOnSearch,(t={},t[Wr.visible]=!a&&!i,t),!!(c&&l)&&tC.hasVariations,m&&tC.noBackground,d),"data-unified":n,"aria-label":fnt(r),"data-full-name":r,style:h},u)}function fnt(e){return e[e.length-1]}var tC=Qn.create({emoji:{".":Wr.emoji,position:"relative",width:"var(--epr-emoji-fullsize)",height:"var(--epr-emoji-fullsize)",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"var(--epr-emoji-fullsize)",maxHeight:"var(--epr-emoji-fullsize)",borderRadius:"8px",overflow:"hidden",transition:"background-color 0.2s",":hover":{backgroundColor:"var(--epr-emoji-hover-color)"},":focus":{backgroundColor:"var(--epr-focus-bg-color)"}},noBackground:{background:"none",":hover":{backgroundColor:"transparent",background:"none"},":focus":{backgroundColor:"transparent",background:"none"}},hasVariations:{".":Wr.emojiHasVariations,":after":{content:"",display:"block",width:"0",height:"0",right:"0px",bottom:"1px",position:"absolute",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",transform:"rotate(135deg)",borderBottom:"4px solid var(--epr-emoji-variation-indicator-color)",zIndex:"var(--epr-emoji-variations-indictator-z-index)"},":hover:after":{borderBottom:"4px solid var(--epr-emoji-variation-indicator-color-hover)"}}}),Cw=Qn.create({external:{".":Wr.external,fontSize:"0"},common:{alignSelf:"center",justifySelf:"center",display:"block"}});function G$(e){var t=e.emojiName,r=e.style,n=e.lazyLoad,a=n===void 0?!1:n,i=e.imgUrl,o=e.onError,l=e.className;return b.createElement("img",{src:i,alt:t,className:Lr(mnt.emojiImag,Cw.external,Cw.common,l),loading:a?"lazy":"eager",onError:o,style:r})}var mnt=Qn.create({emojiImag:{".":"epr-emoji-img",maxWidth:"var(--epr-emoji-fullsize)",maxHeight:"var(--epr-emoji-fullsize)",minWidth:"var(--epr-emoji-fullsize)",minHeight:"var(--epr-emoji-fullsize)",padding:"var(--epr-emoji-padding)"}});function hnt(e){var t=e.unified,r=e.style,n=e.className;return b.createElement("span",{className:Lr(pnt.nativeEmoji,Cw.common,Cw.external,n),"data-unified":t,style:r},AQ(t))}var pnt=Qn.create({nativeEmoji:{".":"epr-emoji-native",fontFamily:'"Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji"!important',position:"relative",lineHeight:"100%",fontSize:"var(--epr-emoji-size)",textAlign:"center",alignSelf:"center",justifySelf:"center",letterSpacing:"0",padding:"var(--epr-emoji-padding)"}});function L4(e){var t=e.emoji,r=e.unified,n=e.emojiStyle,a=e.size,i=e.lazyLoad,o=e.getEmojiUrl,l=o===void 0?LY:o,c=e.className,u=GY(),d=u[1],f=Tp(),m=f.emojiByUnified,h={};a&&(h.width=h.height=h.fontSize=a+"px");var p=t||m(r);if(!p)return null;if(PQ(p))return b.createElement(G$,{style:h,emojiName:r,emojiStyle:ti.NATIVE,lazyLoad:i,imgUrl:p.imgUrl,onError:g,className:c});return b.createElement(b.Fragment,null,n===ti.NATIVE?b.createElement(hnt,{unified:r,style:h,className:c}):b.createElement(G$,{style:h,emojiName:xtt(p),emojiStyle:n,lazyLoad:i,imgUrl:l(r,n),onError:g,className:c}));function g(){d(function(y){return new Set(y).add(r)})}}function lN(e){var t=e.emoji,r=e.unified,n=e.hidden,a=e.hiddenOnSearch,i=e.emojiStyle,o=e.showVariations,l=o===void 0?!0:o,c=e.size,u=e.lazyLoad,d=e.getEmojiUrl,f=e.className,m=e.noBackgroun
3919d,h=m===void 0?!1:m,p=e.style,g=Ep(t);return b.createElement(dnt,{hasVariations:g,showVariations:l,hidden:n,hiddenOnSearch:a,emojiNames:jA(t),unified:r,noBackground:h,style:p},b.createElement(L4,{unified:r,emoji:t,size:c,emojiStyle:i,lazyLoad:u,getEmojiUrl:d,className:f}))}var gnt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjgwcHgiIHZpZXdCb3g9IjAgMCAyMCA4MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgODAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjODY4Njg2IiBkPSJNNS43LDEwLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40QzYsMTAuOSw2LjEsMTEsNi4zLDExaDMuNHYzLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40CgljMC4xLDAuMSwwLjIsMC4yLDAuNCwwLjJjMC4zLDAsMC41LTAuMiwwLjUtMC41di0zLjRoMy40YzAuMywwLDAuNS0wLjIsMC41LTAuNXMtMC4yLTAuNS0wLjUtMC41aC0zLjRWNi43YzAtMC4zLTAuMi0wLjUtMC41LTAuNQoJQzkuOCw2LDkuNiw2LjIsOS42LDYuNXYzLjRINi4yQzUuOSw5LjksNS43LDEwLjEsNS43LDEwLjRMNS43LDEwLjR6Ii8+CjxwYXRoIGZpbGw9IiMzMzcxQjciIGQ9Ik01LjcsMzAuNGMwLDAuMSwwLjEsMC4zLDAuMiwwLjRTNi4xLDMxLDYuMywzMWgzLjR2My40YzAsMC4xLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMiwwLjIsMC40LDAuMgoJYzAuMywwLDAuNS0wLjIsMC41LTAuNXYtMy40aDMuNGMwLjMsMCwwLjUtMC4yLDAuNS0wLjVzLTAuMi0wLjUtMC41LTAuNWgtMy40di0zLjRjMC0wLjMtMC4yLTAuNS0wLjUtMC41cy0wLjUsMC4yLTAuNSwwLjV2My40SDYuMgoJQzUuOSwyOS45LDUuNywzMC4xLDUuNywzMC40TDUuNywzMC40eiIvPgo8cGF0aCBmaWxsPSIjQzBDMEJGIiBkPSJNNS43LDUwLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40QzYsNTAuOSw2LjEsNTEsNi4zLDUxaDMuNHYzLjRjMCwwLjEsMC4xLDAuMywwLjIsMC40CgljMC4xLDAuMSwwLjIsMC4yLDAuNCwwLjJjMC4zLDAsMC41LTAuMiwwLjUtMC41di0zLjRoMy40YzAuMywwLDAuNS0wLjIsMC41LTAuNXMtMC4yLTAuNS0wLjUtMC41aC0zLjR2LTMuNGMwLTAuMy0wLjItMC41LTAuNS0wLjUKCXMtMC41LDAuMi0wLjUsMC41djMuNEg2LjJDNS45LDQ5LjksNS43LDUwLjEsNS43LDUwLjRMNS43LDUwLjR6Ii8+CjxwYXRoIGZpbGw9IiM2QUE5REQiIGQ9Ik01LjcsNzAuNGMwLDAuMSwwLjEsMC4zLDAuMiwwLjRTNi4xLDcxLDYuMyw3MWgzLjR2My40YzAsMC4xLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMiwwLjIsMC40LDAuMgoJYzAuMywwLDAuNS0wLjIsMC41LTAuNXYtMy40aDMuNGMwLjMsMCwwLjUtMC4yLDAuNS0wLjVzLTAuMi0wLjUtMC41LTAuNWgtMy40di0zLjRjMC0wLjMtMC4yLTAuNS0wLjUtMC41cy0wLjUsMC4yLTAuNSwwLjV2My40SDYuNAoJQzUuOSw2OS45LDUuNyw3MC4xLDUuNyw3MC40TDUuNyw3MC40eiIvPgo8L3N2Zz4=";function ynt(){var e=Pf(),t=e[1];return b.createElement(jb,{"aria-label":"Show all Emojis",title:"Show all Emojis",tabIndex:0,className:Lr(bnt.plusSign),onClick:function(){return t(!1)}})}var bnt=Qn.create(Mn({plusSign:{fontSize:"20px",padding:"17px",color:"var(--epr-text-color)",borderRadius:"50%",textAlign:"center",lineHeight:"100%",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",transition:"background-color 0.2s ease-in-out",":after":{content:"",minWidth:"20px",minHeight:"20px",backgroundImage:"url("+gnt+")",backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundSize:"20px",backgroundPositionY:"0"},":hover":{color:"var(--epr-highlight-color)",backgroundColor:"var(--epr-hover-bg-color-reduced-opacity)",":after":{backgroundPositionY:"-20px"}},":focus":{color:"var(--epr-highlight-color)",backgroundColor:"var(--epr-hover-bg-color-reduced-opacity)",":after":{backgroundPositionY:"-40px"}}}},Ou("plusSign",{":after":{backgroundPositionY:"-40px"},":hover:after":{backgroundPositionY:"-60px"}})));function vnt(){var e=Pf(),t=e[0],r=grt(),n=mrt();_Q(r,xy.REACTIONS);var a=_f(),i=KY(),o=Lf();return t?b.createElement("ul",{className:Lr(H$.list,!t&&yA.hidden),ref:r,"aria-label":"Reactions"},n.map(function(l){var c=Xj(l);return c?b.createElement("li",{key:l},b.createElement(lN,{emoji:c,emojiStyle:a,unified:l,showVariations:!1,className:Lr(H$.emojiButton),noBackground:!0,getEmojiUrl:o})):null}),i?b.createElement("li",null,b.createElement(ynt,null)):null):null}var H$=Qn.create({list:{listStyle:"none",margin:"0",padding:"0 5px",display:"flex",justifyContent:"space-between",alignItems:"center",height:"100%"},emojiButton:{":hover":{transform:"scale(1.2)"},":focus":{transform:"scale(1.2)"},":active":{transform:"scale(1.1)"},transition:"transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.5)"}});function xnt(e){var t=Df(),r=b.useState(0),n=r[0],a=r[1];return b.useEffect(function(){var i=e.current;if(!i)return;i.addEventListener("scroll",o,{passive:!0});function o(){var l;a((l=i==null?void 0:i.scrollTop)!=null?l:0),t()}return function(){i==null||i.removeEventListener("scroll",o)}},[e,t]),n}
3919function wnt(e){var t=e.scrollTop,r=e.clientHeight,n=e.topOffset,a=e.style,i=e.dimensions;if(!a||!i)return!1;var o=n+a.top,l=o+i.emojiSize,c=l+i.emojiSize*2>=t&&o<=t+r+i.emojiSize;return!c}function jnt(e,t){return e?{top:Math.floor(t/e.emojisPerRow)*e.emojiSize,left:t%e.emojisPerRow*e.emojiSize}:void 0}var Nnt=40;function Snt(e){var t=oQ(),r=Pf(),n=r[0],a=Pp(),i=b.useRef(),o=CA(),l=o[0],c=HY(),u=c[0],d=b.useState(),f=d[0],m=d[1],h=b.useCallback(function(){var p=t.current;if(p){var g=p.querySelector(jy),y=g==null?void 0:g.clientHeight;y&&(i.current=y);var v=u||y||i.current||Nnt,x=p.clientWidth;if(!(x===0||v===0)){var j=Math.max(1,Math.floor(x/v)),C=Math.ceil(e/j),N=C*v;m({categoryHeight:N,emojisPerRow:j,emojiSize:v})}}},[t,e,u]);return b.useEffect(function(){h()},[e,n,h,l.length]),b.useEffect(function(){var p=a.current;if(p){var g=function(v){var x=v,j=x.propertyName;(j==="width"||j==="max-width"||j==="min-width"||j==="height"||j==="max-height"||j==="min-height")&&(typeof queueMicrotask=="function"?queueMicrotask(function(){return h()}):requestAnimationFrame(function(){return h()}))};return p.addEventListener("transitionend",g,{passive:!0}),function(){p.removeEventListener("transitionend",g)}}},[a,h]),f}function Cnt(){var e=GY(),t=e[0],r=Ort();return function(n){var a=Af(n),i=t.has(a),o=r(a);return{failedToLoad:i,filteredOut:o,hidden:i||o}}}function knt(e){var t=e.categoryEmojis,r=e.topOffset,n=e.onHeightReady,a=e.scrollTop,i=e.isCategoryVisible,o=Cnt(),l=eQ(),c=_f(),u=tN(),d=u[0],f=Gtt(),m=Lf(),h=!JY(),p=hi(),g=0,y=t.filter(function(C){var N=f(C),S=o(C),M=S.failedToLoad,k=S.filteredOut,I=S.hidden;return!M&&!k&&!I&&!N}),v=Snt(y.length);b.useEffect(function(){v&&n(v.categoryHeight)},[v,n,y.length]);var x=function(N){var S,M;return v&&p.current&&wnt({scrollTop:a,clientHeight:(S=(M=p.current)==null?void 0:M.clientHeight)!=null?S:0,topOffset:r,style:N,dimensions:v})},j=y.reduce(function(C,N,S){var M=Af(N,d),k=jnt(v,S);if(x(k)){var I,T;return g++,Yrt(N,c,a,(I=(T=p.current)==null?void 0:T.clientHeight)!=null?I:0,r,k,v,m),C}return i?(C.push(b.createElement(lN,{showVariations:h,key:M,emoji:N,unified:M,emojiStyle:c,lazyLoad:l,getEmojiUrl:m,style:Mn({},k,{position:"absolute"})})),C):(g++,C)},[]);return{virtualizedCounter:g,emojis:j,dimensions:v}}function Mnt(e){var t=e.categoryConfig,r=e.children,n=e.hidden,a=e.hiddenOnSearch,i=e.height,o=Jj(t),l=RY(t);return b.createElement("li",{className:Lr(rC.category,n&&yA.hidden,a&&Tf.hiddenOnSearch),"data-name":o,"aria-label":l},b.createElement("h2",{className:Lr(rC.label)},l),b.createElement("div",{className:Lr(rC.categoryContent),style:{height:i}},r))}var rC=Qn.create({category:{".":Wr.category,minHeight:"calc(var(--epr-emoji-fullsize) + var(--epr-category-label-height))",position:"relative"},categoryContent:{".":Wr.categoryContent,display:"grid",gridGap:"0",gridTemplateColumns:"repeat(auto-fill, var(--epr-emoji-fullsize))",justifyContent:"space-between",margin:"var(--epr-category-padding)",position:"relative"},label:{".":Wr.label,alignItems:"center",backdropFilter:"blur(3px)",backgroundColor:"var(--epr-category-label-bg-color)",color:"var(--epr-category-label-text-color)",display:"flex",fontSize:"16px",fontWeight:"bold",height:"var(--epr-category-label-height)",margin:"0",padding:"var(--epr-category-label-padding)",position:"sticky",textTransform:"capitalize",top:"0",width:"100%",zIndex:"var(--epr-category-label-z-index)"}});function Int(){var e=MA(),t=$tt(),r=_f(),n=Lf(),a=eQ(),i=tN(),o=i[0],l=HY(),c=l[0],u=l[1],d=b.useRef(null);if(b.useLayoutEffect(function(){d.current&&u(d.current.clientHeight)}),c)return null;var f=e[0],m=t(Jj(f))[0],h=m?rl(m,o):"";return m?b.createElement("div",{ref:d},b.createElement(lN,{emoji:m,unified:h,emojiStyle:r,getEmojiUrl:n,lazyLoad:a,showVariations:!1,hidden:!1,style:{opacity:0,pointerEvents:"none",position:"absolute",top:0,left:0,zIndex:-1,height:"var(--epr-emoji-fullsize)",width:"var(--epr-emoji-fullsize)"}})):null}function Ent(e){var t=e.scrollTop,r=MA(),n=b.useState({}),a=n[0],i=n[1],o=oQ(),l=Vtt(),c=xQ(o.current),u=0;return b.createElement("ul",{className:Lr(Ant.emojiList),ref:o},b.createElement(Int,null),r.map(function(d){var f=Jj(d),m=u,h=a[f];return h&&(u+=h+c),b.createElement(b.Suspense,{key:f},b.createElement(Tnt,{categoryEmojis:l(f),categoryConfig:d,topOffset:m,onHeightReady:function(g){a[f]!==g&&i(function(y){var v;return Mn({},y,(v={},v[f]=g,v))})},scrollTop:t}))}))}function Tnt(e){var t=e.categoryEmojis,r=e.categoryConfig,n=e.topOffset,a=e.onHeightReady,i=e.scrollTop,o=CA(),l=o[0],c=knt({categoryEmojis:t,topOffset:n,onHeightReady:a,scrollTop:i,isCategoryVisible:l.includes(r.category)}),u=c.virtualizedCounter,d=c.emojis,f=c.dimensions;return b.createElement(Mnt,{categoryConfig:r,height:f==null?void 0:f.categoryHeight,hidden:!d.length&&u===0},d)}var Ant=Qn.create({emojiList:{".":Wr.emojiList,listStyle:"none",margin:"0",padding:"0"}}),Pnt="data:image/svg+xml;
3919base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MHB4IgoJIGhlaWdodD0iMTVweCIgdmlld0JveD0iMCAwIDUwIDE1IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MCAxNSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnIGlkPSJMYXllcl8xIj4KPC9nPgo8ZyBpZD0iTGF5ZXJfMiI+Cgk8cGF0aCBmaWxsPSIjRkZGRkZGIiBzdHJva2U9IiNFOEU3RTciIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEuODYtMC40M2w5LjgzLDExLjUzYzAuNTksMC42OSwxLjU2LDAuNjksMi4xNCwwbDkuODMtMTEuNTMiLz4KCTxwYXRoIGZpbGw9IiMwMTAyMDIiIHN0cm9rZT0iIzE1MTYxNyIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMjYuODYtMC40M2w5LjgzLDExLjUzYzAuNTksMC42OSwxLjU2LDAuNjksMi4xNCwwbDkuODMtMTEuNTMiLz4KPC9nPgo8L3N2Zz4=",Pm;(function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"})(Pm||(Pm={}));function _nt(){var e=nN(),t=yrt(),r=Ap(),n=r[0],a=_f(),i=Dnt(t),o=i.getTop,l=i.getMenuDirection,c=lQ(),u=Lnt(t),d=Lf(),f=bo(e.current),m=!!(n&&f&&Ep(n)&&f.classList.contains(Wr.emojiHasVariations));b.useEffect(function(){m&&sN(t.current)},[t,m,e]);var h,p;return!m&&e.current?c(null):(h=o(),p=u()),b.createElement("div",{ref:t,className:Lr(Tv.variationPicker,l()===Pm.Down&&Tv.pointingUp,m&&Tv.visible),style:{top:h}},m&&n?[rl(n)].concat(Zj(n)).slice(0,6).map(function(g){return b.createElement(lN,{key:g,emoji:n,unified:g,emojiStyle:a,showVariations:!1,getEmojiUrl:d})}):null,b.createElement("div",{className:Lr(Tv.pointer),style:p}))}function Lnt(e){var t=nN();return function(){var n={};if(!e.current)return n;if(t.current){var a=bo(t.current),i=snt(a);if(!a)return n;n.left=i+(a==null?void 0:a.clientWidth)/2}return n}}function Dnt(e){var t=nN(),r=hi(),n=Pm.Up;return{getMenuDirection:a,getTop:i};function a(){return n}function i(){n=Pm.Up;var o=0;if(!e.current)return 0;var l=U$(e.current);if(t.current){var c,u=r.current,d=bo(t.current),f=U$(d);o=jQ(d);var m=(c=u==null?void 0:u.scrollTop)!=null?c:0;m>o-l&&(n=Pm.Down,o+=f+l)}return o-l}}var Tv=Qn.create(Mn({variationPicker:{".":Wr.variationPicker,position:"absolute",right:"15px",left:"15px",padding:"5px",boxShadow:"0px 2px 5px rgba(0, 0, 0, 0.2)",borderRadius:"3px",display:"flex",alignItems:"center",justifyContent:"space-around",opacity:"0",visibility:"hidden",pointerEvents:"none",top:"-100%",border:"1px solid var(--epr-picker-border-color)",height:"var(--epr-emoji-variation-picker-height)",zIndex:"var(--epr-skin-variation-picker-z-index)",background:"var(--epr-emoji-variation-picker-bg-color)",transform:"scale(0.9)",transition:"transform 0.1s ease-out, opacity 0.2s ease-out"},visible:{opacity:"1",visibility:"visible",pointerEvents:"all",transform:"scale(1)"},pointingUp:{".":"pointing-up",transformOrigin:"center 0%",transform:"scale(0.9)"},".pointing-up":{pointer:{top:"0",transform:"rotate(180deg) translateY(100%) translateX(18px)"}},pointer:{".":"epr-emoji-pointer",content:"",position:"absolute",width:"25px",height:"15px",backgroundRepeat:"no-repeat",backgroundPosition:"0 0",backgroundSize:"50px 15px",top:"100%",transform:"translateX(-18px)",backgroundImage:"url("+Pnt+")"}},Ou("pointer",{backgroundPosition:"-25px 0"})));function Ont(){var e=hi(),t=xnt(e);return _Q(e,xy.PICKER),Ert(),b.createElement("div",{className:Lr(Rnt.body,Tf.hiddenOnReactions),ref:e},b.createElement(_nt,null),b.createElement(Ent,{scrollTop:t}))}var Rnt=Qn.create({body:{".":Wr.scrollBody,flex:"1",overflowY:"scroll",overflowX:"hidden",position:"relative"}});function $nt(e,t){if(!e||!t)return 0;var r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return n.height-(r.y-n.y)}function Fnt(e,t){var r=hi(),n=fQ(),a=dQ();b.useEffect(function(){if(!e)return;var i=r.current;i==null||i.addEventListener("keydown",c,{passive:!0}),i==null||i.addEventListener("mouseover",u,!0),i==null||i.addEventListener("focus",o,!0),i==null||i.addEventListener("mouseout",l,{passive:!0}),i==null||i.addEventListener("blur",l,!0);function o(d){var f=bo(d.target);if(!f)return l();var m=DA(f),h=m.unified,p=m.originalUnified;if(!h||!p)return l();t({unified:h,originalUnified:p})}function l(d){if(d){var f=d.relatedTarget;if(!bo(f))return t(null)}t(null)}function c(d){d.key==="Escape"&&t(null)}function u(d){if(!n()){var f=bo(d.target);
3919if(f){var m=$nt(f,i),h=f.getBoundingClientRect().height;if(m<h)return znt(f,t);mi(f)}}}return function(){i==null||i.removeEventListener("mouseover",u),i==null||i.removeEventListener("mouseout",l),i==null||i.removeEventListener("focus",o,!0),i==null||i.removeEventListener("blur",l,!0),i==null||i.removeEventListener("keydown",c)}},[r,e,t,n,a])}function znt(e,t){var r,n=DA(e),a=n.unified,i=n.originalUnified;!a||!i||((r=document.activeElement)==null||r.blur==null||r.blur(),t({unified:a,originalUnified:i}))}var Av,Ny;(function(e){e.ROW="FlexRow",e.COLUMN="FlexColumn"})(Ny||(Ny={}));function LQ(e){var t=e.children,r=e.className,n=e.style,a=n===void 0?{}:n,i=e.direction,o=i===void 0?Ny.ROW:i;return b.createElement("div",{style:Mn({},a),className:Lr(Y$.flex,r,Y$[o])},t)}var Y$=Qn.create((Av={flex:{display:"flex"}},Av[Ny.ROW]={flexDirection:"row"},Av[Ny.COLUMN]={flexDirection:"column"},Av));function Bnt(e){var t=e.className,r=e.style,n=r===void 0?{}:r;return b.createElement("div",{style:Mn({flex:1},n),className:Lr(t)})}function Unt(e){var t=e.children,r=e.className,n=e.style;return b.createElement("div",{style:Mn({},n,{position:"absolute"}),className:r},t)}function cN(e){var t=e.children,r=e.className,n=e.style;return b.createElement("div",{style:Mn({},n,{position:"relative"}),className:r},t)}function Vnt(e){var t=e.isOpen,r=e.onClick,n=e.isActive,a=e.skinToneVariation,i=e.style;return b.createElement(jb,{style:i,onClick:r,className:Lr("epr-tone-"+a,nC.tone,!t&&nC.closedTone,n&&nC.active),"aria-pressed":n,"aria-label":"Skin tone "+btt[a]})}var nC=Qn.create({closedTone:{opacity:"0",zIndex:"0"},active:{".":"epr-active",zIndex:"1",opacity:"1"},tone:{".":"epr-tone",width:"var(--epr-skin-tone-size)",display:"block",cursor:"pointer",borderRadius:"4px",height:"var(--epr-skin-tone-size)",position:"absolute",right:"0",transition:"transform 0.3s ease-in-out, opacity 0.35s ease-in-out",zIndex:"0",border:"1px solid var(--epr-skin-tone-outer-border-color)",boxShadow:"inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)",":hover":{boxShadow:"0 0 0 3px var(--epr-active-skin-hover-color), inset 0px 0px 0 1px var(--epr-skin-tone-inner-border-color)"},":focus":{boxShadow:"0 0 0 3px var(--epr-focus-bg-color)"},"&.epr-tone-neutral":{backgroundColor:"#ffd225"},"&.epr-tone-1f3fb":{backgroundColor:"#ffdfbd"},"&.epr-tone-1f3fc":{backgroundColor:"#e9c197"},"&.epr-tone-1f3fd":{backgroundColor:"#c88e62"},"&.epr-tone-1f3fe":{backgroundColor:"#a86637"},"&.epr-tone-1f3ff":{backgroundColor:"#60463a"}}}),Dg=28;function Wnt(){return b.createElement(cN,{style:{height:Dg}},b.createElement(Unt,{style:{bottom:0,right:0}},b.createElement(DQ,{direction:Sy.VERTICAL})))}function DQ(e){var t=e.direction,r=t===void 0?Sy.HORIZONTAL:t,n=IA(),a=JY(),i=wb(),o=i[0],l=i[1],c=tN(),u=c[0],d=c[1],f=irt(),m=Df(),h=Of();if(a)return null;var p=Dg*Nw.length+"px",g=o?p:Dg+"px",y=r===Sy.VERTICAL;
3919return b.createElement(cN,{className:Lr(bg.skinTones,y&&bg.vertical,o&&bg.open,y&&o&&bg.verticalShadow),style:y?{flexBasis:g,height:g}:{flexBasis:g}},b.createElement("div",{className:Lr(bg.select),ref:n},Nw.map(function(v,x){var j=v===u;return b.createElement(Vnt,{key:v,skinToneVariation:v,isOpen:o,style:{transform:Lr(y?"translateY(-"+x*(o?Dg:0)+"px)":"translateX(-"+x*(o?Dg:0)+"px)",o&&j&&"scale(1.3)")},isActive:j,onClick:function(){o?(d(v),f(v),h()):l(!0),m()}})})))}var Sy;(function(e){e.VERTICAL="epr-vertical",e.HORIZONTAL="epr-horizontal"})(Sy||(Sy={}));var bg=Qn.create({skinTones:{".":"epr-skin-tones","--":{"--epr-skin-tone-size":"15px"},display:"flex",alignItems:"center",justifyContent:"flex-end",transition:"all 0.3s ease-in-out",padding:"10px 0"},vertical:{padding:"9px",alignItems:"flex-end",flexDirection:"column",borderRadius:"6px",border:"1px solid var(--epr-bg-color)"},verticalShadow:{boxShadow:"0px 0 7px var(--epr-picker-border-color)"},open:{backdropFilter:"blur(5px)",background:"var(--epr-skin-tone-picker-menu-color)",".epr-active":{border:"1px solid var(--epr-active-skin-tone-indicator-border-color)"}},select:{".":"epr-skin-tone-select",position:"relative",width:"var(--epr-skin-tone-size)",height:"var(--epr-skin-tone-size)"}});function qnt(){var e=ZY(),t=gQ(),r=Pf(),n=r[0];return e.showPreview?b.createElement(LQ,{className:Lr(Xg.preview,Tf.hiddenOnReactions,n&&Xg.hideOnReactions)},b.createElement(Gnt,null),b.createElement(Bnt,null),t?b.createElement(Wnt,null):null):null}function Gnt(){var e,t=ZY(),r=b.useState(null),n=r[0],a=r[1],i=_f(),o=Ap(),l=o[0],c=Lf(),u=Tp(),d=u.emojiByUnified;Fnt(t.showPreview,a);var f=d((e=n==null?void 0:n.unified)!=null?e:n==null?void 0:n.originalUnified),m=f!=null&&n!=null;return b.createElement(h,null);function h(){var p=l??d(t.defaultEmoji);if(!p)return null;var g=l?O$(l):t.defaultCaption;return b.createElement(b.Fragment,null,b.createElement("div",null,m?b.createElement(L4,{unified:n==null?void 0:n.unified,emoji:f,emojiStyle:i,size:45,getEmojiUrl:c,className:Lr(Xg.emoji)}):p?b.createElement(L4,{unified:rl(p),emoji:p,emojiStyle:i,size:45,getEmojiUrl:c,className:Lr(Xg.emoji)}):null),b.createElement("div",{className:Lr(Xg.label)},m?O$(f):g))}}var Xg=Qn.create({preview:{alignItems:"center",borderTop:"1px solid var(--epr-preview-border-color)",height:"var(--epr-preview-height)",padding:"0 var(--epr-horizontal-padding)",position:"relative",zIndex:"var(--epr-preview-z-index)"},label:{color:"var(--epr-preview-text-color)",fontSize:"var(--epr-preview-text-size)",padding:"var(--epr-preview-text-padding)",textTransform:"capitalize"},emoji:{padding:"0"},hideOnReactions:{opacity:"0",transition:"opacity 0.5s ease-in-out"}});function Hnt(e){var t;return(t=e==null?void 0:e.getAttribute("data-name"))!=null?t:null}function Ynt(e){var t=e.setActiveCategory,r=e.setVisibleCategories,n=hi();b.useEffect(function(){var a=new Map,i=new Map,o=n.current,l=new IntersectionObserver(function(c){if(o){for(var u=ltt(c),d;!(d=u()).done;){var f=d.value,m=Hnt(f.target);m&&(a.set(m,f.intersectionRatio),i.set(m,f.isIntersecting))}var h=Array.from(a),p=h.filter(function(N){var S=N[0],M=N[1];return M>0||i.get(S)}).map(function(N){var S=N[0];return S});r(p);var g=h[h.length-1];if((g==null?void 0:g[1])==1)return t(g[0]);for(var y=0,v=h;y<v.length;y++){var x=v[y],j=x[0],C=x[1];if(C){t(j);break}}}},{root:o,threshold:[0,1]});return o==null||o.querySelectorAll(Ui(Wr.category)).forEach(function(c){l.observe(c)}),function(){l.disconnect()}},[n,t,r])}function Qnt(){var e=hi(),t=Pp();return function(n){var a;if(e.current){var i=(a=e.current)==null?void 0:a.querySelector('[data-name="'+n+'"]');if(i){var o=i.offsetTop||0;cQ(t.current,o)}}}}function Knt(){var e=nrt();return e?e.length===0:!1}var Jnt="
vendor: 42,642 bytes, line 3919
3919data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMDBweCIgaGVpZ2h0PSI4MHB4IiB2aWV3Qm94PSIwIDAgMjAwIDgwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyMDAgODAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8ZyBpZD0iTGF5ZXJfMTEiPgoJPGc+CgkJPHBhdGggZmlsbD0iIzMzNzFCNyIgc3Ryb2tlPSIjMzM3MUI3IiBzdHJva2Utd2lkdGg9IjAuMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTIuOCwyOS41YzAuNiwwLDEuMS0wLjUsMS4xLTEuMQoJCQljMC0wLjYtMC41LTEuMi0xLjEtMS4yYy0wLjYsMC0xLjIsMC41LTEuMiwxLjJDMTEuNiwyOSwxMi4yLDI5LjUsMTIuOCwyOS41eiBNMTIuOCwyOGMwLjIsMCwwLjQsMC4yLDAuNCwwLjQKCQkJYzAsMC4yLTAuMiwwLjQtMC40LDAuNGMtMC4yLDAtMC40LTAuMi0wLjQtMC40QzEyLjQsMjguMSwxMi42LDI4LDEyLjgsMjh6Ii8+CgkJPHBhdGggZmlsbD0iIzMzNzFCNyIgc3Ryb2tlPSIjMzM3MUI3IiBzdHJva2Utd2lkdGg9IjAuMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTAsMjNjLTMuOCwwLTcsMy4xLTcsN2MwLDMuOCwzLjEsNyw3LDcKCQkJczctMy4xLDctN0MxNywyNi4yLDEzLjgsMjMsMTAsMjN6IE0xMCwzNi4yYy0zLjQsMC02LjItMi44LTYuMi02LjJjMC0zLjQsMi44LTYuMiw2LjItNi4yczYuMiwyLjgsNi4yLDYuMgoJCQlDMTYuMiwzMy40LDEzLjQsMzYuMiwxMCwzNi4yeiIvPgoJCTxwYXRoIGZpbGw9IiMzMzcxQjciIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTE0LjYsMzEuMmMtMC4xLTAuMS0wLjItMC4yLTAuMy0wLjJINS43CgkJCWMtMC4xLDAtMC4yLDAuMS0wLjMsMC4yYy0wLjEsMC4xLTAuMSwwLjIsMCwwLjRjMC43LDIsMi41LDMuMyw0LjYsMy4zczMuOS0xLjMsNC42LTMuM0MxNC43LDMxLjUsMTQuNywzMS4zLDE0LjYsMzEuMnogTTEwLDM0LjEKCQkJYy0xLjYsMC0zLTAuOS0zLjctMi4yaDcuM0MxMywzMy4yLDExLjYsMzQuMSwxMCwzNC4xeiIvPgoJCTxwYXRoIGZpbGw9IiMzMzcxQjciIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTcuMiwyOS41YzAuNiwwLDEuMi0wLjUsMS4yLTEuMQoJCQljMC0wLjYtMC41LTEuMi0xLjItMS4yYy0wLjYsMC0xLjEsMC41LTEuMSwxLjJDNi4xLDI5LDYuNiwyOS41LDcuMiwyOS41eiBNNy4yLDI4YzAuMiwwLDAuNCwwLjIsMC40LDAuNGMwLDAuMi0wLjIsMC40LTAuNCwwLjQKCQkJYy0wLjIsMC0wLjQtMC4yLTAuNC0wLjRDNi44LDI4LjEsNywyOCw3LjIsMjh6Ii8+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBkPSJNNjQuMSwzMy40bDIuMywwYzAuMiwwLDAuNCwwLjIsMC40LDAuNHYyLjFjMCwwLjItMC4yLDAuNC0wLjQsMC40aC0yLjMKCQkJCWMtMC4yLDAtMC40LTAuMi0wLjQtMC40di0yLjFDNjMuNywzMy42LDYzLjgsMzMuNCw2NC4xLDMzLjR6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgZD0iTTczLjUsMzMuNWgyLjRjMC4yLDAsMC40LDAuMiwwLjQsMC40djJjMCwwLjItMC4yLDAuNC0wLjQsMC40aC0yLjQKCQkJCWMtMC4yLDAtMC40LTAuMi0wLjQtMC40bDAtMkM3My4xLDMzLjYsNzMuMywzMy41LDczLjUsMzMuNXoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBkPSJNNjMuNywyOC40aDEyLjZ2NUg2My43VjI4LjR6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgZD0iTTY1LjUsMjMuNmg4LjljMSwwLDEuOSwwLjgsMS45LDEuOXYzLjFINjMuN3YtMy4xQzYzLjcsMjQuNSw2NC41LDIzLjYsNjUuNSwyMy42eiIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjMzM3MUI3IiBjeD0iNjYuMiIgY3k9IjMwLjkiIHJ4PSIwLjkiIHJ5PSIxIi8+CgkJCTxlbGxpcHNlIGZpbGw9IiMzMzcxQjciIGN4PSI3My44IiBjeT0iMzAuOSIgcng9IjAuOSIgcnk9IjEiLz4KCQk8L2c+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBkPSJNOTYuNCwzMGMwLDMuNi0yLjksNi41LTYuNCw2LjVzLTYuNC0yLjktNi40LTYuNXMyLjktNi41LDYuNC02LjVTOTYuNCwyNi40LDk2LjQsMzB6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgZD0iTTk2LjMsMjguNmMwLDAsMCwwLjEsMCwwLjFjLTAuOSwwLjEtMi45LDAuMS00LjYtMS4xYy0xLjEtMC44LTItMS43LTIuNi0yLjUKCQkJCWMtMC4zLTAuNC0wLjYtMC44LTAuNy0xYy0wLjEtMC4xLTAuMS0wLjEtMC4xLTAuMmMwLjUtMC4xLDEuMi0wLjIsMi0wLjFjMS4yLDAsMi41LDAuMywzLjUsMS4xYzEsMC44LDEuNywxLjgsMi4xLDIuOAoJCQkJQzk2LjEsMjcuOSw5Ni4yLDI4LjMsOTYuMywyOC42eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik04NCwzMi4yYzAsMCwwLTAuMSwwLTAuMWMwLjktMC4yLDIuOS0wLjQsNC43LDAuNmMxLjEsMC43LDEuOSwxLjUsMi40LDIuMwoJCQkJYzAuNCwwLjUsMC42LDEsMC43LDEuM2MtMC40LDAuMS0xLDAuMi0xLjcsMC4zYy0xLDAtMi4xLTAuMS0zLjItMC44cy0xLjktMS42LTIuNC0yLjVDODQuMiwzMi44LDg0LjEsMzIuNSw4NCwzMi4yeiIvPgoJCTwvZz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTExNi4zLDI2LjhsLTEuNCwybC0wLjgtMC44bC0wLjYtMC42bDAsMC45bC0wLjEsOC4yaC02LjgKCQkJCWwtMC4xLTguMmwwLTAuOWwtMC42LDAuNmwtMC44LDAuOGwtMS40LTJsMi42LTIuOWMwLjEtMC4xLDAuMi0wLjEsMC4zLTAuMWgxLjNsMC40LDAuN2MwLjcsMS4zLDIuNiwxLjMsMy4zLTAuMWwwLjMtMC42aDEuMgoJCQkJYzAuMSwwLDAuMiwwLDAuMywwLjFsMC4zLTAuM2wtMC4zLDAuM0wxMTYuMywyNi44eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik0xMTAuMSwyNy43aDJ2MC45YzAsMC40LTAuNCwwLjctMSwwLjdjLTAuNiwwLTEtMC4zLTEtMC43TDExMC4xLDI3LjdMMTEwLjEsMjcuN3oiLz4KCQk8L2c+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBkPSJNMTI2LjgsMzQuM2MwLDEuMi0xLDIuMi0yLjIsMi4ycy0yLjItMS0yLjItMi4yczEtMi4yLDIuMi0yLjJTMTI2LjgsMzMuMSwxMjYuOCwzNC4zeiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik0xMzcuNiwzNC4zYzAsMS4yLTEsMi4yLTIuMiwyLjJjLTEuMiwwLTIuMi0xLTIuMi0yLjJzMS0yLjIsMi4yLTIuMgoJCQkJQzEzNi42LDMyLjEsMTM3LjYsMzMuMSwxMzcuNiwzNC4zeiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik0xMjYuOCwyNC40djkuOSIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik0xMzcuNywyNC40djkuOSIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIGQ9Ik0xMjYuOCwyMy41aDEwLjh2Mi43aC0xMC44QzEyNi44LDI2LjIsMTI2LjgsMjMuNSwxMjYuOCwyMy41eiIvPgoJCTwvZz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSIjMzM3MUI3IiBkPSJNMTcwLjgsMjMuMUwxNzAuOCwyMy4xYy0wLjMsMC0wLjUsMC0wLjgsMGMtMi4xLDAtNCwxLTUuMywyLjVsLTAuMSwwbC0wLjEtMC4xbC0xLTEuMmwtMC4zLDMuNGwzLjQsMC4zCgkJCQlsLTEuMS0xLjNsLTAuMS0wLjFsMC4xLTAuMWMxLjEtMS41LDMtMi4zLDUtMi4xbDAsMGMzLjIsMC4zLDUuNSwzLjEsNS4yLDYuM2MtMC4zLDMtMy4xLDUuMy02LjEsNS4xYy0zLjEtMC4yLTUuNC0yLjktNS4zLTYKCQkJCWwtMS4zLTAuMWMtMC4yLDMuOCwyLjYsNy4xLDYuMyw3LjRjMy45LDAuMyw3LjMtMi42LDcuNi02LjVDMTc3LjIsMjYuOCwxNzQuNCwyMy41LDE3MC44LDIzLjF6Ii8+CgkJCTxwYXRoIGZpbGw9IiMzMzcxQjciIGQ9Ik0xNzAuMywyNy40YzAtMC4zLTAuMy0wLjYtMC42LTAuNnMtMC42LDAuMy0wLjYsMC42djMuMmMwLDAuMiwwLjEsMC4zLDAuMiwwLjRjMC4xLDAuMSwwLjMsMC4yLDAuNCwwLjIKCQkJCWgyLjRjMC40LDAsMC42LTAuMywwLjYtMC42YzAtMC40LTAuMy0wLjYtMC42LTAuNmgtMS42aC0wLjJ2LTAuMkwxNzAuMywyNy40TDE3MC4zLDI3LjR6Ii8+CgkJPC9nPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgZD0iTTE4Ni4yLDIzLjRoNy43YzEuNSwwLDIuNywxLjIsMi43LDIuN3Y3LjdjMCwxLjUtMS4yLDIuNy0yLjcsMi43aC03LjcKCQkJCWMtMS41LDAtMi43LTEuMi0yLjctMi43di03LjdDMTgzLjQsMjQuNiwxODQuNywyMy40LDE4Ni4yLDIzLjR6Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiMzMzcxQjciIGN4PSIxODYiIGN5PSIyOC45IiByeD0iMC43IiByeT0iMC43Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiMzMzcxQjciIGN4PSIxOTQiIGN5PSIyNi43IiByeD0iMC43IiByeT0iMC43Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMTg2LDMzLjNsMC40LTAuM2MwLjQtMC4zLDEtMC4zLDEuNS0wLjFsMSwwLjQKCQkJCWMwLjUsMC4yLDEsMC4yLDEuNS0wLjFsMC44LTAuNWMwLjQtMC4zLDEtMC4zLDEuNS0wLjFsMS44LDAuOCIvPgoJCTwvZz4KCTwvZz4KCTxwYXRoIGZpbGw9IiMzMzcxQjciIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLXdpZHRoPSIwLjI1IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGQ9Ik0xNTYsMjQuM2MtMC4yLTAuMS0wLjQtMC4xLTAuNSwwCgkJYzAsMC0wLjIsMC4xLTAuOSwwLjJjLTAuNywwLTIuNC0wLjEtMy44LTAuNmMtMC44LTAuMy0xLjctMC41LTIuNS0wLjVjLTAuMiwwLTAuNCwwLTAuNSwwYy0xLjMsMC0yLjUsMC4zLTMuNiwxCgkJYy0wLjIsMC4xLTAuMiwwLjItMC4yLDAuNHYxMS42YzAsMC4zLDAuMSwwLjUsMC4zLDAuNWMwLjYsMCwwLjUtMC40LDAuNS0wLjZ2LTUuN2MwLjctMC4zLDMuMi0xLjEsNS44LTAuMQoJCWMxLjYsMC42LDMuNSwwLjcsNC4zLDAuN2MwLjgsMCwxLjMtMC4zLDEuMy0wLjNjMC4yLTAuMSwwLjMtMC4yLDAuMy0wLjR2LTUuN0MxNTYuMiwyNC42LDE1Ni4xLDI0LjQsMTU2LDI0LjN6IE0xNTUuNiwzMC4yCgkJYy0wLjEsMC0wLjcsMC4xLTEsMC4xYy0wLjcsMC0yLjQtMC4xLTMuOC0wLjZjLTIuNS0xLTUtMC41LTYuMi0wLjF2LTQuOWMwLjktMC41LDIuMi0wLjcsMy4yLTAuN2MwLjEsMCwwLjMsMCwwLjQsMAoJCWMwLjcsMCwxLjUsMC4yLDIuMiwwLjRjMS42LDAuNiwzLjUsMC43LDQuMywwLjdjMC4yLDAsMC44LDAsMS0wLjFWMzAuMnoiLz4KCTxnPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgZD0iTTQ4LjEsMjMuNWgzLjdjMi41LDAsNC41LDIsNC41LDQuNWMwLDAuNS0wLjQsMC45LTAuOSwwLjlINDQuNWMtMC41LDAtMC45LTAuNC0wLjktMC45CgkJCUM0My42LDI1LjUsNDUuNiwyMy41LDQ4LjEsMjMuNXoiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTQzLjUsMjguOGMtMC4yLDAuMS0wLjUsMS4yLDAsMS41YzEuNCwxLDguNSwwLjgsMTEuMywwLjYKCQkJYzAuOC0wLjEsMS42LTAuNCwxLjctMS4yYzAtMC4zLTAuMS0wLjYtMC42LTAuOSIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSwzMC42TDQzLjMsMzFjLTAuMiwwLjUsMC4yLDEsMC43LDAuOWMwLjMtMC4xLDAuNSwwLDAuNywwLjMKCQkJbDAuMSwwLjJjMC4zLDAuNSwxLDAuNiwxLjUsMC4ybDAsMGMwLjMtMC4yLDAuNy0wLjMsMS0wLjJsMC44LDAuM2MwLjQsMC4yLDAuOCwwLjEsMS4yLDBsMC41LTAuMmMwLjQtMC4yLDAuOS0wLjIsMS4zLDBsMC41LDAuMgoJCQljMC40LDAuMiwwLjgsMC4yLDEuMiwwbDAuMi0wLjFjMC4zLTAuMiwwLjgtMC4yLDEuMSwwLjFsMC4yLDAuMmMwLjMsMC4zLDAuOCwwLjIsMS0wLjJsMC4xLTAuMmMwLjEtMC4yLDAtMC4zLDAuMi0wLjMKCQkJYzAuNSwwLDEuMi0wLjMsMS4xLTAuN2wtMC40LTEuMSIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSwzMi4yYy0wLjEsMC4yLTAuMywwLjgsMCwxLjFjMC4zLDAuNCwzLDEuMSw2LjQsMS4xCgkJCWMyLjIsMCw0LjYtMC4zLDYtMC42YzAuNS0wLjEsMC45LTAuNSwwLjgtMC45YzAtMC4yLTAuMi0wLjUtMC40LTAuNyIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSwzMy4zYzAsMC41LDAuNiwyLjMsMS4zLDIuN2MxLjgsMC44LDUuNywwLjcsOC4xLDAuNQoJCQljMS4zLTAuMSwyLjUtMC43LDMuMi0xLjhjMC4zLTAuNSwwLjUtMSwwLjUtMS40Ii8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjUxLjYiIGN5PSIyNi41IiByeD0iMC4zIiByeT0iMC40Ii8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjUzIiBjeT0iMjUiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjMzM3MUI3IiBjeD0iNTMiIGN5PSIyNy4yIiByeD0iMC4zIiByeT0iMC40Ii8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjU0LjMiIGN5PSIyNi41IiByeD0iMC4zIiByeT0iMC40Ii8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjUwLjkiIGN5PSIyNSIgcng9IjAuMyIgcnk9IjAuNCIvPgoJPC9nPgoJPGc+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBkPSJNMjQuMiwzMXYtNy42YzAuMSwwLjEsMC44LDAuOSwyLjgsMy4xYzIuNS0xLjYsNS42LTAuNyw2LjksMGwyLjQtMy4xdjcuMQoJCQljMCwxLjItMC4xLDIuNS0wLjksMy40Yy0xLDEuMi0yLjcsMi41LTUuMywyLjVjLTIuOSwwLTQuNS0xLjUtNS4zLTIuOUMyNC4yLDMyLjksMjQuMiwzMiwyNC4yLDMxeiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMjEuMiwzMGw1LjQsMS4yIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzM3MUI3IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0yMS4yLDM0LjFsNS40LTEuMiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzguOCwzMGwtNS40LDEuMiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzNzFCNyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzguOCwzNC4xbC01LjQtMS4yIi8+CgkJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMzMzcxQjciIGQ9Ik0yOS41LDMyLjRMMjksMzEuN2MtMC4yLTAuMywwLTAuNiwwLjMtMC42aDEuNAoJCQljMC4zLDAsMC41LDAuNCwwLjMsMC42bC0wLjcsMWwwLDBjLTAuNywxLjItMi42LDEuMS0zLjEtMC4zbC0wLjEtMC4yYy0wLjEtMC4yLDAtMC40LDAuMi0wLjVzMC40LDAsMC41LDAuMmwwLjEsMC4yCgkJCUMyOC4zLDMyLjgsMjkuMSwzMi45LDI5LjUsMzIuNHoiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiMzMzcxQjciIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTMyLjQsMzIuMWwtMC4xLDAuMmMtMC40LDEtMS44LDEuMS0yLjMsMC4yIi8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjI3LjYiIGN5PSIyOS43IiByeD0iMC43IiByeT0iMC43Ii8+CgkJPGVsbGlwc2UgZmlsbD0iIzMzNzFCNyIgY3g9IjMyLjQiIGN5PSIyOS43IiByeD0iMC43IiByeT0iMC43Ii8+Cgk8L2c+Cgk8Zz4KCQk8cGF0aCBmaWxsPSIjQzBDMEJGIiBzdHJva2U9IiNDMEMwQkYiIHN0cm9rZS13aWR0aD0iMC4xIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGQ9Ik0xMi44LDQ5LjVjMC42LDAsMS4xLTAuNSwxLjEtMS4xCgkJCWMwLTAuNi0wLjUtMS4yLTEuMS0xLjJjLTAuNiwwLTEuMiwwLjUtMS4yLDEuMkMxMS42LDQ5LDEyLjIsNDkuNSwxMi44LDQ5LjV6IE0xMi44LDQ4YzAuMiwwLDAuNCwwLjIsMC40LDAuNAoJCQljMCwwLjItMC4yLDAuNC0wLjQsMC40Yy0wLjIsMC0wLjQtMC4yLTAuNC0wLjRDMTIuNCw0OC4xLDEyLjYsNDgsMTIuOCw0OHoiLz4KCQk8cGF0aCBmaWxsPSIjQzBDMEJGIiBzdHJva2U9IiNDMEMwQkYiIHN0cm9rZS13aWR0aD0iMC4xIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGQ9Ik0xNC42LDUxLjJjLTAuMS0wLjEtMC4yLTAuMi0wLjMtMC4ySDUuNwoJCQljLTAuMSwwLTAuMiwwLjEtMC4zLDAuMmMtMC4xLDAuMS0wLjEsMC4yLDAsMC40YzAuNywyLDIuNSwzLjMsNC42LDMuM3MzLjktMS4zLDQuNi0zLjNDMTQuNyw1MS41LDE0LjcsNTEuMywxNC42LDUxLjJ6IE0xMCw1NC4xCgkJCWMtMS42LDAtMy0wLjktMy43LTIuMmg3LjNDMTMsNTMuMiwxMS42LDU0LjEsMTAsNTQuMXoiLz4KCQk8cGF0aCBmaWxsPSIjQzBDMEJGIiBzdHJva2U9IiNDMEMwQkYiIHN0cm9rZS13aWR0aD0iMC4xIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGQ9Ik03LjIsNDkuNWMwLjYsMCwxLjItMC41LDEuMi0xLjEKCQkJYzAtMC42LTAuNS0xLjItMS4yLTEuMmMtMC42LDAtMS4xLDAuNS0xLjEsMS4yQzYuMSw0OSw2LjYsNDkuNSw3LjIsNDkuNXogTTcuMiw0OGMwLjIsMCwwLjQsMC4yLDAuNCwwLjRjMCwwLjItMC4yLDAuNC0wLjQsMC40CgkJCWMtMC4yLDAtMC40LTAuMi0wLjQtMC40QzYuOCw0OC4xLDcsNDgsNy4yLDQ4eiIvPgoJCTxwYXRoIGZpbGw9IiNDMEMwQkYiIHN0cm9rZT0iI0MwQzBCRiIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEwLDQzYy0zLjgsMC03LDMuMS03LDdjMCwzLjgsMy4xLDcsNyw3CgkJCXM3LTMuMSw3LTdDMTcsNDYuMiwxMy44LDQzLDEwLDQzeiBNMTAsNTYuMmMtMy40LDAtNi4yLTIuOC02LjItNi4yYzAtMy40LDIuOC02LjIsNi4yLTYuMnM2LjIsMi44LDYuMiw2LjIKCQkJQzE2LjIsNTMuNCwxMy40LDU2LjIsMTAsNTYuMnoiLz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIGQ9Ik02NC4xLDUzLjRsMi4zLDBjMC4yLDAsMC40LDAuMiwwLjQsMC40djIuMWMwLDAuMi0wLjIsMC40LTAuNCwwLjRoLTIuMwoJCQkJYy0wLjIsMC0wLjQtMC4yLTAuNC0wLjR2LTIuMUM2My43LDUzLjYsNjMuOCw1My40LDY0LjEsNTMuNHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBkPSJNNzMuNSw1My41aDIuNGMwLjIsMCwwLjQsMC4yLDAuNCwwLjR2MmMwLDAuMi0wLjIsMC40LTAuNCwwLjRoLTIuNAoJCQkJYy0wLjIsMC0wLjQtMC4yLTAuNC0wLjRsMC0yQzczLjEsNTMuNiw3My4zLDUzLjUsNzMuNSw1My41eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIGQ9Ik02My43LDQ4LjRoMTIuNnY1SDYzLjdWNDguNHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBkPSJNNjUuNSw0My42aDguOWMxLDAsMS45LDAuOCwxLjksMS45djMuMUg2My43di0zLjFDNjMuNyw0NC41LDY0LjUsNDMuNiw2NS41LDQzLjZ6Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiNDMEMwQkYiIGN4PSI2Ni4yIiBjeT0iNTAuOSIgcng9IjAuOSIgcnk9IjEiLz4KCQkJPGVsbGlwc2UgZmlsbD0iI0MwQzBCRiIgY3g9IjczLjgiIGN5PSI1MC45IiByeD0iMC45IiByeT0iMSIvPgoJCTwvZz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIGQ9Ik05Ni40LDUwYzAsMy42LTIuOSw2LjUtNi40LDYuNXMtNi40LTIuOS02LjQtNi41czIuOS02LjUsNi40LTYuNVM5Ni40LDQ2LjQsOTYuNCw1MHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBkPSJNOTYuMyw0OC42YzAsMCwwLDAuMSwwLDAuMWMtMC45LDAuMS0yLjksMC4xLTQuNi0xLjJjLTEuMS0wLjgtMi0xLjctMi42LTIuNQoJCQkJYy0wLjMtMC40LTAuNi0wLjgtMC43LTFjLTAuMS0wLjEtMC4xLTAuMi0wLjEtMC4yYzAuNS0wLjEsMS4yLTAuMiwyLTAuMmMxLjIsMCwyLjUsMC4zLDMuNSwxLjFjMSwwLjgsMS43LDEuOCwyLjEsMi44CgkJCQlDOTYuMSw0Ny45LDk2LjIsNDguMyw5Ni4zLDQ4LjZ6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTg0LDUyLjJjMCwwLDAtMC4xLDAtMC4xYzAuOS0wLjIsMi45LTAuNCw0LjcsMC42YzEuMSwwLjcsMS45LDEuNSwyLjQsMi4zCgkJCQljMC40LDAuNSwwLjYsMSwwLjcsMS4zYy0wLjQsMC4xLTEsMC4yLTEuNywwLjNjLTEsMC0yLjEtMC4xLTMuMi0wLjhzLTEuOS0xLjYtMi40LTIuNUM4NC4yLDUyLjgsODQuMSw1Mi41LDg0LDUyLjJ6Ii8+CgkJPC9nPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMTE2LjMsNDYuOGwtMS40LDJsLTAuOC0wLjhsLTAuNi0wLjdsMCwwLjlsLTAuMSw4LjJoLTYuOAoJCQkJbC0wLjEtOC4ybDAtMC45bC0wLjYsMC43bC0wLjgsMC44bC0xLjQtMmwyLjYtMi45YzAuMS0wLjEsMC4yLTAuMSwwLjMtMC4xaDEuM2wwLjQsMC43YzAuNywxLjMsMi42LDEuMywzLjMtMC4xbDAuMy0wLjZoMS4yCgkJCQljMC4xLDAsMC4yLDAsMC4zLDAuMWwwLjMtMC4zbC0wLjMsMC4zTDExNi4zLDQ2Ljh6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTExMC4xLDQ3LjdoMnYwLjljMCwwLjQtMC40LDAuNy0xLDAuN2MtMC42LDAtMS0wLjMtMS0wLjdMMTEwLjEsNDcuN0wxMTAuMSw0Ny43eiIvPgoJCTwvZz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIGQ9Ik0xMjYuOCw1NC4zYzAsMS4yLTEsMi4yLTIuMiwyLjJzLTIuMi0xLTIuMi0yLjJzMS0yLjIsMi4yLTIuMlMxMjYuOCw1My4xLDEyNi44LDU0LjN6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTEzNy42LDU0LjNjMCwxLjItMSwyLjItMi4yLDIuMmMtMS4yLDAtMi4yLTEtMi4yLTIuMnMxLTIuMiwyLjItMi4yCgkJCQlDMTM2LjYsNTIuMSwxMzcuNiw1My4xLDEzNy42LDU0LjN6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTEyNi44LDQ0LjR2OS45Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTEzNy43LDQ0LjR2OS45Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgZD0iTTEyNi44LDQzLjVoMTAuOHYyLjdoLTEwLjhDMTI2LjgsNDYuMiwxMjYuOCw0My41LDEyNi44LDQzLjV6Ii8+CgkJPC9nPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9IiNDMEMwQkYiIGQ9Ik0xNzAuOCw0My4xTDE3MC44LDQzLjFjLTAuMywwLTAuNSwwLTAuOCwwYy0yLjEsMC00LDEtNS4zLDIuNWwtMC4xLDBsLTAuMS0wLjFsLTEtMS4ybC0wLjMsMy40bDMuNCwwLjMKCQkJCWwtMS4xLTEuM2wtMC4xLTAuMWwwLjEtMC4xYzEuMS0xLjUsMy0yLjMsNS0yLjFsMCwwYzMuMiwwLjMsNS41LDMuMSw1LjIsNi4zYy0wLjMsMy0zLjEsNS4zLTYuMSw1LjFjLTMuMS0wLjItNS40LTIuOS01LjMtNgoJCQkJbC0xLjMtMC4xYy0wLjIsMy44LDIuNiw3LjEsNi4zLDcuNGMzLjksMC4zLDcuMy0yLjYsNy42LTYuNUMxNzcuMiw0Ni44LDE3NC40LDQzLjUsMTcwLjgsNDMuMXoiLz4KCQkJPHBhdGggZmlsbD0iI0MwQzBCRiIgZD0iTTE3MC4zLDQ3LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42cy0wLjYsMC4zLTAuNiwwLjZ2My4yYzAsMC4yLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMywwLjIsMC40LDAuMgoJCQkJaDIuNGMwLjQsMCwwLjYtMC4zLDAuNi0wLjZjMC0wLjMtMC4zLTAuNi0wLjYtMC42aC0xLjZoLTAuMnYtMC4yTDE3MC4zLDQ3LjRMMTcwLjMsNDcuNHoiLz4KCQk8L2c+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBkPSJNMTg2LjIsNDMuNGg3LjdjMS41LDAsMi43LDEuMiwyLjcsMi43djcuN2MwLDEuNS0xLjIsMi43LTIuNywyLjdoLTcuNwoJCQkJYy0xLjUsMC0yLjctMS4yLTIuNy0yLjd2LTcuN0MxODMuNCw0NC43LDE4NC43LDQzLjQsMTg2LjIsNDMuNHoiLz4KCQkJPGVsbGlwc2UgZmlsbD0iI0MwQzBCRiIgY3g9IjE4NiIgY3k9IjQ4LjkiIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQkJPGVsbGlwc2UgZmlsbD0iI0MwQzBCRiIgY3g9IjE5NCIgY3k9IjQ2LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0xODYsNTMuM2wwLjQtMC4zYzAuNC0wLjMsMS0wLjMsMS41LTAuMWwxLDAuNAoJCQkJYzAuNSwwLjIsMSwwLjIsMS41LTAuMWwwLjgtMC41YzAuNC0wLjMsMS0wLjMsMS41LTAuMWwxLjgsMC44Ii8+CgkJPC9nPgoJPC9nPgoJPHBhdGggZmlsbD0iI0MwQzBCRiIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2Utd2lkdGg9IjAuMjUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTE1Niw0NC4zYy0wLjItMC4xLTAuNC0wLjEtMC41LDAKCQljMCwwLTAuMiwwLjEtMC45LDAuMmMtMC43LDAtMi40LTAuMS0zLjgtMC42Yy0wLjgtMC4zLTEuNy0wLjUtMi41LTAuNWMtMC4yLDAtMC40LDAtMC41LDBjLTEuMywwLTIuNSwwLjMtMy42LDEKCQljLTAuMiwwLjEtMC4yLDAuMi0wLjIsMC40djExLjZjMCwwLjMsMC4xLDAuNSwwLjMsMC41YzAuNiwwLDAuNS0wLjQsMC41LTAuNnYtNS43YzAuNy0wLjMsMy4yLTEuMSw1LjgtMC4xCgkJYzEuNiwwLjYsMy41LDAuNyw0LjMsMC43YzAuOCwwLDEuMy0wLjMsMS4zLTAuM2MwLjItMC4xLDAuMy0wLjIsMC4zLTAuNHYtNS43QzE1Ni4yLDQ0LjYsMTU2LjEsNDQuNCwxNTYsNDQuM3ogTTE1NS42LDUwLjIKCQljLTAuMSwwLTAuNywwLjEtMSwwLjFjLTAuNywwLTIuNC0wLjEtMy44LTAuNmMtMi41LTEtNS0wLjUtNi4yLTAuMXYtNC45YzAuOS0wLjUsMi4yLTAuNywzLjItMC43YzAuMSwwLDAuMywwLDAuNCwwCgkJYzAuNywwLDEuNSwwLjIsMi4yLDAuNGMxLjYsMC42LDMuNSwwLjcsNC4zLDAuN2MwLjIsMCwwLjgsMCwxLTAuMVY1MC4yeiIvPgoJPGc+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBkPSJNNDguMSw0My41aDMuN2MyLjUsMCw0LjUsMiw0LjUsNC41YzAsMC41LTAuNCwwLjktMC45LDAuOUg0NC41Yy0wLjUsMC0wLjktMC40LTAuOS0wLjkKCQkJQzQzLjYsNDUuNSw0NS42LDQzLjUsNDguMSw0My41eiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSw0OC44Yy0wLjIsMC4xLTAuNSwxLjIsMCwxLjVjMS40LDEsOC41LDAuOCwxMS4zLDAuNgoJCQljMC44LTAuMSwxLjYtMC40LDEuNy0xLjJjMC0wLjMtMC4xLTAuNi0wLjYtMC45Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDUwLjZMNDMuMyw1MWMtMC4yLDAuNSwwLjIsMSwwLjcsMC45YzAuMy0wLjEsMC41LDAsMC43LDAuMwoJCQlsMC4xLDAuMmMwLjMsMC41LDEsMC42LDEuNSwwLjJsMCwwYzAuMy0wLjIsMC43LTAuMywxLTAuMmwwLjgsMC4zYzAuNCwwLjIsMC44LDAuMSwxLjIsMGwwLjUtMC4yYzAuNC0wLjIsMC45LTAuMiwxLjMsMGwwLjUsMC4yCgkJCWMwLjQsMC4yLDAuOCwwLjIsMS4yLDBsMC4yLTAuMWMwLjMtMC4yLDAuOC0wLjIsMS4xLDAuMWwwLjIsMC4yYzAuMywwLjMsMC44LDAuMiwxLTAuMmwwLjEtMC4yYzAuMS0wLjIsMC0wLjMsMC4yLTAuMwoJCQljMC41LDAsMS4yLTAuMywxLjEtMC43bC0wLjQtMS4xIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDUyLjJjLTAuMSwwLjItMC4zLDAuOCwwLDEuMWMwLjMsMC40LDMsMS4xLDYuNCwxLjEKCQkJYzIuMiwwLDQuNi0wLjMsNi0wLjZjMC41LTAuMSwwLjktMC41LDAuOC0wLjljMC0wLjItMC4yLTAuNS0wLjQtMC43Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDUzLjNjMCwwLjUsMC42LDIuMywxLjMsMi43YzEuOCwwLjgsNS43LDAuNyw4LjEsMC41CgkJCWMxLjMtMC4xLDIuNS0wLjcsMy4yLTEuOGMwLjMtMC41LDAuNS0xLDAuNS0xLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iNTEuNiIgY3k9IjQ2LjUiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iNTMiIGN5PSI0NSIgcng9IjAuMyIgcnk9IjAuNCIvPgoJCTxlbGxpcHNlIGZpbGw9IiNDMEMwQkYiIGN4PSI1MyIgY3k9IjQ3LjIiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iNTQuMyIgY3k9IjQ2LjUiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iNTAuOSIgY3k9IjQ1IiByeD0iMC4zIiByeT0iMC40Ii8+Cgk8L2c+Cgk8Zz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIGQ9Ik0yNC4yLDUxdi03LjZjMC4xLDAuMSwwLjgsMC45LDIuOCwzLjFjMi41LTEuNyw1LjYtMC43LDYuOSwwbDIuNC0zLjF2Ny4xCgkJCWMwLDEuMi0wLjEsMi41LTAuOSwzLjRjLTEsMS4yLTIuNywyLjUtNS4zLDIuNWMtMi45LDAtNC41LTEuNS01LjMtMi45QzI0LjIsNTIuOSwyNC4yLDUyLDI0LjIsNTF6Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0yMS4yLDUwbDUuNCwxLjIiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNDMEMwQkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTIxLjIsNTQuMWw1LjQtMS4yIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0zOC44LDUwbC01LjQsMS4yIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjQzBDMEJGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0zOC44LDU0LjFsLTUuNC0xLjIiLz4KCQk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0MwQzBCRiIgZD0iTTI5LjUsNTIuNEwyOSw1MS43Yy0wLjItMC4zLDAtMC42LDAuMy0wLjZoMS40CgkJCWMwLjMsMCwwLjUsMC40LDAuMywwLjZsLTAuNywxbDAsMGMtMC43LDEuMi0yLjYsMS4xLTMuMS0wLjNsLTAuMS0wLjJjLTAuMS0wLjIsMC0wLjQsMC4yLTAuNXMwLjQsMCwwLjUsMC4ybDAuMSwwLjIKCQkJQzI4LjMsNTIuOCwyOS4xLDUyLjksMjkuNSw1Mi40eiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0MwQzBCRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzIuNCw1Mi4xbC0wLjEsMC4yYy0wLjQsMS0xLjgsMS4xLTIuMywwLjIiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iMjcuNiIgY3k9IjQ5LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQk8ZWxsaXBzZSBmaWxsPSIjQzBDMEJGIiBjeD0iMzIuNCIgY3k9IjQ5LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCTwvZz4KCTxnPgoJCTxwYXRoIGZpbGw9IiM2QUE5REQiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTE0LjYsNzEuMmMtMC4xLTAuMS0wLjItMC4yLTAuMy0wLjJINS43CgkJCWMtMC4xLDAtMC4yLDAuMS0wLjMsMC4yYy0wLjEsMC4xLTAuMSwwLjIsMCwwLjRjMC43LDIsMi41LDMuMyw0LjYsMy4zczMuOS0xLjMsNC42LTMuM0MxNC43LDcxLjUsMTQuNyw3MS4zLDE0LjYsNzEuMnogTTEwLDc0LjEKCQkJYy0xLjYsMC0zLTAuOS0zLjctMi4yaDcuM0MxMyw3My4yLDExLjYsNzQuMSwxMCw3NC4xeiIvPgoJCTxwYXRoIGZpbGw9IiM2QUE5REQiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEyLjgsNjkuNWMwLjYsMCwxLjEtMC41LDEuMS0xLjEKCQkJYzAtMC42LTAuNS0xLjItMS4xLTEuMmMtMC42LDAtMS4yLDAuNS0xLjIsMS4yQzExLjYsNjksMTIuMiw2OS41LDEyLjgsNjkuNXogTTEyLjgsNjhjMC4yLDAsMC40LDAuMiwwLjQsMC40CgkJCWMwLDAuMi0wLjIsMC40LTAuNCwwLjRjLTAuMiwwLTAuNC0wLjItMC40LTAuNEMxMi40LDY4LjEsMTIuNiw2OCwxMi44LDY4eiIvPgoJCTxwYXRoIGZpbGw9IiM2QUE5REQiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTcuMiw2OS41YzAuNiwwLDEuMi0wLjUsMS4yLTEuMQoJCQljMC0wLjYtMC41LTEuMi0xLjItMS4yYy0wLjYsMC0xLjEsMC41LTEuMSwxLjJDNi4xLDY5LDYuNiw2OS41LDcuMiw2OS41eiBNNy4yLDY4YzAuMiwwLDAuNCwwLjIsMC40LDAuNGMwLDAuMi0wLjIsMC40LTAuNCwwLjQKCQkJYy0wLjIsMC0wLjQtMC4yLTAuNC0wLjRDNi44LDY4LjEsNyw2OCw3LjIsNjh6Ii8+CgkJPHBhdGggZmlsbD0iIzZBQTlERCIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2Utd2lkdGg9IjAuMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTAsNjNjLTMuOCwwLTcsMy4xLTcsN2MwLDMuOCwzLjEsNyw3LDcKCQkJczctMy4xLDctN0MxNyw2Ni4yLDEzLjgsNjMsMTAsNjN6IE0xMCw3Ni4yYy0zLjQsMC02LjItMi44LTYuMi02LjJjMC0zLjQsMi44LTYuMiw2LjItNi4yczYuMiwyLjgsNi4yLDYuMgoJCQlDMTYuMiw3My40LDEzLjQsNzYuMiwxMCw3Ni4yeiIvPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTY0LjEsNzMuNGwyLjMsMGMwLjIsMCwwLjQsMC4yLDAuNCwwLjR2Mi4xYzAsMC4yLTAuMiwwLjQtMC40LDAuNGgtMi4zCgkJCQljLTAuMiwwLTAuNC0wLjItMC40LTAuNHYtMi4xQzYzLjcsNzMuNiw2My44LDczLjQsNjQuMSw3My40eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIGQ9Ik03My41LDczLjVoMi40YzAuMiwwLDAuNCwwLjIsMC40LDAuNHYyLjFjMCwwLjItMC4yLDAuNC0wLjQsMC40aC0yLjQKCQkJCWMtMC4yLDAtMC40LTAuMi0wLjQtMC40bDAtMi4xQzczLjEsNzMuNiw3My4zLDczLjUsNzMuNSw3My41eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIGQ9Ik02My43LDY4LjRoMTIuNnY1SDYzLjdWNjguNHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBkPSJNNjUuNSw2My42aDguOWMxLDAsMS45LDAuOCwxLjksMS45djMuMUg2My43di0zLjFDNjMuNyw2NC41LDY0LjUsNjMuNiw2NS41LDYzLjZ6Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiM2QUE5REQiIGN4PSI2Ni4yIiBjeT0iNzAuOSIgcng9IjAuOSIgcnk9IjAuOSIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iNzMuOCIgY3k9IjcwLjkiIHJ4PSIwLjkiIHJ5PSIwLjkiLz4KCQk8L2c+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBkPSJNOTYuNCw3MGMwLDMuNi0yLjksNi41LTYuNCw2LjVzLTYuNC0yLjktNi40LTYuNXMyLjktNi41LDYuNC02LjVTOTYuNCw2Ni40LDk2LjQsNzB6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTk2LjMsNjguNmMwLDAsMCwwLjEsMCwwLjFjLTAuOSwwLjEtMi45LDAuMS00LjYtMS4yYy0xLjEtMC44LTItMS43LTIuNi0yLjUKCQkJCWMtMC4zLTAuNC0wLjYtMC44LTAuNy0xLjFjLTAuMS0wLjEtMC4xLTAuMi0wLjEtMC4yYzAuNS0wLjEsMS4yLTAuMiwyLTAuMmMxLjIsMCwyLjUsMC4zLDMuNSwxLjFjMSwwLjgsMS43LDEuOCwyLjEsMi44CgkJCQlDOTYuMSw2Ny45LDk2LjIsNjguMyw5Ni4zLDY4LjZ6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTg0LDcyLjJjMCwwLDAtMC4xLDAtMC4xYzAuOS0wLjIsMi45LTAuNCw0LjcsMC42YzEuMSwwLjcsMS45LDEuNSwyLjQsMi4zCgkJCQljMC40LDAuNSwwLjYsMSwwLjcsMS4zYy0wLjQsMC4xLTEsMC4yLTEuNywwLjNjLTEsMC0yLjEtMC4xLTMuMi0wLjhzLTEuOS0xLjYtMi40LTIuNUM4NC4yLDcyLjgsODQuMSw3Mi40LDg0LDcyLjJ6Ii8+CgkJPC9nPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMTE2LjMsNjYuOGwtMS40LDJsLTAuOC0wLjhsLTAuNi0wLjdsMCwwLjlsLTAuMSw4LjJoLTYuOAoJCQkJbC0wLjEtOC4ybDAtMC45bC0wLjYsMC43bC0wLjgsMC44bC0xLjQtMmwyLjYtMi45YzAuMS0wLjEsMC4yLTAuMSwwLjMtMC4xaDEuM2wwLjQsMC43YzAuNywxLjMsMi42LDEuMywzLjMtMC4xbDAuMy0wLjZoMS4yCgkJCQljMC4xLDAsMC4yLDAsMC4zLDAuMWwwLjMtMC4zbC0wLjMsMC4zTDExNi4zLDY2Ljh6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTExMC4xLDY3LjdoMnYwLjljMCwwLjQtMC40LDAuNy0xLDAuN2MtMC42LDAtMS0wLjMtMS0wLjdMMTEwLjEsNjcuN0wxMTAuMSw2Ny43eiIvPgoJCTwvZz4KCTwvZz4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIGQ9Ik0xMjYuOCw3NC4zYzAsMS4yLTEsMi4yLTIuMiwyLjJzLTIuMi0xLTIuMi0yLjJzMS0yLjIsMi4yLTIuMlMxMjYuOCw3My4xLDEyNi44LDc0LjN6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTEzNy42LDc0LjNjMCwxLjItMSwyLjItMi4yLDIuMmMtMS4yLDAtMi4yLTEtMi4yLTIuMnMxLTIuMiwyLjItMi4yCgkJCQlDMTM2LjYsNzIuMSwxMzcuNiw3My4xLDEzNy42LDc0LjN6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTEyNi44LDY0LjR2OS45Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTEzNy43LDY0LjR2OS45Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgZD0iTTEyNi44LDYzLjVoMTAuOHYyLjdoLTEwLjhDMTI2LjgsNjYuMiwxMjYuOCw2My41LDEyNi44LDYzLjV6Ii8+CgkJPC9nPgoJPC9nPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9IiM2QUE5REQiIGQ9Ik0xNzAuOCw2My4xTDE3MC44LDYzLjFjLTAuMywwLTAuNSwwLTAuOCwwYy0yLjEsMC00LDEtNS4zLDIuNWwtMC4xLDBsLTAuMS0wLjFsLTEtMS4ybC0wLjMsMy40bDMuNCwwLjMKCQkJCWwtMS4xLTEuM2wtMC4xLTAuMWwwLjEtMC4xYzEuMS0xLjQsMy0yLjMsNS0yLjFsMCwwYzMuMiwwLjMsNS41LDMuMSw1LjIsNi4zYy0wLjMsMy0zLjEsNS4zLTYuMSw1LjFjLTMuMS0wLjItNS40LTIuOS01LjMtNgoJCQkJbC0xLjMtMC4xYy0wLjIsMy44LDIuNiw3LjEsNi4zLDcuNGMzLjksMC4zLDcuMy0yLjYsNy42LTYuNUMxNzcuMiw2Ni44LDE3NC40LDYzLjUsMTcwLjgsNjMuMXoiLz4KCQkJPHBhdGggZmlsbD0iIzZBQTlERCIgZD0iTTE3MC4zLDY3LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42cy0wLjYsMC4zLTAuNiwwLjZ2My4yYzAsMC4yLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMywwLjIsMC40LDAuMgoJCQkJaDIuNGMwLjQsMCwwLjYtMC4zLDAuNi0wLjZTMTcyLjQsNzAsMTcyLDcwaC0xLjZoLTAuMnYtMC4yTDE3MC4zLDY3LjRMMTcwLjMsNjcuNHoiLz4KCQk8L2c+Cgk8L2c+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBkPSJNMTg2LjIsNjMuNGg3LjdjMS41LDAsMi43LDEuMiwyLjcsMi43djcuN2MwLDEuNS0xLjIsMi43LTIuNywyLjdoLTcuNwoJCQkJYy0xLjUsMC0yLjctMS4yLTIuNy0yLjd2LTcuN0MxODMuNCw2NC43LDE4NC43LDYzLjQsMTg2LjIsNjMuNHoiLz4KCQkJPGVsbGlwc2UgZmlsbD0iIzZBQTlERCIgY3g9IjE4NiIgY3k9IjY4LjkiIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQkJPGVsbGlwc2UgZmlsbD0iIzZBQTlERCIgY3g9IjE5NCIgY3k9IjY2LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0xODYsNzMuM2wwLjQtMC4zYzAuNC0wLjMsMS0wLjMsMS41LTAuMWwxLDAuNAoJCQkJYzAuNSwwLjIsMSwwLjIsMS41LTAuMWwwLjgtMC41YzAuNC0wLjMsMS0wLjMsMS41LTAuMWwxLjgsMC44Ii8+CgkJPC9nPgoJPC9nPgoJPHBhdGggZmlsbD0iIzZBQTlERCIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2Utd2lkdGg9IjAuMjUiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTE1Niw2NC4zYy0wLjItMC4xLTAuNC0wLjEtMC41LDAKCQljMCwwLTAuMiwwLjEtMC45LDAuMmMtMC43LDAtMi40LTAuMS0zLjgtMC42Yy0wLjgtMC4zLTEuNy0wLjUtMi41LTAuNWMtMC4yLDAtMC40LDAtMC41LDBjLTEuMywwLTIuNSwwLjMtMy42LDEKCQljLTAuMiwwLjEtMC4yLDAuMi0wLjIsMC40djExLjZjMCwwLjMsMC4xLDAuNSwwLjMsMC41YzAuNiwwLDAuNS0wLjQsMC41LTAuNnYtNS43YzAuNy0wLjMsMy4yLTEuMSw1LjgtMC4xCgkJYzEuNiwwLjYsMy41LDAuNyw0LjMsMC43YzAuOCwwLDEuMy0wLjMsMS4zLTAuM2MwLjItMC4xLDAuMy0wLjIsMC4zLTAuNHYtNS43QzE1Ni4yLDY0LjYsMTU2LjEsNjQuNCwxNTYsNjQuM3ogTTE1NS42LDcwLjIKCQljLTAuMSwwLTAuNywwLjEtMSwwLjFjLTAuNywwLTIuNC0wLjEtMy44LTAuNmMtMi41LTEtNS0wLjUtNi4yLTAuMXYtNC45YzAuOS0wLjUsMi4yLTAuNywzLjItMC43YzAuMSwwLDAuMywwLDAuNCwwCgkJYzAuNywwLDEuNSwwLjIsMi4yLDAuNGMxLjYsMC42LDMuNSwwLjcsNC4zLDAuN2MwLjIsMCwwLjgsMCwxLTAuMVY3MC4yeiIvPgoJPGc+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBkPSJNNDguMSw2My41aDMuN2MyLjUsMCw0LjUsMiw0LjUsNC41YzAsMC41LTAuNCwwLjktMC45LDAuOUg0NC41Yy0wLjUsMC0wLjktMC40LTAuOS0wLjkKCQkJQzQzLjYsNjUuNSw0NS42LDYzLjUsNDguMSw2My41eiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSw2OC44Yy0wLjIsMC4xLTAuNSwxLjIsMCwxLjVjMS40LDAuOSw4LjUsMC44LDExLjMsMC42CgkJCWMwLjgtMC4xLDEuNi0wLjQsMS43LTEuMmMwLTAuMy0wLjEtMC42LTAuNi0wLjkiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTQzLjUsNzAuNkw0My4zLDcxYy0wLjIsMC41LDAuMiwxLDAuNywwLjljMC4zLTAuMSwwLjUsMC4xLDAuNywwLjMKCQkJbDAuMSwwLjJjMC4zLDAuNSwxLDAuNiwxLjUsMC4ybDAsMGMwLjMtMC4yLDAuNy0wLjMsMS0wLjJsMC44LDAuM2MwLjQsMC4yLDAuOCwwLjEsMS4yLDBsMC41LTAuMmMwLjQtMC4yLDAuOS0wLjIsMS4zLDBsMC41LDAuMgoJCQljMC40LDAuMiwwLjgsMC4yLDEuMi0wLjFsMC4yLTAuMWMwLjMtMC4yLDAuOC0wLjIsMS4xLDAuMWwwLjIsMC4yYzAuMywwLjMsMC44LDAuMiwxLTAuMmwwLjEtMC4yYzAuMS0wLjIsMC0wLjMsMC4yLTAuMwoJCQljMC41LDAsMS4yLTAuMywxLjEtMC43bC0wLjQtMS4xIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDcyLjJjLTAuMSwwLjItMC4zLDAuOCwwLDEuMWMwLjMsMC40LDMsMS4xLDYuNCwxLjEKCQkJYzIuMiwwLDQuNi0wLjMsNi0wLjZjMC41LTAuMSwwLjktMC40LDAuOC0wLjljMC0wLjItMC4yLTAuNS0wLjQtMC43Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDczLjNjMCwwLjUsMC42LDIuMywxLjMsMi43YzEuOCwwLjgsNS43LDAuNyw4LjEsMC41CgkJCWMxLjMtMC4xLDIuNS0wLjcsMy4yLTEuOGMwLjMtMC41LDAuNS0xLDAuNS0xLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iNTEuNiIgY3k9IjY2LjUiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iNTMiIGN5PSI2NSIgcng9IjAuMyIgcnk9IjAuNCIvPgoJCTxlbGxpcHNlIGZpbGw9IiM2QUE5REQiIGN4PSI1MyIgY3k9IjY3LjIiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iNTQuMyIgY3k9IjY2LjUiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iNTAuOSIgY3k9IjY1IiByeD0iMC4zIiByeT0iMC40Ii8+Cgk8L2c+Cgk8Zz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIGQ9Ik0yNC4yLDcxdi03LjZjMC4xLDAuMSwwLjgsMC45LDIuOCwzLjFjMi41LTEuNyw1LjYtMC43LDYuOSwwbDIuNC0zLjF2Ny4xCgkJCWMwLDEuMi0wLjEsMi41LTAuOSwzLjRjLTEsMS4yLTIuNywyLjUtNS4zLDIuNWMtMi45LDAtNC41LTEuNS01LjMtMi45QzI0LjIsNzIuOSwyNC4yLDcyLDI0LjIsNzF6Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNkFBOUREIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0yMS4yLDcwLjFsNS40LDEuMiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMjEuMiw3NC4xbDUuNC0xLjIiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2QUE5REQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTM4LjgsNzAuMWwtNS40LDEuMiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzguOCw3NC4xbC01LjQtMS4yIi8+CgkJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiM2QUE5REQiIGQ9Ik0yOS41LDcyLjRMMjksNzEuN2MtMC4yLTAuMywwLTAuNiwwLjMtMC42aDEuNAoJCQljMC4zLDAsMC41LDAuNCwwLjMsMC42bC0wLjcsMWwwLDBjLTAuNywxLjItMi42LDEuMS0zLjEtMC4zbC0wLjEtMC4yYy0wLjEtMC4yLDAtMC40LDAuMi0wLjVjMC4yLTAuMSwwLjQsMCwwLjUsMC4ybDAuMSwwLjIKCQkJQzI4LjMsNzIuOCwyOS4xLDcyLjksMjkuNSw3Mi40eiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZBQTlERCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzIuNCw3Mi4xbC0wLjEsMC4yYy0wLjQsMS0xLjgsMS4xLTIuMywwLjIiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iMjcuNiIgY3k9IjY5LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCQk8ZWxsaXBzZSBmaWxsPSIjNkFBOUREIiBjeD0iMzIuNCIgY3k9IjY5LjciIHJ4PSIwLjciIHJ5PSIwLjciLz4KCTwvZz4KPC9nPgo8Zz4KCTxwYXRoIGZpbGw9IiM4Njg2ODYiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEyLjgsOS41YzAuNiwwLDEuMS0wLjUsMS4xLTEuMgoJCWMwLTAuNi0wLjUtMS4xLTEuMS0xLjFjLTAuNiwwLTEuMiwwLjUtMS4yLDEuMVMxMi4yLDkuNSwxMi44LDkuNXogTTEyLjgsNy45YzAuMiwwLDAuNCwwLjIsMC40LDAuNGMwLDAuMi0wLjIsMC40LTAuNCwwLjQKCQljLTAuMiwwLTAuNC0wLjItMC40LTAuNEMxMi40LDguMSwxMi42LDcuOSwxMi44LDcuOXoiLz4KCTxwYXRoIGZpbGw9IiM4Njg2ODYiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLXdpZHRoPSIwLjEiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTcuMiw5LjVjMC42LDAsMS4yLTAuNSwxLjItMS4yCgkJYzAtMC42LTAuNS0xLjEtMS4yLTEuMWMtMC42LDAtMS4xLDAuNS0xLjEsMS4xUzYuNiw5LjUsNy4yLDkuNXogTTcuMiw3LjljMC4yLDAsMC40LDAuMiwwLjQsMC40YzAsMC4yLTAuMiwwLjQtMC40LDAuNAoJCUM3LDguNyw2LjgsOC41LDYuOCw4LjNDNi44LDguMSw3LDcuOSw3LjIsNy45eiIvPgoJPHBhdGggZmlsbD0iIzg2ODY4NiIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2Utd2lkdGg9IjAuMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTQuNiwxMS4yYy0wLjEtMC4xLTAuMi0wLjItMC4zLTAuMkg1LjcKCQljLTAuMSwwLTAuMiwwLjEtMC4zLDAuMmMtMC4xLDAuMS0wLjEsMC4yLDAsMC40YzAuNywyLDIuNSwzLjMsNC42LDMuM3MzLjktMS4zLDQuNi0zLjNDMTQuNywxMS40LDE0LjcsMTEuMywxNC42LDExLjJ6IE0xMCwxNC4xCgkJYy0xLjYsMC0zLTAuOS0zLjctMi4yaDcuM0MxMywxMy4yLDExLjYsMTQuMSwxMCwxNC4xeiIvPgoJPHBhdGggZmlsbD0iIzg2ODY4NiIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2Utd2lkdGg9IjAuMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTAsM2MtMy44LDAtNywzLjEtNyw3czMuMSw3LDcsN3M3LTMuMSw3LTcKCQlTMTMuOCwzLDEwLDN6IE0xMCwxNi4yYy0zLjQsMC02LjItMi44LTYuMi02LjJTNi42LDMuOCwxMCwzLjhzNi4yLDIuOCw2LjIsNi4yUzEzLjQsMTYuMiwxMCwxNi4yeiIvPgo8L2c+CjxnIGlkPSJDYXJfMDAwMDAwMTg5MzUzOTUwODU0MTM0MTM3NTAwMDAwMDA4MjUyNzM4Nzc4NDI3NzU3MTVfIj4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik02NC4xLDEzLjRsMi4zLDBjMC4yLDAsMC40LDAuMiwwLjQsMC40djIuMWMwLDAuMi0wLjIsMC40LTAuNCwwLjRoLTIuMwoJCQkJYy0wLjIsMC0wLjQtMC4yLTAuNC0wLjR2LTIuMUM2My43LDEzLjYsNjMuOCwxMy40LDY0LjEsMTMuNHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNNzMuNSwxMy40aDIuNGMwLjIsMCwwLjQsMC4yLDAuNCwwLjR2Mi4xYzAsMC4yLTAuMiwwLjQtMC40LDAuNGgtMi40CgkJCQljLTAuMiwwLTAuNC0wLjItMC40LTAuNGwwLTIuMUM3My4xLDEzLjYsNzMuMywxMy40LDczLjUsMTMuNHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNNjMuNyw4LjRoMTIuNnY1SDYzLjdWOC40eiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik02NS41LDMuNmg4LjljMSwwLDEuOSwwLjgsMS45LDEuOXYzLjFINjMuN1Y1LjVDNjMuNyw0LjQsNjQuNSwzLjYsNjUuNSwzLjZ6Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiM4Njg2ODYiIGN4PSI2Ni4yIiBjeT0iMTAuOSIgcng9IjAuOSIgcnk9IjAuOSIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjODY4Njg2IiBjeD0iNzMuOCIgY3k9IjEwLjkiIHJ4PSIwLjkiIHJ5PSIwLjkiLz4KCQk8L2c+Cgk8L2c+CjwvZz4KPGcgaWQ9IkFjdGl2aXRpZXMiPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgZD0iTTk2LjQsMTBjMCwzLjYtMi45LDYuNS02LjQsNi41cy02LjQtMi45LTYuNC02LjVzMi45LTYuNSw2LjQtNi41Uzk2LjQsNi40LDk2LjQsMTB6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgZD0iTTk2LjMsOC42YzAsMCwwLDAuMSwwLDAuMWMtMC45LDAuMS0yLjksMC4xLTQuNi0xLjJjLTEuMS0wLjgtMi0xLjctMi42LTIuNQoJCQkJYy0wLjMtMC40LTAuNi0wLjgtMC43LTEuMWMtMC4xLTAuMS0wLjEtMC4yLTAuMS0wLjJjMC41LTAuMSwxLjItMC4yLDItMC4yYzEuMiwwLDIuNSwwLjMsMy41LDEuMWMxLDAuOCwxLjcsMS44LDIuMSwyLjgKCQkJCUM5Ni4xLDcuOSw5Ni4yLDguMyw5Ni4zLDguNnoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNODQsMTIuMWMwLDAsMC0wLjEsMC0wLjFjMC45LTAuMiwyLjktMC40LDQuNywwLjZjMS4xLDAuNiwxLjksMS41LDIuNCwyLjMKCQkJCWMwLjQsMC41LDAuNiwxLDAuNywxLjNjLTAuNCwwLjEtMSwwLjItMS43LDAuM2MtMSwwLTIuMS0wLjEtMy4yLTAuOGMtMS4xLTAuNi0xLjktMS42LTIuNC0yLjVDODQuMiwxMi44LDg0LjEsMTIuNCw4NCwxMi4xeiIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8ZyBpZD0iT2JqZWN0c18wMDAwMDA2NDMxMjM3MTczOTEzMDMxNTI1MDAwMDAxMDIyNTg4OTAzMjIyODYzMjk3NV8iPgoJPGc+CgkJPGc+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMTE2LjMsNi44bC0xLjQsMkwxMTQuMSw4bC0wLjYtMC43bDAsMC45bC0wLjEsOC4yaC02LjhsLTAuMS04LjIKCQkJCWwwLTAuOUwxMDUuOSw4bC0wLjgsMC44bC0xLjQtMmwyLjYtMi45YzAuMS0wLjEsMC4yLTAuMSwwLjMtMC4xaDEuM2wwLjQsMC43YzAuNywxLjMsMi42LDEuMywzLjMtMC4xbDAuMy0wLjZoMS4yCgkJCQljMC4xLDAsMC4yLDAsMC4zLDAuMWwwLjMtMC4zbC0wLjMsMC4zTDExNi4zLDYuOHoiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNMTEwLjEsNy43aDJ2MC45YzAsMC40LTAuNCwwLjctMSwwLjdjLTAuNiwwLTEtMC4zLTEtMC43TDExMC4xLDcuN0wxMTAuMSw3Ljd6Ii8+CgkJPC9nPgoJPC9nPgo8L2c+CjxnIGlkPSJTeW1ib2xzXzAwMDAwMDk2NzQ2OTA3ODY5OTI5OTIxMTgwMDAwMDA2NDg0ODEyODMwMjgyNTgyNDE2XyI+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNMTI2LjgsMTQuM2MwLDEuMi0xLDIuMi0yLjIsMi4ycy0yLjItMS0yLjItMi4yczEtMi4yLDIuMi0yLjJTMTI2LjgsMTMuMSwxMjYuOCwxNC4zeiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik0xMzcuNiwxNC4zYzAsMS4yLTEsMi4yLTIuMiwyLjJjLTEuMiwwLTIuMi0xLTIuMi0yLjJzMS0yLjIsMi4yLTIuMgoJCQkJQzEzNi42LDEyLjEsMTM3LjYsMTMuMSwxMzcuNiwxNC4zeiIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik0xMjYuOCw0LjR2OS45Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgZD0iTTEzNy43LDQuNHY5LjkiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBkPSJNMTI2LjgsMy41aDEwLjh2Mi43aC0xMC44QzEyNi44LDYuMiwxMjYuOCwzLjUsMTI2LjgsMy41eiIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8ZyBpZD0iUmVjZW50cyI+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZmlsbD0iIzg2ODY4NiIgZD0iTTE3MC44LDMuMUwxNzAuOCwzLjFjLTAuMywwLTAuNSwwLTAuOCwwYy0yLjEsMC00LDEtNS4zLDIuNWwtMC4xLDBsLTAuMS0wLjFsLTEtMS4ybC0wLjMsMy40bDMuNCwwLjMKCQkJCWwtMS4xLTEuM2wtMC4xLTAuMWwwLjEtMC4xYzEuMS0xLjQsMy0yLjMsNS0yLjFsMCwwYzMuMiwwLjMsNS41LDMuMSw1LjIsNi4zYy0wLjMsMy0zLjEsNS4zLTYuMSw1LjFjLTMuMS0wLjItNS40LTIuOS01LjMtNgoJCQkJTDE2Myw5LjVjLTAuMiwzLjgsMi42LDcuMSw2LjMsNy40YzMuOSwwLjQsNy4zLTIuNiw3LjYtNi41QzE3Ny4yLDYuOCwxNzQuNCwzLjUsMTcwLjgsMy4xeiIvPgoJCQk8cGF0aCBmaWxsPSIjODY4Njg2IiBkPSJNMTcwLjMsNy40YzAtMC4zLTAuMy0wLjYtMC42LTAuNlMxNjksNy4xLDE2OSw3LjR2My4yYzAsMC4yLDAuMSwwLjMsMC4yLDAuNGMwLjEsMC4xLDAuMywwLjIsMC40LDAuMgoJCQkJaDIuNGMwLjQsMCwwLjYtMC4zLDAuNi0wLjZzLTAuMy0wLjYtMC42LTAuNmgtMS42aC0wLjJWOS44TDE3MC4zLDcuNEwxNzAuMyw3LjR6Ii8+CgkJPC9nPgoJPC9nPgo8L2c+CjxnIGlkPSJDdXN0b21fMDAwMDAxODEwODcyMjk0MzQzMDIzMzY3ODAwMDAwMDUxNTIyNzc5NDU5NDA2NzQ0ODhfIj4KCTxnPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik0xODYuMiwzLjRoNy43YzEuNSwwLDIuNywxLjIsMi43LDIuN3Y3LjdjMCwxLjUtMS4yLDIuNy0yLjcsMi43aC03LjcKCQkJCWMtMS41LDAtMi43LTEuMi0yLjctMi43VjYuMUMxODMuNCw0LjYsMTg0LjcsMy40LDE4Ni4yLDMuNHoiLz4KCQkJPGVsbGlwc2UgZmlsbD0iIzg2ODY4NiIgY3g9IjE4NiIgY3k9IjguOSIgcng9IjAuNyIgcnk9IjAuNyIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjODY4Njg2IiBjeD0iMTk0IiBjeT0iNi43IiByeD0iMC43IiByeT0iMC43Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMTg2LDEzLjNsMC40LTAuM2MwLjQtMC4zLDEtMC4zLDEuNS0wLjFsMSwwLjQKCQkJCWMwLjUsMC4yLDEsMC4yLDEuNS0wLjFsMC44LTAuNWMwLjQtMC4zLDEtMC4zLDEuNS0wLjFsMS44LDAuOCIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8cGF0aCBmaWxsPSIjODY4Njg2IiBzdHJva2U9IiM4Njg2ODYiIHN0cm9rZS13aWR0aD0iMC4yNSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMTU2LDQuM2MtMC4yLTAuMS0wLjQtMC4xLTAuNSwwCgljMCwwLTAuMiwwLjEtMC45LDAuMWMtMC43LDAtMi40LTAuMS0zLjgtMC42Yy0wLjgtMC4zLTEuNy0wLjUtMi41LTAuNWMtMC4yLDAtMC40LDAtMC41LDBjLTEuMywwLTIuNSwwLjMtMy42LDEKCWMtMC4yLDAuMS0wLjIsMC4yLTAuMiwwLjR2MTEuNmMwLDAuMywwLjEsMC41LDAuMywwLjVjMC42LDAsMC41LTAuNCwwLjUtMC42di01LjdjMC43LTAuMywzLjItMS4xLDUuOC0wLjFjMS42LDAuNiwzLjUsMC43LDQuMywwLjcKCWMwLjgsMCwxLjMtMC4zLDEuMy0wLjNjMC4yLTAuMSwwLjMtMC4yLDAuMy0wLjRWNC43QzE1Ni4yLDQuNSwxNTYuMSw0LjQsMTU2LDQuM3ogTTE1NS42LDEwLjJjLTAuMSwwLTAuNywwLjEtMSwwLjEKCWMtMC43LDAtMi40LTAuMS0zLjgtMC42Yy0yLjUtMS01LTAuNS02LjItMC4xVjQuN2MwLjktMC41LDIuMi0wLjcsMy4yLTAuN2MwLjEsMCwwLjMsMCwwLjQsMGMwLjcsMCwxLjUsMC4yLDIuMiwwLjQKCWMxLjYsMC42LDMuNSwwLjcsNC4zLDAuN2MwLjIsMCwwLjgsMCwxLTAuMVYxMC4yeiIvPgo8ZyBpZD0iRm9vZCI+Cgk8ZyBpZD0iTGF5ZXJfMTIiPgoJCTxnPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIGQ9Ik00OC4xLDMuNWgzLjdjMi41LDAsNC41LDIsNC41LDQuNWMwLDAuNS0wLjQsMC45LTAuOSwwLjlINDQuNWMtMC41LDAtMC45LTAuNC0wLjktMC45CgkJCQlDNDMuNiw1LjUsNDUuNiwzLjUsNDguMSwzLjV6Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSw4LjdjLTAuMiwwLjEtMC41LDEuMiwwLDEuNWMxLjQsMC45LDguNSwwLjgsMTEuMywwLjYKCQkJCWMwLjgtMC4xLDEuNi0wLjQsMS43LTEuMmMwLTAuMy0wLjEtMC42LTAuNi0wLjkiLz4KCQkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik00My41LDEwLjZMNDMuMywxMWMtMC4yLDAuNSwwLjIsMSwwLjcsMC45CgkJCQljMC4zLTAuMSwwLjUsMC4xLDAuNywwLjNsMC4xLDAuMmMwLjMsMC41LDEsMC42LDEuNSwwLjJsMCwwYzAuMy0wLjIsMC43LTAuMywxLTAuMmwwLjgsMC4zYzAuNCwwLjEsMC44LDAuMSwxLjIsMGwwLjUtMC4yCgkJCQljMC40LTAuMiwwLjktMC4yLDEuMywwbDAuNSwwLjJjMC40LDAuMiwwLjgsMC4xLDEuMi0wLjFsMC4yLTAuMWMwLjMtMC4yLDAuOC0wLjEsMS4xLDAuMWwwLjIsMC4yYzAuMywwLjMsMC44LDAuMiwxLTAuMmwwLjEtMC4yCgkJCQljMC4xLTAuMiwwLTAuMywwLjItMC40YzAuNSwwLDEuMi0wLjMsMS4xLTAuN2wtMC40LTEuMSIvPgoJCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTQzLjUsMTIuMWMtMC4xLDAuMi0wLjMsMC44LDAsMS4xYzAuMywwLjQsMywxLjEsNi40LDEuMQoJCQkJYzIuMiwwLDQuNi0wLjMsNi0wLjZjMC41LTAuMSwwLjktMC40LDAuOC0wLjljMC0wLjItMC4yLTAuNS0wLjQtMC43Ii8+CgkJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNNDMuNSwxMy4zYzAsMC41LDAuNiwyLjQsMS4zLDIuNmMxLjgsMC44LDUuNywwLjcsOC4xLDAuNQoJCQkJYzEuMy0wLjEsMi41LTAuNywzLjItMS44YzAuMy0wLjUsMC41LTEsMC41LTEuNCIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjODY4Njg2IiBjeD0iNTEuNiIgY3k9IjYuNSIgcng9IjAuMyIgcnk9IjAuNCIvPgoJCQk8ZWxsaXBzZSBmaWxsPSIjODY4Njg2IiBjeD0iNTMiIGN5PSI0LjkiIHJ4PSIwLjMiIHJ5PSIwLjQiLz4KCQkJPGVsbGlwc2UgZmlsbD0iIzg2ODY4NiIgY3g9IjUzIiBjeT0iNy4yIiByeD0iMC4zIiByeT0iMC40Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiM4Njg2ODYiIGN4PSI1NC4zIiBjeT0iNi41IiByeD0iMC4zIiByeT0iMC40Ii8+CgkJCTxlbGxpcHNlIGZpbGw9IiM4Njg2ODYiIGN4PSI1MC45IiBjeT0iNC45IiByeD0iMC4zIiByeT0iMC40Ii8+CgkJPC9nPgoJPC9nPgo8L2c+CjxnIGlkPSJBbmltYWxzIj4KCTxnPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgZD0iTTI0LjIsMTFWMy41YzAuMSwwLjEsMC44LDAuOSwyLjgsMy4xYzIuNS0xLjcsNS42LTAuNyw2LjksMGwyLjQtMy4xdjcuMQoJCQljMCwxLjItMC4xLDIuNS0wLjksMy40Yy0xLDEuMi0yLjcsMi41LTUuMywyLjVjLTIuOSwwLTQuNS0xLjUtNS4zLTIuOUMyNC4yLDEyLjksMjQuMiwxMS45LDI0LjIsMTF6Ii8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0yMS4yLDEwbDUuNCwxLjIiLz4KCQk8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM4Njg2ODYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgZD0iTTIxLjIsMTQuMWw1LjQtMS4yIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0zOC44LDEwbC01LjQsMS4yIi8+CgkJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODY4Njg2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0zOC44LDE0LjFsLTUuNC0xLjIiLz4KCQk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzg2ODY4NiIgZD0iTTI5LjUsMTIuNEwyOSwxMS43Yy0wLjItMC4zLDAtMC42LDAuMy0wLjZoMS40CgkJCWMwLjMsMCwwLjUsMC40LDAuMywwLjZsLTAuNywxbDAsMGMtMC43LDEuMi0yLjYsMS4xLTMuMS0wLjNsLTAuMS0wLjJjLTAuMS0wLjIsMC0wLjQsMC4yLTAuNXMwLjQsMCwwLjUsMC4ybDAuMSwwLjIKCQkJQzI4LjMsMTIuNywyOS4xLDEyLjksMjkuNSwxMi40eiIvPgoJCTxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzg2ODY4NiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBkPSJNMzIuNCwxMi4xbC0wLjEsMC4yYy0wLjQsMS0xLjgsMS4xLTIuMywwLjIiLz4KCQk8ZWxsaXBzZSBmaWxsPSIjODY4Njg2IiBjeD0iMjcuNiIgY3k9IjkuNyIgcng9IjAuNyIgcnk9IjAuNyIvPgoJCTxlbGxpcHNlIGZpbGw9IiM4Njg2ODYiIGN4PSIzMi40IiBjeT0iOS43IiByeD0iMC43IiByeT0iMC43Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+
3919";function Znt(e){var t,r,n=e.isActiveCategory,a=e.category,i=e.allowNavigation,o=e.categoryConfig,l=e.onClick,c=e.customIcon,u=(t=o.icon)!=null?t:c,d=u!=null;return b.createElement(jb,{tabIndex:i?0:-1,className:Lr(J$.catBtn,Tf.categoryBtn,d?J$.customIcon:"epr-icn-"+a,(r={},r[Wr.active]=n,r)),onClick:l,"aria-label":RY(o),"aria-selected":n,role:"tab","aria-controls":"epr-category-nav-id"},d?u:null)}var Q$={backgroundPositionY:"calc(var(--epr-category-navigation-button-size) * 3)"},Xnt={backgroundPositionY:"calc(var(--epr-category-navigation-button-size) * 2)"},K$={":not(.epr-search-active)":{catBtn:{":hover":Q$,"&.epr-active":Q$}}},J$=Qn.create(Mn({catBtn:{".":"epr-cat-btn",display:"inline-block",transition:"opacity 0.2s ease-in-out",position:"relative",height:"var(--epr-category-navigation-button-size)",width:"var(--epr-category-navigation-button-size)",backgroundSize:"calc(var(--epr-category-navigation-button-size) * 10)",outline:"none",backgroundPosition:"0 0",backgroundImage:"url("+Jnt+")",":focus:before":{content:"",position:"absolute",top:"-2px",left:"-2px",right:"-2px",bottom:"-2px",border:"2px solid var(--epr-category-icon-active-color)",borderRadius:"50%"},"&.epr-icn-suggested":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -8)"},"&.epr-icn-custom":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -9)"},"&.epr-icn-activities":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -4)"},"&.epr-icn-animals_nature":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -1)"},"&.epr-icn-flags":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -7)"},"&.epr-icn-food_drink":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -2)"},"&.epr-icn-objects":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -5)"},"&.epr-icn-smileys_people":{backgroundPositionX:"0px"},"&.epr-icn-symbols":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -6)"},"&.epr-icn-travel_places":{backgroundPositionX:"calc(var(--epr-category-navigation-button-size) * -3)"}},customIcon:{".":"epr-cat-btn-custom-icon",backgroundImage:"none",display:"flex",alignItems:"center",justifyContent:"center"}},Ou("catBtn",Xnt),{".epr-dark-theme":Mn({},K$),".epr-auto-theme":Mn({},K$)}));function eat(){var e=b.useState(null),t=e[0],r=e[1],n=CA(),a=n[1],i=Qnt();Ynt({setActiveCategory:r,setVisibleCategories:a});var o=rN(),l=MA(),c=rrt(),u=EA(),d=Knt();return b.createElement("div",{className:Lr(tat.nav),role:"tablist","aria-label":"Category navigation",id:"epr-category-nav-id",ref:u},l.map(function(f){var m=Jj(f),h=m===t;if(lnt(f)&&d)return null;var p=!o&&!h;return b.createElement(Znt,{key:m,category:m,isActiveCategory:h,allowNavigation:p,categoryConfig:f,customIcon:c[m],onClick:function(){i(m),setTimeout(function(){r(m)},10)}})}))}var tat=Qn.create({nav:{".":"epr-category-nav",display:"flex",flexDirection:"row",justifyContent:"space-around",padding:"var(--epr-header-padding)"},".epr-search-active":{nav:{opacity:"0.3",cursor:"default",pointerEvents:"none"}},".epr-main:has(input:not(:placeholder-shown))":{nav:{opacity:"0.3",cursor:"default",pointerEvents:"none"}}}),OQ="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjgwcHgiIHZpZXdCb3g9IjAgMCAyMCA4MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgODAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjODY4Njg2IiBkPSJNNi45OCwxMy41OWMwLjEsMC4xLDAuMjQsMC4xNSwwLjM3LDAuMTVzMC4yNy0wLjA1LDAuMzctMC4xNWwyLjQyLTIuNDJsMi40MywyLjQzCgljMC4xLDAuMSwwLjI0LDAuMTUsMC4zNywwLjE1YzAuMTQsMCwwLjI3LTAuMDUsMC4zNy0wLjE1YzAuMjEtMC4yMSwwLjIxLTAuNTQsMC0wLjc1bC0yLjQzLTIuNDNMMTMuMzIsOAoJYzAuMjEtMC4yMSwwLjIxLTAuNTQsMC0wLjc1Yy0wLjIxLTAuMjEtMC41NC0wLjIxLTAuNzUsMGwtMi40MiwyLjQyTDcuNzQsNy4yN2MtMC4yMS0wLjIxLTAuNTQtMC4yMS0wLjc1LDAKCWMtMC4yMSwwLjIxLTAuMjEsMC41NCwwLDAuNzVsMi40MSwyLjQxbC0yLjQyLDIuNDJDNi43NywxMy4wNSw2Ljc3LDEzLjM5LDYuOTgsMTMuNTlMNi45OCwxMy41OXoiLz4KPHBhdGggZmlsbD0iIzg2ODY4NiIgZD0iTTEwLjE1LDE4LjQzYzQuNDEsMCw4LTMuNTksOC04YzAtNC40MS0zLjU5LTgtOC04Yy00LjQxLDAtOCwzLjU5LTgsOEMyLjE1LDE0Ljg0LDUuNzQsMTguNDMsMTAuMTUsMTguNDN6CgkgTTEwLjE1LDMuNDljMy44MywwLDYuOTQsMy4xMSw2Ljk0LDYuOTRjMCwzLjgzLTMuMTEsNi45NC02Ljk0LDYuOTRjLTMuODMsMC02Ljk0LTMuMTEtNi45NC02Ljk0QzMuMjEsNi42LDYuMzMsMy40OSwxMC4xNSwzLjQ5CglMMTAuMTUsMy40OXoiLz4KPHBhdGggZmlsbD0iIzMzNzFCNyIgZD0iTTYuOTgsMzMuNTljMC4xLDAuMSwwLjI0LDAuMTUsMC4zNywwLjE1czAuMjctMC4wNSwwLjM3LTAuMTVsMi40Mi0yLjQybDIuNDMsMi40MwoJYzAuMSwwLjEsMC4yNCwwLjE1LDAuMzcsMC4xNWMwLjE0LDAsMC4yNy0wLjA1LDAuMzctMC4xNWMwLjIxLTAuMjEsMC4yMS0wLjU0LDAtMC43NWwtMi40My0yLjQzTDEzLjMyLDI4CgljMC4yMS0wLjIxLDAuMjEtMC41NCwwLTAuNzVjLTAuMjEtMC4yMS0wLjU0LTAuMjEtMC43NSwwbC0yLjQyLDIuNDJsLTIuNDEtMi40MWMtMC4y
3919MS0wLjIxLTAuNTQtMC4yMS0wLjc1LDAKCWMtMC4yMSwwLjIxLTAuMjEsMC41NCwwLDAuNzVsMi40MSwyLjQxbC0yLjQyLDIuNDJDNi43NywzMy4wNSw2Ljc3LDMzLjM5LDYuOTgsMzMuNTlMNi45OCwzMy41OXoiLz4KPHBhdGggZmlsbD0iIzMzNzFCNyIgZD0iTTEwLjE1LDM4LjQzYzQuNDEsMCw4LTMuNTksOC04YzAtNC40MS0zLjU5LTgtOC04Yy00LjQxLDAtOCwzLjU5LTgsOEMyLjE1LDM0Ljg0LDUuNzQsMzguNDMsMTAuMTUsMzguNDN6CgkgTTEwLjE1LDIzLjQ5YzMuODMsMCw2Ljk0LDMuMTEsNi45NCw2Ljk0YzAsMy44My0zLjExLDYuOTQtNi45NCw2Ljk0Yy0zLjgzLDAtNi45NC0zLjExLTYuOTQtNi45NAoJQzMuMjEsMjYuNiw2LjMzLDIzLjQ5LDEwLjE1LDIzLjQ5TDEwLjE1LDIzLjQ5eiIvPgo8cGF0aCBmaWxsPSIjQzBDMEJGIiBkPSJNNi45OCw1My41OWMwLjEsMC4xLDAuMjQsMC4xNSwwLjM3LDAuMTVzMC4yNy0wLjA1LDAuMzctMC4xNWwyLjQyLTIuNDJsMi40MywyLjQzCgljMC4xLDAuMSwwLjI0LDAuMTUsMC4zNywwLjE1YzAuMTQsMCwwLjI3LTAuMDUsMC4zNy0wLjE1YzAuMjEtMC4yMSwwLjIxLTAuNTQsMC0wLjc1bC0yLjQzLTIuNDNMMTMuMzIsNDgKCWMwLjIxLTAuMjEsMC4yMS0wLjU0LDAtMC43NWMtMC4yMS0wLjIxLTAuNTQtMC4yMS0wLjc1LDBsLTIuNDIsMi40MmwtMi40MS0yLjQxYy0wLjIxLTAuMjEtMC41NC0wLjIxLTAuNzUsMAoJYy0wLjIxLDAuMjEtMC4yMSwwLjU0LDAsMC43NWwyLjQxLDIuNDFsLTIuNDIsMi40MkM2Ljc3LDUzLjA1LDYuNzcsNTMuMzksNi45OCw1My41OUw2Ljk4LDUzLjU5eiIvPgo8cGF0aCBmaWxsPSIjQzBDMEJGIiBkPSJNMTAuMTUsNTguNDNjNC40MSwwLDgtMy41OSw4LThjMC00LjQxLTMuNTktOC04LThjLTQuNDEsMC04LDMuNTktOCw4QzIuMTUsNTQuODQsNS43NCw1OC40MywxMC4xNSw1OC40M3oKCSBNMTAuMTUsNDMuNDljMy44MywwLDYuOTQsMy4xMSw2Ljk0LDYuOTRjMCwzLjgzLTMuMTEsNi45NC02Ljk0LDYuOTRjLTMuODMsMC02Ljk0LTMuMTEtNi45NC02Ljk0CglDMy4yMSw0Ni42LDYuMzMsNDMuNDksMTAuMTUsNDMuNDlMMTAuMTUsNDMuNDl6Ii8+CjxwYXRoIGZpbGw9IiM2QUE5REQiIGQ9Ik02Ljk4LDczLjU5YzAuMSwwLjEsMC4yNCwwLjE1LDAuMzcsMC4xNXMwLjI3LTAuMDUsMC4zNy0wLjE1bDIuNDItMi40MmwyLjQzLDIuNDMKCWMwLjEsMC4xLDAuMjQsMC4xNSwwLjM3LDAuMTVjMC4xNCwwLDAuMjctMC4wNSwwLjM3LTAuMTVjMC4yMS0wLjIxLDAuMjEtMC41NCwwLTAuNzVsLTIuNDMtMi40M0wxMy4zMiw2OAoJYzAuMjEtMC4yMSwwLjIxLTAuNTQsMC0wLjc1Yy0wLjIxLTAuMjEtMC41NC0wLjIxLTAuNzUsMGwtMi40MiwyLjQybC0yLjQxLTIuNDFjLTAuMjEtMC4yMS0wLjU0LTAuMjEtMC43NSwwCgljLTAuMjEsMC4yMS0wLjIxLDAuNTQsMCwwLjc1bDIuNDEsMi40MWwtMi40MiwyLjQyQzYuNzcsNzMuMDUsNi43Nyw3My4zOSw2Ljk4LDczLjU5TDYuOTgsNzMuNTl6Ii8+CjxwYXRoIGZpbGw9IiM2QUE5REQiIGQ9Ik0xMC4xNSw3OC40M2M0LjQxLDAsOC0zLjU5LDgtOGMwLTQuNDEtMy41OS04LTgtOGMtNC40MSwwLTgsMy41OS04LDhDMi4xNSw3NC44NCw1Ljc0LDc4LjQzLDEwLjE1LDc4LjQzegoJIE0xMC4xNSw2My40OWMzLjgzLDAsNi45NCwzLjExLDYuOTQsNi45NGMwLDMuODMtMy4xMSw2Ljk0LTYuOTQsNi45NGMtMy44MywwLTYuOTQtMy4xMS02Ljk0LTYuOTQKCUMzLjIxLDY2LjYsNi4zMyw2My40OSwxMC4xNSw2My40OUwxMC4xNSw2My40OXoiLz4KPC9zdmc+";function rat(){var e=hQ(),t=Xtt();return b.createElement(jb,{className:Lr(Z$.btnClearSearch,Tf.visibleOnSearchOnly),onClick:e,"aria-label":t,title:t},b.createElement("div",{className:Lr(Z$.icnClearnSearch)}))}var nat={":hover":{"> .epr-icn-clear-search":{backgroundPositionY:"-60px"}}},Z$=Qn.create(Mn({btnClearSearch:{".":"epr-btn-clear-search",position:"absolute",right:"var(--epr-search-bar-inner-padding)",height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",top:"50%",transform:"translateY(-50%)",padding:"0",borderRadius:"50%",":hover":{background:"var(--epr-hover-bg-color)"},":focus":{background:"var(--epr-hover-bg-color)"}},icnClearnSearch:{".":"epr-icn-clear-search",backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundSize:"20px",height:"20px",width:"20px",backgroundImage:"url("+OQ+")",":hover":{backgroundPositionY:"-20px"},":focus":{backgroundPositionY:"-20px"}}},Ou("icnClearnSearch",{backgroundPositionY:"-40px"}),Ou("btnClearSearch",nat))),aat="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjQwcHgiIHZpZXdCb3g9IjAgMCAyMCA0MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzg2ODY4NiIgZD0iTTEyLDguODFjMCwyLjA4LTEuNjgsMy43Ni0zLjc2LDMuNzZjLTIuMDgsMC0zLjc2LTEuNjgtMy43Ni0zLjc2CgljMC0yLjA4LDEuNjgtMy43NiwzLjc2LTMuNzZDMTAuMzIsNS4wNSwxMiw2LjczLDEyLDguODF6IE0xMS4yMywxMi43MmMtMC44MywwLjY0LTEuODcsMS4wMS0yLjk5LDEuMDFjLTIuNzIsMC00LjkyLTIuMi00LjkyLTQuOTIKCWMwLTIuNzIsMi4yLTQuOTIsNC45Mi00LjkyYzIuNzIsMCw0LjkyLDIuMiw0LjkyLDQuOTJjMCwxLjEzLTAuMzgsMi4xNi0xLjAxLDIuOTlsMy45NCwzLjkzYzAuMjUsMC4yNSwwLjI1LDAuNjYsMCwwLjkyCgljLTAuMjUsMC4yNS0wLjY2LDAuMjUtMC45MiwwTDExLjIzLDEyLjcyeiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0MwQzBCRiIgZD0iTTEyLDI4LjgxYzAsMi4wOC0xLjY4LDMuNzYtMy43NiwzLjc2Yy0yLjA4LDAtMy43Ni0xLjY4LTMuNzYtMy43NgoJYzAtMi4wOCwxLjY4LTMuNzYsMy43Ni0zLjc2QzEwLjMyLDI1LjA1LDEyLDI2LjczLDEyLDI4LjgxeiBNMTEuMjMsMzIuNzJjLTAuODMsMC42NC0xLjg3LDEuMDEtMi45OSwxLjAxCgljLTIuNzIsMC00LjkyLTIuMi00LjkyLTQuOTJjMC0yLjcyLDIuMi00LjkyLDQuOTItNC45MmMyLjcyLDAsNC45MiwyLjIsNC45Miw0LjkyYzAsMS4xMy0wLjM4LDIuMTYtMS4wMSwyLjk5bDMuOTQsMy45MwoJYzAuMjUsMC4yNSwwLjI1LDAuNjYsMCwwLjkyYy0wLjI1LDAuMjUtMC42NiwwLjI1LTAuOTIsMEwxMS4yMywzMi43MnoiLz4KPC9zdmc+";function sat(){return b.createElement("div",{className:Lr(iat.icnSearch)})}var iat=Qn.create(Mn({icnSearch:{".":"epr-icn-search",content:"",position:"absolute",top:"50%",left:"var(--epr-search-bar-inner-padding)",transform:"translateY(-50%)",width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"0 0",backgroundSize:"20px",backgroundImage:"url("+aat+")"}},Ou("icnSearch",{backgroundPositionY:"-20px"})));function oat(){var e=tQ(),t=AA();return e?null:b.createElement(LQ,{className:Lr(hx.overlay)},b.createElement(lat,null),t?b.createElement(DQ,null):null)}function lat(){var e=Df(),t=qu(),r=Ztt(),n=trt(),a=_rt(),i=a.statusSearchResults,o=a.searchTerm,l=a.onChange,c=t==null?void 0:t.current,u=c==null?void 0:c.value;return b.createElement(cN,{className:Lr(hx.searchContainer)},b.createElement("input",{autoFocus:n,"aria-label":"Type to search for an emoji",onFocus:e,className:Lr(hx.search),type:"text","aria-controls":"epr-search-id",placeholder:r,onChange:function(f){var m,h;l((m=f==null||(h=f.target)==null?void 0:h.value)!=null?m:u)},ref:t}),o?b.createElement("div",{role:"status",className:Lr("epr-status-search-results",hx.visuallyHidden),"aria-live":"polite",id:"epr-search-id","aria-atomic":"true"},i):null,b.createElement(sat,null),b.createElement(rat,null))}var hx=Qn.create(Mn({overlay:{padding:"var(--epr-header-padding)",zIndex:"var(--epr-header-overlay-z-index)"},searchContainer:{".":"epr-search-container",flex:"1",display:"block",minWidth:"0"},visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"},search:{outline:"none",transition:"all 0.2s ease-in-out",color:"var(--epr-search-input-text-color)",borderRadius:"var(--epr-search-input-border-radius)",padding:"var(--epr-search-input-padding)",height:"var(--epr-search-input-height)",backgroundColor:"var(--epr-search-input-bg-color)",border:"1px solid var(--epr-search-border-color)",width:"100%",":focus":{backgroundColor:"var(--epr-search-input-bg-color-active)",border:"1px solid var(--epr-search-border-color-active)"},"::placeholder":{color:"var(--epr-search-input-placeholder-color)"}},btnClearSearch:{".":"epr-btn-clear-search",position:"absolute",right:"var(--epr-search-bar-inner-padding)",height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",top:"50%",transform:"translateY(-50%)",padding:"0",borderRadius:"50%",":hover":{background:"var(--epr-hover-bg-color)"},":focus":{background:"var(--epr-hover-bg-color)"}},icnClearnSearch:{".":"epr-icn-clear-search",backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundSize:"20px",height:"20px",width:"20px",backgroundImage:"url("+OQ+")",":hover":{backgroundPositionY:"-20px"},":focus":{backgroundPositionY:"-20px"}}},Ou("icnClearnSearch",{backgroundPositionY:"-40px"}),Ou("btnClearSearch",{":hover > .epr-icn-clear-search":{backgroundPositionY:"-60px"}})));function cat(){return b.createElement(cN,{className:Lr("epr-header",Tf.hiddenOnReactions)},b.createElement(oat,null),b.createElement(eat,null))}function uat(e){return b.createElement(prt,null,b.createElement(dtt,null),b.createElement(_tt,Object.assign({},e),b.createElement(Utt,null,b.createElement(dat,null))))}function dat(){var e=Pf(),t=e[0],r=KY(),n=b.useState(!t),a=n[0],i=n[1],o=art();return b.useEffect(function(){t&&!r||a||i(!0)},[a,r,t]),o?b.createElement(Zrt,null,b.createElement(vnt,null),b.createElement(fat,{renderAll:a})):null}function fat(e){var t=e.renderAll;return t?b.createElement(b.Fragment,null,b.createElement(cat,null),b.createElement(Ont,null),b.createElement(qnt,null)):null}var mat=b.memo(uat,AY),hat=function(e){ctt(t,e);function t(n){var a;return a=e.call(this,n)||this,a.state={hasError:!1},a}t.getDerivedStateFromError=function(){return{hasError:!0}};var r=t.prototype;return r.componentDidCatch=function(a,i){console.error("Emoji Picker React failed to render:",a,i)},r.render=function(){return this.state.hasError?null:this.props.children},t}(b.Component);function pat(e){var t=Jtt({onEmojiClick:e.onEmojiClick,onReactionClick:e.onReactionClick,onSkinToneChange:e.onSkinToneChange});return b.createElement(hat,null,b.createElement(YY.Provider,{value:t},b.createElement(mat,Object.assign({},e))))}const RQ=({content:e,onContentChange:t,media:r,onMediaChange:n,onClearMedia:a,existingMediaUrl:i,existingMediaType:o,status:l="draft",format:c,onFormatChange:u,brandId:d="",selectedPlatforms:f=[],aiResponse:m,onAiResponseChange:h})=>{const{t:p,i18n:g}=Te(),[y,v]=b.useState(e),[x,j]=b.useState(!1),[C,N]=b.useState(null),[S,M]=b.useState(!1),[k,I]=b.useState(!1),[T,L]=b.useState(""),R=b.useRef(null),_=b.useRef(null),B=b.useRef(y),z=b.useRef(C);b.useEffect(()=>{B.current=y},[y]),b.useEffect(()=>{z.current=C},[C]);const[D,A]=b.useState(!1),[P,E]=b.useState(!1),[F,$]=b.useState(null),[H,X]=b.useState(null),[ue,le]=b.useState(!1),ae=b.useRef(null),[te,ne]=b.useState(!1),[J,G]=b.useState(""),[Q,W]=b.useState(null),Y=pY(),{data:q}=oa(),Z=/\b(?:https?:\/\/)?(?:www\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}(?:[\/?#][^\s]*)?\b/ig,me=Ne=>{Z.lastIndex=0;const Ae=Z.exec(Ne);Ae&&Ae[0]?(j(!0),N(Ae[0])):(j(!1),N(null))};b.useEffect(()=>
3919{v(e),me(e)},[e]);const we=Ne=>{switch(Ne){case"draft":return{name:p("status.draft","Draft"),Icon:no,color:"gray",emoji:"📝"};case"scheduled":return{name:p("status.scheduled","Scheduled"),Icon:ql,color:"blue",emoji:"🗓️"};case"ready_to_publish":return{name:p("status.ready_to_publish","Ready to Publish"),Icon:ihe,color:"teal",emoji:"🚀"};case"waiting_for_approval":return{name:p("status.waiting_for_approval","Needs Approval"),Icon:xa,color:"orange",emoji:"👀"};case"published":return{name:p("status.published","Published"),Icon:Ba,color:"green",emoji:"✅"};case"rejected":return{name:p("status.rejected","Rejected"),Icon:_t,color:"red",emoji:"❌"};case"error":return{name:p("status.error","Error"),Icon:qs,color:"red",emoji:"⚠️"};case"pending":return{name:p("status.pending","Pending"),Icon:ql,color:"yellow",emoji:"🚧"};case"waiting":return{name:p("status.waiting","Waiting"),Icon:ql,color:"orange",emoji:"⏳"};default:return{name:Ne,Icon:qs,color:"gray",emoji:"❓"}}},{name:he,emoji:ie,color:ye}=we(l),pe=`bg-${ye}-100`,ce=`text-${ye}-700`,xe=!d||!y.trim()||f.length===0||S,Ee=!C||f.length===0||D,Ye=()=>S?"":d?y.trim()?f.length===0?p("tooltips.boostDisabled.selectPlatform","Select at least one platform to enable AI Boost"):"":p("tooltips.boostDisabled.addContent","Add content to enable AI Boost"):p("tooltips.boostDisabled.selectBrand","Select a brand to enable AI Boost"),fe=()=>{xe&&!S&&(L(Ye()),I(!0))},je=()=>{I(!1),L("")},We=async()=>{if(xe){console.warn("Boost with AI called while button should be disabled.");return}M(!0),h&&h(null);const Ne=Qe.currentUser;if(!Ne){alert(p("errors.authRequiredAi")),M(!1);return}const Ae=await Ne.getIdToken(),lt="https://api.socialness.ai/ai-coach/content/review",Mt={content:y,brandId:d,appLanguage:g.language||"en",platforms:f};console.log("Sending AI Boost request to:",lt),console.log("Payload:",Mt);try{const jt=await fetch(lt,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Ae}`},body:JSON.stringify(Mt)});if(console.log("Raw AI response status:",jt.status),!jt.ok){let ve="No error details available.";try{ve=await jt.text()}catch(nt){console.error("Could not parse error response body:",nt)}console.error("API Error Body:",ve);let Fe="";try{const nt=JSON.parse(ve);Fe=nt.detail||nt.message||""}catch{}throw new Error(`API request failed: ${jt.status}. ${Fe||ve}`)}const Xe=await jt.json();if(console.log("AI Response data:",Xe),!Xe||typeof Xe!="object")throw new Error("Invalid response data structure");const Bt={hookStrength:Xe.hookStrength||0,brandAlignment:Xe.brandAlignment||0,ctaEffectiveness:Xe.ctaEffectiveness||0,platformOptimization:Xe.platformOptimization||0,contentQuality:Xe.contentQuality||0,overallScore:Xe.overallScore||0,originalScore:Xe.originalScore||{hookStrength:0,brandAlignment:0,ctaEffectiveness:0,platformOptimization:0,contentQuality:0,overallScore:0},feedback:Xe.feedback||"",enhancedContent:Xe.enhancedContent||"",enhancedScores:Xe.enhancedScores||{hookStrength:0,brandAlignment:0,ctaEffectiveness:0,platformOptimization:0,contentQuality:0,overallScore:0},reasoning:Xe.reasoning||"",originalContent:Xe.originalContent||y,brandId:Xe.brandId||d,platforms:Xe.platforms||f,language:Xe.language||g.language||"en",timestamp:Xe.timestamp||new Date().toISOString()};console.log("Structured AI response:",Bt),h&&h(Bt)}catch(jt){console.error("Error boosting content with AI:",jt);const Xe=jt instanceof Error?jt.message:"Unknown error occurred";alert(`${p("errors.boostFailed")}: ${Xe}`)}finally{M(!1)}},yt=async()=>{if(Ee||!C){alert(p("errors.utmBoostNotReady","Cannot boost link. Ensure a URL is present and a platform is selected."));return}A(!0),$(null);const Ne=Qe.currentUser;if(!Ne){alert(p("errors.authRequiredAi","Authentication is required to boost links.")),A(!1);return}const Ae=await Ne.getIdToken(),lt="https://api.socialness.ai/ai-coach/utm/generate",Mt=f[0],Xe={postContent:y,platform:Mt,originalUrl:C,format:c==="reel"?"video":"image",language:g.language||"en"};console.log("Sending UTM Boost request to:",lt),console.log("UTM Payload:",Xe);try{const Bt=await fetch(lt,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Ae}`},body:JSON.stringify(Xe)});if(console.log("Raw UTM response status:",Bt.status),!Bt.ok){let Fe="No error details available.";try{Fe=await Bt.text()}catch(At){console.error("Could not parse UTM error response body:",At)}console.error("UTM API Error Body:",Fe);let nt="";try{const At=JSON.parse(Fe);nt=At.detail||At.message||""}catch{}throw new Error(`UTM API request failed: ${Bt.status}. ${nt||Fe}`)}const ve=await Bt.json();if(console.log("UTM Response data:",ve),!ve||typeof ve!="object"||!ve.final_url||!ve.utm_params)throw new Error("Invalid UTM response data structure");$(ve),X(ve),E(!0)}catch(Bt){console.error("Error boosting link with UTM:",Bt);const ve=Bt instanceof Error?Bt.message:"Unknown error occurred";alert(`${p("errors.utmBoostFailed","Failed to boost link")}: ${ve}`),E(!1),$(null)}finally{A(!1)}},gt=Ne=>{const Ae=y.replace(C,Ne);v(Ae),t(Ae),N(Ne),E(!1),$(null)},qe=Ne=>{G(Ne),E(!1),ne(!0)},ze=()=>{console.log("handleGoBackToUtm called"),console.log("utmApiResponse:",F),console.log("savedUtmResponse:",H),ne(!1),G(""),H?(console.log("Restoring UTM modal with saved data"),$(H),E(!0)):console.log("No saved UTM response data available")},$e=async Ne=>{try{const Ae=`https://go.socialness.ai/${Ne.shortCode}`,lt={oldURL:Ne.destinationUrl,newURL:Ae,brandId:Ne.brandId||""};await Y.mutateAsync(lt);const Mt=B.current,jt=z.current;if(jt&&Mt.includes(jt)){const Xe=Mt.replace(jt,Ae);v(Xe),t(Xe),N(Ae)}ne(!1),G(""),$(null),X(null),W(p("links.createSuccess","Short link created successfully!")),setTimeout(()=>W(null),3e3)}catch(Ae){console.error("Failed to create smart link:",Ae),alert(p("links.createError","Failed to create short link. Please try again."))}},ct=b.useCallback(Ne=>{const Ae=_.current;if(!Ae)return;const lt=Ae.selectionStart,Mt=Ae.selectionEnd;if(lt===Mt)return;const jt=y.substring(lt,Mt),Xe=Ne(jt),Bt=y.substring(0,lt)+Xe+y.substring(Mt);v(Bt),t(Bt),me(Bt),requestAnimationFrame(()=>{Ae.focus(),Ae.setSelectionRange(lt,lt+Xe.length)})},[y,t]),oe=b.useCallback(Ne=>{const Ae=_.current,lt=Ae?Ae.selectionStart:y.length,Mt=y.substring(0,lt)+Ne.emoji+y.substring(lt);v(Mt),t(Mt),le(!1);const jt=lt+Ne.emoji.length;requestAnimationFrame(()=>{Ae==null||Ae.focus(),Ae==null||Ae.setSelectionRange(jt,jt)})},[y,t]);return b.useEffect(()=>{if(!ue)return;const Ne=Ae=>{ae.current&&!ae.current.contains(Ae.target)&&le(!1)};return document.addEventListener("mousedown",Ne),()=>document.removeEventListener("mousedown",Ne)},[ue]),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:p("postContent.title","Post Content")}),s.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${pe} ${ce}`,children:[s.jsx("span",{role:"img","aria-label":he,children:ie}),he]})]}),s.jsxs("div",{className:"relative flex items-center gap-2",children:[x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-sm text-green-600 font-bold",children:p("postContent.urlDetected","URL Detected")}),s.jsx("span",{children:"👉🏽"}),s.jsx("button",{onClick:yt,disabled:Ee,className:`inline-flex items-center px-3 py-1.5 text-sm font-semibold rounded-lg border focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed ${D?"bg-gray-100 text-gray-400 border-gray-300":"text-primary-600 bg-white border-primary-600 hover:bg-primary-50"}`,children:D?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-1.5 border-2 border-t-transparent border-primary-600 rounded-full animate-spin"}),p("common.trackingLink","Tracking Link...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Eu,{className:"w-4 h-4 mr-1.5"}),p("actions.trackYourLink","Track your link")]})})]}),s.jsxs("div",{className:"relative",children:[s.jsx("button",{ref:R,onClick:We,disabled:xe,onMouseOver:fe,onMouseOut:je,onFocus:fe,onBlur:je,className:`inline-flex items-center px-3 py-1.5 text-sm font-semibold text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${xe?"bg-gray-400 hover:bg-gray-400":"bg-primary-600 hover:bg-primary-700"}`,children:S?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-1.5 border-2 border-t-transparent border-white rounded-full animate-spin"}),s.jsx("span",{className:"text-sm font-semibold",children:p("common.boosting","Boosting...")})]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-1.5"}),s.jsx("span",{className:"text-sm font-semibold",children:p("actions.boostWithAi","Boost with AI")})]})}),k&&xe&&!S&&s.jsxs("div",{role:"tooltip",className:"absolute top-full left-1/2 transform -translate-x-1/2 mt-2 w-max max-w-xs px-3 py-1.5 bg-gray-900 text-white text-xs rounded-md shadow-lg z-10 whitespace-nowrap",children:[s.jsx(uh,{className:"inline w-3 h-3 mr-1"})," ",T]})]})]})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx("div",{className:"flex justify-between items-center mb-1",children:s.jsx("label",{htmlFor:"caption",className:"block text-sm font-medium text-gray-700",children:p("postContent.caption","Caption")})}),Q&&s.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded-lg bg-green-50 border border-green-200 px-3 py-2 text-sm text-green-700",children:[s.jsx(Ba,{className:"w-4 h-4 flex-shrink-0"}),Q]}),s.jsxs("div",{className:"flex items-center gap-1 p-1.5 border border-gray-200 border-b-0 rounded-t-lg bg-gray-50",children:[s.jsx("button",{type:"button",onClick:()=>ct(Qet),title:p("postContent.boldTooltip","Bold"),className:"inline-flex items-center justify-center w-8 h-8 rounded-md text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500",children:s.jsx(Ume,{className:"w-4 h-4",strokeWidth:2.5})}),s.jsx("button",{type:"button",onClick:()=>ct(Ket),title:p("postContent.italicTooltip","Italic"),className:"inline-flex items-center justify-center w-8 h-8 rounded-md text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500",children:s.jsx(Hme,{className:"w-4 h-4",strokeWidth:2.5})}),s.jsx("button",{type:"button",onClick:()=>ct(Jet),title:p("postContent.underlineTooltip","Underline"),className:"inline-flex items-center justify-center w-8 h-8 rounded-md text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500",children:s.jsx(lhe,{className:"w-4 h-4",strokeWidth:2.5})}),s.jsx("div",{className:"w-px h-5 bg-gray-300 mx-0.5"}),s.jsxs("div",{className:"relative",ref:ae,children:[s.jsx("button",{type:"button",onClick:()=>le(!ue),title:p("postContent.emojiTooltip","Emoji"),className:"inline-flex items-center justify-center w-8 h-8 rounded-md text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500",children:s.jsx(R7,{className:"w-4 h-4",strokeWidth:2})}),ue&&s.jsx("div",{className:"absolute top-full left-0 z-50 mt-1 shadow-xl rounded-lg",children:s.jsx(pat,{onEmojiClick:oe,theme:Bh.LIGHT,width:350,height:400,searchPlaceHolder:p("postContent.emojiSearch","Search emoji..."),previewConfig:{showPreview:!1}})})]})]}),s.jsx("textarea",{ref:_,id:"caption",value:y,onChange:Ne=>{const Ae=Ne.target.value;v(Ae),t(Ae),me(Ae)}
3919,placeholder:p("postContent.placeholder","Write your post content here..."),className:"w-full h-96 p-3 border border-gray-300 rounded-t-none rounded-b-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent resize-vertical min-h-[24rem]"})]})}),P&&F&&s.jsx(EQe,{isOpen:P,onClose:()=>{E(!1),$(null)},onUpdateLink:gt,onCreateShortLink:qe,utmResponse:F}),te&&s.jsx(Ret,{isOpen:te,onClose:()=>{ne(!1),G("")},onGoBack:ze,onSubmit:$e,brands:(q==null?void 0:q.brands)||[],isCreating:Y.isPending,initialLinkData:null,isEditMode:!1,prefilledUrl:J,defaultBrandId:d})]})},gat=({aiResponse:e,copied:t,onCopyContent:r,onApplyAiContent:n})=>{const{t:a}=Te(),i=o=>{const l=o.split(`
3920`),c=[];return l.forEach((u,d)=>{if(u.trim()!=="")if(u.trim().startsWith("* **")){const f=u.match(/^\* \*\*(.*?)\*\*:\s*(.*)/);if(f){const[,m,h]=f;c.push(s.jsx("div",{className:"mt-3 first:mt-0",children:s.jsxs("p",{className:"text-sm text-gray-700",children:[s.jsxs("span",{className:"font-bold text-gray-900",children:["• ",m,":"]})," ",h]})},d))}else c.push(s.jsx("p",{className:"text-sm text-gray-700 mt-3 first:mt-0",children:u},d))}else{const m=u.split(/(\*\*.*?\*\*)/).map((h,p)=>{if(h.startsWith("**")&&h.endsWith("**")){const g=h.slice(2,-2);return s.jsx("span",{className:"font-bold text-gray-900",children:g},p)}return h});c.push(s.jsx("p",{className:"text-sm text-gray-700 mt-3 first:mt-0",children:m},d))}}),c};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx(Hn,{className:"w-6 h-6 text-purple-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:a("aiAnalysis.title","AI Post Analysis")})]}),s.jsxs("div",{className:"border border-green-200 rounded-lg bg-green-50 overflow-hidden",children:[s.jsx("div",{className:"bg-green-100 px-4 py-2 border-b border-green-200",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-medium text-green-800",children:a("postContent.aiEnhancedContent","AI Enhanced Content")}),e&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:r,className:"inline-flex items-center p-1 text-gray-600 hover:text-green-700 rounded",title:"Copy to clipboard",children:t?s.jsx(Ba,{className:"w-4 h-4 text-green-600"}):s.jsx(Iu,{className:"w-4 h-4"})}),s.jsx("button",{onClick:n,className:"inline-flex items-center px-2 py-1 text-xs text-white bg-primary-600 rounded hover:bg-primary-700",children:a("cards.aiContent.apply","Apply")})]})]})}),s.jsx("div",{className:"p-4",children:e?s.jsx("p",{className:"text-sm text-gray-800",children:e.enhancedContent}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-center",children:[s.jsx(Hn,{className:"w-6 h-6 text-green-400 mb-2"}),s.jsx("p",{className:"text-sm font-medium text-gray-600",children:a("postContent.useBoostPrompt",'Use "Boost with AI" to enhance your content')}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:a("postContent.optimizationDescription","Our AI will optimize your caption for better engagement")})]})})]}),s.jsxs("div",{className:"border border-purple-200 rounded-lg bg-purple-50 overflow-hidden",children:[s.jsx("div",{className:"bg-purple-100 px-4 py-2 border-b border-purple-200",children:s.jsx("h3",{className:"text-sm font-medium text-purple-800",children:a("postContent.aiFeedback","AI Feedback")})}),s.jsx("div",{className:"p-4",children:e?s.jsx("div",{className:"space-y-3",children:i(e.feedback)}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-center",children:[s.jsx(Hn,{className:"w-6 h-6 text-purple-400 mb-2"}),s.jsx("p",{className:"text-sm font-medium text-gray-600",children:a("postContent.feedbackWillAppearHere","AI feedback will appear here")}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:a("postContent.professionalInsights","Get professional insights on how to improve your content")})]})})]}),e&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"border border-orange-200 rounded-lg bg-orange-50 overflow-hidden",children:[s.jsx("div",{className:"bg-orange-100 px-4 py-2 border-b border-orange-200",children:s.jsx("h3",{className:"text-sm font-medium text-orange-800",children:a("cards.aiContent.originalScore","Original Score")})}),s.jsx("div",{className:"p-4 flex items-center justify-center",children:s.jsxs("span",{className:"text-3xl font-bold text-orange-600",children:[e.originalScore.overallScore.toFixed(1),"/10"]})})]}),s.jsxs("div",{className:"border border-green-200 rounded-lg bg-green-50 overflow-hidden",children:[s.jsx("div",{className:"bg-green-100 px-4 py-2 border-b border-green-200",children:s.jsx("h3",{className:"text-sm font-medium text-green-800",children:a("cards.aiContent.enhancedScore","Enhanced Score")})}),s.jsx("div",{className:"p-4 flex items-center justify-center",children:s.jsxs("span",{className:"text-3xl font-bold text-green-600",children:[e.enhancedScores.overallScore.toFixed(1),"/10"]})})]})]}),s.jsxs("div",{className:"border border-gray-200 rounded-lg bg-gray-50 overflow-hidden",children:[s.jsx("div",{className:"bg-gray-100 px-4 py-2 border-b border-gray-200",children:s.jsx("h3",{className:"text-sm font-medium text-gray-800",children:a("cards.aiContent.detailedScores","Detailed Analysis")})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-700",children:a("cards.aiContent.hookStrength","Hook Strength")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium text-orange-600",children:[e.originalScore.hookStrength,"/10"]}),s.jsx("span",{className:"text-gray-400",children:"→"}),s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[e.enhancedScores.hookStrength,"/10"]})]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-700",children:a("cards.aiContent.brandAlignment","Brand Alignment")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium text-orange-600",children:[e.originalScore.brandAlignment,"/10"]}),s.jsx("span",{className:"text-gray-400",children:"→"}),s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[e.enhancedScores.brandAlignment,"/10"]})]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-700",children:a("cards.aiContent.ctaEffectiveness","CTA Effectiveness")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium text-orange-600",children:[e.originalScore.ctaEffectiveness,"/10"]}),s.jsx("span",{className:"text-gray-400",children:"→"}),s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[e.enhancedScores.ctaEffectiveness,"/10"]})]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-700",children:a("cards.aiContent.platformOptimization","Platform Optimization")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium text-orange-600",children:[e.originalScore.platformOptimization,"/10"]}),s.jsx("span",{className:"text-gray-400",children:"→"}),s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[e.enhancedScores.platformOptimization,"/10"]})]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-700",children:a("cards.aiContent.contentQuality","Content Quality")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-medium text-orange-600",children:[e.originalScore.contentQuality,"/10"]}),s.jsx("span",{className:"text-gray-400",children:"→"}),s.jsxs("span",{className:"text-sm font-medium text-green-600",children:[e.enhancedScores.contentQuality,"/10"]})]})]})]})]})]})]})},$Q=({content:e,platforms:t=[],selectedPlatforms:r=[],media:n=null,multiImages:a=[],existingMediaUrls:i=[],mediaUrl:o=null,mediaType:l=null,existingMediaUrl:c,existingMediaType:u,format:d="regular",selectedBrand:f,brandName:m,brandLogo:h,brands:p=[],hideEngagementCounts:g=!1})=>{var P;const{t:y}=Te(),v=p.find(E=>E.id===f),[x,j]=b.useState(null),[C,N]=b.useState([]),[S,M]=b.useState(null),[k,I]=b.useState(null),[T,L]=b.useState(!1);b.useEffect(()=>{if(n){const E=URL.createObjectURL(n);if(j(E),n.type.startsWith("image/")){const F=new Image;F.onload=()=>{j($=>$===E?E+"?loaded":E)},F.onerror=()=>{j(E)},F.src=E}return()=>{URL.revokeObjectURL(E)}}else j(null)},[n]),b.useEffect(()=>{if(a&&a.length>0){const E=a.map(F=>URL.createObjectURL(F));return N(E),()=>
3920{E.forEach(F=>URL.revokeObjectURL(F))}}N([])},[a]);const R=n?{type:n.type.startsWith("image/")?"image":"video",url:x||"",uploadedAt:new Date().toISOString()}:o||c?{type:l||u||"image",url:o||c||"",uploadedAt:new Date().toISOString()}:void 0,_=!!(n&&(n.type==="application/pdf"||(P=n.name)!=null&&P.toLowerCase().endsWith(".pdf"))),B=o||c||"",z=!!(!_&&typeof B=="string"&&B.toLowerCase().includes(".pdf"));b.useEffect(()=>{let E=!1;async function F(){const H=window;if(H.pdfjsLib)return H.pdfjsLib;await new Promise((ue,le)=>{const ae=document.createElement("script");ae.src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js",ae.async=!0,ae.onload=()=>ue(),ae.onerror=()=>le(new Error("pdfjs load failed")),document.head.appendChild(ae)});const X=window.pdfjsLib;return X&&(X.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.min.js"),X}async function $(){try{if(!_&&!z){I(null);return}L(!0);const H=await F();let X;if(_&&n){const he=await n.arrayBuffer();X=H.getDocument({data:he})}else if(z){const he=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?`/api/pdf-proxy?url=${encodeURIComponent(B)}`:B,ye=await(await fetch(he)).arrayBuffer();X=H.getDocument({data:ye})}else return;const le=await(await X.promise).getPage(1),ae=le.getViewport({scale:1}),te=1080,ne=1350,J=Math.min(te/ae.width,ne/ae.height),G=le.getViewport({scale:J}),Q=document.createElement("canvas"),W=Q.getContext("2d");if(!W)return;Q.width=Math.floor(G.width),Q.height=Math.floor(G.height),await le.render({canvasContext:W,viewport:G}).promise;const Y=document.createElement("canvas"),q=Y.getContext("2d");if(!q)return;Y.width=te,Y.height=ne,q.fillStyle="#ffffff",q.fillRect(0,0,te,ne);const Z=Math.floor((te-Q.width)/2),me=Math.floor((ne-Q.height)/2);q.drawImage(Q,Z,me);const we=Y.toDataURL("image/png");E||I(we)}catch{E||I(null)}finally{E||L(!1)}}return $(),()=>{E=!0}},[n,o,c,_,z]);const D=(_||z)&&k?{type:"image",url:`${k}#pdfthumb`,uploadedAt:new Date().toISOString()}:R,A=t.length>0?t:r;return b.useEffect(()=>{A.length>0?(!S||!A.includes(S))&&M(A[0]):M(null)},[A,S]),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(xa,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:y("cards.preview.title","Preview")})]}),A.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex space-x-1 mb-4 border-b border-gray-200 overflow-x-auto",children:A.map(E=>s.jsx("button",{onClick:()=>M(E),className:`py-2 px-3 flex items-center gap-2 whitespace-nowrap ${S===E?"border-b-2 border-primary-600 text-primary-600 font-medium":"text-gray-500 hover:text-gray-700 hover:border-b-2 hover:border-gray-300"}`,"aria-pressed":S===E,children:s.jsx(cr,{platform:E,size:18})},E))}),S?s.jsx("div",{className:"rounded-lg p-0",children:(_||z)&&!k?s.jsx("div",{className:"flex items-center justify-center h-[360px]",children:s.jsx(tA,{message:y("common.loading","Loading...")})}):s.jsx(sY,{platform:S,content:e,media:D,mediaUrl:x||(C.length===1?C[0]:void 0)||(i&&i.length===1?i[0]:void 0),mediaUrls:C.length>0?C:i&&i.length>0?i:void 0,brand:v,brandName:m||(v==null?void 0:v.name),brandLogo:h||(v==null?void 0:v.logo),format:d,hideEngagementCounts:g})}):s.jsx("div",{className:"text-center py-8 text-gray-500",children:y("cards.preview.selectPlatformPrompt","Select a platform to see the preview")})]}):s.jsx("div",{className:"text-center py-8 text-gray-500",children:y("cards.preview.selectPlatformPrompt","Select a platform to see the preview")})]})},yat={warning:{icon:qs,bgClass:"bg-yellow-50",borderClass:"border-yellow-200",textClass:"text-yellow-800",iconClass:"text-yellow-600"},error:{icon:bs,bgClass:"bg-red-50",borderClass:"border-red-200",textClass:"text-red-800",iconClass:"text-red-600"},info:{icon:uh,bgClass:"bg-blue-50",borderClass:"border-blue-200",textClass:"text-blue-800",iconClass:"text-blue-600"},success:{icon:Ba,bgClass:"bg-green-50",borderClass:"border-green-200",textClass:"text-green-800",iconClass:"text-green-600"}},e0=({message:e,type:t,size:r="md",className:n=""})=>{const{t:a}
3920=Te(),i=yat[t];if(!e)return null;const o=i.icon,l=a(e,{defaultValue:e});let c="p-4",u="w-5 h-5",d="gap-3";return r==="sm"?(c="p-2",u="w-4 h-4",d="gap-2"):r==="xs"&&(c="px-2 py-1",u="w-4 h-4",d="gap-1.5"),s.jsxs("div",{className:`rounded-lg border flex items-start ${c} ${d} ${i.bgClass} ${i.borderClass} ${n}`,role:"alert",children:[s.jsx("div",{className:`flex-shrink-0 mt-0.5 ${i.iconClass}`,children:s.jsx(o,{className:u,"aria-hidden":"true"})}),s.jsx("div",{className:`${i.textClass}`,children:l})]})},FQ=({title:e="",allowComments:t=!1,allowDuets:r=!1,allowStitch:n=!1,discloseContent:a=!1,privacy:i="",disclosureType:o=[],tiktokUsername:l="",tiktokProfileImage:c="",userAgreedToTerms:u=!1,onTitleChange:d,onAllowCommentsChange:f,onAllowDuetsChange:m,onAllowStitchChange:h,onPrivacyChange:p,onDiscloseContentChange:g,onUserAgreedToTermsChange:y,onValidationChange:v})=>{const{t:x,i18n:j}=Te(),[C,N]=U.useState(!1),[S,M]=U.useState(i),k=U.useRef(null),I=b.useRef({isValid:!1,triggered:!1});U.useEffect(()=>{console.log("🔍 TikTokComplianceCard - Privacy prop changed:",{newPrivacy:i,currentSelectedPrivacy:S}),i!==S&&M(i)},[i]),U.useEffect(()=>{function E(F){k.current&&!k.current.contains(F.target)&&N(!1)}return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[]),U.useEffect(()=>{console.log("🔍 TikTokComplianceCard - Component state:",{privacyProp:i,selectedPrivacyState:S,isDropdownOpen:C})},[i,S,C]);const T=()=>x(S?`tiktok.privacy.${S.toLowerCase()}.label`:"tiktok.privacy.select"),L=()=>x(S?`tiktok.privacy.${S.toLowerCase()}.description`:"tiktok.privacy.selectDescription"),R=()=>S?S==="PUBLIC_TO_EVERYONE"?s.jsx(xa,{className:"w-5 h-5 text-gray-400 mr-3"}):S==="MUTUAL_FOLLOW_FRIENDS"?s.jsx(Jr,{className:"w-5 h-5 text-gray-400 mr-3"}):S==="FOLLOWER_OF_CREATOR"?s.jsx(kk,{className:"w-5 h-5 text-gray-400 mr-3"}):s.jsx(ch,{className:"w-5 h-5 text-gray-400 mr-3"}):null,_=E=>{if(console.log("🔍 Handling privacy change:",{from:S,to:E}),E==="PUBLIC_TO_EVERYONE"||E==="MUTUAL_FOLLOW_FRIENDS"||E==="FOLLOWER_OF_CREATOR"||E==="SELF_ONLY"){const F=E;M(F),p==null||p(F)}N(!1)},B=()=>{const E=!o.includes("branded");E&&S!=="PUBLIC_TO_EVERYONE"&&_("PUBLIC_TO_EVERYONE");const F=E?[...o,"branded"]:o.filter($=>$!=="branded");g==null||g(!0,F.join(","))},z=a&&o.length===0;U.useEffect(()=>{const E=!a||a&&o.length>0,F=u,$=!!S,H=E&&F&&$;(!I.current.triggered||I.current.isValid!==H)&&(I.current={isValid:H,triggered:!0},v==null||v(H),console.log("🔍 TikTokComplianceCard - Validation state changed:",{isBrandDisclosureValid:E,isAgreedToTermsValid:F,isPrivacyValid:$,overall:H,discloseContent:a,disclosureTypeCount:o.length}))},[a,o,u,S,v]);const D=()=>(o.includes("brand"),o.includes("branded")?"tiktok.compliance.agreement.musicAndBranded":"tiktok.compliance.agreement.musicOnly"),A=s.jsx("a",{href:`https://www.tiktok.com/legal/page/global/music-usage-confirmation/${j.language}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700"}),P=s.jsx("a",{href:`https://www.tiktok.com/legal/page/global/bc-policy/${j.language}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700"});return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-6",children:x("tiktok.compliance.title")}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:x("tiktok.compliance.publishOn","This content will be published on")}),s.jsx("div",{className:"p-3 bg-primary-50 rounded-lg border border-primary-500",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Du,{pictureUrl:c,username:l||"tiktokaccount",platform:"tiktok",size:"md"}),s.jsxs("div",{children:[s.jsxs("p",{className:"font-medium text-gray-900",children:["@",l||"tiktokaccount"]}),s.jsx("p",{className:"text-xs text-gray-500",children:"TikTok"})]})]})})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex items-start",children:[s.jsx("input",{type:"checkbox",id:"tiktok-terms-agreement",checked:u,onChange:()=>
3920y==null?void 0:y(!u),className:"h-4 w-4 rounded text-primary-600 border-gray-300 focus:ring-primary-500 mt-1",required:!0}),s.jsx("label",{htmlFor:"tiktok-terms-agreement",className:"ml-3 mb-3",children:s.jsx("span",{className:"block text-sm font-medium text-gray-900",children:s.jsx(k0,{i18nKey:D(),components:[P,A]})})})]}),!u&&s.jsx(e0,{type:"warning",message:"tiktok.compliance.termsAgreementWarning",size:"sm",className:"mt-2 text-xs"})]}),s.jsx("div",{className:"border-t border-gray-200 mb-6"}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{htmlFor:"tiktokTitle",className:"block text-sm font-medium text-gray-700 mb-1",children:x("tiktok.compliance.videoTitle","Title")}),s.jsx("input",{type:"text",id:"tiktokTitle",value:e,onChange:E=>d==null?void 0:d(E.target.value),placeholder:x("tiktok.compliance.videoTitlePlaceholder","Enter title (leave empty to use post content)"),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{className:"mb-6 space-y-2",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:x("tiktok.compliance.privacyQuestion")}),s.jsxs("div",{className:"mt-1 relative",ref:k,children:[s.jsxs("button",{type:"button",onClick:()=>N(!C),className:`w-full flex items-center justify-between p-3 rounded-lg border ${S?"border-gray-200 bg-white":"border-gray-300 bg-white text-black"} hover:bg-gray-50 transition-colors`,children:[s.jsxs("div",{className:"flex items-center",children:[R(),s.jsxs("div",{className:"text-left",children:[s.jsx("p",{className:`font-medium ${S?"text-gray-900":"text-black"}`,children:T()}),s.jsx("p",{className:"text-sm text-gray-500",children:L()})]})]}),s.jsx(Vr,{className:`w-5 h-5 text-gray-400 transition-transform ${C?"rotate-180":""}`})]}),!S&&s.jsx("div",{className:"mt-2 text-sm text-gray-600 flex items-center gap-1",children:s.jsx("span",{children:"Please select a privacy option for TikTok"})}),C&&s.jsx("div",{className:"absolute z-50 w-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200",children:["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"].map(E=>{const F=E==="SELF_ONLY"&&o.includes("branded");return s.jsxs("button",{type:"button",onClick:()=>!F&&_(E),className:`w-full flex items-start p-3 hover:bg-primary-50 transition-colors text-left 
3921                      ${S===E?"bg-primary-50":""} 
3922                      ${F?"opacity-50 cursor-not-allowed":""}`,disabled:F,children:[E==="PUBLIC_TO_EVERYONE"?s.jsx(xa,{className:"w-5 h-5 text-gray-400 mr-3"}):E==="MUTUAL_FOLLOW_FRIENDS"?s.jsx(Jr,{className:"w-5 h-5 text-gray-400 mr-3"}):E==="FOLLOWER_OF_CREATOR"?s.jsx(kk,{className:"w-5 h-5 text-gray-400 mr-3"}):s.jsx(ch,{className:"w-5 h-5 text-gray-400 mr-3"}),s.jsxs("div",{className:"flex-grow",children:[s.jsx("p",{className:`font-medium text-gray-900 ${F?"text-gray-400":""}`,children:x(`tiktok.privacy.${E.toLowerCase()}.label`)}),s.jsx("p",{className:`text-sm ${F?"text-gray-400":"text-gray-500"}`,children:x(`tiktok.privacy.${E.toLowerCase()}.description`)}),E==="SELF_ONLY"&&s.jsx(e0,{type:"warning",message:"tiktok.compliance.brandedContentPrivateWarning",size:"xs",className:"text-xs mt-1.5"})]})]},E)})})]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-4",children:x("tiktok.compliance.allowUsersTo")}),s.jsxs("div",{className:"flex items-center space-x-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm text-gray-700",children:x("tiktok.compliance.comment")}),s.jsx("button",{type:"button",onClick:()=>f==null?void 0:f(!t),className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${t?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${t?"translate-x-4":"translate-x-0"}`})})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm text-gray-700",children:x("tiktok.compliance.duet")}),s.jsx("button",{type:"button",onClick:()=>m==null?void 0:m(!r),className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${r?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${r?"translate-x-4":"translate-x-0"}`})})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm text-gray-700",children:x("tiktok.compliance.stitch")}),s.jsx("button",{type:"button",onClick:()=>h==null?void 0:h(!n),className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${n?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${n?"translate-x-4":"translate-x-0"}`})})]})]})]}),s.jsx("div",{className:"pt-4",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:x("tiktok.compliance.discloseTitle")}),s.jsx("button",{type:"button",onClick:()=>{a?g==null||g(!1,""):g==null||g(!0,o.join(","))},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${a?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${a?"translate-x-5":"translate-x-0"}`})})]}),s.jsx("p",{className:"text-sm text-gray-500",children:x("tiktok.compliance.discloseDescription")}),a&&s.jsxs("div",{className:"mt-4 space-y-4",children:[z&&s.jsx(e0,{type:"warning",message:"tiktok.compliance.disclosureNoOptionsWarning",size:"sm",className:"text-xs"}),o.length>0&&s.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg flex items-start space-x-3",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"w-5 h-5 text-blue-400",children:s.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})})}),s.jsx("p",{className:"text-sm text-blue-700",children:o.includes("branded")?'Your video will be labeled "Paid Partnership". This cannot be changed once your video is posted.':o.includes("brand")?x("tiktok.compliance.infoBoxText"):null})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-start",children:s.jsxs("div",{className:"flex items-start cursor-pointer",onClick:()=>{const E=o.includes("brand")?o.filter(F=>F!=="brand"):[...o,"brand"];g==null||g(!0,E.join(","))},children:[s.jsx("input",{type:"checkbox",id:"brand",checked:o.includes("brand"),onChange:()=>{}
3922,className:"h-4 w-4 rounded text-primary-600 border-gray-300 focus:ring-primary-500 mt-1 cursor-pointer"}),s.jsxs("label",{htmlFor:"brand",className:"ml-3 cursor-pointer",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-900",children:x("tiktok.compliance.yourBrand")}),s.jsx("span",{className:"block text-sm text-gray-500",children:x("tiktok.compliance.yourBrandDescription")})]})]})}),s.jsx("div",{className:"flex items-start relative group",children:s.jsxs("div",{className:`flex items-start ${S==="SELF_ONLY"?"cursor-not-allowed opacity-50":"cursor-pointer"}`,onClick:()=>{S!=="SELF_ONLY"&&B()},children:[s.jsx("input",{type:"checkbox",id:"branded",checked:o.includes("branded"),disabled:S==="SELF_ONLY",onChange:()=>{},className:`h-4 w-4 rounded text-primary-600 border-gray-300 focus:ring-primary-500 mt-1 ${S==="SELF_ONLY"?"cursor-not-allowed":"cursor-pointer"}`}),s.jsxs("label",{htmlFor:"branded",className:"ml-3 cursor-pointer",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-900",children:x("tiktok.compliance.brandedContent")}),s.jsx("span",{className:"block text-sm text-gray-500",children:x("tiktok.compliance.brandedContentDescription")})]})]})})]})]})]})})})]})]})},zQ=({title:e,tags:t,privacy:r,onTitleChange:n,onTagsChange:a,onPrivacyChange:i})=>{const{t:o}=Te(),[l,c]=U.useState(""),u=()=>{l.trim()&&(a([...t,l.trim()]),c(""))},d=m=>{const h=[...t];h.splice(m,1),a(h)},f=m=>{m.key==="Enter"&&(m.preventDefault(),u())};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(F7,{className:"w-5 h-5 text-red-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"YouTube Settings"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"youtubeTitle",className:"block text-sm font-medium text-gray-700 mb-1",children:"Video Title"}),s.jsx("input",{type:"text",id:"youtubeTitle",value:e,onChange:m=>n(m.target.value),placeholder:"Enter video title (leave empty to use post content)",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"youtubeTags",className:"block text-sm font-medium text-gray-700 mb-1",children:"Tags"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",id:"youtubeTags",value:l,onChange:m=>c(m.target.value),onKeyDown:f,placeholder:"Add tags",className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),s.jsx("button",{onClick:u,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:"Add"})]}),t.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:t.map((m,h)=>s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-primary-100 rounded-full",children:[s.jsx($7,{className:"w-3 h-3 text-primary-700"}),s.jsx("span",{className:"text-sm text-primary-700",children:m}),s.jsx("button",{onClick:()=>d(h),className:"w-4 h-4 flex items-center justify-center text-gray-500 hover:text-gray-700",children:"×"})]},h))})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"youtubePrivacy",className:"block text-sm font-medium text-gray-700 mb-1",children:"Privacy"}),s.jsxs("select",{id:"youtubePrivacy",value:r,onChange:m=>i(m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[s.jsx("option",{value:"public",children:"Public"}),s.jsx("option",{value:"unlisted",children:"Unlisted"}),s.jsx("option",{value:"private",children:"Private"})]}),s.jsxs("div",{className:"mt-2 flex items-center gap-2 text-sm text-gray-500",children:[s.jsx(xa,{className:"w-4 h-4"}),s.jsx("span",{children:r==="public"?"Anyone can search for and view":r==="unlisted"?"Only people with the link can view":"Only you can view"})]})]})]})]})},BQ=({organizationId:e,visibility:t,selectedBrandId:r,onOrganizationIdChange:n,onVisibilityChange:a})=>{var u,d;const{t:i}=Te(),{data:o}=oa(),l=(u=o==null?void 0:o.brands)==null?void 0:u.find(f=>f.id===r),c=((d=l==null?void 0:l.social_accounts)==null?void 0:d.filter(f=>f.platform.toLowerCase()==="linkedin"))||[];return b.useEffect(()=>{c.length>0&&!e&&n(c[0].pageId)},[c,e,n]),s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(Kme,{className:"w-5 h-5 text-[#0A66C2]"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:i("linkedin.settings.title","LinkedIn Settings")})]}),s.jsxs("div",{className:"space-y-4",children:[c.length>0&&s.jsxs("div",{children:[s.jsx("label",{htmlFor:"linkedinAccount",className:"block text-sm font-medium text-gray-700 mb-1",children:i("linkedin.settings.companyPage","LinkedIn Company Page")}
3922),s.jsx("select",{id:"linkedinAccount",value:e,onChange:f=>n(f.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:c.map(f=>s.jsx("option",{value:f.pageId,children:f.username||i("linkedin.settings.companyPageName","Company Page ({{pageId}})",{pageId:f.pageId})},f.accountId))}),s.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-gray-500",children:[s.jsx(Vme,{className:"w-3 h-3"}),s.jsx("span",{children:i("linkedin.settings.publishingAsCompany","Publishing as company page")})]})]}),c.length===0&&s.jsx("div",{className:"bg-yellow-50 border border-yellow-100 rounded-lg p-4",children:s.jsx("p",{className:"text-sm text-yellow-800",children:i("linkedin.settings.noPages","No LinkedIn company pages are connected to this brand. Please connect a LinkedIn account in the Accounts section.")})}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"visibility",className:"block text-sm font-medium text-gray-700 mb-1",children:i("linkedin.settings.visibility","Post Visibility")}),s.jsxs("select",{id:"visibility",value:t,onChange:f=>a(f.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[s.jsx("option",{value:"PUBLIC",children:i("linkedin.settings.visibilityPublic","Public")}),s.jsx("option",{value:"CONNECTIONS",children:i("linkedin.settings.visibilityConnections","Connections only")})]})]})]})]})},UQ=({title:e,link:t,selectedBoardId:r,allowComments:n=!0,availableBoards:a=[],onTitleChange:i,onLinkChange:o,onBoardChange:l,onAllowCommentsChange:c,onRefreshBoards:u})=>{const{t:d}=Te(),[f,m]=U.useState(!1),[h,p]=U.useState(!1),g=a.find(x=>x.id===r),y=x=>{l(x),m(!1)},v=async()=>{if(u){p(!0);try{await u()}catch(x){console.error("Error refreshing Pinterest boards:",x)}finally{p(!1)}}};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(WN,{className:"w-5 h-5 text-red-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:d("pinterest.settings.title","Pinterest Settings")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"pinterestTitle",className:"block text-sm font-medium text-gray-700 mb-1",children:d("pinterest.settings.pinTitle","Pin Title")}),s.jsx("input",{type:"text",id:"pinterestTitle",value:e,onChange:x=>i(x.target.value),placeholder:d("pinterest.settings.pinTitlePlaceholder","Enter pin title (leave empty to use post content)"),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"pinterestLink",className:"block text-sm font-medium text-gray-700 mb-1",children:d("pinterest.settings.link","Link")}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:s.jsx(Ti,{className:"h-4 w-4 text-gray-400"})}),s.jsx("input",{type:"url",id:"pinterestLink",value:t,onChange:x=>o(x.target.value),placeholder:d("pinterest.settings.linkPlaceholder","https://your-website.com"),className:"w-full pl-10 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsx("p",{className:"mt-1 text-xs text-gray-500",children:d("pinterest.settings.linkDescription","Link where users will be directed when they click your pin")})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"pinterestBoard",className:"block text-sm font-medium text-gray-700 mb-1",children:d("pinterest.settings.board","Board")}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>m(!f),className:"w-full flex items-center justify-between p-3 border border-gray-300 rounded-lg bg-white hover:bg-gray-50 transition-colors",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(WN,{className:"w-4 h-4 text-red-600 mr-2"}),s.jsxs("div",{className:"text-left",children:[s.jsx("p",{className:`font-medium ${g?"text-gray-900":"text-gray-500"}`,children:g?g.name:d("pinterest.settings.selectBoard","Select a board")}),(g==null?void 0:g.description)&&s.jsx("p",{className:"text-sm text-gray-500",children:g.description})]})]}),s.jsx(Vr,{className:`w-4 h-4 text-gray-400 transition-transform ${f?"rotate-180":""}`})]}),f&&s.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200 max-h-60 overflow-y-auto",children:[a.length===0?s.jsx("div",{className:"p-3 text-sm text-gray-500",children:d("pinterest.settings.noBoards","No boards available")}):a.map(x=>s.jsxs("button",{type:"button",onClick:()=>y(x.id),className:`w-full flex items-start p-3 hover:bg-red-50 transition-colors text-left ${r===x.id?"bg-red-50":""}`,children:[s.jsx(WN,{className:"w-4 h-4 text-red-600 mr-3 mt-0.5"}),s.jsxs("div",{className:"flex-grow",children:[s.jsx("p",{className:"font-medium text-gray-900",children:x.name}),x.description&&s.jsx("p",{className:"text-sm text-gray-500",children:x.description})]})]},x.id)),u&&s.jsx("div",{className:"border-t border-gray-200 p-2",children:s.jsxs("button",{type:"button",onClick:v,disabled:h,className:"w-full flex items-center justify-center gap-2 p-2 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ai,{className:`w-4 h-4 ${h?"animate-spin":""}`}),s.jsx("span",{children:h?d("pinterest.settings.refreshing","Refreshing..."):d("pinterest.settings.refreshBoards","Refresh boards")})]})})]})]}),!g&&s.jsx("div",{className:"mt-2 text-sm text-gray-600 flex items-center gap-1",children:s.jsx("span",{children:d("pinterest.settings.boardRequired","Please select a board for your pin")})})]}),s.jsx("div",{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sl,{className:"w-4 h-4 text-gray-600"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:d("pinterest.settings.allowComments","Allow Comments")}),s.jsx("p",{className:"text-sm text-gray-500",children:d("pinterest.settings.allowCommentsDescription","
3922Let people comment on your pin")})]})]}),s.jsx("button",{type:"button",onClick:()=>c(!n),className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${n?"bg-red-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${n?"translate-x-5":"translate-x-0"}`})})]})})]})]})},VQ=()=>{const e=qr();return mn({mutationFn:async t=>{var r;try{const n=await((r=Qe.currentUser)==null?void 0:r.getIdToken(!0));if(!n)throw new Error("No authentication token available");console.log(`🚀 Publishing existing post ID: ${t}`);const a=`https://api.socialness.ai/posts/${t}/publish`;console.log(`📡 Making API request to: ${a}`);const i={Authorization:`Bearer ${n}`,"Content-Type":"application/json"};console.log("🔑 Request headers:",Object.keys(i).join(", "));try{const o=await fetch(a,{method:"POST",headers:i,cache:"no-store"});console.log("📡 Publish API Response status:",o.status,o.statusText),console.log("📡 Response headers:",JSON.stringify([...o.headers.entries()]));const l=o.headers.get("content-type");if(console.log("📡 Response content type:",l),!o.ok){if(l&&l.includes("text/html"))return console.error("❌ Received HTML error response (likely CloudFlare)"),{success:!1,error:`Server error (${o.status}). Please try again later.`};let c="Failed to publish post",u;try{return u=await o.json(),console.error("❌ API Error Response:",u),c=u.error||u.message||c,{success:!1,error:c,response:u}}catch(d){console.error("❌ API Error (not JSON):",o.statusText,d);try{const f=await o.text();return console.error("Response as text:",f.substring(0,500)),f.includes("<!DOCTYPE html>")||f.includes("<html")?{success:!1,error:`Server error (${o.status}). Please try again later.`}:{success:!1,error:f.substring(0,200)}}catch(f){return console.error("Could not read response as text either:",f),{success:!1,error:`${o.status} ${o.statusText}`}}}}if(l&&l.includes("application/json"))try{const c=await o.json();if(console.log("✅ Post published successfully. Response data:",JSON.stringify(c,null,2)),c.results&&c.results.tiktok){const u=c.results.tiktok;if(u.success===!0&&(console.log("✅ TikTok publication initiated successfully:",u),Object.entries(c.results).filter(([f,m])=>f!=="tiktok"&&!m.success).length===0))return{success:!0,message:"Publication initiated on TikTok",results:c.results}}if(c.results){const u=Object.entries(c.results).filter(([d,f])=>d==="tiktok"&&f.success===!0?!1:!f.success).map(([d,f])=>{let m;if(typeof f.error=="object"&&f.error!==null)try{m=JSON.stringify(f.error)}catch{m="[object Object]"}else m=f.error||f.message||"Unknown error";return`${d}: ${m}`});if(u.length>0)return c.results.tiktok&&c.results.tiktok.success===!0?{success:!0,message:"Publication initiated on TikTok, but failed on some other platforms",error:`Failed to publish to some platforms:
3923${u.join(`
3924`)}`,results:c.results}:{success:!1,error:`Failed to publish to some platforms:
3925${u.join(`
3926`)}`,results:c.results}}return{success:!0,...c}}catch(c){return console.error("💥 Error parsing JSON response:",c),{success:!1,error:"Invalid response from server"}}else try{const c=await o.text();return console.log("📄 Non-JSON response:",c.substring(0,500)),o.ok?{success:!0,message:"Post published successfully"}:{success:!1,error:"Server returned invalid response format"}}catch(c){return console.error("💥 Error reading response:",c),{success:!1,error:"Failed to read server response"}}}catch(o){return console.error("💥 Network error:",o),{success:!1,error:o instanceof Error?`Network error: ${o.message}`:"Network error connecting to server"}}}catch(n){return console.error("💥 Error in publish operation:",n),{success:!1,error:n instanceof Error?n.message:"Failed to publish post"}}},onSuccess:t=>
3926{t.success&&e.invalidateQueries({queryKey:["posts"]})}})},bat=({onComplete:e})=>{const{t}=Te();return b.useEffect(()=>{const r=setTimeout(()=>{e()},1500);return()=>clearTimeout(r)},[e]),s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:s.jsxs("div",{className:"bg-white rounded-xl shadow-2xl p-12 flex flex-col items-center justify-center transform transition-all duration-500 animate-success-modal",children:[s.jsxs("div",{className:"relative mb-4",children:[s.jsx("div",{className:"w-20 h-20 rounded-full bg-green-100 flex items-center justify-center",children:s.jsx(Ba,{className:"w-12 h-12 text-green-600 animate-success-check"})}),s.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-green-500 opacity-0 animate-success-ring"})]}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2 animate-success-text",children:t("publishModal.successTitle","Success!")}),s.jsx("p",{className:"text-gray-600 text-center animate-success-text",children:t("publishModal.successMessage","Your post has been published successfully.")})]})})},WQ=({isOpen:e,onClose:t,onConfirm:r,postId:n,content:a,platforms:i,brand:o,hasMedia:l,mediaType:c,format:u,scheduledAt:d,media:f,mediaUrl:m,multiImages:h=[],existingMediaUrls:p=[],connectedAccounts:g=[],autoStart:y=!1})=>{const{t:v}=Te(),{showToast:x}=bc(),j=VQ(),[C,N]=b.useState(!1),[S,M]=b.useState(null),[k,I]=b.useState({}),[T,L]=b.useState(!1),[R,_]=b.useState(()=>Array.from(new Set(i.map(ne=>ne)))),[B,z]=b.useState(()=>{const te={};return i.forEach(ne=>te[ne]="idle"),te}),[D,A]=b.useState({hasError:!1,type:null,url:""});b.useEffect(()=>{const te=new URL(window.location.href);e?(te.searchParams.set("modal","publishing"),window.history.replaceState({},"",`${te.pathname}${te.search}${te.hash}`)):te.searchParams.get("modal")==="publishing"&&(te.searchParams.delete("modal"),window.history.replaceState({},"",`${te.pathname}${te.search}${te.hash}`))},[e]),b.useEffect(()=>{const te={};
3926i.forEach(ne=>te[ne]="idle"),z(te)},[i,e]),b.useEffect(()=>{const te=new Set(i);_(Array.from(te)),(async()=>{try{if(!n)return;const J=await ex(n);if(!J)return;let G=[];if(Array.isArray(J.platforms)?G=J.platforms:J.platforms&&typeof J.platforms=="object"&&(G=Object.keys(J.platforms)),G.length>0){const Q=G.map(Y=>W2(Y)),W=new Set([...Array.from(te),...Q]);_(Array.from(W))}}catch{}})()},[e,n,i]),b.useEffect(()=>{if(e&&y&&!C){const te=setTimeout(()=>{le()},0);return()=>clearTimeout(te)}},[e,y]);const P=()=>{if(!l)return{url:"",detectedType:"image"};let te="";if(Array.isArray(h)&&h.length>0){const J=h[0],G=URL.createObjectURL(J);let Q="image";if(J&&typeof J.type=="string"&&(J.type.startsWith("video/")?Q="video":J.type.startsWith("image/")&&(Q="image")),Q==="image"){const Y=(J.name||"").toLowerCase();(Y.endsWith(".mp4")||Y.endsWith(".mov")||Y.endsWith(".webm")||Y.endsWith(".avi")||Y.endsWith(".m4v"))&&(Q="video")}return{url:G,detectedType:u==="reel"?"video":Q}}if(typeof m=="string"&&m)te=m;else if(m&&typeof m=="object"){const J=m;J.url&&typeof J.url=="string"&&(te=J.url)}else f instanceof File?te=URL.createObjectURL(f):Array.isArray(p)&&p.length>0&&(te=p[0]);te&&!te.startsWith("http")&&!te.startsWith("blob:")&&te.startsWith("/")&&(te=`${window.location.origin}${te}`);let ne;if(c==="video")ne="video";else if(c==="image")ne="image";else{let J;if(f instanceof File)if(f.type.startsWith("video/"))J="video";else if(f.type.startsWith("image/"))J="image";else{const G=f.name.toLowerCase();G.endsWith(".mp4")||G.endsWith(".mov")||G.endsWith(".webm")||G.endsWith(".avi")?J="video":(G.endsWith(".jpg")||G.endsWith(".jpeg")||G.endsWith(".png")||G.endsWith(".gif")||G.endsWith(".webp")||G.endsWith(".avif"))&&(J="image")}if(J)ne=J;else{let G;if(te){const Q=te.toLowerCase();Q.endsWith(".mp4")||Q.endsWith(".mov")||Q.endsWith(".avi")||Q.endsWith(".webm")?G="video":Q.endsWith(".jpg")||Q.endsWith(".jpeg")||Q.endsWith(".png")||Q.endsWith(".gif")||Q.endsWith(".webp")||Q.endsWith(".avif")||Q.endsWith(".svg")?G="image":Q.includes("video")&&!Q.includes("video_game")&&!Q.includes("gamingvideo")&&(G="video")}G?ne=G:ne=u==="reel"?"video":"image"}}if(u==="reel"&&(ne="video"),te){const J=te.toLowerCase(),G=/(\.mp4|\.mov|\.avi|\.webm|\.m4v)(\?|#|$)/i.test(J)||J.includes("/video/")||J.includes("video"),Q=/(\.jpg|\.jpeg|\.png|\.gif|\.webp|\.avif|\.svg)(\?|#|$)/i.test(J);G?ne="video":Q&&(ne="image")}return!te&&l&&console.warn("No valid media source found despite hasMedia being true"),{url:te,detectedType:ne}},E=b.useMemo(()=>P(),[l,f,m,c,u]);if(!e)return null;const F=te=>{const ne=g.find(J=>J.platform.toLowerCase()===te.toLowerCase());if(ne&&ne.username)return`@${ne.username}`;if(!o)return"";if(o.social_accounts&&Array.isArray(o.social_accounts)){let J;if(te.toLowerCase()==="instagram"?(J=o.social_accounts.find(G=>G.platform.toLowerCase()==="instagram"),J||(J=o.social_accounts.find(G=>G.platform.toLowerCase()==="facebook"))):J=o.social_accounts.find(G=>G.platform.toLowerCase()===te.toLowerCase()),J&&J.username)return`@${J.username}`}return`@${o.name.toLowerCase().replace(/\s/g,"")}`},$=()=>{if(!l)return v("publishModal.media.noMedia","No media");const te=E.detectedType,ne=te==="video"?"🎥":"🖼️",J=v(`publishModal.media.type.${te}`,te),G=v(`publishModal.media.format.${u==="reel"?"reel":"attachment"}`,u);return`${ne} ${J} ${G}`},H=()=>{x(v("posts.publish.tiktokInitiated","Your post has been initiated on TikTok. We will show you on the Calendar page when your post is published."),"success")},X=()=>{L(!0)},ue=()=>{L(!1),r(),t()},le=async()=>{var te,ne,J,G,Q,W,Y,q,Z,me,we,he,ie,ye,pe,ce,xe,Ee,Ye;try{if(z(qe=>{const ze={...qe};return i.forEach($e=>ze[$e]="publishing"),ze}),N(!0),M(null),I({}),!n)throw new Error("Missing post ID");if(d){console.log(`✅ Post scheduled successfully for: ${d}`),X();return}console.log(`💬 Publishing draft post: ${n}`);const fe=await j.mutateAsync(n);if(console.log("📊 Publish result:",JSON.stringify(fe,null,2)),i.includes("linkedin")){const qe=(te=fe.results)==null?void 0:te.linkedin;if(qe!=null&&qe.success||fe.message&&fe.message.toLowerCase().includes("initiated")){console.log("LinkedIn publication initiated successfully"),X();return}}
3926if(i.includes("tiktok")){const qe=(J=(ne=fe.results)==null?void 0:ne.results)==null?void 0:J.tiktok,ze=(G=fe.results)==null?void 0:G.tiktok;if(qe!=null&&qe.success||ze!=null&&ze.success||qe!=null&&qe.publish_id||ze!=null&&ze.publish_id||fe.publish_id||(Q=fe.results)!=null&&Q.publish_id){console.log("TikTok publication initiated successfully"),X(),H();return}}if(fe.message&&(fe.message.toLowerCase().includes("initiated")||fe.message.toLowerCase().includes("initié"))){console.log("Publication initiated successfully based on message"),X();return}if(fe.success||!fe.success&&((W=fe.results)!=null&&W.success)){console.log("✅ Post published successfully (or specific results indicate success)!"),X();return}console.error("❌ Failed to publish draft post or partial failure:",fe);const je={},We={...B};let yt=!1,gt=fe.error||fe.message||"Failed to publish to some platforms";if(i.forEach(qe=>{We[qe]!=="success"&&(We[qe]="error")}),fe.results&&Array.isArray(fe.results))fe.results.forEach(qe=>{const ze=qe;if(ze&&typeof ze=="object"&&ze.platform){const $e=ze.platform,ct=$e.charAt(0).toUpperCase()+$e.slice(1);if(ze.success)We[$e]="success";else{We[$e]="error";let oe=`Unknown error on ${ct}`;ze.response?ze.response.error&&typeof ze.response.error=="string"?oe=ze.response.error:ze.response.message&&typeof ze.response.message=="string"&&ze.response.success===!1&&(oe=ze.response.message):ze.error&&typeof ze.error=="string"?oe=ze.error:ze.message&&typeof ze.message=="string"&&(oe=ze.message),je[ct]=oe,yt=!0,console.log(`Detailed error for ${ct} (from array): ${oe}`)}}});else if((Y=fe.results)!=null&&Y.results&&typeof fe.results.results=="object"&&!Array.isArray(fe.results.results))for(const qe in fe.results.results){const ze=qe,$e=fe.results.results[qe];if($e&&typeof $e=="object"){const ct=ze.charAt(0).toUpperCase()+ze.slice(1);if($e.success)We[ze]="success";else{We[ze]="error";let oe=`Unknown error on ${ct}`;$e.error?typeof $e.error=="string"?oe=$e.error:typeof $e.error=="object"&&$e.error.message&&(oe=$e.error.message):$e.message&&typeof $e.message=="string"&&(oe=$e.message),(q=$e.data)!=null&&q.message&&typeof $e.data.message=="string"&&$e.data.success===!1?oe=$e.data.message:(Z=$e.error_details)!=null&&Z.message&&typeof $e.error_details.message=="string"&&(oe=$e.error_details.message),je[ct]=oe,yt=!0,console.log(`Detailed error for ${ct} (from results.results): ${oe}`)}}}else fe.results&&typeof fe.results=="object"&&!Array.isArray(fe.results)&&Object.keys(fe.results).forEach(qe=>{var ct,oe;if(qe==="success"||qe==="results"||qe==="tiktok"||qe==="linkedin"){const Ne=fe.results[qe];if(typeof Ne!="object"||Ne===null||typeof Ne.success!="boolean")return}const ze=qe,$e=fe.results[qe];if($e&&typeof $e=="object"&&typeof $e.success=="boolean"){const Ne=ze.charAt(0).toUpperCase()+ze.slice(1);if($e.success)We[ze]="success";else{We[ze]="error";let Ae=`Unknown error on ${Ne}`;$e.error?typeof $e.error=="string"?Ae=$e.error:typeof $e.error=="object"&&$e.error.message&&(Ae=$e.error.message):$e.message&&typeof $e.message=="string"&&(Ae=$e.message),(ct=$e.data)!=null&&ct.message&&typeof $e.data.message=="string"&&$e.data.success===!1?Ae=$e.data.message:(oe=$e.error_details)!=null&&oe.message&&typeof $e.error_details.message=="string"&&(Ae=$e.error_details.message),je[Ne]=Ae,yt=!0,console.log(`Detailed error for ${Ne} (from results object): ${Ae}`)}}});if(i.forEach(qe=>{fe.success&&We[qe]!=="error"?We[qe]!=="success"&&(We[qe]="success"):!fe.success&&We[qe]!=="success"&&(We[qe]==="idle"||We[qe]==="publishing")&&(We[qe]="error")}),i.length===1&&i.includes("tiktok")){let qe=!1;if(Array.isArray(fe.results)){const ze=fe.results.find($e=>$e.platform==="tiktok");ze&&ze.success&&(qe=!0)}else((he=(we=(me=fe.results)==null?void 0:me.results)==null?void 0:we.tiktok)!=null&&he.success||(ye=(ie=fe.results)==null?void 0:ie.tiktok)!=null&&ye.success||(xe=(ce=(pe=fe.results)==null?void 0:pe.results)==null?void 0:ce.tiktok)!=null&&xe.publish_id||(Ye=(Ee=fe.results)==null?void 0:Ee.tiktok)!=null&&Ye.publish_id)&&(qe=!0);if(qe&&(console.log("⚠️ Interpreting as success for TikTok (single platform focus)"),We.tiktok="success",!yt)){X(),H();return}}if(z(We),yt&&Object.keys(je).length>0){I(je);const qe=Object.keys(je);qe.length>1?gt=`Failed to publish to ${qe.length} platforms. See details below.`:gt=`Failed to publish to ${qe[0]}. See details below.`}else if(!(!fe.success&&Object.keys(je).length===0)){if(fe.success&&Object.keys(je).length===0){i.forEac
3926h(qe=>We[qe]="success"),z(We),console.log("✅ All platforms published successfully (fallback check)"),X();return}}M(gt)}catch(fe){console.error("❌ Error publishing post:",fe),M(fe instanceof Error?fe.message:"Failed to publish post"),I({})}finally{N(!1)}},ae=()=>C?v("publishModal.buttons.publishing","Publishing..."):d?v("publishModal.buttons.schedulePost","Schedule Post"):v("publishModal.buttons.publishNow","Publish Now");return s.jsxs(s.Fragment,{children:[T&&s.jsx(bat,{onComplete:ue}),s.jsx("div",{className:"fixed inset-0 z-40 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-2xl max-w-4xl w-full p-6 max-h-[80vh] overflow-y-auto transform transition-all duration-300 ease-in-out",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bs,{className:"w-5 h-5 text-primary-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:v("publishModal.title","Confirm Publication")})]}),s.jsx("button",{onClick:t,disabled:C,className:"text-gray-400 hover:text-gray-500 disabled:opacity-50",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-6",children:[o&&s.jsxs("div",{className:"flex items-center gap-3 p-4 bg-gray-50 rounded-lg",children:[s.jsx("img",{src:o.logo,alt:o.name,className:"w-10 h-10 rounded-lg object-contain"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-gray-900",children:o.name}),s.jsx("p",{className:"text-sm text-gray-500",children:v("publishModal.brandPublishingAs","Publishing as brand")})]})]}),d&&s.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 rounded-lg",children:[s.jsx(vo,{className:"w-5 h-5 text-blue-600"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-blue-900",children:v("publishModal.schedule.title","Scheduled Publication")}),s.jsx("p",{className:"text-sm text-blue-700",children:v("publishModal.schedule.willPublishOn","Will be published on {{datetime}}",{datetime:new Date(d).toLocaleString()})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:v("publishModal.content.title","Content")}),s.jsx("div",{className:"p-4 bg-gray-50 rounded-lg",children:s.jsxs("div",{className:"flex gap-4",children:[l&&s.jsx("div",{className:`relative flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden ${u==="reel"?"w-24 aspect-[9/16]":"w-24 aspect-square"}`,children:(()=>{const{url:te,detectedType:ne}=E;return te?s.jsxs(s.Fragment,{children:[s.jsx(Un,{mediaUrl:te,altText:"Preview",type:ne,objectFit:"cover",className:"w-full h-full",controls:ne==="video",autoPlayOnMount:ne==="video",muted:!0,loop:ne==="video"}),s.jsx("div",{className:"absolute top-1 right-1 px-1.5 py-0.5 bg-black/50 text-white text-xs rounded",children:u==="reel"?"9:16":"1:1"})]}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-200 text-gray-500 text-xs p-2 text-center",children:v("publishModal.media.unavailable","Media preview unavailable")})})()}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-gray-900 whitespace-pre-line break-words line-clamp-5",children:a}),s.jsxs("div",{className:"mt-2 flex items-center gap-2 text-sm text-gray-500",children:[s.jsx("span",{children:$()}),u==="reel"&&s.jsx("span",{className:"px-2 py-0.5 bg-primary-100 text-primary-700 rounded-full text-xs",children:v("publishModal.badge.reel","Reel format")})]})]})]})})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:v("publishModal.list.title","Will be published on")}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:R.map(te=>s.jsxs("div",{className:"flex items-center justify-between p-3 border border-black rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[(()=>{var Q,W,Y;const ne=g.find(q=>q.platform.toLowerCase()===te.toLowerCase());if(ne)return console.log(`[PublishConfirmationModal] Using connected account for ${te}:`,ne),s.jsx(Du,{platform:te,pictureUrl:ne.picture_url,username:ne.username,size:"md"});let J;te.toLowerCase()==="instagram"?(J=(Q=o==null?void 0:o.social_accounts)==null?void 0:Q.find(q=>q.platform.toLowerCase()==="instagram"),J||(J=(W=o==null?void 0:o.social_accounts)==null?void 0:W.find(q=>q.platform.toLowerCase()==="facebook"))):J=(Y=o==null?void 0:o.social_accounts)==null?void 0:Y.find(q=>q.platform.toLowerCase()===te.toLowerCase()),console.log(`[PublishConfirmationModal] Fallback account for ${te}:`,J);const G=(J==null?void 0:J.profile_url)||(J==null?void 0:J.picture_url)||"";return console.log(`[PublishConfirmationModal] Picture URL for ${te}:`,G),s.jsx(Du,{platform:te,pictureUrl:G,username:(J==null?void 0:J.username)||"",size:"md"})})(),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-gray-900",children:te.charAt(0).toUpperCase()+te.slice(1)}),s.jsx("p",{className:"text-sm text-gray-500",children:F(te)})]})]}),B[te]==="publishing"&&s.jsx(Rn,{className:"w-5 h-5 text-primary-600 animate-spin"}),B[te]==="success"&&s.jsx(ma,{className:"w-5 h-5 text-green-500"}),B[te]==="error"&&s.jsx(E2,{className:"w-5 h-5 text-red-500"}),B[te]==="idle"&&s.jsx(ma,{className:"w-5 h-5 text-gray-400"})]},te))})]}),s.jsx("div",{className:"bg-yellow-50 border border-yellow-100 rounded-lg p-4",children:s.jsx("p",{className:"text-sm text-yellow-800",children:d?v("publishModal.warning.scheduled","This post will be published at the scheduled time."):v("publishModal.warning.publishAll","This action will publish your post to all selected platforms. This cannot be undone.")})}),S&&s.jsx("div",{className:"bg-red-50 border border-red-100 rounded-lg p-4 mt-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(bs,{className:"w-5 h-5 text-red-600 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-red-700",children:Object.keys(k).length>
39260?v("publishModal.errors.title","Publication Errors"):v("publishModal.errors.generic","Failed to publish post")}),s.jsx("p",{className:"text-sm text-red-600 mt-1 whitespace-pre-line",children:S}),Object.keys(k).length>0&&s.jsx("ul",{className:"list-disc list-inside mt-2 space-y-1",children:Object.entries(k).map(([te,ne])=>s.jsxs("li",{className:"text-sm text-red-600",children:[s.jsxs("span",{className:"font-semibold",children:[te,":"]})," ",ne]},te))})]})]})}),s.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[s.jsx("button",{onClick:t,disabled:C,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800 disabled:opacity-50",children:v("publishModal.buttons.cancel","Cancel")}),s.jsx("button",{onClick:le,disabled:C,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 disabled:bg-primary-400",children:C?s.jsxs("span",{className:"flex items-center",children:[s.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),ae()]}):ae()})]})]})]})]})})]})},vat=({isOpen:e,onClose:t,onSaveDraft:r,missingPlatforms:n,brandName:a})=>{const{t:i}=Te();if(!e)return null;const o=n.map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(", ");return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-2xl max-w-lg w-full p-6 transform transition-all duration-300 ease-in-out",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bs,{className:"w-6 h-6 text-yellow-500"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i("modals.saveDraftInstead.title","Account Connection Missing")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600",children:i("modals.saveDraftInstead.message","The selected brand '{{brandName}}' does not have a connected account for the following platform(s): {{platformList}}. You can save this post as a draft and connect the accounts later.",{brandName:a||"Selected Brand",platformList:o})}),s.jsx("div",{className:"flex flex-wrap gap-2 items-center justify-center my-3",children:n.map(l=>s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-200",children:[s.jsx(cr,{platform:l,size:14}),l.charAt(0).toUpperCase()+l.slice(1),s.jsx(bs,{className:"w-3 h-3 text-yellow-600 ml-1"})]},l))}),s.jsx("p",{className:"text-sm text-gray-600",children:i("modals.saveDraftInstead.question","Would you like to save this post as a draft instead?")})]}),s.jsxs("div",{className:"flex justify-end gap-3 pt-5 mt-5 border-t",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",children:i("common.cancel","Cancel")}),s.jsxs("button",{onClick:()=>{r(),t()},className:"inline-flex items-center px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700",children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),i("common.saveDraft","Save as Draft")]})]})]})]})})},xat=({reviewers:e=[],selectedReviewerId:t=null,onReviewerSelect:r,className:n="",isLoading:a=!1,disabled:i=!1,placeholder:o,currentUserId:l=null})=>{const{t:c}=Te(),[u,d]=b.useState(!1),[f,m]=b.useState({}),h=e.find(v=>(v==null?void 0:v.id)===t)||null,p=o||c("cards.approval.selectPlaceholder","Select a reviewer...");if(a)return s.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg animate-pulse ${n}`,children:[s.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-200"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-24"}),s.jsx(Vr,{className:"w-4 h-4 text-gray-300"})]});if(e.length===0&&!a)return s.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 border border-gray-200 rounded-lg text-gray-400 ${n}`,children:[s.jsx(Fi,{className:"w-5 h-5 text-gray-400"}),s.jsx("span",{className:"text-sm truncate",children:c("cards.approval.noReviewers","N
3926o reviewers available")}),s.jsx(Vr,{className:"w-4 h-4 text-gray-300"})]});const g=v=>{m(x=>({...x,[v]:!0}))},y=()=>{var v,x;return h?s.jsxs(s.Fragment,{children:[h.photoURL&&!f[h.id]?s.jsx("img",{src:h.photoURL,alt:`${h.firstName} ${h.lastName}`,className:"w-5 h-5 rounded-full flex-shrink-0 object-cover",onError:()=>g(h.id)}):s.jsxs("span",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs text-gray-500 flex-shrink-0",children:[(v=h.firstName)==null?void 0:v.charAt(0),(x=h.lastName)==null?void 0:x.charAt(0)]}),s.jsx("span",{className:"text-sm text-gray-700 truncate",children:`${h.firstName} ${h.lastName}`})]}):s.jsx("span",{className:"text-sm text-gray-500 truncate",children:p})};return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>!i&&d(!u),disabled:i||e.length===0,className:`w-full flex items-center justify-between gap-2 px-4 py-2 border border-gray-200 rounded-lg transition-colors h-10 ${i?"bg-gray-100 cursor-not-allowed":"hover:border-primary-300"} ${n}`,children:[s.jsx("span",{className:"flex items-center gap-2 overflow-hidden",children:s.jsx(y,{})}),s.jsx(Vr,{className:"w-4 h-4 text-gray-500 flex-shrink-0"})]}),u&&!i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10 bg-transparent",onClick:()=>d(!1)}),s.jsxs("div",{className:"absolute left-0 mt-1 w-full rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20 max-h-60 overflow-y-auto",children:[" ",s.jsx("div",{className:"py-1",children:e.filter(v=>v.id!==l||v.id===t).map(v=>{var x,j;return s.jsxs("button",{type:"button",onClick:()=>{r(v.id),d(!1)},className:`w-full flex items-center gap-2 px-4 py-2 text-sm text-left ${v.id===t?"bg-primary-50 text-primary-600":"text-gray-700 hover:bg-gray-50 hover:text-gray-900"}`,children:[v.photoURL&&!f[v.id]?s.jsx("img",{src:v.photoURL,alt:`${v.firstName} ${v.lastName}`,className:"w-5 h-5 rounded-full flex-shrink-0 object-cover",onError:()=>g(v.id)}):s.jsxs("span",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs text-gray-500 flex-shrink-0",children:[(x=v.firstName)==null?void 0:x.charAt(0),(j=v.lastName)==null?void 0:j.charAt(0)]}),s.jsx("span",{className:"truncate",children:`${v.firstName} ${v.lastName}`})]},v.id)})})]})]})]})},wat=({requiresApproval:e,selectedReviewerId:t,reviewers:r=[],onApprovalToggle:n,onReviewerChange:a,isLoadingReviewers:i=!1,currentUserId:o=null,actualPostStatus:l,finalReviewer:c,finalReviewComments:u})=>{var g,y,v,x,j,C;const{t:d}=Te(),[f,m]=b.useState(null),h=(l==="ready_to_publish"||l==="scheduled"||l==="published")&&c||l==="rejected"&&c;b.useEffect(()=>{if(t){const N=r.find(S=>S.id===t)||null;m(N)}else m(null)},[t,r]);const p=()=>{const N=!e;n(N),N?r.length>0&&!t&&a(r[0].id):a(null)};return!e||i||r.length,s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx(pL,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:h?d("cards.approval.statusTitle","Approval Status"):d("cards.approval.title","Approval Required")})]}),s.jsxs("div",{className:"space-y-6",children:[!h&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:d("cards.approval.toggleLabel","Send for approval")}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:d("cards.approval.toggleDescription","This post will require approval from the reviewer you select below.")})]}),s.jsx("button",{type:"button",onClick:p,className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${e?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${e?"translate-x-5":"translate-x-0"}`})})]}),s.jsxs("div",{className:e?"opacity-100":"opacity-50 pointer-events-none",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"reviewer-select",className:"block text-sm font-medium text-gray-700 mb-1",children:d("cards.approval.reviewerLabel","Select Reviewer")}),s.jsx(xat,{reviewers:r,selectedReviewerId:t,onReviewerSelect:a,isLoading:i,disabled:!e||i,placeholder:d("c
3926ards.approval.selectPlaceholder","Select a reviewer..."),currentUserId:o})]}),e&&!t&&r.length>0&&s.jsxs("div",{className:"mt-3 flex items-start gap-2 text-orange-600 bg-orange-50 p-3 rounded-lg",children:[s.jsx(uh,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsx("p",{className:"text-sm",children:d("cards.approval.selectReviewerWarning","Please select a reviewer for this post.")})]}),e&&r.length===0&&!i&&s.jsxs("div",{className:"mt-3 flex items-start gap-2 text-red-600 bg-red-50 p-3 rounded-lg",children:[s.jsx(uh,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsx("p",{className:"text-sm",children:d("cards.approval.noReviewersError","No eligible reviewers found for the selected brand. Cannot request approval.")})]})]})]}),s.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:d("cards.approval.statusTitle","Approval Status")}),h?(l==="ready_to_publish"||l==="scheduled"||l==="published")&&c?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center text-sm text-green-600",children:[s.jsx(Ba,{className:"w-4 h-4 mr-2 flex-shrink-0"}),s.jsxs("span",{children:[d("cards.approval.approvedBy","Approved by"),": ",s.jsx("strong",{children:c.name})]}),c.photoURL?s.jsx("img",{src:c.photoURL,alt:c.name,className:"w-5 h-5 rounded-full object-cover ml-2"}):(c.firstName||c.lastName)&&s.jsxs("span",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs text-gray-500 ml-2 flex-shrink-0",children:[(g=c.firstName)==null?void 0:g.charAt(0).toUpperCase(),(y=c.lastName)==null?void 0:y.charAt(0).toUpperCase()]})]}),u&&s.jsxs("div",{children:[s.jsxs("h5",{className:"text-xs font-semibold text-gray-600 ml-6 mb-0.5",children:[d("cards.approval.commentsLabel","Comments"),":"]}),s.jsx("div",{className:"text-xs text-gray-600 ml-6 italic bg-gray-50 p-2 rounded whitespace-pre-wrap",children:u})]})]}):l==="rejected"&&c?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center text-sm text-red-600",children:[s.jsx(E2,{className:"w-4 h-4 mr-2 flex-shrink-0"}),s.jsxs("span",{children:[d("cards.approval.rejectedBy","Rejected by"),": ",s.jsx("strong",{children:c.name})]}),c.photoURL?s.jsx("img",{src:c.photoURL,alt:c.name,className:"w-5 h-5 rounded-full object-cover ml-2"}):(c.firstName||c.lastName)&&s.jsxs("span",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs text-gray-500 ml-2 flex-shrink-0",children:[(v=c.firstName)==null?void 0:v.charAt(0).toUpperCase(),(x=c.lastName)==null?void 0:x.charAt(0).toUpperCase()]})]}),u&&s.jsxs("div",{children:[s.jsxs("h5",{className:"text-xs font-semibold text-gray-600 ml-6 mb-0.5",children:[d("cards.approval.commentsLabel","Comments"),":"]}),s.jsx("div",{className:"text-xs text-gray-600 ml-6 italic bg-gray-50 p-2 rounded whitespace-pre-wrap",children:u})]})]}):null:s.jsxs("div",{className:"flex items-center text-sm",children:[s.jsx(pL,{className:"w-4 h-4 text-gray-400 flex-shrink-0 mr-2"}),e&&f?s.jsxs("span",{className:"text-primary-600 flex items-center",children:[d("cards.approval.statusRequired","Will be reviewed by {{reviewerName}}",{reviewerName:`${f.firstName} ${f.lastName}`}),f.photoURL?s.jsx("img",{src:f.photoURL,alt:`${f.firstName} ${f.lastName}`,className:"w-5 h-5 rounded-full object-cover ml-2"}):s.jsxs("span",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs text-gray-500 ml-2 flex-shrink-0",children:[(j=f.firstName)==null?void 0:j.charAt(0),(C=f.lastName)==null?void 0:C.charAt(0)]})]}):e&&!f&&r.length>0?s.jsx("span",{className:"text-orange-600 ml-2",children:d("cards.approval.statusPendingSelection","Awaiting reviewer selection")}):e&&r.length===0?s.jsx("span",{className:"text-red-600 ml-2",children:d("cards.approval.statusNoReviewersAvailable","No reviewers available")}):s.jsx("span",{className:"text-gray-600 ml-2",children:d("cards.approval.statusNotRequired","Will not be reviewed")})]})]})]})]})},jat=({isOpen:e,onClose:t,onSubmit:r,decision:n})=>{const{t:a}=Te(),[i,o]=b.useState("");
3926if(b.useEffect(()=>{e&&o("")},[e]),!e||!n)return null;const l=()=>{r(i)},c=n==="approved"?a("modals.reviewComment.titleApprove","Approve Post"):a("modals.reviewComment.titleReject","Reject Post"),u=n==="approved"?a("modals.reviewComment.submitApprove","Submit Approval"):a("modals.reviewComment.submitReject","Submit Rejection"),d=n==="approved"?"bg-green-600 hover:bg-green-700":"bg-red-600 hover:bg-red-700";return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-md mx-4 border border-black",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[s.jsxs("h3",{className:"text-lg font-semibold text-gray-900 flex items-center",children:[s.jsx(jf,{className:"w-5 h-5 mr-2 text-gray-500"}),c]}),s.jsx("button",{onClick:t,className:"p-1 rounded-full text-gray-400 hover:bg-gray-100 hover:text-gray-600","aria-label":a("common.close"),children:s.jsx(_t,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"p-6 space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600",children:a("modals.reviewComment.description","Add an optional comment for the writer.")}),s.jsx("textarea",{value:i,onChange:f=>o(f.target.value),rows:4,className:"w-full px-3 py-2 text-gray-700 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:a("modals.reviewComment.placeholder","Your comment...")})]}),s.jsxs("div",{className:"flex items-center justify-end p-4 border-t border-gray-200 space-x-3",children:[s.jsx("button",{onClick:t,type:"button",className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:a("common.cancel","Cancel")}),s.jsx("button",{onClick:l,type:"button",className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 ${d} focus:ring-${n==="approved"?"green":"red"}-500`,children:u})]})]})})},Nat={score:{color:"#6d28d9"}},Sat=e=>`${e}h`,td=e=>typeof e!="string"||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Cat=e=>({0:"dimanche",1:"lundi",2:"mardi",3:"mercredi",4:"jeudi",5:"vendredi",6:"saturday"})[e]||"lundi",kat=({brandId:e,brandName:t,selectedPlatforms:r})=>{const{t:n,i18n:a}=Te(),[i,o]=b.useState(null),[l,c]=b.useState(!1),[u,d]=b.useState(null),[f,m]=b.useState(null),[h,p]=b.useState(null),g=b.useRef(null);b.useEffect(()=>{const C=async()=>{if(!e||r.length===0){o(null),d(null),c(!1),m(null),p(null);return}c(!0),d(null);try{const N=Qe.currentUser;if(!N)throw new Error("User not authenticated.");const S=await N.getIdToken(),M=await fetch("https://api.socialness.ai/ai-coach/posting-time/analyze",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${S}`},body:JSON.stringify({brandId:e,personaId:"",platforms:r,appLanguage:a.language||"en"})});if(!M.ok){let I=`API Error: ${M.status}`;try{const T=await M.json();I=T.detail||T.message||I}catch{}throw new Error(I)}const k=await M.json();if(o(k),k&&k.length>0){const I=k.some(R=>R.metadata.platform===f);let T,L;if(I&&f?(T=f,L=k.find(R=>R.metadata.platform===f)):(T=k[0].metadata.platform,L=k[0],m(T)),L){const R=Object.keys(L.dailyHourlyEngagement),B=gke(new Date),z=Cat(B).toLowerCase();R.includes(z)?p(z):h&&R.includes(h)||p(R.length>0?R[0]:null)}else p(null)}else m(null),p(null)}catch(N){console.error("Error fetching AI best time:",N),d(N instanceof Error?N.message.includes("authenticated")?n("errors.authRequired","Authentication required"):N.message:n("errors.unknownError","An unknown error occurred.")),o(null),m(null),p(null)}finally{c(!1)}};if(!e){o(null),d(null),c(!1),m(null),p(null),g.current&&(clearTimeout(g.current),g.current=null);return}if(r.length===0){o(null),d(null),c(!1),m(null),p(null),g.current&&(clearTimeout(g.current),g.current=null);return}return g.current&&clearTimeout(g.current),o(null),d(null),g.current=setTimeout(()=>{C()},2e3),()=>{g.current&&clearTimeout(g.current)}},[e,r,a.language]);const y=b.useMemo(()=>i==null?void 0:i.find(C=>C.metadata.platform===f),[i,f]),v=b.useMemo(()=>y?Object.keys(y.dailyHourlyEngagement):[],[y]);b.useEffect(()=>{y&&h&&!v.includes(h)?p(v.length>0?v[0]:null):y&&!h&&v.length>0&&p(v[0])},[y,v,h]);const x=b.useMemo(()=>!y||!h||!y.dailyHourlyEngagement[h]?[]:y.dailyHourlyEngagement[h].map(N=>({name:`${N.hour}h`,hour:N.hour,score:N.score,reason:N.reason}))||[],[y,h]),j=()=>!e||r.length===0?s.jsxs("div",{className:"text-center text-gray-500 py-10 px-4",children:[s.jsx(Fs,{className:"mx-auto h-8 w-8 text-gray-400 mb-2"}),n("aiBestTime.selectPrompt","Select a Brand and at least one Platform to see AI recommendations.")]}):l?s.jsxs("div",{className:"space-y-4 animate-pulse",children:[s.jsx("div",{className:"h-[250px] w-full bg-gray-200 rounded-lg"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-4 w-4 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-3 w-3/4 bg-gray-200 rounded"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"h-3 w-1/4 bg-gray-200 rounded mb-2"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx("div",{className:"h-4 w-12 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-4 w-16 bg-gray-200 rounded-full"})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"h-3 w-1/4 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.jsx("div",{className:"h-4 w-14 bg-gray-200 rounded-full"})})]})]})]}):u?s.jsxs("div",{className:"text-center text-red-600 py-10 px-4",children:[s.jsx(qs,{className:"mx-auto h-8 w-8 text-red-500 mb-2"}),n("aiBestTime.errorLoading","Error loading recommendations:")," ",u]}):!i||i.length===0||!y||!h||x.length===0?s.jsxs("div",{className:"text-center text-gray-500 py-10 px-4",children:[s.jsx(Fs,{className:"mx-auto h-8 w-8 text-gray-400 mb-2"}),n("aiBestTime.noDataForDay","Please choose a brand AND a platform to start")]}):s.jsx("div",{className:"h-[220px] w-full",children:s.jsx(NW,{width:"100%",height:"100%",children:s.jsxs(PHe,{data:x,margin:{top:5,right:5,left:-25,bottom:0},children:[s.jsx(XT,{strokeDasharray:"3 3",vertical:!1}),s.jsx(Np,{dataKey:"hour",tickFormatter:Sat,tickLine:!1,axisLine
3926:!1,interval:2,fontSize:12,padding:{left:10,right:10}}),s.jsx(Sp,{domain:[0,10],ticks:[0,2.5,5,7.5,10],axisLine:!1,tickLine:!1,fontSize:10,width:30}),s.jsx(to,{cursor:{fill:"hsl(var(--muted))",fillOpacity:.3},content:({active:C,payload:N,label:S})=>{var M;if(C&&N&&N.length){const k=N[0].payload;return s.jsx("div",{className:"rounded-lg border bg-white p-2 shadow-sm text-xs",children:s.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:n("aiBestTime.tooltipHour","Hour:")}),s.jsx("span",{className:"font-bold",children:S})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:n("aiBestTime.tooltipScore","Score:")}),s.jsx("span",{className:"font-bold",children:(M=k.score)==null?void 0:M.toFixed(1)})]}),k.reason&&s.jsxs("div",{className:"flex flex-col text-left mt-1",children:[s.jsx("span",{className:"text-muted-foreground text-[10px]",children:n("aiBestTime.tooltipReason","Reason:")}),s.jsx("span",{className:"font-normal text-[11px] whitespace-normal",children:k.reason})]})]})})}return null}}),s.jsx(If,{dataKey:"score",fill:"var(--color-score)",radius:[4,4,0,0]})]})})});return s.jsxs("div",{className:"bg-white rounded-xl border border-primary-600 shadow-lg",children:[s.jsxs("div",{className:"p-4 sm:p-6 border-b border-gray-200",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[s.jsx(Fs,{className:"w-5 h-5 text-primary-600"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:t?s.jsxs(s.Fragment,{children:[n("aiBestTime.titleForBrandPrefix","Meilleur moment selon l'IA pour")," ",s.jsx("span",{className:"text-primary-700",children:t})]}):n("aiBestTime.title","AI Best Time to Post")})]}),s.jsx("p",{className:"text-sm text-gray-500",children:n("aiBestTime.description","Hourly engagement score based on AI analysis")})]}),i&&i.length>1&&s.jsx("div",{className:"px-4 sm:px-6 pt-4 border-b border-gray-200",children:s.jsx("div",{className:"flex space-x-2 overflow-x-auto",children:i.map(C=>s.jsx("button",{onClick:()=>m(C.metadata.platform),className:`p-2 rounded-md border-b-2 flex items-center justify-center ${f===C.metadata.platform?"border-primary-600 bg-primary-50":"border-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 hover:border-gray-300"} transition-colors duration-150 ease-in-out`,"aria-label":n(`platforms.${C.metadata.platform}`,td(C.metadata.platform)),title:n(`platforms.${C.metadata.platform}`,td(C.metadata.platform)),children:s.jsx(cr,{platform:C.metadata.platform,size:20})},C.metadata.platform))})}),y&&v.length>0&&s.jsx("div",{className:"px-4 sm:px-6 pt-3 border-b border-gray-200",children:s.jsx("div",{className:"flex space-x-3 overflow-x-auto",children:v.map(C=>s.jsx("button",{onClick:()=>p(C),className:`pb-1.5 px-1 text-xs font-medium border-b-2 ${h===C?"border-primary-600 text-primary-700":"border-transparent text-gray-500 hover:text-gray-600 hover:border-gray-300"}`,children:n(`days.${C.toLowerCase()}`,td(C))},C))})}),s.jsx("div",{className:"px-4 py-2 sm:px-6 sm:py-3",children:j()}),y&&h&&!l&&!u&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200 space-y-3",children:[y.nextBestTime&&s.jsxs("div",{className:"flex items-start gap-2 text-gray-700 px-4 sm:px-6 py-3 text-sm",children:[s.jsx(Fs,{className:"h-4 w-4 text-yellow-500 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold",children:n("aiBestTime.suggestionPrefix","AI Suggestion:")})," ",n("aiBestTime.suggestionBody","Next best time to post is around")," ",s.jsx("span",{className:"font-bold text-primary-700",children:td(y.nextBestTime)}),"."]})]}),y.topRecommendations&&y.topRecommendations.length>0&&s.jsxs("div",{className:"px-4 sm:px-6 pt-4 pb-2 border-t border-gray-200",children:[s.jsx("h4",{className:"text-xs font-semibold text-gray-600 mb-2",children:n("aiBestTime.topRecommendationsTitle","Top Recommended Times:")}),s.jsx("ul",{className:"space-y-2",children:y.topRecommendations.slice(0,3).map((C,N)=>s.jsxs("li",{className:"text-xs text-gray-600",children:[s.jsxs("span",{className:"font-semibold",children:[n(`days.${C.day.toLowerCase()}`,td(C.day)),":"]})," ",C.startTime," - ",C.endTime,C.reason&&s.jsxs("span",{className:"italic text-gray-500 ml-1",children:["- ",C.reason]})]},N))})]}),y.bestDays&&y.worstDays&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-6 pt-4 pb-4 border-t border-gray-200",children:[s.jsxs("div",{children:[s.jsxs("h4",{className:"flex items-center gap-1.5 text-xs font-semibold text-gray-600 mb-2",children:[s.jsx(Ba,{className:"w-3.5 h-3.5 text-green-500"}),n("aiBestTime.bestDays","Best Days")]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.bestDays.map(C=>s.jsx("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded-full text-xs font-medium",children:n(`days.${C.toLowerCase()}`,td(C))},C))})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"flex items-center gap-1.5 text-xs font-semibold text-gray-600 mb-2",children:[s.jsx(E2,{className:"w-3.5 h-3.5 text-red-500"}),n("aiBestTime.avoidDays","Days to Avoid")]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.worstDays.map(C=>s.jsx("span",{className:"px-2 py-0.5 bg-red-100 text-red-800 rounded-full text-xs font-medium",children:n(`days.${C.toLowerCase()}`,td(C))},C))})]})]}),y.platformSpecificNotes&&s.jsx("div",{className:"px-4 sm:px-6 pt-3 pb-4 border-t border-gray-200",children:s.jsx("p",{className:"text-xs text-gray-500 italic",children:y.platformSpecificNotes})})]}),s.jsx("style",{children:`:root { --color-score: ${Nat.score.color}; }`})]})},Mat=({selectedBrandId:e,onBrandSelect:t,selectedPlatforms:r,onPlatformToggle:n,onFormatChange:a,format:i="text",connectedAccounts:o=[],tiktokAccount:l})=>{const{t:c}=Te(),{availablePlatforms:u}=eA(),{data:d,isLoading:f}=oa(),m=(d==null?void 0:d.brands)||[],h=b.useMemo(()=>{const j=[...o];return l!=null&&l.username&&!j.some(C=>C.platform==="tiktok")&&j.push({platform:"tiktok",username:l.username,picture_url:l.picture_url}),j},[o,l]),p=j=>
3926{n(j),(j==="youtube"||j==="tiktok")&&a&&(r.includes(j)||a("reel"))},g=j=>i==="regular"?j==="tiktok"||j==="youtube":i==="reel"?j==="linkedin"||j==="pinterest"||j==="twitter":!1,y=[...u,...ub.filter(j=>(j.id==="facebook"||j.id==="instagram")&&j.status==="coming-soon")],v=j=>h.find(C=>C.platform===j),x=j=>{const C=r.includes(j.id),N=v(j.id),S=g(j.id);return N?s.jsxs("button",{onClick:()=>!S&&p(j.id),disabled:S,className:`flex flex-col items-center justify-center gap-1 sm:gap-2 p-2 sm:p-3 h-24 w-full rounded-lg border ${S?"border-gray-300 bg-gray-50 cursor-not-allowed opacity-50":C?"border-primary-600 bg-primary-50":"border-black hover:border-primary-600"}`,children:[s.jsx(Du,{pictureUrl:N.picture_url,username:N.username,platform:j.id,size:"md"}),s.jsxs("span",{className:`text-[10px] w-full text-center line-clamp-2 overflow-hidden whitespace-normal break-words ${S?"text-gray-400":"text-gray-700"}`,children:["@",N.username]})]},j.id):s.jsxs("button",{onClick:()=>!S&&p(j.id),disabled:S,className:`flex flex-col items-center justify-center gap-1 sm:gap-2 p-2 sm:p-3 h-24 w-full rounded-lg border ${S?"border-gray-300 bg-gray-50 cursor-not-allowed opacity-50":C?"border-primary-600 bg-primary-50":"border-black hover:border-primary-600"}`,children:[s.jsx(cr,{platform:j.id,size:24}),s.jsx("span",{className:`text-[10px] w-full text-center line-clamp-2 overflow-hidden whitespace-normal break-words ${S?"text-gray-400":"text-gray-700"}`,children:j.name})]},j.id)};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(li,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:c("cards.brandsAndPlatforms.title","Marques & Plateformes")})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("cards.brands.title","Brand")}),s.jsx(hl,{brands:m,selectedBrandId:e,onBrandSelect:t,isLoading:f})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("postContent.formats","Format")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>a==null?void 0:a("regular"),className:`flex items-center gap-2 px-4 py-2 rounded-lg border text-sm font-medium transition-colors duration-150 ${i==="regular"?"bg-primary-50 border-primary-600 text-primary-700":"bg-white border-black text-gray-700 hover:bg-gray-50 hover:border-gray-400"}`,children:[s.jsx("span",{className:"text-lg",children:"📸"}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{children:c("postContent.regularFormat","Regular (Horizontal)").split(" (")[0]}),s.jsxs("div",{className:"text-xs opacity-75",children:["(",c("postContent.regularFormat","Regular (Horizontal)").split(" (")[1]]})]})]}),s.jsxs("button",{onClick:()=>a==null?void 0:a("reel"),className:`flex items-center gap-2 px-4 py-2 rounded-lg border text-sm font-medium transition-colors duration-150 ${i==="reel"?"bg-primary-50 border-primary-600 text-primary-700":"bg-white border-black text-gray-700 hover:bg-gray-50 hover:border-gray-400"}`,children:[s.jsx("span",{className:"text-lg",children:"📱"}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{children:c("postContent.reelFormat","Reel (Vertical)").split(" (")[0]}),s.jsxs("div",{className:"text-xs opacity-75",children:["(",c("postContent.reelFormat","Reel (Vertical)").split(" (")[1]]})]})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("cards.platforms.sectionTitle","Plateformes")}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3",children:y.map(j=>x(j))})]})]})},Pv="/assets/canva-DNSRjIq1.svg",Iat=({isOpen:e,isGenerating:t,isCanvaLoading:r,onToggle:n,onGenerate:a,onCanva:i,canvaLogo:o})=>{const{t:l}=Te();return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:n,disabled:r||t,className:"inline-flex items-center px-3 py-1.5 text-sm font-semibold text-white bg-primary-600 hover:bg-primary-700 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(tn,{className:"w-4 h-4 mr-1.5"}),l("actions.createImage","Create an image"),s.jsx(Vr,{className:`w-4 h-4 ml-1.5 transition-transform ${e?"rotate-180":""}`})]}),e&&s.jsx("div",{className:"absolute top-full mt-1 right-0 z-10 w-56 bg-white border border-gray-200 rounded-lg shadow-lg",children:s.jsxs("div",{className:"py-1",children:[s.jsx("button",{onClick:a,disabled:t,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-purple-50 disabled:opacity-50 disabled:cursor-not-allowed",children:t?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-3 border-2 border-t-transparent border-gray-500 rounded-full animate-spin"}),l("common.generating","Generating...")]}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{className:"w-4 h-4 mr-3 text-purple-500"}),l("actions.generateWithAI","Generate with AI")]})}),s.jsx("button",{onClick:i,disabled:r,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-purple-50 disabled:opacity-50 disabled:cursor-not-allowed",children:r?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-3 border-2 border-t-transparent border-gray-500 rounded-full animate-spin"}),l("common.loading","Loading...")]}):s.jsxs(s.Fragment,{children:[s.jsx("img",{src:o,alt:"Canva",className:"w-4 h-4 mr-3"}),s.jsxs("span",{className:"flex items-center",children:[l("actions.designInCanva","Design in Canva"),s.jsx("span",{className:"ml-2 inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-red-500 text-white",children:"Beta"})]})]})})]})})]})},Eat=({isOpen:e,onToggle:t,onAddFromDesktop:r,onAddFromCanva:n,isBusy:a,canvaLogo:i})=>{const{t:o}
3926=Te();return s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:t,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-lg border border-primary-600 text-primary-700 bg-white hover:bg-primary-50",children:[s.jsx(tn,{className:"w-4 h-4 mr-1.5"}),o("postContent.addMoreImages","Add more images"),s.jsx(Vr,{className:`w-4 h-4 ml-1.5 transition-transform ${e?"rotate-180":""}`})]}),e&&s.jsx("div",{className:"absolute top-full mt-1 right-0 z-10 w-56 bg-white border border-gray-200 rounded-lg shadow-lg",children:s.jsxs("div",{className:"py-1",children:[s.jsxs("button",{onClick:r,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[s.jsx(Zy,{className:"w-4 h-4 mr-3 text-green-500"}),o("actions.addFromDesktop","Add from desktop")]}),s.jsx("button",{onClick:n,disabled:a,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-3 border-2 border-t-transparent border-gray-500 rounded-full animate-spin"}),o("common.loading","Loading...")]}):s.jsxs(s.Fragment,{children:[s.jsx("img",{src:i,alt:"Canva",className:"w-4 h-4 mr-3"}),o("actions.addFromCanva","Add from Canva")]})})]})})]})},Tat=({dragActive:e,allowMultipleImages:t,onDrag:r,onDrop:n,onChange:a,inputId:i="file-upload"})=>{const{t:o}=Te();return s.jsxs("div",{onDragEnter:r,onDragLeave:r,onDragOver:r,onDrop:n,className:`mt-1 flex justify-center px-6 pt-5 pb-6 border-2 ${e?"border-primary-500":"border-gray-300"} border-dashed rounded-md h-64 items-center text-center relative`,children:[s.jsx("input",{id:i,name:i,type:"file",className:"sr-only",onChange:a,accept:t?".jpg,.jpeg,.png,.mp4,.mov":"image/*,video/*,application/pdf",multiple:t}),s.jsxs("label",{htmlFor:i,className:"w-full h-full flex flex-col items-center justify-center cursor-pointer",children:[s.jsx(Zy,{className:`mx-auto h-12 w-12 ${e?"text-primary-500":"text-gray-400"}`}),s.jsx("span",{className:`mt-2 block text-sm font-medium ${e?"text-primary-600":"text-gray-900"}`,children:t?o("postContent.dropMediaHereMultiple","Drop your media here or click to upload (multiple allowed)"):o("postContent.dropMediaHere","Drop your media here or click to upload")}),s.jsx("p",{className:`mt-1 text-xs ${e?"text-primary-500":"text-gray-500"}`,children:t?o("postContent.supportedFormatsMultiple","Supports JPG, PNG, MP4, MOV up to 10MB each"):o("postContent.supportedFormats","Supports images, videos and PDFs up to 10MB")})]})]})},aC=({file:e,url:t,className:r="",style:n={}})=>{const a=U.useMemo(()=>e instanceof File?URL.createObjectURL(e):null,[e]);U.useEffect(()=>()=>{a&&URL.revokeObjectURL(a)},[a]);const[i,o]=U.useState(1),[l,c]=U.useState(null),[u,d]=U.useState(!1),[f,m]=U.useState(null),h=U.useRef(null),[p,g]=U.useState(0),[y,v]=U.useState(null),[x,j]=U.useState(!1),[C,N]=U.useState(!0);U.useEffect(()=>{const P=h.current;if(!P)return;g(P.getBoundingClientRect().width);const E=new ResizeObserver(F=>{const $=F[0];g($.contentRect.width)});return E.observe(P),()=>E.disconnect()},[]);const S=a||t||"",M=!!(t&&!a);if(!S)return s.jsx("div",{className:`flex items-center justify-center bg-gray-100 rounded-lg ${r}`,style:n,children:s.jsx("p",{className:"text-xs text-gray-600",children:"No PDF"})});const k=i>1,I=l?i<l:!0,T=U.useRef(null),L=U.useRef(null),R=U.useRef(null),_=U.useCallback(async()=>{const P=window;if(P.pdfjsLib)return P.pdfjsLib;await new Promise((F,$)=>{const H=document.createElement("script");H.src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js",H.async=!0,H.onload=()=>F(),H.onerror=()=>{const X=document.createElement("script");X.src="https://unpkg.com/[email protected]/build/pdf.min.js",X.async=!0,X.onload=()=>F(),X.onerror=()=>$(new Error("Failed to load pdf.js")),document.head.appendChild(X)},document.head.appendChild(H)});const E=window.pdfjsLib;return E&&(E.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.min.js"),E},[]);U.useEffect(()=>{let P=!1;async function E(){try{const F=await _();if(!F)return;N(!0);let $;if(e instanceof File){const X=URL.createObjectURL(e);$=F.getDocument(X)}else if(t){const X=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?`/api/pdf-proxy?url=${encodeURIComponent(t)}`:t;try{const ue=await fetch(X,{mode:"cors"});if(!ue.ok)throw new Error(`HTTP ${ue.status}`);const le=await ue.arrayBuffer();$=F.getDocument({data:le})}catch{$=F.getDocument({url:t,disableRange:!0,disableStream:!0,withCredentials:!1})}}else{v("No PDF data");return}const H=await $.promise;if(P)return;R.current=H,c(H.numPages||null),o(1);try{const ue=(await H.getPage(1)).getViewport({scale:1}),le=ue.height/ue.width;isFinite(le)&&le>.3&&le<3.5&&m(le)}catch{}d(!0),v(null),N(!1)}catch{c(null),v("Unable to render PDF"),M&&j(!0),N(!1)}}return E(),()=>{P=!0,L.current&&L.current.cancel()}},[e,t,_]),U.useEffect(()=>{async function P(){const E=R.current,F=T.current;
3926if(!E||!F||!p)return;const $=await E.getPage(i),H=$.getViewport({scale:1}),X=p/H.width,ue=$.getViewport({scale:X}),le=F.getContext("2d");if(!le)return;const ae=window.devicePixelRatio||1;F.width=Math.floor(ue.width*ae),F.height=Math.floor(ue.height*ae),F.style.width=`${Math.floor(ue.width)}px`,F.style.height=`${Math.floor(ue.height)}px`,le.setTransform(ae,0,0,ae,0,0);const te=ue.height/ue.width;(!f||Math.abs(te-f)>.01)&&m(te),L.current&&L.current.cancel(),L.current=$.render({canvasContext:le,viewport:ue});try{await L.current.promise}catch(ne){ne&&ne.name!=="RenderingCancelledException"&&v("Render failed")}N(!1)}P()},[i,p,u]);const B=T.current,z=B&&B.width?Math.max(.5,Math.min(3,B.height/B.width)):null,A=Math.max(320,Math.round(p*(f??z??1.4142)));return s.jsxs("div",{ref:h,className:`w-full rounded-lg bg-gray-100 relative ${r}`,style:n,children:[s.jsxs("div",{style:{width:"100%",height:A},className:"overflow-hidden rounded-lg border border-black flex items-center justify-center",children:[y?M&&t?s.jsx("iframe",{src:`https://docs.google.com/gview?embedded=1&url=${encodeURIComponent(t)}`,title:"PDF preview (fallback)",className:"w-full h-full",style:{border:"none"}}):s.jsxs("div",{className:"text-center text-xs text-gray-600",children:[s.jsx("div",{className:"mb-2",children:y}),s.jsx("a",{href:a||t||"#",target:"_blank",rel:"noopener noreferrer",className:"inline-block px-2 py-1 border border-black rounded bg-white hover:bg-gray-50",children:"Open PDF"}),x&&s.jsx("div",{className:"mt-2 text-[10px] text-gray-500 max-w-[90%] mx-auto",children:"Remote host blocks embedding or CORS; preview uses fallback. Download to view if blocked."})]}):s.jsx("canvas",{ref:T,className:"max-w-full max-h-full"}),C&&!y&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-transparent","aria-label":"Loading PDF",children:s.jsx(tA,{size:"md"})})]}),s.jsxs("div",{className:"absolute top-3 right-3 bg-black/70 text-white text-xs px-2 py-0.5 rounded",children:[i,l?`/${l}`:""]}),s.jsx("button",{type:"button","aria-label":"Previous page",onClick:()=>k&&o(P=>Math.max(1,P-1)),disabled:!k,className:`absolute left-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full border border-black bg-white shadow flex items-center justify-center ${k?"hover:bg-gray-50":"opacity-50 cursor-not-allowed"}`,children:"‹"}),s.jsx("button",{type:"button","aria-label":"Next page",onClick:()=>I&&o(P=>P+1),disabled:!I,className:`absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full border border-black bg-white shadow flex items-center justify-center ${I?"hover:bg-gray-50":"opacity-50 cursor-not-allowed"}`,children:"›"})]})},X$=({url:e})=>{const r=(a=>{const i=a.toLowerCase();return i.includes("youtube.com")||i.includes("youtu.be")?{name:"YouTube",icon:F7,color:"text-red-600"}:i.includes("facebook.com")?{name:"Facebook",icon:qme,color:"text-blue-600"}:i.includes("instagram.com")?{name:"Instagram",icon:Gme,color:"text-pink-600"}:{name:"Video",icon:fL,color:"text-gray-600"}})(e),n=r.icon;return s.jsx("div",{className:"w-full h-full bg-gray-100 flex flex-col items-center justify-center p-4",children:s.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-200 rounded-full flex items-center justify-center",children:s.jsx(n,{className:`w-8 h-8 ${r.color}`})}),s.jsx("div",{className:"absolute -bottom-1 -right-1 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-md",children:s.jsx(fL,{className:"w-4 h-4 text-gray-600 ml-0.5",fill:"currentColor"})})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-sm font-medium text-gray-700",children:[r.name," Video"]}),s.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center mt-2 px-3 py-1 bg-primary-600 text-white text-xs rounded-full hover:bg-primary-700 transition-colors",children:"View Video"})]})]})})},Aat=({existingMediaUrls:e,multipleMedia:t,singleMedia:r,existingMediaUrl:n,existingMediaType:a,onRemoveSingle:i,onRemoveMulti:o,onRemoveExistingUrl:l})=>{const c=g=>!!(g&&(g.type==="application/pdf"||g.name.toLowerCase().endsWith(".pdf"))),u=g=>!!(g&&(g.type==="video/mp4"||g.type==="video/quicktime"||g.name.toLowerCase().match(/\.(mp4|mov)$/))),d=g=>g.toLowerCase().match(/\.(mp4|mov)$/),f=g=>{const y=g.toLowerCase();return y.includes("youtube.com")||y.includes("youtu.be")||y.includes("facebook.com")&&y.includes("/videos/")||y.includes("instagram.com")&&(y.includes("/reel/")||y.includes("/p/"))},m=(r?1:0)+(n?1:0),h=e.length+t.length+m,p=h===1?"grid-cols-1":h===2?"grid-cols-2":"grid-cols-3";return s.jsxs("div",{className:`grid ${p} gap-3`,children:[e.map((g,y)=>s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-100",children:[s.jsx("div",{className:"w-full",style:{aspectRatio:"4 / 5"},children:d(g)?s.jsx(Zi,{src:g,alt:`Video ${y+1}`,type:"video",className:"w-full h-full object-cover",controls:!0}):f(g)?s.jsx(X$,{url:g}):s.jsx(Zi,{src:g,alt:`Image ${y+1}`,type:"image",className:"w-full h-full object-cover",controls:!1})}),l&&s.jsx("button",{onClick:()=>l(y),className:"absolute top-2 right-2 p-1 bg-black bg-opacity-50 text-white rounded-full hover:bg-opacity-75",title:"Remove media",children:s.jsx(_t,{className:"w-4 h-4"})})]},`url-${y}`)),t.map((g,y)=>s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-100",children:[s.jsx("div",{className:"w-full",style:{aspectRatio:"4 / 5"},children:u(g)?s.jsx(Zi,{src:URL.createObjectURL(g),alt:`Video ${y+1}`,type:"video",className:"w-full h-full object-cover",controls:!0}):c(g)?s.jsx(aC,{file:g,className:"w-full h-full"}):s.jsx(Zi,{src:URL.createObjectURL(g),alt:`Image ${y+1}`,type:"image",className:"w-full h-full object-cover",controls:!1})}),s.jsx("button",{onClick:()=>o(y),className:"absolute top-2 right-2 p-1 bg-black bg-opacity-50 text-white rounded-full hover:bg-opacity-75",title:"Remove media",children:s.jsx(_t,{className:"w-4 h-4"})})]},`file-${y}`)),r&&e.length===0&&t.length===0&&s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-100",children:[s.jsx("div",{className:"w-full",style:{aspectRatio:"4 / 5"},children:u(r)?s.jsx(Zi,{src:URL.createObjectURL(r),alt:"Video",type:"video",className:"w-full h-full object-cover",controls:!0}):c(r)?s.jsx(aC,{file:r,className:"w-full h-full"}):s.jsx(Zi,{src:URL.createObjectURL(r),alt:"Image",type:"image",className:"w-full h-full object-cover",controls:!1})}),s.jsx("button",{onClick:i,className:"absolute top-2 right-2 p-1 bg-black bg-opacity-50 text-white rounded-full hover:bg-opacity-75",title:"Remove media",children:s.jsx(_t,{className:"w-4 h-4"})})]},"single-media"),n&&e.length===0&&t.length===0&&!r&&s.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-100",children:[s.jsx("div",{className:"w-full",style:{aspectRatio:"4 / 5"},children:a==="video"&&d(n)?s.jsx(Zi,{src:n,alt:"Video",type:"video",className:"w-full h-full object-cover",controls:!0}):a==="video"&&f(n)?s.jsx(X$,{url:n}):n.toLowerCase().endsWith(".pdf")?s.jsx(aC,{url:n,className:"w-full h-full"}):s.jsx(Zi,{src:n,alt:"Image",type:"image",className:"w-full h-full object-cover",controls:!1})}),s.jsx("button",{onClick:i,className:"absolute top-2 right-2 p-1 bg-black bg-opacity-50 text-white rounded-full hover:bg-opacity-75",title:"Remove media",children:s.jsx(_t,{className:"w-4 h-4"})})]},"single-existing")]})},Pat=({isOpen:e,onClose:t,url:r})=>{const{t:n}=Te(),[a,i]=b.useState(!1);return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-hidden",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4 lg:ml-16",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl w-[95vw] lg:w-[calc(95vw-4rem)] max-w-none h-[95vh] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("h2",{className:"text-xl font-semibold",children:n("socialness.browser","Socialness Browser")})}),s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",title:n("common.close","Close"),children:"×"})})]}),s.jsxs("div",{className:"flex-1 h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-gray-200",children:[s.jsx("div",{className:"text-sm text-gray-600 truncate",title:r,children:r||"https://www.socialness.ai"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("button",{onClick:()=>{r&&window.open(r,"_blank","noopener,noreferrer")},className:"text-sm text-primary-600 hover:text-primary-700",children:n("common.openInNewTab","Open in new tab")})})]}),s.jsx("iframe",{src:r||"https://www.socialness.ai",className:"w-full h-full min-h-[calc(95vh-80px)]",title:"Socialness Browser",allow:"clipboard-read; clipboard-write; fullscreen; autoplay; encrypted-media; picture-in-picture; web-share",sandbox:"allow-same-origin allow-scripts allow-forms allow-popups allow-presentation allow-downloads allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",onError:()=>i(!0),onLoad:()=>i(!1)}),a&&s.jsx("div",{className:"absolute inset-0 bg-white/90 flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-gray-700 mb-3",children:n("canva.embedBlocked","The editor refused to load in an embedded view.")}),s.jsx("button",{onClick:()=>{r&&window.open(r,"_blank","noopener,noreferrer")},className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700",children:n("actions.openInCanva","Open in Canva")})]})})]})]})]})}):null},_at="/assets/No%20Preview%20Yet-CaEt0GQe.png",Lat=({isOpen:e,isExporting:t,isRefreshing:r,canvaDesigns:n,canvaDesignsPage:a,selectedCanvaDesigns:i,onClose:o,onToggleSelect:l,onImportSelected:c,onRefresh:u,setPage:d,canvaLogo:f})=>{const{t:m}=Te();if(!e)return null;const h=Math.ceil(((n==null?void 0:n.length)||0)/10);return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4 lg:ml-16",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:()=>{t||o()}}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl w-[85vw] lg:w-[calc(90vw-4rem)] max-w-none max-h-[90vh] overflow-hidden",children:[t&&s.jsx("div",{className:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center z-10 rounded-xl",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-8 h-8 border-4 border-primary-600 border-t-transparent roun
3926ded-full animate-spin mx-auto mb-4"}),s.jsx("p",{className:"text-gray-700 font-medium",children:m("canva.exportingDesigns","Exporting designs...")}),s.jsx("p",{className:"text-gray-500 text-sm mt-1",children:m("canva.preparingImages","Please wait while we prepare your images")})]})}),s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:f,alt:"Canva",className:"w-6 h-6"}),s.jsx("h2",{className:"text-xl font-semibold",children:i.length>0?i.length===1?m("canva.selectDesignSingular","Select Canva Designs ({{count}} selected)",{count:i.length}):m("canva.selectDesignsPlural","Select Canva Designs ({{count}} selected)",{count:i.length}):m("canva.selectDesign","Select a Canva Design")})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[i.length>0&&s.jsx("button",{onClick:c,disabled:t,className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white text-sm font-medium rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:t?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-t-transparent border-white rounded-full animate-spin"}),m("canva.exporting","Exporting...",{count:i.length})]}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),i.length===1?m("canva.addMedia","Add 1 media",{count:i.length}):m("canva.addMedias","Add {{count}} medias",{count:i.length})]})}),s.jsx("button",{onClick:u,disabled:t||r,className:"inline-flex items-center px-3 py-2 text-gray-600 hover:text-gray-800 disabled:opacity-50 disabled:cursor-not-allowed text-sm font-medium rounded-lg hover:bg-gray-100 transition-colors",title:m("canva.refreshDesigns","Refresh designs"),children:r?s.jsx("div",{className:"w-4 h-4 border-2 border-t-transparent border-gray-500 rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),s.jsx("button",{onClick:o,disabled:t,className:"text-gray-400 hover:text-gray-500 disabled:opacity-50 disabled:cursor-not-allowed",title:t?m("canva.waitForExport","Please wait for export to complete"):m("common.close","Close"),children:"×"})]})]}),s.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-120px)]",children:n.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:n.slice(a*10,(a+1)*10).map(p=>{const g=i.some(y=>y.id===p.id);return s.jsxs("div",{onClick:()=>l(p),className:`group cursor-pointer border-2 rounded-lg overflow-hidden hover:shadow-md transition-all duration-200 ${g?"border-primary-500 bg-primary-50 shadow-md":"border-gray-200 hover:border-primary-500"}`,children:[s.jsxs("div",{className:"aspect-square bg-gray-100 relative",children:[p.thumbnail?s.jsx("img",{src:p.thumbnail.url,alt:p.title||"Canva Design",title:p.thumbnail.url,className:"w-full h-full object-cover"}):s.jsx("img",{src:_at,alt:m("canva.noPreview","No preview"),className:"w-full h-full object-contain bg-gray-100"}),s.jsx("div",{className:"absolute top-2 left-2",children:s.jsx("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ${g?"bg-primary-500 border-primary-500":"bg-white border-gray-300 group-hover:border-primary-500"}`,children:g&&s.jsx("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 transition-all duration-200 flex items-center justify-center",children:s.jsx("div",{className:"bg-white bg-opacity-90 rounded-full p-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:s.jsxs("svg",{className:"w-4 h-4 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-900 line-clamp-2 mb-1",children:p.title||"Untitled Design"}),s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[s.jsx("span",{children:typeof p.page_count=="number"?s.jsxs(s.Fragment,{children:[p.page_count," page",p.page_count!==1?"s":""]}):null}),s.jsx("span",{children:p.updated_at?new Date(p.updated_at*1e3).toLocaleDateString():""})]})]})]}
3926,p.id)})}),s.jsxs("div",{className:"flex items-center justify-between mt-6",children:[s.jsxs("button",{onClick:()=>d(Math.max(0,a-1)),disabled:a===0,className:"inline-flex items-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[s.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),m("common.previous","Previous")]}),s.jsx("div",{className:"text-sm text-gray-500",children:m("canva.page","Page {{current}} of {{total}}",{current:a+1,total:h})}),s.jsxs("button",{onClick:()=>d(Math.min(Math.floor((n.length||0)/10),a+1)),disabled:a>=Math.floor((n.length||0)/10),className:"inline-flex items-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[m("common.next","Next"),s.jsx("svg",{className:"w-4 h-4 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx("img",{src:f,alt:"Canva",className:"w-12 h-12 mx-auto mb-4 opacity-50"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:m("canva.noDesigns","No designs found")}),s.jsx("p",{className:"text-gray-500 mb-4",children:m("canva.noDesignsDesc","You don't have any designs in your Canva account yet.")}),s.jsxs("button",{onClick:o,className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx("img",{src:f,alt:"Canva",className:"w-4 h-4 mr-2"}),m("canva.createNew","Create new design")]})]})})]})]})})},Dat=({tag:e})=>{const{t}=Te(),r=rA(t);if(!e)return null;const n=Aj(e||void 0);if(!n)return null;const a=py[n];return a?s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs border ${a.bg} ${a.text} ${a.border}`,children:[s.jsx("span",{children:gy[n]}),s.jsx("span",{children:r[n]})]}):null},Oat=({count:e,minCap:t,selectedCaps:r})=>{const{t:n}=Te();if(r.length>0){if(e>t){const a=r.map(({platform:i,cap:o})=>`${i}: ${o}`).join(", ");return s.jsx("div",{className:"text-xs text-orange-700 bg-orange-50 border border-orange-200 rounded px-2 py-1 text-center",children:n("warnings.multiImagesCap","You selected {{count}} images. Current platform limits, {{list}}.",{count:e,list:a})})}return null}return e>20?s.jsx("div",{className:"text-xs text-orange-700 bg-orange-50 border border-orange-200 rounded px-2 py-1 text-center",children:n("warnings.instagramCap","Instagram carousel supports up to 20 images.")}):null},Rat=({brandId:e,content:t="",selectedPlatforms:r=[],onExistingMediaChange:n,onMediaChange:a,setError:i})=>{const{t:o}=Te(),l=uet(),[c,u]=b.useState(!1),[d,f]=b.useState(null),m=(p,g)=>{if(!e){i==null||i(o("errors.missingBrand","Missing brand for image generation"));return}const y={brandId:e,postContent:t||"Generate an image",tone:"professional",platforms:r.length>0?r:["instagram","linkedin"],aspect_ratio:fY(g),style_type:mY(p)};l.mutate(y,{onSuccess:v=>{v.imageUrl&&f(v.imageUrl)},onError:v=>{i==null||i((v==null?void 0:v.message)||o("errors.imageGenerationFailed","Image generation failed"))}})},h=p=>{n==null||n(p),a==null||a(null),f(null),u(!1)};return{isOpen:c,setIsOpen:u,isLoading:l.isPending,temporaryUrl:d,setTemporaryUrl:f,handleGenerate:m,handleValidate:h}},qQ=()=>{const{t:e}=Te(),{showToast:t}=bc(),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState([]),[m,h]=b.useState(!1),[p,g]=b.useState(0),[y,v]=b.useState([]),[x,j]=b.useState(!1),[C,N]=b.useState(!1),S=async()=>{try{u(!0);const _=await ul.get("/management/integrations/canva/config");if(_.data.success&&_.data.authUrl){const B=window.location.pathname+window.location.search;sessionStorage.setItem("oauth_redirect_after_auth",B),sessionStorage.setItem("oauth_redirect_timestamp",Date.now().toString()),sessionStorage.setItem("oauth_canva_config","true"),window.location.href=_.data.authUrl}else t(e("integrations.configError","Failed to configure Canva integration. Please try again."),"error")}catch{t(e("integrations.configError","Failed to configure Canva integration. Please try again."),"error")}finally{u(!1)}},M=async(_=!1)=>{var $,H,X;const B=Qe.currentUser;if(!B)throw new Error("No authenticated user");const z=await B.getIdToken(),D=100,A=20,P=[];let E=null;for(let ue=0;ue<A;ue+=1){const le=new URL("https://api.socialness.ai/management/integrations/canva/designs");le.searchParams.set("limit",String(D)),E&&le.searchParams.set("continuation",E);const ae=await fetch(le.toString(),{method:"GET",headers:{Authorization:`Bearer ${z}`}});if(!ae.ok){if(ae.status===401||ae.status===403){let G=!0;try{const Q=await ae.clone().json();Q&&typeof Q=="object"&&(G=(Q.code||(($=Q.error)==null?void 0:$.code))==="canva_reauth_required"||!!Q.requiresReauth||!!((H=Q.error)!=null&&H.requiresReauth)||ae.status===401||ae.status===403)}catch{}return _?(t(e("integrations.canvaAuthFailed","Canva authorization failed. Please try reconnecting from the Integrations page."),"error"),null):(G&&await S(),null)}const J=await ae.text();throw new Error(`API Error: ${ae.status} - ${J}`)}const te=await ae.json();if(!te.success||!((X=te.data)!=null&&X.designs))break;P.push(...te.data.designs);const ne=te.data.continuation;if(!ne)break;E=ne}const F=P.map(ue=>{var ne,J,G,Q,W,Y,q,Z,me,we,he,ie,ye;const le=(ne=ue.thumbnail)==null?void 0:ne.url,ae=(G=(J=ue.urls)==null?void 0:J.thumbnail)==null?void 0:G.url,te=(W=(Q=le||ae||"")==null?void 0:Q.replace)==null?void 0:W.call(Q,/^@/,"");return{...ue,urls:{...ue.urls,view_url:((q=(Y=ue.urls)==null?void 0:Y.view_url)==null?void 0:q.replace(/^@/,""))||((Z=ue.urls)==null?void 0:Z.view_url),edit_url:((we=(me=ue.urls)==null?void 0:me.edit_url)==null?void 0:we.replace(/^@/,""))||((he=ue.urls)==null?void 0:he.edit_url),thumbnail:(ie=ue.urls)!=null&&ie.thumbnail?{...ue.urls.thumbnail,url:(ue.urls.thumbnail.url||"").replace(/^@/,"")}:(ye=ue.urls)==null?void 0:ye.thumbnail},thumbnail:te?{url:te}:void 0}});return f(F),g(0),F};return{isCanvaLoading:r,isFetchingDesigns:a,isRefreshingDesigns:o,isConfiguringCanva:c,canvaDesigns:d,isCanvaDesignsModalOpen:m,canvaDesignsPage:p,selectedCanvaDesigns:y,isExportingDesigns:x,isSocialnessModalOpen:C,setIsSocialnessModalOpen:N,setIsCanvaDesignsModalOpen:h,setCanvaDesignsPage:g,setSelectedCanvaDesigns:v,configureCanvaIntegration:S,handleRefreshDesigns:async()=>
3926{l(!0);try{await M()}finally{l(!1)}},handleAddFromCanva:async(_=!1)=>{i(!0);try{await M(_)&&h(!0)}finally{i(!1)}},handleCanvaDesignToggle:_=>{v(B=>B.some(D=>D.id===_.id)?B.filter(D=>D.id!==_.id):[...B,_])},exportCanvaDesigns:async _=>{var B;j(!0);try{const z=Qe.currentUser;if(!z)throw new Error("No authenticated user");const D=await z.getIdToken(),A=await fetch("https://api.socialness.ai/management/integrations/canva/export",{method:"POST",headers:{Authorization:`Bearer ${D}`,"Content-Type":"application/json"},body:JSON.stringify({designs:_.map(E=>({designId:E}))})});if(!A.ok)throw new Error(`Export failed: ${A.status}`);const P=await A.json();if(P.success&&((B=P.data)!=null&&B.export_jobs)){const E=[];for(const F of P.data.export_jobs)F.status==="success"&&F.urls&&F.urls.length>0&&E.push(...F.urls);if(E.length>0)return E;throw new Error("No export URLs received from successful jobs")}throw new Error("Export request failed or returned no jobs")}finally{j(!1)}},createNewDesign:async()=>{var _,B;try{const z=Qe.currentUser;if(!z)throw new Error("No authenticated user");const D=await z.getIdToken(),A=await fetch("https://api.socialness.ai/management/integrations/canva/new-design",{method:"GET",headers:{Authorization:`Bearer ${D}`}});if(!A.ok)throw new Error(`Create design failed: ${A.status}`);const P=await A.json();return((B=(_=P==null?void 0:P.design)==null?void 0:_.urls)==null?void 0:B.edit_url)||null}catch{return null}}}},$at=({brandId:e,media:t,onMediaChange:r,onClearMedia:n,existingMediaUrl:a,existingMediaType:i,content:o="",selectedPlatforms:l=[],onExistingMediaChange:c,existingMediaUrls:u=[],onExistingMediaUrlsChange:d,currentImageStyle:f,allowMultipleImages:m=!1,multipleMedia:h=[],onMultipleImagesChange:p,postMediaTypeTag:g,onCanvaModalToggle:y,openCanvaModalOnLoad:v,onSaveDraft:x})=>{const{t:j}=Te();bc();const[C,N]=b.useState(!1),[S,M]=b.useState(!1),[k,I]=b.useState(!1),T=b.useRef(null),L=b.useRef(null),R=b.useRef(null),_=Rat({brandId:e,content:o,selectedPlatforms:l,onExistingMediaChange:c,onMediaChange:r,setError:oe=>q({submit:oe})}),{isCanvaLoading:B,isFetchingDesigns:z,isRefreshingDesigns:D,isConfiguringCanva:A,canvaDesigns:P,isCanvaDesignsModalOpen:E,canvaDesignsPage:F,selectedCanvaDesigns:$,isExportingDesigns:H,isSocialnessModalOpen:X,setIsSocialnessModalOpen:ue,setIsCanvaDesignsModalOpen:le,setCanvaDesignsPage:ae,handleRefreshDesigns:te,handleAddFromCanva:ne,handleCanvaDesignToggle:J,exportCanvaDesigns:G,createNewDesign:Q,setSelectedCanvaDesigns:W}=qQ(),[Y,q]=b.useState({}),Z=oe=>{oe.preventDefault(),oe.stopPropagation(),oe.type==="dragenter"||oe.type==="dragover"?N(!0):oe.type==="dragleave"&&N(!1)},me=oe=>{if(oe.preventDefault(),oe.stopPropagation(),N(!1),!oe.dataTransfer.files)return;const Ne=Array.from(oe.dataTransfer.files);if(m){const Ae=Ne.filter(lt=>lt.type==="image/jpeg"||lt.type==="image/png"||lt.type==="video/mp4"||lt.type==="video/quicktime");Ae.length>0&&(p==null||p([...h||[],...Ae]))}else Ne[0]&&r(Ne[0])},we=oe=>{if(!oe.target.files)return;const Ne=Array.from(oe.target.files);if(m){const Ae=Ne.filter(lt=>lt.type==="image/jpeg"||lt.type==="image/png"||lt.type==="video/mp4"||lt.type==="video/quicktime");Ae.length>0&&(p==null||p([...h||[],...Ae])),r(null)}else Ne[0]&&r(Ne[0])},he=()=>{n==null||n(),c==null||c(null)},ie=oe=>{if(!p)return;const Ne=[...h||[]];Ne.splice(oe,1),p(Ne)},ye=oe=>{if(!d)return;const Ne=[...u||[]];Ne.splice(oe,1),d(Ne)},[pe]=b.useState(void 0),ce=async()=>{try{await(x==null?void 0:x())}catch{}const oe=await Q();if(oe){const Ne=window.open(oe,"_blank","noopener,noreferrer");Ne&&(Ne.opener=null);return}else q({submit:j("errors.canvaCreateFailed","Failed to start a new Canva design")})},xe=()=>{const oe=o&&o.trim()!=="",Ne=l&&l.length>0;if(!oe&&!Ne){q({createImage:j("errors.captionAndPlatformRequired","Please add a caption and select a publishing channel before creating an image")});return}if(!oe){q({createImage:j("errors.captionRequired","Please add a caption before creating an image")});return}if(!Ne){q({createImage:j("errors.platformRequired","Please select a publishing channel before creating an image")});return}q({}),M(Ae=>!Ae)},Ee=async()=>{var oe,Ne,Ae,lt;if($.length!==0)try{const Mt=[],jt=[];for(const Xe of $){let Bt=null;const ve=[(Ne=(oe=Xe.urls)==null?void 0:oe.thumbnail)==null?void 0:Ne.url,(Ae=Xe.urls)==null?void 0:Ae.view_url,(lt
3926=Xe.urls)==null?void 0:lt.edit_url].filter(Boolean);for(const Fe of ve){const nt=Fe.replace(/^@/,"");if(!(nt.includes("canva.com/api/design")&&(nt.includes("/view")||nt.includes("/edit")))&&!nt.includes("canva.com/api/design")){Bt=nt;break}}Bt?Mt.push(Bt):jt.push(Xe.id)}if(jt.length>0)try{const Xe=await G(jt);Mt.push(...Xe)}catch{}if(Mt.length>0){const Xe=[];u&&u.length>0?Xe.push(...u):a&&Xe.push(a),Xe.push(...Mt),Xe.length>1?(d==null||d(Xe),c==null||c(null)):Xe.length===1&&(c==null||c(Xe[0]),d==null||d([]))}else throw new Error("No valid image URLs found for selected designs.");W([]),le(!1)}catch(Mt){q({submit:(Mt==null?void 0:Mt.message)||j("errors.canvaSelectFailed","Failed to import selected designs")})}};b.useEffect(()=>{const oe=Ne=>{L.current&&!L.current.contains(Ne.target)&&M(!1),R.current&&!R.current.contains(Ne.target)&&I(!1)};if(S||k)return document.addEventListener("mousedown",oe),()=>document.removeEventListener("mousedown",oe)},[S,k]),b.useEffect(()=>{const oe=async()=>{const Ae=sessionStorage.getItem("oauth_canva_config"),lt=sessionStorage.getItem("canva_export_url");if(Ae==="true"&&(sessionStorage.removeItem("oauth_canva_config"),setTimeout(async()=>{try{await ne(!0)}catch{}},1e3)),lt){sessionStorage.removeItem("canva_export_url");try{const Mt=u!=null&&u.length?[...u]:[];a&&Mt.push(a),Mt.push(lt),Mt.length>1?(d==null||d(Mt),c==null||c(null)):(c==null||c(lt),d==null||d([]))}catch(Mt){console.error("Error handling Canva export URL:",Mt)}}};oe();const Ne=()=>{document.hidden||oe()};return document.addEventListener("visibilitychange",Ne),()=>document.removeEventListener("visibilitychange",Ne)},[u,a,d,c]),b.useEffect(()=>{y==null||y(E)},[E,y]);const Ye=b.useRef(!1);b.useEffect(()=>{v&&!Ye.current&&(Ye.current=!0,ne())},[v,ne]),b.useEffect(()=>{o&&o.trim()!==""&&l&&l.length>0&&Y.createImage&&q({})},[o,l,Y.createImage]);const fe={instagram:20,facebook:10,linkedin:9,"google-business":10,twitter:4},je=()=>{const oe=(l||[]).map(Ae=>({platform:Ae.toLowerCase(),cap:fe[Ae.toLowerCase()]})).filter(Ae=>typeof Ae.cap=="number");return oe.length===0?{minCap:20,caps:[]}:{minCap:oe.reduce((Ae,{cap:lt})=>Math.min(Ae,lt),oe[0].cap),caps:oe}},{minCap:We,caps:yt}=je(),gt={instagram:"Instagram",facebook:"Facebook",linkedin:"LinkedIn","google-business":"Google Business",twitter:"Twitter"},qe=yt.length>0?yt.reduce((oe,Ne)=>Ne.cap<oe.cap?Ne:oe,yt[0]):void 0,ze=qe?gt[qe.platform]||qe.platform:j("common.platform","Platform"),$e=(t?1:0)+(a?1:0)+((u==null?void 0:u.length)||0)+((h==null?void 0:h.length)||0),ct=(()=>{if(!e)return!1;const oe=g?Aj(g||void 0):void 0;return!(oe&&(oe==="document"||oe==="multi"||oe==="video")||i==="video"||t&&typeof t.type=="string"&&t.type.startsWith("video/")||((u==null?void 0:u.length)||0)>1||((h==null?void 0:h.length)||0)>1)})();return s.jsxs("div",{className:"bg-white rounded-xl shadow-md p-6 border border-black",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:j("mediaPost.title","Media")}),s.jsx(Dat,{tag:g})]}),s.jsx("div",{className:"flex items-center gap-3",ref:L,children:ct&&s.jsx(Iat,{isOpen:S,isGenerating:_.isLoading,isCanvaLoading:B,onToggle:xe,onGenerate:()=>{M(!1),_.setIsOpen(!0)},onCanva:()=>{M(!1),ce()},canvaLogo:Pv})})]}),Y.createImage&&s.jsx("div",{className:"mt-2 bg-red-50 border border-red-200 rounded-md p-2",children:s.jsx("p",{className:"text-sm text-red-600",children:Y.createImage})}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"mb-2",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700",children:j("postContent.media","Media")}),m&&s.jsxs("span",{className:"text-[11px] text-gray-600 italic",children:[$e,"/",We," ",j("common.images","images")]})]}),m&&s.jsx("span",{className:"block text-[10px] text-gray-500 italic mt-0.5",children:j("hints.platformCapNamed","{{platform}} allows multi-images up to {{cap}} images",{platform:ze,cap:We})})]}),h.length>0||u.length>0||t||a?s.jsxs("div",{className:"relative",children:[s.jsx(Aat,{existingMediaUrls:u,multipleMedia:h,singleMedia:t,existingMediaUrl:a,existingMediaType:i||null,onRemoveSingle:he,onRemoveMulti:ie,onRemoveExistingUrl:d?ye:void 0}),s.jsxs("div",{className:"mt-3 flex flex-col items-center justify-center gap-1",children:[s.jsx(Oat,{count:u.length+h.length,minCap:We,selectedCaps:yt}),s.jsx("input",{ref:T,type:"file",accept:".jpg,.jpeg,.png,.mp4,.mov",multiple:!0,className:"hidden",onChange:we}),s.jsx("div",{ref:R,className:"relative",children:s.jsx(Eat,{isOpen:k,onToggle:()=>I(oe=>!oe),onAddFromDesktop:()=>{var oe;return(oe=T.current)==null?void 0:oe.click()},onAddFromCanva:ne,isBusy:z||A,canvaLogo:Pv})})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Tat,{dragActive:C,allowMultipleImages:m,onDrag:Z,onDrop:me,onChange:we}),s.jsx("div",{className:"mt-4 flex justify-center",children:s.jsx("button",{onClick:ne,disabled:z||A,className:"inline-flex items-center px-4 py-2 text-sm font-medium text-primary-600 bg-white border border-primary-600 hover:bg-primary-50 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:z||A?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-t-transparent border-primary-600 rounded-full animate-spin"}),A?j("integrations.configuring","Configuring..."):j("common.loading","Loading...")]}):s.jsxs(s.Fragment,{children:[s.jsx("img",{src:Pv,alt:"Canva",className:"w-4 h-4 mr-2"}),j("actions.addFromCanva","Add from Canva")]})})})]})]}),Y.submit&&s.jsx("div",{className:"mt-3 bg-red-50 border border-red-200 rounded-md p-3",children:s.jsx("p",{className:"text-sm text-red-600",children:Y.submit})}),s.jsx(hY,{isOpen:_.isOpen,onClose:()=>{_.setIsOpen(!1),_.setTemporaryUrl(null)},onGenerate:_.handleGenerate,onValidate:_.handleValidate,isLoading:_.isLoading,currentImageStyle:f||"auto",currentImageSize:"square",generatedImageUrl:_.temporaryUrl}),s.jsx(Pat,{isOpen:X,onClose:()=>ue(!1),url:pe}),s.jsx(Lat,{isOpen:E,isExporting:H,isRefreshing:D,canvaDesigns:P,canvaDesignsPage:F,selectedCanvaDesigns:$,onClose:()=>{H||(le(!1),W([]))},onToggleSelect:J,onImportSelected:Ee,onRefresh:te,setPage:ae,canvaLogo:Pv})]})},e9=()=>{var kr;const{t:e}=Te(),{postId:t}=U4(),r=pn(),n=vs(),a=new URLSearchParams(n.search),{showToast:i}=bc(),o=!!t,l=V2(),c=mA(),u=(Ce,Ge)=>{if(/\.pdf(\?|#|$)/i.test(Ce))return"DOCUMENT";const Je=(Ce||"").toLowerCase(),Xt=/(\.png|\.jpe?g|\.webp|\.gif|\.bmp|\.tiff?|\.avif|\.svg)(\?|#|$)/i,pr=/(\.mp4|\.mov|\.avi|\.webm|\.m4v)(\?|#|$)/i;return Xt.test(Je)?"IMAGE":pr.test(Je)||Ge==="video"?"VIDEO":"IMAGE"},d=Ce=>{const Ge=(Ce.type||"").toLowerCase();return Ge==="application/pdf"?"DOCUMENT":Ge.startsWith("video/")?"VIDEO":"IMAGE"},f=Ce=>{var Xt;let Ge=null;const Je=["id","post.id","data.id","data.post.id","success.post.id","postId","_id","documentId"];for(const pr of Je){const ot=pr.split(".").reduce((Ut,mr)=>Ut==null?void 0:Ut[mr],Ce);if(ot){Ge=ot;break}}if(!Ge&&((Xt=Ce.media)!=null&&Xt.url)){const pr=Ce.media.url,ot=pr.match(/\/(\d{13})-/);if(ot){const Ut=ot[1],mr=Ce.userId?Ce.userId.slice(-6):"";Ge=mr?`${Ut}_${mr}`:Ut}if(!Ge){const Ut=pr.match(/-([a-f0-9]{8})\./);if(Ut&&Ce.userId){const mr=Ut[1],en=Ce.userId.slice(-6);Ge=`${mr}_${en}`}}}return Ge||(Ie.error("CreateEditPostPage","Failed to extract post ID from response",Ce),null)},m=n.state,[h,p]=b.useState(o),g=b.useMemo(()=>a.get("modal")==="add-from-canva",[n.search]),y=b.useMemo(()=>a.get("modal")==="publishing",[n.search]),[v,x]=b.useState((m==null?void 0:m.content)||""),[j,C]=b.useState((m==null?void 0:m.brandId)||""),[N,S]=b.useState(m!=null&&m.platform?[m.platform]:[]),[M,k]=b.useState("regular"),[I,T]=b.useState(null),[L,R]=b.useState([]),[_,B
3926]=b.useState([]),[z,D]=b.useState((m==null?void 0:m.imageUrl)||null),[A,P]=b.useState(m!=null&&m.imageUrl?"image":null),[E,F]=b.useState("draft"),[$,H]=b.useState(null),[X,ue]=b.useState(null),[le,ae]=b.useState({show:!1}),[te,ne]=b.useState({show:!1,missingPlatforms:[]}),[J,G]=b.useState(null),[Q,W]=b.useState(!1),[Y,q]=b.useState(!1),[Z,me]=b.useState(null),[we,he]=b.useState(!1),ie=b.useRef(null),[ye,pe]=b.useState(!1),[ce,xe]=b.useState(null),[Ee,Ye]=b.useState(!o),[fe,je]=b.useState(!1),We=b.useRef(!1),yt=b.useRef(null),gt=()=>{const Ce=[...N].sort(),Ge=[..._].sort();return{content:v,selectedBrand:j,selectedPlatforms:Ce,format:M,hasLocalFile:I instanceof File,localImagesCount:L.length,mediaUrl:z||null,mediaType:A||null,existingMediaUrls:Ge,scheduledAt:$||null,requiresApproval:qe,selectedReviewerId:$e||null,tiktokSettings:Lt,youtubeSettings:et,linkedinSettings:pt,pinterestSettingsWithoutTemp:{title:Pt.title,link:Pt.link,selectedBoardId:Pt.selectedBoardId,allowComments:Pt.allowComments,availableBoards:Pt.availableBoards}}},[qe,ze]=b.useState(!1),[$e,ct]=b.useState(null),[oe,Ne]=b.useState([]),[Ae,lt]=b.useState(!1),[Mt,jt]=b.useState(null),[Xe,Bt]=b.useState(null),ve=b.useMemo(()=>oe.length,[oe]),[Fe,nt]=b.useState("preview"),[At,Wt]=b.useState(null),[In,ir]=b.useState(!1),[Qt,Sn]=b.useState(null),nn=()=>{T(null),D(null),P(null),R([])},[Lt,_e]=b.useState({title:"",allowComments:!1,allowDuets:!1,allowStitch:!1,discloseContent:!1,privacy:"",disclosureType:[],userAgreedToTerms:!1,isValid:!0}),[et,ft]=b.useState({title:"",tags:[],privacy:"public"}),[pt,$t]=b.useState({organizationId:"",visibility:"PUBLIC"}),[Pt,Ft]=b.useState({title:"",link:"",selectedBoardId:"",allowComments:!0,availableBoards:[],savedBoardName:void 0}),{data:Dr,isLoading:K}=oa();qr();const ke=b.useMemo(()=>(Dr==null?void 0:Dr.brands)||[],[Dr]),Ze=b.useMemo(()=>{var Ce;return((Ce=Qe.currentUser)==null?void 0:Ce.uid)||null},[(kr=Qe.currentUser)==null?void 0:kr.uid]),bt=b.useMemo(()=>Ce=>{var Ge,Je,Xt,pr,ot,Ut,mr,en,er,qn,En,Mr,Hr,ca,ss,ge,Oe,Nt,wt,Ir,an,ta,nr,gr,gn,Na,Hs;try{me(Ce);const it=Ce;Sn(it.postMediaType||it.post_media_type||null);let Co="";typeof it.content=="string"?Co=it.content:it.content&&typeof it.content=="object"&&it.content.text?Co=it.content.text:it.content&&typeof it.content=="object"&&(Co=JSON.stringify(it.content)),x(Co||"");const Cc=it.brandId||it.brand_id||"";C(Cc);let sn=[];it.platforms?Array.isArray(it.platforms)?sn=it.platforms:typeof it.platforms=="object"&&it.platforms!==null&&(sn=Object.keys(it.platforms)):it.platform&&(sn=[it.platform]),S(sn);const Rf=it.format||(((Ge=it.media)==null?void 0:Ge.type)==="video"?"reel":"regular");k(Rf==="reel"?"reel":"regular");let Ys=null,Gi=null,kc=!1;const Yu=it.postMediaType==="multi-image"||it.postMediaType==="multi-images"||it.postMediaType==="multi",bl=Array.isArray(it.media)&&it.media.length>1,Mc=(Xt=(Je=it.media)==null?void 0:Je.arrayValue)==null?void 0:Xt.values;if((Yu||bl)&&(Array.isArray(it.media)||Array.isArray(Mc))){const Yr=[],_s=Array.isArray(it.media)?it.media:Mc;for(const ar of _s){if(typeof ar=="string"){Yr.push(ar);continue}const yn=((pr=ar==null?void 0:ar.mapValue)==null?void 0:pr.fields)||{},Ls=(ar==null?void 0:ar.url)||((ot=yn==null?void 0:yn.url)==null?void 0:ot.stringValue)||(ar==null?void 0:ar.stringValue),is=(ar==null?void 0:ar.thumbnailUrl)||(ar==null?void 0:ar.thumbnail_url)||(ar==null?void 0:ar.thumbnailUrl1)||((Ut=yn==null?void 0:yn.thumbnailUrl)==null?void 0:Ut.stringValue),xl=((ar==null?void 0:ar.type)||((mr=yn==null?void 0:yn.type)==null?void 0:mr.stringValue)||"").toString().toLowerCase(),Qi=Ls||is,Ec=typeof Qi=="string"&&/\.(png|jpe?g|webp|gif|bmp|tiff?|avif|svg)(\?|#|$)/i.test(Qi);Qi&&(xl.startsWith("image")||xl===""||xl===void 0||Ec)&&Yr.push(Qi)}Yr.length>0&&(B(Yr),D(null),P("image"),kc=!0)}if(!kc){const Yr=Xn(it.media);Yr?(Ys=Yr.url,Gi=Yr.type):it.mediaUrl||it.media_url?(Ys=it.mediaUrl||it.media_url,Gi=it.mediaType||it.media_type||(Ys!=null&&Ys.includes(".mp4")?"video":"image")):(er=(en=it.data)==null?void 0:en.media)!=null&&er.url?(Ys=it.data.media.url,Gi=it.data.media.type||"image"):(En=(qn=it.post)==null?void 0:qn.media)!=null&&En.url&&(Ys=it.post.media.url,Gi=it.post.media.type||"image"),D(Ys),P(Gi)}F(it.status||"draft");const xs=it.scheduledAt||it.scheduled_at||it.scheduledFor||null;if(H(xs),ue(xs),(Hr=(Mr=it.platforms)==null?void 0:Mr.tiktok)!=null&&Hr.settings||(ca=it.platformSettings)!=null&&ca.tiktok||it.tiktokSettings||it.tiktok_settings){const Yr=((ge=(ss=it.platforms)==null?void 0:ss.tiktok)==null?void 0:ge.settings)||{},_s=((Oe=it.platformSettings)==null?void 0:Oe.tiktok)||{},yn={...it.tiktokSettings||it.tiktok_settings||{},..._s,...Yr};let Ls="";const is=yn.privacy_level||yn.privacy;switch((Nt=is==null?void 0:is.toUpperCase)==null?void 0:Nt.call(is)){case"PUBLIC":case"PUBLIC_TO_EVERYONE":Ls="PUBLIC_TO_EVERYONE";break;case"MUTUAL_FOLLOW_FRIENDS":case"MUTUAL_FOLLOWERS":Ls="MUTUAL_FOLLOW_FRIENDS";break;case"FOLLOWER_OF_CREATOR":case"FOLLOWERS":Ls="FOLLOWER_OF_CREATOR";break;case"PRIVATE":case"SELF_ONLY":Ls="SELF_ONLY";break;default:Ls=""}_e({title:yn.title||"",allowComments:!yn.disable_comment,allowDuets:!yn.disable_duet,allowStitch:!yn.disable_stitch,discloseContent:!!(yn.brand_safety_brand_owned||yn.brand_safety_paid_partnership),privacy:Ls,disclosureType:[...yn.brand_safety_brand_owned?["brand"]:[],...yn.brand_safety_paid_partnership?["branded"]:[]],userAgreedToTerms:yn.userAgreedToTerms||yn.user_agreed_to_terms||!1,isValid:!0})}const Ic=(Ir=(wt=it.platforms)==null?void 0:wt.youtube)==null?void 0:Ir.settings,Qu=(an=it.platformSettings)==null?void 0:an.youtube,Hi=it.youtubeSettings||it.youtube_settings;if(Ic||Qu||Hi){const Yr={...Hi,...Qu,...Ic};ft({title:Yr.title||"",tags:Array.isArray(Yr.tags)?Yr.tags:[],privacy:Yr.privacy||"public"})}if((nr=(ta=it.platforms)==null?void 0:ta.linkedin)!=null&&nr.settings||it.linkedinSettings||it.linkedin_
3926settings){const Yr=((gn=(gr=it.platforms)==null?void 0:gr.linkedin)==null?void 0:gn.settings)||{},ar={...it.linkedinSettings||it.linkedin_settings||{},...Yr};$t({organizationId:ar.organizationId||ar.organization_id||"",visibility:ar.visibility||"PUBLIC"})}if((Hs=(Na=it.platformData)==null?void 0:Na.pinterest)!=null&&Hs.settings){const Yr=it.platformData.pinterest.settings;Ft({title:Yr.title||"",link:Yr.link||"",selectedBoardId:Yr.board_id||"",allowComments:Yr.allow_comments!==void 0?Yr.allow_comments:!0,availableBoards:[],savedBoardName:Yr.board_name})}else Ft({title:"",link:"",selectedBoardId:"",allowComments:!0,availableBoards:[],savedBoardName:void 0});const Yi=it.reviewerId||it.reviewer_id||null,vl=it.needsReview!==void 0?it.needsReview:it.needs_review!==void 0?it.needs_review:!!Yi;if(vl!==void 0||Yi)if(ze(!!vl),ct(Yi),Bt(it.reviewComment||it.review_comment||null),Yi&&["ready_to_publish","scheduled","published","rejected"].includes(it.status)){const _s=ke.find(ar=>ar.id===(it.brandId||it.brand_id));if(_s&&_s.members){const ar=_s.members.find(yn=>yn.id===Yi);jt(ar?{id:ar.id,name:`${ar.firstName||""} ${ar.lastName||""}`.trim(),photoURL:ar.photoURL||void 0,firstName:ar.firstName||"",lastName:ar.lastName||""}:{id:"unknown",name:e("common.unknownReviewer","Unknown Reviewer")})}else jt({id:"unknown",name:e("common.unknownReviewer","Unknown Reviewer")})}else jt(null)}catch(it){Ie.error("CreateEditPostPage","Failed hydrating from navigation state post",it)}Ye(!0),je(!1),We.current=!0;try{yt.current=JSON.stringify(gt())}catch{yt.current=null}},[ke,e]);b.useEffect(()=>{if(Ee){if(We.current){We.current=!1;return}try{const Ce=JSON.stringify(gt());je(Ce!==yt.current)}catch{je(!1)}}},[v,j,N,M,I,z,L,_,$,Lt,et,pt,Pt,qe,$e]),b.useEffect(()=>{o&&t&&(async()=>{var Ge;try{if(p(!0),!Qe.currentUser){Ie.error("CreateEditPostPage","No authenticated user"),G("You must be logged in to edit a post"),p(!1);return}const Xt=(Ge=n.state)==null?void 0:Ge.post;if(Xt){bt(Xt);const ot=(Xt.postMediaType||Xt.post_media_type||"").toString().toLowerCase(),Ut=["multi","multi-image","multi-images","carousel","carousel-post","album"].includes(ot),mr=Array.isArray(Xt.media)&&Xt.media.length>1;if(Ut&&!mr){const en=await ex(t);en&&bt(en)}p(!1);return}const pr=await ex(t);if(!pr)throw new Error("Invalid post data received from API");bt(pr)}catch(Je){Ie.error("CreateEditPostPage","Error fetching post data",Je),Je instanceof Error?(Ie.error("CreateEditPostPage",`Error details: ${Je.name} - ${Je.message}`,Je.stack),Je.message&&Je.message.includes("404")?(G(`Post with ID "${t}" could not be found. It may have been deleted.`),setTimeout(()=>{G(pr=>pr+`
3927
3928You will be redirected to the posts list in 5 seconds...`),setTimeout(()=>{r("/my-content-hub")},5e3)},2e3)):G(`Failed to load post: ${Je.message}`)):G("Failed to load post: Unknown error")}finally{p(!1)}})()},[o,t,r,n.state,bt]),b.useEffect(()=>{if(j&&ke.length>0){lt(!0);const Ce=ke.find(Je=>Je.id===j),Ge=((Ce==null?void 0:Ce.members)||[]).filter(Je=>{var Xt,pr,ot;return Je.status==="active"&&((ot=(pr=(Xt=Je.permissions)==null?void 0:Xt.actions)==null?void 0:pr.post)==null?void 0:ot.canPublish)===!0}).map(Je=>({id:Je.id,firstName:Je.firstName||"Unnamed",lastName:Je.lastName||"User",photoURL:Je.photoURL||void 0}));Ie.info("CreateEditPostPage",`Found ${Ge.length} potential reviewers for brand ${j}`),Ne(Ge),lt(!1)}else j||(Ne([]),ct(null))},[j,ke]),b.useEffect(()=>{if(!j&&ke.length>0&&!o)if(ke.length===1)C(ke[0].id);else{const Ce=ke.reduce((Ge,Je)=>{const Xt=(Je.social_accounts||[]).length,pr=(Ge.social_accounts||[]).length;return Xt>pr?Je:Ge},ke[0]);C(Ce.id)}},[ke,j,o]),b.useEffect(()=>{var Ce;if(qe&&ve>0){if(!oe.some(Je=>Je.id===$e)){const Je=((Ce=oe[0])==null?void 0:Ce.id)||null;ct(Je)}}else qe||ct(null)},[qe,ve]);const Re=Ce=>{C(Ce)},dt=b.useCallback(()=>{const Ce=ke.find(Je=>Je.id===j);if(!Ce||!Ce.social_accounts)return{username:"",picture_url:""};const Ge=Ce.social_accounts.find(Je=>Je.platform.toLowerCase()==="tiktok");return Ge?{username:Ge.username||"",picture_url:Ge.profile_url||Ge.picture_url||""}:{username:"",picture_url:""}},[ke,j]),Et=()=>N.includes("tiktok")&&Lt.discloseContent&&Lt.disclosureType.length===0,xt=()=>!(!j||!v.trim()||N.length===0||N.includes("tiktok")&&(!Lt.userAgreedToTerms||!Lt.privacy||Lt.discloseContent&&Lt.disclosureType.length===0||Lt.discloseContent&&!Lt.isValid)||N.includes("pinterest")&&!Pt.selectedBoardId||qe&&(!$e||oe.length===0)),qt=b.useCallback(()=>{const Ce=ke.find(Ge=>Ge.id===j);return!Ce||!Ce.social_accounts?[]:Ce.social_accounts.filter(Ge=>Ge.platform&&Ge.username).map(Ge=>({platform:Ge.platform.toLowerCase(),username:Ge.username,picture_url:Ge.profile_url||Ge.picture_url||"",followers_count:Ge.followers_count||0,name:Ge.name||Ge.username||"",boards:Ge.boards||[]}))},[ke,j]),Gr=b.useMemo(()=>{const Ge=qt().find(Je=>Je.platform==="pinterest");return!Ge||!Ge.boards?[]:Ge.boards.map(Je=>
3928({id:Je.id,name:Je.name,description:Je.description||"",privacy:Je.privacy,follower_count:Je.follower_count||0,pin_count:Je.pin_count||0,created_at:Je.created_at,owner:Je.owner,media:Je.media}))},[qt]),la=b.useCallback(async()=>{try{const Ce=Qe.currentUser;if(!Ce)throw new Error("No authenticated user");const Ge=await Ce.getIdToken(),Je=await fetch("https://api.socialness.ai/management/pinterest/boards?fresh=true",{method:"GET",headers:{Authorization:`Bearer ${Ge}`,"Content-Type":"application/json"}});if(!Je.ok)throw new Error(`Failed to refresh boards: ${Je.status}`);const Xt=await Je.json();console.log("Refreshed Pinterest boards:",Xt),Xt.success&&Xt.boards&&Array.isArray(Xt.boards)?(Ft(pr=>({...pr,availableBoards:Xt.boards.map(ot=>({id:ot.id,name:ot.name,description:ot.description||"",privacy:ot.privacy,follower_count:ot.follower_count||0,pin_count:ot.pin_count||0,created_at:ot.created_at,owner:ot.owner,media:ot.media}))})),console.log("Updated Pinterest boards in settings:",Xt.boards.length,"boards")):console.warn("Invalid response format from Pinterest boards API:",Xt)}catch(Ce){throw console.error("Error refreshing Pinterest boards:",Ce),Ce}},[]),$n=b.useMemo(()=>dt(),[dt]),Rt=b.useMemo(()=>qt(),[qt]),rr=Gr;b.useEffect(()=>{Ft(Ce=>({...Ce,availableBoards:rr}))},[rr]),b.useEffect(()=>{rr.length>0&&Ft(Ce=>{if(Ce.selectedBoardId&&rr.some(ot=>ot.id===Ce.selectedBoardId))return Ce;let Ge=Ce.selectedBoardId;if(!Ge&&Ce.savedBoardName){const ot=rr.find(Ut=>Ut.name===Ce.savedBoardName);ot&&(Ge=ot.id)}const Je=Ge&&rr.some(ot=>ot.id===Ge),Xt=!Ge&&!Ce.savedBoardName,pr=Je?Ge:Xt?rr.length>0?rr[0].id:"":Ge;return pr!==Ce.selectedBoardId||Ce.savedBoardName!==(Je?void 0:Ce.savedBoardName)?{...Ce,selectedBoardId:pr,savedBoardName:Je?void 0:Ce.savedBoardName}:Ce})},[rr]),VQ();const Be=(()=>{if(!j||N.length===0)return[];const Ce=ke.find(Je=>Je.id===j),Ge=((Ce==null?void 0:Ce.social_accounts)||[]).map(Je=>Je.platform.toLowerCase());return N.filter(Je=>!Ge.includes(Je.toLowerCase()))})(),Ke=(Ce=>ke.find(Ge=>Ge.id===Ce)||null)(j),ee=async Ce=>{if(Ce.show&&Ce.postId)try{const Ge=await ex(Ce.postId);Ge&&Ge.media&&Ge.media.url&&D(Ge.media.url),ae(Ce),Pe("publishing")}catch(Ge){Ie.error("CreateEditPostPage","Error fetching post data for confirmation",Ge),ae(Ce),Pe("publishing")}else ae(Ce),Pe(null)};b.useEffect(()=>{y&&o&&t&&!le.show&&!h&&ee({show:!0,postId:t})},[y,o,t,le.show,h]);const de=async(Ce=!1)=>{var Ge,Je,Xt;try{if(W(!0),Ce||q(!0),G(null),$&&!kXe($))throw new Error(e("cards.schedule.pastDateWarning"));if(Ce&&j&&N.length>0){const er=ke.find(Mr=>Mr.id===j),qn=((er==null?void 0:er.social_accounts)||[]).map(Mr=>Mr.platform.toLowerCase()),En=N.filter(Mr=>!qn.includes(Mr.toLowerCase()));if(En.length>0){Ie.warn("CreateEditPostPage",`Missing account connections for platforms: ${En.join(", ")}`),ne({show:!0,missingPlatforms:En}),W(!1);return}}if(!j)throw new Error("Please select a brand");if(!v.trim())throw new Error("Content cannot be empty");const pr=N.includes("tiktok");if(Ce&&pr){const er=[];if(Lt.userAgreedToTerms||er.push("You must agree to TikTok's Music Usage Confirmation"),Lt.privacy||er.push("You must select a privacy level for your TikTok post"),er.length>0)throw new Error(er.join(`
3929`))}if(Ce&&N.includes("pinterest")&&!Pt.selectedBoardId)throw new Error("Please select a Pinterest board to continue.");if(Ce&&o&&t&&!$&&!fe){await ee({show:!0,postId:t}),W(!1),q(!1);return}const ot=M==="reel"?"reel":"regular",Ut={};if(N.includes("tiktok")&&(Ut.tiktok={settings:{title:Lt.title||v.substring(0,100),privacy_level:Lt.privacy,disable_duet:!Lt.allowDuets,disable_comment:!Lt.allowComments,disable_stitch:!Lt.allowStitch,brand_safety_brand_owned:Lt.disclosureType.includes("brand"),brand_safety_paid_partnership:Lt.disclosureType.includes("branded")}}),N.includes("instagram")&&(Ut.instagram={settings:{video_cover_timestamp_ms:1e3,share_to_feed:!0}}),N.includes("youtube")&&(Ut.youtube={settings:{title:et.title||v.substring(0,100),privacy:et.privacy,tags:et.tags,category_id:"22"}}),N.includes("facebook")&&(Ut.facebook={settings:{title:v.substring(0,100)}}),N.includes("linkedin")&&(Ut.linkedin={settings:{organizationId:pt.organizationId,visibility:pt.visibility}}),N.includes("pinterest")){const er=Pt.availableBoards.find(En=>En.id===Pt.selectedBoardId),qn=(er==null?void 0:er.name)||"";Ut.pinterest={settings:{title:Pt.title||v.substring(0,100),link:Pt.link,board_id:Pt.selectedBoardId,board_name:qn,allow_comments:Pt.allowComments}}}const mr={brandId:j,title:"",content:v,format:ot,platforms:Ut,needsReview:qe,reviewerId:qe&&$e||"",tags:[],hashtags:[]},en=[];if(z&&!I&&en.push({url:z,type:u(z,A),thumbnailUrl:z,description:""}),_&&_.length>0)for(const er of _)en.push({url:er,type:u(er,null),thumbnailUrl:er,description:""});if(en.length>0&&(mr.media=en),$?(mr.status="scheduled",mr.scheduledAt=$):Ce&&qe&&$e?mr.status="waiting_for_approval":(mr.status=Ce?"published":"draft",mr.scheduledAt=null),L.length>0)try{const er=Qe.currentUser;if(!er)throw new Error("No authenticated user for file upload");const qn=await er.getIdToken(),En=[];for(const Mr of L){const Hr=new FormData;Hr.append("file",Mr),j&&Hr.append("brandId",j);const ca=await fetch("https://storage.socialness.ai/upload",{method:"POST",headers:{Authorization:`Bearer ${qn}`},body:Hr});if(!ca.ok){const Oe=await ca.text();throw new Error(`File upload failed: ${ca.status} ${Oe}`)}const ss=await ca.json(),ge=ss.publicUrl||ss.url||ss.fileUrl||((Ge=ss.data)==null?void 0:Ge.url);if(!ge)throw new Error("File upload response missing URL");En.push(ge)}if(mr.media=[...en,...En.map(Mr=>({url:Mr,type:u(Mr,null),thumbnailUrl:Mr,description:""}))],o&&t)await c.mutateAsync({postId:t,postData:mr,isFormData:!1}),Ce&&!$&&await ee({show:!0,postId:t});else if(!o){const Mr=await l.mutateAsync({postData:mr,isFormData:!1}),Hr=f(Mr);Ce&&!$&&Hr&&await ee({show:!0,postId:Hr})}}catch(er){throw Ie.error("CreateEditPostPage","Multi-images upload failed",er),er}else if(o&&I instanceof File)try{const er=Qe.currentUser;if(!er)throw new Error("No authenticated user for file upload");const qn=await er.getIdToken(),En=new FormData;En.append("file",I),j&&En.append("brandId",j);const Mr=await fetch("https://storage.socialness.ai/upload",{method:"POST",headers:{Authorization:`Bearer ${qn}`},body:En});if(!Mr.ok){const ge=await Mr.text();throw Ie.error("CreateEditPostPage","File upload failed",ge),new Error(`File upload failed: ${Mr.status} ${ge}`)}const Hr=await Mr.json(),ca=Hr.publicUrl||Hr.url||Hr.fileUrl||((Je=Hr.data)==null?void 0:Je.url);if(!ca)throw Ie.error("CreateEditPostPage","No URL in upload response",Hr),new Error("File upload response missing URL");mr.media=[...en,{url:ca,type:d(I),thumbnailUrl:ca,description:""}];const ss=await c.mutateAsync({postId:t,postData:mr,isFormData:!1});Ce&&!$&&await ee({show:!0,postId:t})}catch(er){throw Ie.error("CreateEditPostPage","Two-step upload process failed",er),new Error(`Failed to upload and update post: ${er instanceof Error?er.message:"Unknown error"}`)}
3929else if(!o&&I instanceof File&&I.size>0)try{const er=Qe.currentUser;if(!er)throw new Error("No authenticated user for file upload");const qn=await er.getIdToken(),En=new FormData;En.append("file",I),j&&En.append("brandId",j);const Mr=await fetch("https://storage.socialness.ai/upload",{method:"POST",headers:{Authorization:`Bearer ${qn}`},body:En});if(!Mr.ok){const Oe=await Mr.text();throw Ie.error("CreateEditPostPage","File upload failed (create)",Oe),new Error(`File upload failed: ${Mr.status} ${Oe}`)}const Hr=await Mr.json(),ca=Hr.publicUrl||Hr.url||Hr.fileUrl||((Xt=Hr.data)==null?void 0:Xt.url);if(!ca)throw Ie.error("CreateEditPostPage","Upload response missing URL (create)",Hr),new Error("File upload response missing URL");mr.media=[...en,{url:ca,type:d(I),thumbnailUrl:ca,description:""}];const ss=await l.mutateAsync({postData:mr,isFormData:!1}),ge=f(ss);Ce&&!$&&ge&&await ee({show:!0,postId:ge})}catch(er){throw Ie.error("CreateEditPostPage","Failed to create post with uploaded media",er),er}else if(o&&t){const er=await c.mutateAsync({postId:t,postData:mr,isFormData:!1});Ce&&!$&&await ee({show:!0,postId:t})}else if(!o){const er=await l.mutateAsync({postData:mr,isFormData:!1}),qn=f(er);if(Ce&&!$&&qn)await ee({show:!0,postId:qn});else if(Ce&&!$&&!qn){i("Post created successfully","success"),r("/my-content-hub");return}}if($)i(e("toasts.scheduleSuccess","Post scheduled successfully!"),"success"),r("/my-content-hub");else if(Ce)Ce&&qe&&$e&&(i(e("toasts.approvalRequested","Post sent for approval successfully!"),"success"),r("/my-content-hub"));else{i(e("toasts.draftSaved","Changes saved."),"success");try{yt.current=JSON.stringify(gt())}catch{}je(!1),F("draft")}}catch(pr){Ie.error("Submission error:",pr),G(pje(pr,e))}finally{W(!1),q(!1)}},Se=async()=>{q(!0);try{await de(!1),i(e("toasts.draftSavedDueToMissingAccounts","Post saved as draft due to missing account connections."),"info")}finally{q(!1)}},Ue=Ce=>{N.includes(Ce)?S(N.filter(Ge=>Ge!==Ce)):S([...N,Ce])},Pe=Ce=>{const Ge=new URL(window.location.href);Ce?Ge.searchParams.set("modal",Ce):Ge.searchParams.delete("modal"),window.history.replaceState({},"",`${Ge.pathname}${Ge.search}${Ge.hash}`)},tt=()=>{try{r("/my-content-hub")}catch(Ce){Ie.error("CreateEditPostPage","Error navigating after publish",Ce)}};({...et,privacy:et.privacy});const kt=async Ce=>{if(!t||!ce){Ie.error("CreateEditPostPage","Missing postId or review decision for submission");return}W(!0),G(null);try{await yje(t,ce,Ce),i(e("toasts.reviewSubmitSuccess","Review submitted successfully!"),"success"),r("/my-content-hub")}catch(Ge){Ie.error("CreateEditPostPage",`Error submitting ${ce} review for post ${t}`,Ge),i(Ge instanceof Error?Ge.message:e("toasts.reviewSubmitError","Failed to submit review"),"error")}finally{pe(!1),W(!1),xe(null)}},or=()=>{At&&(navigator.clipboard.writeText(At.enhancedContent),ir(!0),setTimeout(()=>ir(!1),2e3))},Nr=()=>{At&&(x(At.enhancedContent),Wt(null))},Fr=Qe.currentUser,Sr=o&&Z&&Z.status==="waiting_for_approval"&&(Fr==null?void 0:Fr.uid)===Z.reviewerId;let Zt=e("actions.publishNow","Publish Now");return qe&&$e?Zt=e("actions.sendForApproval","Send for Approval"):$&&(Zt=e("actions.schedule","Schedule")),h?s.jsxs("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0 animate-pulse",children:[s.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200",children:s.jsx("div",{className:"w-[95%] mx-auto px-4 sm:px-6 py-4",children:s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 bg-gray-200 rounded-lg"})," ",s.jsxs("div",{children:[s.jsx("div",{className:"h-6 w-48 bg-gray-200 rounded mb-1"})," ",s.jsx("div",{className:"h-4 w-64 bg-gray-200 rounded"})," "]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"h-10 w-28 bg-gray-200 rounded-lg"})," ",s.jsx("div",{className:"h-10 w-32 bg-gray-200 rounded-lg"})," "]})]})})}),s.jsx("div",{className:"w-[95%] mx-auto py-6",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 lg:gap-6",children:[s.jsxs("div",{className:"space-y-4 lg:space-y-6 col-span-1 xl:col-span-2 min-w-0",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-6",children:[s.jsx("div",{className:"h-48 bg-gray-200 rounded-xl"})," ",s.jsx("div",{className:"h-48 bg-gray-200 rounded-xl"})," "]}),s.jsx("div",{className:"h-64 bg-gray-200 rounded-xl"}),s.jsx("div",{className:"h-40 bg-gray-200 rounded-xl"}),s.jsx("div",{className:"h-60 bg-gray-200 rounded-xl"})]}),s.jsx("div",{className:"xl:col-span-1",children:s.jsx("div",{className:"sticky top-28 space-y-6",children:s.jsx("div",{className:"h-96 bg-gray-200 rounded-xl"})})})]})})]}):s.jsxs("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0",children:[s.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200",children:s.jsxs("div",{className:"w-[95%] mx-auto px-4 sm:px-6 py-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("button",{onClick:()=>r(-1),className:"p-2 rounded-lg hover:text-primary-600 transition-colors","aria-label":e("common.back","Back"),children:s.jsx(lh,{className:"w-6 h-6"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold text-gray-900 font-title",children:o?e("pages.editPost.title","Edit Post"):e("pages.createPost.title","Create Post")}),s.jsx("p",{className:"text-sm text-gray-500",children:o?e("pages.editPost.subtitle","Update your social media post"):e("pages.createPost.subtitle","Create a new social media post")})]})]}),s.jsx("div",{className:"flex items-center space-x-3",children:Sr?s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>de(!1),className:"flex-1 sm:flex-initial inline-flex items-center px-4 py-2 text-primary-600 bg-white border border-primary-600 rounded-lg hover:bg-primary-50 transition-colors",disabled:Q,children:[s.jsx(il,{className:"w-5 h-5 mr-2"}),e("common.saveDraft","Save Draft")]}),s.jsx("button",{onClick:()=>{xe("rejected"),pe(!0)},className:"flex-1 sm:flex-initial inline-flex items-center px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors",disabled:Q,children:e("actions.reject","Reject")}),s.jsx("button",{onClick:()=>{xe("approved"),pe(!0)},className:"flex-1 sm:flex-initial inline-flex items-center px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg transition-colors",disabled:Q,children:e("actions.approve","Approve")})]}):s.jsxs(s.Fragment,{children:[" ",s.jsxs("button",{onClick:()=>de(!1),className:"flex-1 sm:flex-initial inline-flex items-center px-4 py-2 text-primary-600 bg-white border border-primary-600 rounded-lg hover:bg-primary-50 transition-colors",disabled:Q,children:[s.jsx(il,{className:"w-5 h-5 mr-2"}),e("common.saveDraft","Save Draft")]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{ref:ie,onClick:()=>de(!0),onMouseOver:()=>he(!0),onMouseOut:()=>he(!1),onFocus:()=>he(!0),onBlur:()=>he(!1),className:`flex-1 sm:flex-initial inline-flex items-center px-4 py-2 ${xt()?"bg-primary-600 hover:bg-primary-700":"bg-gray-300 cursor-not-allowed opacity-50"} text-white rounded-lg transition-colors`,disabled:Q||!xt(),children:[s.jsx(nf,{className:`w-5 h-5 mr-2 ${xt()?"":"opacity-50"}`}),Zt]}),we&&!xt()&&Et()&&s.jsx("div",{className:"absolute top-full left-1/2 transform -translate-x-1/2 mt-2 z-50 w-64",children:s.jsx(e0,{type:"warning",size:"xs",message:"tooltips.publishDisabled.tiktokDisclosure"})})]})]})})]}),Be.length>0&&Ke&&s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsxs("div",{className:"text-red-600 text-sm font-medium text-right",children:[s.jsx("div",{children:e("warnings.noAccountConnectedForBrandMultiple","{{brandName}} does not have connected accounts for: {{platformList}}.",{brandName:Ke.name,platformList:Be.map(Ce=>Ce.charAt(0).toUpperCase()+Ce.slice(1)).join(", ")})}),s.jsx("div",{className:"mt-1",children:e("warnings.saveAsDraftOnlyNote","You can save as draft but not publish yet.")})]})}),N.includes("pinterest")&&!Pt.selectedBoardId&&s.jsx("div",{className:"mt-2 flex justify-end",children:s.jsx("div",{className:"text-red-600 text-sm font-medium text-right",children:e("warnings.pinterestNoBoardSelected","Please select a Pinterest board to continue.")})}),s.jsxs("div",{className:"flex justify-end border-b border-gray-200 mt-4 -mb-4",children:[s.jsxs("button",{onClick:()=>nt("preview"),className:`px-6 py-3 text-sm font-medium flex items-center gap-2 border-b-2 transition-colors ${Fe==="preview"?"text-primary-600 border-primary-600":"text-black border-transparent hover:text-primary-600"}
3929`,children:[s.jsx(xa,{className:"w-4 h-4"}),e("tabs.preview","Preview")]}),s.jsxs("button",{onClick:()=>nt("ai-time-suggestions"),className:`px-6 py-3 text-sm font-medium flex items-center gap-2 border-b-2 transition-colors ${Fe==="ai-time-suggestions"?"text-primary-600 border-primary-600":"text-black border-transparent hover:text-primary-600"}`,children:[s.jsx(ql,{className:"w-4 h-4"}),e("tabs.aiTimeSuggestions","AI Time Suggestions")]}),s.jsxs("button",{onClick:()=>nt("planning"),className:`px-6 py-3 text-sm font-medium flex items-center gap-2 border-b-2 transition-colors ${Fe==="planning"?"text-primary-600 border-primary-600":"text-black border-transparent hover:text-primary-600"}`,children:[s.jsx(vo,{className:"w-4 h-4"}),e("tabs.planning","Planning")]})]}),J&&s.jsx("div",{className:"mt-4",children:s.jsx(e0,{type:"error",message:J,className:"text-sm"})})]})}),s.jsx("div",{className:"w-[95%] mx-auto py-6",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 lg:gap-6",children:[s.jsx("div",{className:"space-y-4 lg:space-y-6 col-span-1 xl:col-span-2 min-w-0",children:s.jsxs("div",{className:"space-y-4 lg:space-y-6 col-span-1 xl:col-span-2 min-w-0",children:[s.jsx("div",{className:"min-w-0",children:s.jsx(RQ,{content:v,onContentChange:x,media:I,onMediaChange:T,existingMediaUrl:z,existingMediaType:A,onClearMedia:nn,status:E,format:M,onFormatChange:k,brandId:j,selectedPlatforms:N,aiResponse:At,onAiResponseChange:Wt})}),At&&s.jsx("div",{className:"min-w-0",children:s.jsx(gat,{aiResponse:At,copied:In,onCopyContent:or,onApplyAiContent:Nr})}),s.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 xl:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-4",children:[s.jsx(Mat,{selectedBrandId:j,onBrandSelect:Re,selectedPlatforms:N,onPlatformToggle:Ue,onFormatChange:k,format:M,connectedAccounts:Rt,tiktokAccount:$n}),N.includes("linkedin")&&s.jsx(BQ,{organizationId:pt.organizationId,visibility:pt.visibility,selectedBrandId:j,onOrganizationIdChange:Ce=>$t({...pt,organizationId:Ce}),onVisibilityChange:Ce=>$t({...pt,visibility:Ce})}),N.includes("pinterest")&&s.jsx(UQ,{title:Pt.title,link:Pt.link,selectedBoardId:Pt.selectedBoardId,allowComments:Pt.allowComments,availableBoards:Pt.availableBoards,onTitleChange:Ce=>Ft(Ge=>({...Ge,title:Ce})),onLinkChange:Ce=>Ft(Ge=>({...Ge,link:Ce})),onBoardChange:Ce=>Ft(Ge=>({...Ge,selectedBoardId:Ce})),onAllowCommentsChange:Ce=>Ft(Ge=>({...Ge,allowComments:Ce})),onRefreshBoards:la})]}),s.jsx("div",{className:"min-w-0",children:s.jsx($at,{media:I,onMediaChange:T,onClearMedia:()=>T(null),existingMediaUrl:z,existingMediaType:A,existingMediaUrls:_,onExistingMediaUrlsChange:B,brandId:j,content:v,selectedPlatforms:N,onExistingMediaChange:Ce=>{Ce?(D(Ce),P("image")):(D(null),P(null))},currentImageStyle:(()=>{const Ce=new Set(["auto","realistic","design","3d","artistic","modern","ad"]),Ge=Ke,Je=((Ge==null?void 0:Ge.imageStyle)||"").toString().toLowerCase();return Ce.has(Je)?Je:"auto"})(),allowMultipleImages:!0,multipleMedia:L,onMultipleImagesChange:R,postMediaTypeTag:Qt,onCanvaModalToggle:Ce=>Pe(Ce?"add-from-canva":null),openCanvaModalOnLoad:g,onSaveDraft:async()=>{try{return await de(!1),!0}catch{return!1}}})})]}),N.includes("tiktok")&&s.jsx("div",{className:"min-w-0",children:s.jsx(FQ,{title:Lt.title,tiktokUsername:$n.username,tiktokProfileImage:$n.picture_url,allowComments:Lt.allowComments,allowDuets:Lt.allowDuets,allowStitch:Lt.allowStitch,discloseContent:Lt.discloseContent,privacy:Lt.privacy,disclosureType:Lt.disclosureType,userAgreedToTerms:Lt.userAgreedToTerms,onTitleChange:Ce=>_e({...Lt,title:Ce}),onAllowCommentsChange:Ce=>_e({...Lt,allowComments:Ce}),onAllowDuetsChange:Ce=>_e({...Lt,allowDuets:Ce}),onAllowStitchChange:Ce=>_e({...Lt,allowStitch:Ce}),onDiscloseContentChange:(Ce,Ge)=>_e({...Lt,discloseContent:Ce,disclosureType:Ge?Ge.split(","):[]}),onPrivacyChange:Ce=>_e({...Lt,privacy:Ce}),onUserAgreedToTermsChange:Ce=>_e({...Lt,userAgreedToTerms:Ce}),onValidationChange:Ce=>_e({...Lt,isValid:Ce})})}),N.includes("youtube")&&s.jsx("div",{className:"min-w-0",children:s.jsx(zQ,{title:et.title,tags:et.tags,privacy:et.privacy,onTitleChange:Ce=>ft({...et,title:Ce}),onTagsChange:Ce=>ft({...et,tags:Ce}),onPrivacyChange:Ce=>ft({...et,privacy:Ce})})})]})}),s.jsx("div",{className:"xl:col-span-1",children:s.jsx("div",{className:"sticky top-28",children:s.jsxs("div",{className:"space-y-6",children:[Fe==="preview"&&s.jsx($Q,{content:v,selectedPlatforms:N,media:I,multiImages:L,existingMediaUrls:_,existingMediaUrl:z,existingMediaType:A,format:M,selectedBrand:j,brandName:Ke==null?void 0:Ke.name,brandLogo:Ke==null?void 0:Ke.logo,brands:ke,hideEngagementCounts:!0}),Fe==="ai-time-suggestions"&&s.jsx(kat,{brandId:j,selectedPlatforms:N,brandName:Ke==null?void 0:Ke.name}),Fe==="planning"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx(fA,{initialScheduledAtUtc:X,onScheduleChange:H}),s.jsx(wat,{requiresApproval:qe,selectedReviewerId:$e,reviewers:oe,onApprovalToggle:ze,onReviewerChange:ct,isLoadingReviewers:Ae,currentUserId:Ze,actualPostStatus:E,finalReviewer:Mt,finalReviewComments:Xe})]})]})})})]})}),s.jsx(Hj,{isOpen:Q,title:"Saving your post",message:"Please wait while we save your post...",videoSrc:"/Panda Riding Horse for GIF.mov",gifUrl:"https://media.socialness.ai/loading/unicorn.gif"}),s.jsx(WQ,{isOpen:le.show,postId:le.postId||"",onClose:()=>{ee({show:!1})},onConfirm:tt,content:v,platforms:N,brand:Ke,hasMedia:!!(I||z||_&&_.length>0||L&&L.length>0),mediaType:A||void 0,format:M,scheduledAt:$,media:I,mediaUrl:z,multiImages:L,existingMediaUrls:_,connectedAccounts:Rt,autoStart:!$&&!N.includes("tiktok")}),s.jsx(vat,{isOpen:te.show,onClose:()=>ne({show:!1,missingPlatforms:[]}),onSaveDraft:Se,missingPlatforms:te.missingPlatforms,brandName:Ke==null?void 0:Ke.name}),s.jsx(jat,{isOpen:ye,onClose:()=>pe(!1),onSubmit:kt,decision:ce})]})},Fat=()=>{const{t:e,i18n:t}=Te();pn();const{user:r}=Ps(),n=(r==null?void 0:r.firstName)||(r!=null&&r.name?r.name.split(" ")[0]:""),a=n?n.charAt(0).toUpperCase()+n.slice(1):"";return s.jsx("div",{className:"relative overflow-hidden rounded-2xl border border-black bg-[#0a5ad8]",children:s.jsxs("div",{className:"relative z-10 p-6 md:p-10",children:[s.jsx("h2",{className:"font-title text-2xl font-bold text-white md:text-3xl",children:e("onboarding.banner.title",{firstName:a})}),s.jsxs("div",{className:"mt-3 text-white/90 leading-relaxed",children:[s.jsx("p",{children:e("onboarding.banner.featuresIntro","Go through your own onboarding to enjoy our unique features:")}),s.jsxs("ul",{className:"mt-2 list-disc pl-6 columns-1 md:columns-3 [column-fill:_balance] gap-6",children:[s.jsx("li",{children:e("brands.title","Brand Strategy Lab")}),s.jsx("li",{children:e("personas.title","AI Persona Builder")}),s.jsx("li",{children:e("contentCreation.title","AI Content Studio")}
3929),s.jsx("li",{children:e("boostMode.title","Boost Mode")}),s.jsx("li",{children:e("accounts.title","Social Media Hub")}),s.jsx("li",{children:e("teamMembers.title","Team Hub")}),s.jsx("li",{children:e("calendar.title","Smart Content Calendar")}),s.jsx("li",{children:e("sidebar.aiLinksBuilder","AI Link Builder & Shortener")}),s.jsx("li",{children:e("analytics.title","Performance Coach Analytics")}),s.jsx("li",{children:e("cards.approval.title","Approval Workflow")}),s.jsx("li",{children:e("cards.aiContent.title","Smart Visual Creator")}),s.jsx("li",{children:e("mediaGallery.title","Media Gallery")})]}),s.jsx("p",{className:"mt-3",children:e("onboarding.banner.supportHint","Have any question? Reach out to us via the chat on the bottom right.")})]})]})})},zat=()=>{const{t:e}=Te();return s.jsx("div",{className:"space-y-4",children:Array(4).fill(0).map((t,r)=>s.jsxs(U.Fragment,{children:[r>0&&s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-4 w-0.5 bg-gray-200 animate-pulse"})}),s.jsxs("div",{className:"rounded-xl border border-gray-200 p-5 shadow-md bg-white animate-pulse",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-gray-200"}),s.jsx("div",{className:"h-5 bg-gray-200 rounded w-1/3"})]}),s.jsxs("div",{className:"space-y-2 pl-[3.25rem] mb-4",children:[s.jsx("div",{className:"h-3 bg-gray-200 rounded w-full"}),s.jsx("div",{className:"h-3 bg-gray-200 rounded w-5/6"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("div",{className:"h-8 w-24 bg-gray-200 rounded-lg"})})]})]},r))})},Bat=(e,t)=>e===0?t("onboarding.encouragement.start","Let's get started!"):e<30?t("onboarding.encouragement.goodStart","Good start, keep going!"):e<70?t("onboarding.encouragement.halfway","Great job! You're over halfway there!"):e<100?t("onboarding.encouragement.almostThere","Almost there, just a few more steps!"):t("onboarding.encouragement.done","Congratulations! You completed the onboarding!"),Uat=()=>{const{t:e}=Te(),{onboardingProgress:t,isLoading:r,completeStep:n,growth:a}=ME(),[i,o]=b.useState(0),l=b.useRef(0),{user:c,isLoading:u}=Ps(),[d,f]=b.useState(!1),[m,h]=b.useState(!1);if(u||!c&&!r)return s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-16 lg:pt-0 flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-blue-500 mx-auto"}),s.jsx("p",{className:"mt-4 text-gray-600",children:e("common.loading","Loading...")})]})});b.useEffect(()=>{document.title=e("onboarding.title","Onboarding")},[e]),b.useEffect(()=>{var L;if(!c||r||m)return;const I=`socialness_first_onboarding_visit_${c.id}`;if(!localStorage.getItem(I)&&!((L=t==null?void 0:t.steps)==null?void 0:L.brand_analysis)){const _=setTimeout(()=>{f(!0),h(!0),localStorage.setItem(I,"true")},1e3);return()=>clearTimeout(_)}},[c,r,t,m]);const p=c!=null&&c.name?c.name.split(" ")[0]:"";p.charAt(0).toUpperCase()+p.slice(1),b.useEffect(()=>{const I=document.createElement("style");return I.id="confetti-animations",I.textContent=`
3930      @keyframes fade-in-confetti {
3931        0% { opacity: 0; }
3932        100% { opacity: 1; }
3933      }
3934    `,document.getElementById("confetti-animations")||document.head.appendChild(I),()=>{const T=document.getElementById("confetti-animations");T&&T.remove()}},[]),b.useEffect(()=>{const I=(t==null?void 0:t.percentageCompleted)||0,T=l.current;if(l.current=I,I===T){o(I);return}let L=null;const R=1500,_=B=>{L||(L=B);const z=B-L,D=Math.min(z/R,1),A=T+(I-T)*D;o(Math.round(A)),D<1&&requestAnimationFrame(_)};requestAnimationFrame(_)},[t==null?void 0:t.percentageCompleted]);const g=()=>s.jsxs("div",{className:"bg-white rounded-xl border border-black p-6 shadow-lg hover:shadow-xl transition-shadow relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 overflow-hidden z-0",children:[...Array(25)].map((I,T)=>{const L=["w-4 h-1 rounded-full","w-1 h-4 rounded-full","w-2 h-2 rounded-full","w-3 h-3 rounded-full","w-2 h-2 rotate-45"],R=["bg-primary-400","bg-yellow-400","bg-red-400","bg-purple-400"],_=L[T%L.length],B=R[T%R.length];return s.jsx("div",{className:`absolute ${_} ${B}
3934`,style:{top:`${Math.random()*100}%`,left:`${Math.random()*100}%`,opacity:0,animation:`fade-in-confetti ${Math.random()*.5+.5}s forwards ${Math.random()*1.5}s`,transform:`rotate(${Math.random()*180}deg)`}},T)})}),s.jsxs("div",{className:"flex flex-col items-center text-center relative z-10",children:[s.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-4",children:S===100?e("onboarding.progress.completed","Well done!"):e("onboarding.progress.title","Your Progress 🤩")}),s.jsxs("div",{className:"relative inline-flex mb-6 w-36 h-36",children:[s.jsx("div",{className:"w-full h-full rounded-full bg-transparent absolute"}),s.jsx("svg",{className:"w-full h-full absolute top-0 left-0",viewBox:"0 0 100 100",children:s.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:S===100?"#E9B949":"#22C55E",strokeWidth:"8",strokeDasharray:`${i*283/100} 283`,strokeDashoffset:"0",transform:"rotate(-90 50 50)",strokeLinecap:"round",className:"transition-all duration-300 ease-out"})}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:S===100?s.jsx("div",{className:"bg-yellow-400 rounded-full p-2 w-16 h-16 flex items-center justify-center",children:s.jsx("svg",{className:"w-10 h-10 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})})}):s.jsx("div",{className:"text-center",children:s.jsxs("span",{className:"text-4xl font-bold text-gray-900",children:[i,"%"]})})})]}),s.jsx("p",{className:`${S===100?"text-xl":"text-base"} text-gray-700 font-medium`,children:S===100?e("onboarding.progress.allSteps","You completed all steps."):S<30?e("onboarding.progress.lowCompletion","You're just getting started!"):S<70?e("onboarding.encouragement.halfway","Great job! You're over halfway there!"):e("onboarding.progress.highCompletion","Almost there!")})]})]}),y=I=>{const T=a==null?void 0:a[I];return typeof T=="number"?` (+${T}%)`:""},v=[{id:1,key:"brand_analysis",title:`${e("onboarding.steps.brand_analysis.title","Analyser sa marque")}${y("brand_analysis")}`,description:e("onboarding.steps.brand_analysis.description","Utilisez l'IA pour analyser votre site web et obtenir une stratégie de marque complète et personnalisée"),link:"/brand-strategy-lab?modal=analyze",actionTextKey:"onboarding.actions.startAnalyze"},{id:2,key:"persona_creation",title:`${e("onboarding.steps.persona_creation.title","Créer un persona")}${y("persona_creation")}`,description:e("onboarding.steps.persona_creation.description","Générez des profils détaillés de votre audience idéale avec l'IA pour mieux cibler votre contenu"),link:"/ai-personas-builder?modal=create",actionTextKey:"onboarding.actions.startCreatePersona"},{id:3,key:"social_account_connection",title:`${e("onboarding.steps.social_account_connection.title","Connecter un compte réseau social")}${y("social_account_connection")}`,description:e("onboarding.steps.social_account_connection.description","Connectez vos comptes de réseaux sociaux pour programmer et publier automatiquement"),link:"/social-media-hub?modal=connect",actionTextKey:"onboarding.actions.startConnectAccount"},{id:4,key:"ai_analytics",title:`${e("onboarding.steps.ai_analytics.title","Voir ses analytics analysés par l'IA")}${y("ai_analytics")}`,description:e("onboarding.steps.ai_analytics.description","Obtenez des insights intelligents sur la performance de vos publications grâce à l'analyse IA"),link:"/analytics",actionTextKey:"onboarding.actions.startViewAnalytics"},{id:5,key:"shorten_link",title:`${e("onboarding.steps.shorten_link.title","Create a smart trackable link")}${y("shorten_link")}`,description:e("onboarding.steps.shorten_link.description","Use the Smart Link Builder and Shortener to generated automatically a trackable link and shorten it to make it easier to share."),link:"/ai-links-builder?modal=create",actionTextKey:"onboarding.actions.trackYourLink"},{id:6,key:"content_creation",title:`${e("onboarding.steps.content_creation.title","Créer du contenu")}${y("content_creation")}`,description:e("onboarding.steps.content_creation.description","Créez du contenu pour vos réseaux sociaux adapté à votre marque et personas grâce à l'IA"),link:"/content-creation",actionTextKey:"onboarding.actions.startCreateContent"},{id:7,key:"post_review",title:`${e("onboarding.steps.post_review.title","Ask AI to review your post")}${y("post_review")}`,description:e("onboarding.steps.post_review.description","Not sure about your next post? Ask AI directly in the app to check what can be improved and why?"),link:"/p
3934osts/new",actionTextKey:"onboarding.actions.startReviewPost"}],x=v.find(I=>!(t!=null&&t.steps[I.key])),j=(x==null?void 0:x.id)||v[v.length-1].id+1,C=I=>{console.log(`Starting step: ${I}`)},N=I=>{const T=(t==null?void 0:t.steps)||{};switch(I){case"persona_creation":return!T.brand_analysis;case"shorten_link":return!T.brand_analysis;case"content_creation":return!(T.brand_analysis&&T.persona_creation);case"ai_analytics":return!T.social_account_connection;default:return!1}},S=(t==null?void 0:t.percentageCompleted)||0;Bat(S,e);const M=I=>{const T=window.$chatwoot;if(!(T!=null&&T.hasLoaded))return;try{T.toggle("open"),I.preventDefault()}catch(R){console.warn("Chatwoot: could not open chat",R);return}const L=e("onboarding.videoCall.demoRequestMessage","Hey, I want to book a demo!");try{T.setCustomAttributes({demo_request:L}),T.setLabel("demo-request")}catch(R){console.warn("Chatwoot: could not tag the demo request",R)}},k=()=>{f(!1)};return s.jsxs(rs,{title:e("onboarding.title","Onboarding"),subtitle:e("onboarding.subtitle","Some explanation here on overview"),children:[s.jsx("div",{className:"mb-8",children:s.jsx(Fat,{})}),s.jsx("div",{className:"mb-6 md:hidden",children:s.jsx(g,{})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"md:col-span-2",children:[s.jsx("h2",{className:"font-title text-xl font-semibold text-gray-900 mb-2",children:e("onboarding.banner.journeyTitle","The journey")}),r?s.jsx(zat,{}):s.jsx("div",{className:"space-y-4",children:v.map((I,T)=>s.jsxs(U.Fragment,{children:[T>0&&s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:`h-4 w-0.5 ${t!=null&&t.steps[v[T-1].key]?"bg-green-500":"bg-gray-200"}`})}),s.jsxs("div",{className:`rounded-xl border p-5 shadow-md hover:shadow-lg transition-shadow ${N(I.key)?"border-gray-200 bg-white":I.id===j?"border-primary-500 ring-2 ring-primary-200 bg-white":t!=null&&t.steps[I.key]?"border-green-500 bg-green-50":"border-black bg-white"}`,children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center transition-all duration-300 ease-in-out ${t!=null&&t.steps[I.key]?"bg-green-500 text-white shadow-md":I.id===j?"bg-primary-500 text-white ring-2 ring-primary-200 animate-pulse shadow-lg":N(I.key)?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 text-gray-500"}`,children:t!=null&&t.steps[I.key]?s.jsx(ma,{className:"w-6 h-6"}):N(I.id)?s.jsx(N0,{className:"w-5 h-5"}):s.jsx("div",{className:"font-semibold text-lg",children:I.id})}),s.jsx("h3",{className:`text-lg font-semibold ${t!=null&&t.steps[I.key]?"text-gray-500":I.id===j?"text-gray-900":"text-gray-500"}`,children:I.title})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-4 pl-[3.25rem]",children:I.description}),s.jsxs("div",{className:"flex justify-end",children:[(t==null?void 0:t.steps[I.key])&&!N(I.key)&&s.jsx(Us,{to:I.link,className:"inline-flex items-center px-4 py-1 text-sm bg-white border border-primary-600 text-primary-600 rounded-lg hover:bg-primary-50 transition shadow-sm",children:e("onboarding.actions.redo","Do again")}),I.id===j&&!N(I.key)&&s.jsx(Us,{to:I.link,onClick:()=>C(I.key),className:"inline-flex items-center px-4 py-1 text-sm bg-primary-600 text-white border border-primary-600 rounded-lg hover:bg-primary-700 transition shadow-sm",children:e(I.actionTextKey||"onboarding.actions.start","Commencer")}),N(I.key)&&s.jsxs("div",{className:"inline-flex items-center px-4 py-1 text-sm bg-gray-200 text-gray-500 border border-gray-300 rounded-lg cursor-not-allowed shadow-sm",title:e("onboarding.tooltips.locked","Complétez l'étape précédente pour déverrouiller"),children:[s.jsx(N0,{className:"w-4 h-4 mr-2"}),e("onboarding.actions.locked","Verrouillé")]})]})]}),T===v.length-1&&!(t!=null&&t.steps[I.key])&&s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-4 w-0.5 bg-gray-200"})})]},I.id))})]}),s.jsxs("div",{className:"md:col-span-1 space-y-6 md:mt-8",children:[s.jsx("div",{className:"hidden md:block",children:s.jsx(g,{})}),s.jsx("div",{className:"bg-white rounded-xl border border-black p-6 shadow-lg hover:shadow-xl transition-shadow",children:s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx(CE,{className:"w-8 h-8 text-primary-500 mb-2"}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:e("onboarding.videoCall.title","Réservez votre appel vidéo personnalisé")}),s.jsx("p",{className:"text-gray-600 mb-4",children:e("onboarding.videoCall.description","Obtenez une visite guidée de 30 minutes pour garantir une configuration optimale")})]}),s.jsx("div",{className:"mt-auto flex flex-wrap gap-4",children:s.jsx("a",{href:`mailto:[email protected]?subject=${encodeURIComponent(e("onboarding.videoCall.demoRequestMessage","Hey, I want to book a demo!"))}`,onClick:M,className:"inline-flex items-center justify-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors shadow-sm",children:e("onboarding.videoCall.cta","Schedule time")}
3934)})]})}),s.jsx("div",{className:"bg-white rounded-xl border border-black p-6 shadow-lg hover:shadow-xl transition-shadow",children:s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx(qg,{className:"w-8 h-8 text-primary-500 mb-2"}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:e("onboarding.choosePlan.title","Choisissez votre forfait")}),s.jsx("p",{className:"text-gray-600 mb-4",children:e("onboarding.choosePlan.description","Sélectionnez le forfait adapté à votre entreprise et débloquez toutes les fonctionnalités premium")})]}),s.jsx("div",{className:"mt-auto flex flex-wrap gap-4",children:s.jsxs(Us,{to:"/billing",className:"inline-flex items-center justify-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors shadow-sm",children:[e("onboarding.choosePlan.cta","View plans"),s.jsx(Jy,{className:"w-4 h-4 ml-2"})]})})]})})]})]}),s.jsx(fH,{isOpen:d,onClose:k})]})},GQ=({onModify:e,onDelete:t,onDuplicate:r,onCheckStatus:n,onPromoteToDraft:a,status:i,className:o="",menuPosition:l="bottom",isAnyProcessing:c=!1,isExternal:u=!1,externalPermalink:d=null,onHide:f})=>{const{t:m}=Te(),[h,p]=b.useState(!1),g=b.useRef(null),y=b.useRef(null),[v,x]=b.useState({});b.useEffect(()=>{const C=N=>{g.current&&!g.current.contains(N.target)&&p(!1)};return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}},[]),b.useEffect(()=>{if(h&&y.current){const C=y.current.getBoundingClientRect(),N=173;x({position:"fixed",left:`${C.left-N+C.width}px`,top:`${C.bottom+8}px`,width:`${N}px`,zIndex:60})}},[h,l]);const j=!!c;return!e&&!t&&!r&&!n?null:s.jsxs("div",{className:`relative ${o}`,ref:g,children:[s.jsx("button",{ref:y,onClick:C=>{C.stopPropagation(),p(!h)},className:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Actions",children:s.jsx(M2,{className:"w-5 h-5 text-gray-500"})}),h&&s.jsx("div",{style:v,className:"rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5",children:s.jsxs("div",{className:"py-1",children:[u&&s.jsxs(s.Fragment,{children:[d&&s.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",onClick:C=>{C.stopPropagation(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:[s.jsx(C2,{className:"w-4 h-4 text-gray-500"}),s.jsx("span",{children:m("common.openOnPlatform","Ouvrir sur la plateforme")})]}),f&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),f(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:[s.jsx(ch,{className:"w-4 h-4 text-gray-500"}),s.jsx("span",{children:m("common.hide","Masquer")})]}),s.jsx("div",{className:"border-t border-gray-100 my-1"}),s.jsx("div",{className:"px-4 py-2 text-xs text-gray-400 italic",children:m("common.externalPostReadOnly","Publié hors Socialness — lecture seule")})]}),!u&&j&&n&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),n(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-blue-600 hover:bg-gray-100",children:[s.jsx(ai,{className:"w-4 h-4 text-blue-500"}),s.jsx("span",{children:m("common.checkPostStatus","Check Post Status")})]}),!u&&a&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),a(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-amber-700 hover:bg-amber-50",children:[s.jsx(A7,{className:"w-4 h-4 text-amber-500"}),s.jsx("span",{children:m("common.promoteToDraft","Promote to Draft")})]}),!u&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),e(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:[s.jsx(S0,{className:"w-4 h-4 text-gray-500"}),s.jsx("span",{children:m("common.modify")})]}),!u&&r&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),r(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:[s.jsx(Iu,{className:"w-4 h-4 text-gray-500"}),s.jsx("span",{children:m("common.duplicate","Duplicate")})]}),!u&&s.jsxs("button",{onClick:C=>{C.stopPropagation(),t(),p(!1)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-red-600 hover:bg-gray-100",children:[s.jsx(lc,{className:"w-4 h-4 text-red-500"}),s.jsx("span",{children:m("common.delete")})]})]})})]})},Vat=e=>e.platforms?Array.isArray(e.platforms)?e.platforms.filter(t=>typeof t=="string"):typeof e.platforms=="object"?Object.keys(e.platforms):[]:[],Wat=({post:e,accountImage:t,brandLogo:r="https://ai-coach.socialness.ai/brand/favicon-proxy?domain=socialness.ai",brandName:n="Socialness.ai",onDelete:a,onHide:i})=>{const{t:o}
3934=Te(),l=e.source==="external",c=l?(()=>{const g=e.platformResults||{},y=e.platformData||{};return[...Object.values(g).map(x=>(x==null?void 0:x.postUrl)||(x==null?void 0:x.permalink)),...Object.values(y).map(x=>{var j,C;return((j=x==null?void 0:x.results)==null?void 0:j.postUrl)||((C=x==null?void 0:x.results)==null?void 0:C.permalink)})].find(x=>typeof x=="string"&&x.length>0)||null})():null,u=g=>{switch(g){case"draft":return"📝";case"scheduled":return"📆";case"waiting_for_approval":return"⏳";case"processing":return"⚙️";case"published":return"✅";case"rejected":return"❌";case"error":return"⚠️";case"ready_to_publish":return"🚀";default:return""}},d=g=>{const y=Xn(g.media);return y?y.type==="video"?"🎬":y.type==="image"?"🖼️":"📱":"📝"},m=e.status==="published"||e.status==="waiting_for_approval"||e.status==="processing"?new Date(e.updatedAt).toLocaleDateString():e.status==="scheduled"&&e.scheduledFor?new Date(e.scheduledFor).toLocaleDateString():null,h=()=>{},p=()=>{a&&a(e.id)};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg hover:shadow-xl transition-shadow overflow-hidden",children:[s.jsx("div",{className:"p-4 border-b border-gray-100",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:t||r,alt:n,className:"w-14 h-14 rounded-lg object-cover border border-black"})}),s.jsxs("div",{children:[s.jsx("span",{className:"text-base font-semibold block",children:n}),m&&s.jsx("span",{className:"text-xs text-gray-400 block",children:m}),l&&s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 mt-1 rounded-full text-[10px] border bg-gray-100 text-gray-600 border-gray-200",title:o("contentHub.externalPostTooltip","Cette publication a été faite directement sur la plateforme, sans passer par Socialness."),children:[s.jsx("span",{children:"🔗"}),s.jsx("span",{children:o("contentHub.externalBadge","Publié hors Socialness")})]})]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:u(e.status)}),s.jsx(GQ,{onModify:h,onDelete:p,status:e.status,className:"z-10",isExternal:l,externalPermalink:c,onHide:l&&i?()=>i(e.id):void 0})]}),s.jsx("div",{className:"flex gap-1",children:Vat(e).map(g=>s.jsx(cr,{platform:g,size:16},g))})]})]})}),(()=>{const g=Xn(e.media);if(!g)return null;const y=/\.pdf(\?|#|$)/i.test(g.url);return s.jsxs("div",{className:"relative pb-[125%] bg-gray-100 overflow-visible",children:[y?s.jsx(Ef,{src:g.url,className:"absolute inset-0 w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:g.url,altText:"Post media",type:g.type,className:"absolute inset-0 w-full h-full",objectFit:"cover",controls:g.type==="video",autoPlayOnMount:!1,muted:!0}),s.jsx("div",{className:"absolute bottom-0 right-0 bg-white text-gray-800 text-xs px-2 py-1 rounded-full flex items-center gap-1 transform translate-x-1/2 translate-y-1/2 shadow-sm border border-gray-200",children:s.jsx("span",{children:d(e)})})]})})(),s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("div",{className:"text-sm text-gray-700 whitespace-pre-wrap flex-1 pr-3",children:e.content}),!Xn(e.media)&&s.jsx("div",{className:"bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full flex items-center gap-1 flex-shrink-0",children:s.jsx("span",{children:d(e)})})]})})]})};function qat(e,t,r){return(t=Z7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t9(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r9(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t9(Object(r),!0).forEach(function(n){qat(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t9(Object(r)).forEac
3934h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Os(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var n9=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),a9=function(){return Math.random().toString(36).substring(7).split("").join(".")},s9={INIT:"@@redux/INIT"+a9(),REPLACE:"@@redux/REPLACE"+a9()};function Gat(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function HQ(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Os(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Os(1));return r(HQ)(e,t)}if(typeof e!="function")throw new Error(Os(2));var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(Os(3));return i}function f(g){if(typeof g!="function")throw new Error(Os(4));if(c)throw new Error(Os(5));var y=!0;return u(),l.push(g),function(){if(y){if(c)throw new Error(Os(6));y=!1,u();var x=l.indexOf(g);l.splice(x,1),o=null}}}function m(g){if(!Gat(g))throw new Error(Os(7));if(typeof g.type>"u")throw new Error(Os(8));if(c)throw new Error(Os(9));try{c=!0,i=a(i,g)}finally{c=!1}for(var y=o=l,v=0;v<y.length;v++){var x=y[v];x()}return g}function h(g){if(typeof g!="function")throw new Error(Os(10));a=g,m({type:s9.REPLACE})}function p(){var g,y=f;return g={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(Os(11));function j(){x.next&&x.next(d())}j();var C=y(j);return{unsubscribe:C}}},g[n9]=function(){return this},g}return m({type:s9.INIT}),n={dispatch:m,subscribe:f,getState:d,replaceReducer:h},n[n9]=p,n}function i9(e,t){return function(){return t(e.apply(this,arguments))}}function o9(e,t){if(typeof e=="function")return i9(e,t);if(typeof e!="object"||e===null)throw new Error(Os(16));var r={};for(var n in e){var a=e[n];typeof a=="function"&&(r[n]=i9(a,t))}return r}function YQ(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Hat(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(Os(15))},o={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(c){return c(o)});return i=YQ.apply(void 0,l)(a.dispatch),r9(r9({},a),{},{dispatch:i})}}}var QQ=U.createContext(null);function Yat(e){e()}var KQ=Yat,Qat=function(t){return KQ=t},Kat=function(){return KQ};function Jat(){var e=Kat(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var a=t;a;)a.callback(),a=a.next})},get:function(){for(var a=[],i=t;i;)a.push(i),i=i.next;return a},subscribe:function(a){var i=!0,o=r={callback:a,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var l9={notify:function(){},get:function(){return[]}};function JQ(e,t){var r,n=l9;function a(f){return c(),n.subscribe(f)}function i(){n.notify()}function o(){d.onStateChange&&d.onStateChange()}function l(){return!!r}function c(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=Jat())}function u(){r&&(r(),r=void 0,n.clear(),n=l9)}var d={addNestedSub:a,notifyNestedSubs:i,handleChangeWrapper:o,isSubscribed:l,trySubscribe:c,tryUnsubscribe:u,getListeners:function(){return n}};return d}var ZQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?b.useLayoutEffect:b.useEffect;function Zat(e){var t=e.store,r=e.context,n=e.children,a=b.useMemo(function(){var l=JQ(t);return{store:t,subscription:l}},[t]),i=b.useMemo(function(){return t.getState()},[t]);ZQ(function(){var l=a.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[a,i]);var o=r||QQ;return U.createElement(o.Provider,{value:a},n)}
3934var XQ={exports:{}},Pn={};/** @license React v17.0.2
3935 * react-is.production.min.js
3936 *
3937 * Copyright (c) Facebook, Inc. and its affiliates.
3938 *
3939 * This source code is licensed under the MIT license found in the
3940 * LICENSE file in the root directory of this source tree.
3941 */var uN=60103,dN=60106,Nb=60107,Sb=60108,Cb=60114,kb=60109,Mb=60110,Ib=60112,Eb=60113,FA=60120,Tb=60115,Ab=60116,eK=60121,tK=60122,rK=60117,nK=60129,aK=60131;if(typeof Symbol=="function"&&Symbol.for){var Ga=Symbol.for;uN=Ga("react.element"),dN=Ga("react.portal"),Nb=Ga("react.fragment"),Sb=Ga("react.strict_mode"),Cb=Ga("react.profiler"),kb=Ga("react.provider"),Mb=Ga("react.context"),Ib=Ga("react.forward_ref"),Eb=Ga("react.suspense"),FA=Ga("react.suspense_list"),Tb=Ga("react.memo"),Ab=Ga("react.lazy"),eK=Ga("react.block"),tK=Ga("react.server.block"),rK=Ga("react.fundamental"),nK=Ga("react.debug_trace_mode"),aK=Ga("react.legacy_hidden")}function So(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case uN:switch(e=e.type,e){case Nb:case Cb:case Sb:case Eb:case FA:return e;default:switch(e=e&&e.$$typeof,e){case Mb:case Ib:case Ab:case Tb:case kb:return e;default:return t}}case dN:return t}}}var Xat=kb,est=uN,tst=Ib,rst=Nb,nst=Ab,ast=Tb,sst=dN,ist=Cb,ost=Sb,lst=Eb;Pn.ContextConsumer=Mb;Pn.ContextProvider=Xat;Pn.Element=est;Pn.ForwardRef=tst;Pn.Fragment=rst;Pn.Lazy=nst;Pn.Memo=ast;Pn.Portal=sst;Pn.Profiler=ist;Pn.StrictMode=ost;Pn.Suspense=lst;Pn.isAsyncMode=function(){return!1};Pn.isConcurrentMode=function(){return!1};Pn.isContextConsumer=function(e){return So(e)===Mb};Pn.isContextProvider=function(e){return So(e)===kb};Pn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===uN};Pn.isForwardRef=function(e){return So(e)===Ib};Pn.isFragment=function(e){return So(e)===Nb};Pn.isLazy=function(e){return So(e)===Ab};Pn.isMemo=function(e){return So(e)===Tb};Pn.isPortal=function(e){return So(e)===dN};Pn.isProfiler=function(e){return So(e)===Cb};Pn.isStrictMode=function(e){return So(e)===Sb};Pn.isSuspense=function(e){return So(e)===Eb};Pn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Nb||e===Cb||e===nK||e===Sb||e===Eb||e===FA||e===aK||typeof e=="object"&&e!==null&&(e.$$typeof===Ab||e.$$typeof===Tb||e.$$typeof===kb||e.$$typeof===Mb||e.$$typeof===Ib||e.$$typeof===rK||e.$$typeof===eK||e[0]===tK)};Pn.typeOf=So;XQ.exports=Pn;var cst=XQ.exports,ust=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],dst=["reactReduxForwardedRef"],fst=[],mst=[null,null];function hst(e,t){var r=e[1];return[t.payload,r+1]}function c9(e,t,r){ZQ(function(){return e.apply(void 0,t)},r)}function pst(e,t,r,n,a,i,o){e.current=n,t.current=a,r.current=!1,i.current&&(i.current=null,o())}function gst(e,t,r,n,a,i,o,l,c,u){if(e){var d=!1,f=null,m=function(){if(!d){var g=t.getState(),y,v;try{y=n(g,a.current)}catch(x){v=x,f=x}v||(f=null),y===i.current?o.current||c():(i.current=y,l.current=y,o.current=!0,u({type:"STORE_UPDATED",payload:{error:v}}))}};r.onStateChange=m,r.trySubscribe(),m();var h=function(){if(d=!0,r.tryUnsubscribe(),r.onStateChange=null,f)throw f};return h}}var yst=function(){return[null,0]};function bst(e,t){t===void 0&&(t={});var r=t,n=r.getDisplayName,a=n===void 0?function(j){return"ConnectAdvanced("+j+")"}:n,i=r.methodName,o=i===void 0?"connectAdvanced":i,l=r.renderCountProp,c=l===void 0?void 0:l,u=r.shouldHandleStateChanges,d=u===void 0?!0:u,f=r.storeKey,m=f===void 0?"store":f;r.withRef;var h=r.forwardRef,p=h===void 0?!1:h,g=r.context,y=g===void 0?QQ:g,v=Z1(r,ust),x=y;return function(C){var N=C.displayName||C.name||"Component",S=a(N),M=Gt({},v,{getDisplayName:a,methodName:o,renderCountProp:c,shouldHandleStateChanges:d,storeKey:m,displayName:S,wrappedComponentName:N,WrappedComponent:C}),k=v.pure;function I(B){return e(B.dispatch,M)}var T=k?b.useMemo:function(B){return B()};function L(B){var z=b.useMemo(function(){var ie=B.reactReduxForwardedRef,ye=Z1(B,dst);return[B.context,ie,ye]},[B]),D=z[0],A=z[1],P=z[2],E=b.useMemo(function(){return D&&D.Consumer&&cst.isContextConsumer(U.createElement(D.Consumer,null))?D:x},[D,x]),F=b.useContext(E),$=!!B.store&&!!B.store.getState&&!!B.store.dispatch;F&&F.store;var H=$?B.store:F.store,X=b.useMemo(function(){return I(H)},[H]),ue=b.useMemo(function(){if(!d)return mst;var ie=JQ(H,$?null:F.subscription),ye=ie.notifyNestedSubs.bind(ie);return[ie,ye]},[H,$,F]),le=ue[0],ae=ue[1],te=b.useMemo(function(){return $?F:Gt({},F,{subscription:le})},[$,F,le]),ne=b.useReducer(hst,fst,yst),J=ne[0],G=J[0],Q=ne[1];if(G&&G.error)throw G.error;var W=b.useRef(),Y=b.useRef(P),q=b.useRef(),Z=b.useRef(!1),me=T(function(){return q.current&&P===Y.current?q.current:X(H.getState(),P)},[H,G,P]);c9(pst,[Y,W,Z,P,me,q,ae]),c9(gst,[d,H,le,X,Y,W,Z,q,ae,Q],[H,le,X]);var we=b.useMemo(function(){return U.createElement(C,Gt({},me,{ref:A}))},[A,C,me]),he=b.useMemo(function(){return d?U.createElement(E.Provider,{value:te},we):we},[E,we,te]);return he}var R=k?U.memo(L):L;
3941if(R.WrappedComponent=C,R.displayName=L.displayName=S,p){var _=U.forwardRef(function(z,D){return U.createElement(R,Gt({},z,{reactReduxForwardedRef:D}))});return _.displayName=S,_.WrappedComponent=C,P_(_,C)}return P_(R,C)}}function u9(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sC(e,t){if(u9(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(t,r[a])||!u9(e[r[a]],t[r[a]]))return!1;return!0}function vst(e,t){var r={},n=function(o){var l=e[o];typeof l=="function"&&(r[o]=function(){return t(l.apply(void 0,arguments))})};for(var a in e)n(a);return r}function zA(e){return function(r,n){var a=e(r,n);function i(){return a}return i.dependsOnOwnProps=!1,i}}function d9(e){return e.dependsOnOwnProps!==null&&e.dependsOnOwnProps!==void 0?!!e.dependsOnOwnProps:e.length!==1}function sK(e,t){return function(n,a){a.displayName;var i=function(l,c){return i.dependsOnOwnProps?i.mapToProps(l,c):i.mapToProps(l)};return i.dependsOnOwnProps=!0,i.mapToProps=function(l,c){i.mapToProps=e,i.dependsOnOwnProps=d9(e);var u=i(l,c);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=d9(u),u=i(l,c)),u},i}}function xst(e){return typeof e=="function"?sK(e):void 0}function wst(e){return e?void 0:zA(function(t){return{dispatch:t}})}function jst(e){return e&&typeof e=="object"?zA(function(t){return vst(e,t)}):void 0}const Nst=[xst,wst,jst];function Sst(e){return typeof e=="function"?sK(e):void 0}function Cst(e){return e?void 0:zA(function(){return{}})}const kst=[Sst,Cst];function Mst(e,t,r){return Gt({},r,e,t)}function Ist(e){return function(r,n){n.displayName;var a=n.pure,i=n.areMergedPropsEqual,o=!1,l;return function(u,d,f){var m=e(u,d,f);return o?(!a||!i(m,l))&&(l=m):(o=!0,l=m),l}}}function Est(e){return typeof e=="function"?Ist(e):void 0}function Tst(e){return e?void 0:function(){return Mst}}const Ast=[Est,Tst];var Pst=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function _st(e,t,r,n){return function(i,o){return r(e(i,o),t(n,o),o)}}function Lst(e,t,r,n,a){var i=a.areStatesEqual,o=a.areOwnPropsEqual,l=a.areStatePropsEqual,c=!1,u,d,f,m,h;function p(j,C){return u=j,d=C,f=e(u,d),m=t(n,d),h=r(f,m,d),c=!0,h}function g(){return f=e(u,d),t.dependsOnOwnProps&&(m=t(n,d)),h=r(f,m,d),h}function y(){return e.dependsOnOwnProps&&(f=e(u,d)),t.dependsOnOwnProps&&(m=t(n,d)),h=r(f,m,d),h}function v(){var j=e(u,d),C=!l(j,f);return f=j,C&&(h=r(f,m,d)),h}function x(j,C){var N=!o(C,d),S=!i(j,u,C,d);return u=j,d=C,N&&S?g():N?y():S?v():h}return function(C,N){return c?x(C,N):p(C,N)}}function Dst(e,t){var r=t.initMapStateToProps,n=t.initMapDispatchToProps,a=t.initMergeProps,i=Z1(t,Pst),o=r(e,i),l=n(e,i),c=a(e,i),u=i.pure?Lst:_st;return u(o,l,c,e,i)}var Ost=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function iC(e,t,r){for(var n=t.length-1;n>=0;n--){var a=t[n](e);if(a)return a}return function(i,o){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+o.wrappedComponentName+".")}}function Rst(e,t){return e===t}function $st(e){var t=e===void 0?{}:e,r=t.connectHOC,n=r===void 0?bst:r,a=t.mapStateToPropsFactories,i=a===void 0?kst:a,o=t.mapDispatchToPropsFactories,l=o===void 0?Nst:o,c=t.mergePropsFactories,u=c===void 0?Ast:c,d=t.selectorFactory,f=d===void 0?Dst:d;return function(h,p,g,y){y===void 0&&(y={});var v=y,x=v.pure,j=x===void 0?!0:x,C=v.areStatesEqual,N=C===void 0?Rst:C,S=v.areOwnPropsEqual,M=S===void 0?sC:S,k=v.areStatePropsEqual,I=k===void 0?sC:k,T=v.areMergedPropsEqual,L=T===void 0?sC:T,R=Z1(v,Ost),_=iC(h,i,"mapStateToProps"),B=iC(p,l,"mapDispatchToProps"),z=iC(g,u,"mergeProps");return n(f,Gt({methodName:"connect",getDisplayName:function(A){return"Connect("+A+")"},shouldHandleStateChanges:!!h,initMapStateToProps:_,initMapDispatchToProps:B,initMergeProps:z,pure:j,areStatesEqual:N,areOwnPropsEqual:M,areStatePropsEqual:I,areMergedPropsEqual:L},R))}}const iK=$st();Qat(Ly.unstable_batchedUpdates);function Fst(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function oK(e,t){var r=b.useState(function(){return{inputs:t,result:e()}})[0],n=b.useRef(!0),a=b.useRef(r),i=n.current||!!(t&&a.current.inputs&&Fst(t,a.current.inputs)),o=i?a.current:{inputs:t,result:e()};return b.useEffect(function(){n.current=!1,a.current=o},[o]),o.result}function zst(e,t){return oK(function(){return e},t)}var Kr=oK,zt=zst,mo=function(t){var r=t.top,n=t.right,a=t.bottom,i=t.left,o=n-i,l=a-r,c={top:r,right:n,bottom:a,left
3941:i,width:o,height:l,x:i,y:r,center:{x:(n+i)/2,y:(a+r)/2}};return c},BA=function(t,r){return{top:t.top-r.top,left:t.left-r.left,bottom:t.bottom+r.bottom,right:t.right+r.right}},f9=function(t,r){return{top:t.top+r.top,left:t.left+r.left,bottom:t.bottom-r.bottom,right:t.right-r.right}},Bst=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},oC={top:0,right:0,bottom:0,left:0},UA=function(t){var r=t.borderBox,n=t.margin,a=n===void 0?oC:n,i=t.border,o=i===void 0?oC:i,l=t.padding,c=l===void 0?oC:l,u=mo(BA(r,a)),d=mo(f9(r,o)),f=mo(f9(d,c));return{marginBox:u,borderBox:mo(r),paddingBox:d,contentBox:f,margin:a,border:o,padding:c}},xi=function(t){var r=t.slice(0,-2),n=t.slice(-2);if(n!=="px")return 0;var a=Number(r);return isNaN(a)&&_u(),a},Ust=function(){return{x:window.pageXOffset,y:window.pageYOffset}},kw=function(t,r){var n=t.borderBox,a=t.border,i=t.margin,o=t.padding,l=Bst(n,r);return UA({borderBox:l,border:a,margin:i,padding:o})},Mw=function(t,r){return r===void 0&&(r=Ust()),kw(t,r)},lK=function(t,r){var n={top:xi(r.marginTop),right:xi(r.marginRight),bottom:xi(r.marginBottom),left:xi(r.marginLeft)},a={top:xi(r.paddingTop),right:xi(r.paddingRight),bottom:xi(r.paddingBottom),left:xi(r.paddingLeft)},i={top:xi(r.borderTopWidth),right:xi(r.borderRightWidth),bottom:xi(r.borderBottomWidth),left:xi(r.borderLeftWidth)};return UA({borderBox:t,margin:n,padding:a,border:i})},cK=function(t){var r=t.getBoundingClientRect(),n=window.getComputedStyle(t);return lK(r,n)},m9=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Vst(e,t){return!!(e===t||m9(e)&&m9(t))}function Wst(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Vst(e[r],t[r]))return!1;return!0}function za(e,t){t===void 0&&(t=Wst);var r,n=[],a,i=!1;function o(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return i&&r===this&&t(l,n)||(a=e.apply(this,l),i=!0,r=this,n=l),a}return o}var Cy=function(t){var r=[],n=null,a=function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];r=l,!n&&(n=requestAnimationFrame(function(){n=null,t.apply(void 0,r)}))};return a.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},a};function uK(e,t){}uK.bind(null,"warn");uK.bind(null,"error");function xu(){}function qst(e,t){return Gt({},e,{},t)}function Pi(e,t,r){var n=t.map(function(a){var i=qst(r,a.options);return e.addEventListener(a.eventName,a.fn,i),function(){e.removeEventListener(a.eventName,a.fn,i)}});return function(){n.forEach(function(i){i()})}}var Gst="Invariant failed";function Iw(e){this.message=e}Iw.prototype.toString=function(){return this.message};function ht(e,t){throw new Iw(Gst)}var Hst=function(e){Wq(t,e);function t(){for(var n,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=e.call.apply(e,[this].concat(i))||this,n.callbacks=null,n.unbind=xu,n.onWindowError=function(l){var c=n.getCallbacks();c.isDragging()&&c.tryAbort();var u=l.error;u instanceof Iw&&l.preventDefault()},n.getCallbacks=function(){if(!n.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return n.callbacks},n.setCallbacks=function(l){n.callbacks=l},n}var r=t.prototype;return r.componentDidMount=function(){this.unbind=Pi(window,[{eventName:"error",fn:this.onWindowError}])},r.componentDidCatch=function(a){if(a instanceof Iw){this.setState({});return}throw a},r.componentWillUnmount=function(){this.unbind()},r.render=function(){return this.props.children(this.setCallbacks)},t}(U.Component),Yst=`
3942  Press space bar to start a drag.
3943  When dragging you can use the arrow keys to move the item around and escape to cancel.
3944  Some screen readers may require you to be in focus mode or to use your pass through key
3945`,Ew=function(t){return t+1},Qst=function(t){return`
3946  You have lifted an item in position `+Ew(t.source.index)+`
3947`},dK=function(t,r){var n=t.droppableId===r.droppableId,a=Ew(t.index),i=Ew(r.index);return n?`
3948      You have moved the item from position `+a+`
3949      to position `+i+`
3950    `:`
3951    You have moved the item from position `+a+`
3952    in list `+t.droppableId+`
3953    to list `+r.droppableId+`
3954    in position `+i+`
3955  `},fK=function(t,r,n){var a=r.droppableId===n.droppableId;return a?`
3956      The item `+t+`
3957      has been combined with `+n.draggableId:`
3958      The item `+t+`
3959      in list `+r.droppableId+`
3960      has been combined with `+n.draggableId+`
3961      in list `+n.droppableId+`
3962    `},Kst=function(t){var r=t.destination;if(r)return dK(t.source,r);var n=t.combine;return n?fK(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},h9=function(t){return`
3963  The item has returned to its starting position
3964  of `+Ew(t.index)+`
3965`},Jst=function(t){if(t.reason==="CANCEL")return`
3966      Movement cancelled.
3967      `+h9(t.source)+`
3968    `;var r=t.destination,n=t.combine;return r?`
3969      You have dropped the item.
3970      `+dK(t.source,r)+`
3971    `:n?`
3972      You have dropped the item.
3973      `+fK(t.draggableId,t.source,n)+`
3974    `:`
3975    The item has been dropped while not over a drop area.
3976    `+h9(t.source)+`
3977  `},px={dragHandleUsageInstructions:Yst,onDragStart:Qst,onDragUpdate:Kst,onDragEnd:Jst},Ua={x:0,y:0},Ja=function(t,r){return{x:t.x+r.x,y:t.y+r.y}},ri=function(t,r){return{x:t.x-r.x,y:t.y-r.y}},wu=function(t,r){return t.x===r.x&&t.y===r.y},_p=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},hf=function(t,r,n){var a;return n===void 0&&(n=0),a={},a[t]=r,a[t==="x"?"y":"x"]=n,a},ky=function(t,r){return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))},p9=function(t,r){return Math.min.apply(Math,r.map(function(n){return ky(t,n)}))},mK=function(t){return function(r){return{x:t(r.x),y:t(r.y)}}},Zst=function(e,t){var r=mo({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return r.width<=0||r.height<=0?null:r},Pb=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},g9=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},Xst={top:0,right:0,bottom:0,left:0},eit=function(t,r){return r?Pb(t,r.scroll.diff.displacement):t},tit=function(t,r,n){if(n&&n.increasedBy){var a;return Gt({},t,(a={},a[r.end]=t[r.end]+n.increasedBy[r.line],a))}return t},rit=function(t,r){return r&&r.shouldClipSubject?Zst(r.pageMarginBox,t):mo(t)},Wh=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,a=e.frame,i=eit(t.marginBox,a),o=tit(i,n,r),l=rit(o,a);return{page:t,withPlaceholder:r,active:l}},VA=function(e,t){e.frame||ht();var r=e.frame,n=ri(t,r.scroll.initial),a=_p(n),i=Gt({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:a},max:r.scroll.max}}),o=Wh({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i}),l=Gt({},e,{frame:i,subject:o});return l};function Tw(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function WA(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}function Hu(e,t){if(e.find)return e.find(t);var r=WA(e,t);if(r!==-1)return e[r]}function hK(e){return Array.prototype.slice.call(e)}var pK=za(function(e){return e.reduce(function(t,r){return t[r.descriptor.id]=r,t},{})}),gK=za(function(e){return e.reduce(function(t,r){return t[r.descriptor.id]=r,t},{})}),fN=za(function(e){return Tw(e)}),nit=za(function(e){return Tw(e)}),Lp=za(function(e,t){var r=nit(t).filter(function(n){return e===n.descriptor.droppableId}).sort(function(n,a){return n.descriptor.index-a.descriptor.index});return r});function qA(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function mN(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var hN=za(function(e,t){return t.filter(function(r){return r.descriptor.id!==e.descriptor.id})}),ait=function(e){var t=e.isMovingForward,r=e.draggable,n=e.destination,a=e.insideDestination,i=e.previousImpact;
3977if(!n.isCombineEnabled)return null;var o=qA(i);if(!o)return null;function l(g){var y={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return Gt({},i,{at:y})}var c=i.displaced.all,u=c.length?c[0]:null;if(t)return u?l(u):null;var d=hN(r,a);if(!u){if(!d.length)return null;var f=d[d.length-1];return l(f.descriptor.id)}var m=WA(d,function(g){return g.descriptor.id===u});m===-1&&ht();var h=m-1;if(h<0)return null;var p=d[h];return l(p.descriptor.id)},Dp=function(e,t){return e.descriptor.droppableId===t.descriptor.id},yK={point:Ua,value:0},My={invisible:{},visible:{},all:[]},sit={displaced:My,displacedBy:yK,at:null},Oi=function(e,t){return function(r){return e<=r&&r<=t}},bK=function(e){var t=Oi(e.top,e.bottom),r=Oi(e.left,e.right);return function(n){var a=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);if(a)return!0;var i=t(n.top)||t(n.bottom),o=r(n.left)||r(n.right),l=i&&o;if(l)return!0;var c=n.top<e.top&&n.bottom>e.bottom,u=n.left<e.left&&n.right>e.right,d=c&&u;if(d)return!0;var f=c&&o||u&&i;return f}},iit=function(e){var t=Oi(e.top,e.bottom),r=Oi(e.left,e.right);return function(n){var a=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);return a}},GA={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},vK={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},oit=function(e){return function(t){var r=Oi(t.top,t.bottom),n=Oi(t.left,t.right);return function(a){return e===GA?r(a.top)&&r(a.bottom):n(a.left)&&n(a.right)}}},lit=function(t,r){var n=r.frame?r.frame.scroll.diff.displacement:Ua;return Pb(t,n)},cit=function(t,r,n){return r.subject.active?n(r.subject.active)(t):!1},uit=function(t,r,n){return n(r)(t)},HA=function(t){var r=t.target,n=t.destination,a=t.viewport,i=t.withDroppableDisplacement,o=t.isVisibleThroughFrameFn,l=i?lit(r,n):r;return cit(l,n,o)&&uit(l,a,o)},dit=function(t){return HA(Gt({},t,{isVisibleThroughFrameFn:bK}))},xK=function(t){return HA(Gt({},t,{isVisibleThroughFrameFn:iit}))},fit=function(t){return HA(Gt({},t,{isVisibleThroughFrameFn:oit(t.destination.axis)}))},mit=function(t,r,n){if(typeof n=="boolean")return n;if(!r)return!0;var a=r.invisible,i=r.visible;if(a[t])return!1;var o=i[t];return o?o.shouldAnimate:!0};function hit(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return mo(BA(r,n))}function Iy(e){var t=e.afterDragging,r=e.destination,n=e.displacedBy,a=e.viewport,i=e.forceShouldAnimate,o=e.last;return t.reduce(function(c,u){var d=hit(u,n),f=u.descriptor.id;c.all.push(f);var m=dit({target:d,destination:r,viewport:a,withDroppableDisplacement:!0});if(!m)return c.invisible[u.descriptor.id]=!0,c;var h=mit(f,o,i),p={draggableId:f,shouldAnimate:h};return c.visible[f]=p,c},{all:[],visible:{},invisible:{}})}function pit(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}function y9(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,a=e.destination,i=pit(t,{inHomeList:r});return{displaced:My,displacedBy:n,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:i}}}}function Aw(e){var t=e.draggable,r=e.insideDestination,n=e.destination,a=e.viewport,i=e.displacedBy,o=e.last,l=e.index,c=e.forceShouldAnimate,u=Dp(t,n);if(l==null)return y9({insideDestination:r,inHomeList:u,displacedBy:i,destination:n});var d=Hu(r,function(g){return g.descriptor.index===l});if(!d)return y9({insideDestination:r,inHomeList:u,displacedBy:i,destination:n});var f=hN(t,r),m=r.indexOf(d),h=f.slice(m),p=Iy({afterDragging:h,destination:n,displacedBy:i,last:o,viewport:a.frame,forceShouldAnimate:c});return{displaced:p,displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:l}}}}function Ru(e,t){return!!t.effected[e]}var git=function(e){var t=e.isMovingForward,r=e.destination,n=e.draggables,a=e.combine,i=e.afterCritical;if(!r.isCombineEnabled)return null;var o=a.draggableId,l=n[o],c=l.descriptor.index,u=Ru(o,i);return u?t?c:c-1:t?c+1:c},yit=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.insideDestination,a=e.location;if(!n.length)return null;var i=a.index,o=t?i+1:i-1,l=n[0].descriptor.index,c=n[n.length-1].descriptor.index,u=r?c:c+1;return o<l||o>u?null:o},bit=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.draggable,a=e.draggables,i=e.destination,o=e.insideDestination,l=e.previousImpact,c=e.viewport,u=e.afterCritical,d=l.at;if(d||ht(),d.type==="REORDER"){var f=yit({isMovingForward:t,isInHomeList:r,location:d.destination,insideDestination:o});return f==null?null:Aw({draggable:n,insideDestination:o,destination:i,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:f})}var m=git({isMovingForward:t,destination:i,displaced:l.displaced,draggables:a,combine:d.combine,afterCritical:u});return m==null?null:Aw({draggable:n,insideDestination:o,destination:i,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:m})}
3977,vit=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,a=e.displacedBy,i=!!(t.visible[n]||t.invisible[n]);return Ru(n,r)?i?Ua:_p(a.point):i?a.point:Ua},xit=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,a=mN(r);a||ht();var i=a.draggableId,o=n[i].page.borderBox.center,l=vit({displaced:r.displaced,afterCritical:t,combineWith:i,displacedBy:r.displacedBy});return Ja(o,l)},wK=function(t,r){return r.margin[t.start]+r.borderBox[t.size]/2},wit=function(t,r){return r.margin[t.end]+r.borderBox[t.size]/2},YA=function(t,r,n){return r[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2},b9=function(t){var r=t.axis,n=t.moveRelativeTo,a=t.isMoving;return hf(r.line,n.marginBox[r.end]+wK(r,a),YA(r,n.marginBox,a))},v9=function(t){var r=t.axis,n=t.moveRelativeTo,a=t.isMoving;return hf(r.line,n.marginBox[r.start]-wit(r,a),YA(r,n.marginBox,a))},jit=function(t){var r=t.axis,n=t.moveInto,a=t.isMoving;return hf(r.line,n.contentBox[r.start]+wK(r,a),YA(r,n.contentBox,a))},Nit=function(e){var t=e.impact,r=e.draggable,n=e.draggables,a=e.droppable,i=e.afterCritical,o=Lp(a.descriptor.id,n),l=r.page,c=a.axis;if(!o.length)return jit({axis:c,moveInto:a.page,isMoving:l});var u=t.displaced,d=t.displacedBy,f=u.all[0];if(f){var m=n[f];if(Ru(f,i))return v9({axis:c,moveRelativeTo:m.page,isMoving:l});var h=kw(m.page,d.point);return v9({axis:c,moveRelativeTo:h,isMoving:l})}var p=o[o.length-1];if(p.descriptor.id===r.descriptor.id)return l.borderBox.center;if(Ru(p.descriptor.id,i)){var g=kw(p.page,_p(i.displacedBy.point));return b9({axis:c,moveRelativeTo:g,isMoving:l})}return b9({axis:c,moveRelativeTo:p.page,isMoving:l})},D4=function(e,t){var r=e.frame;return r?Ja(t,r.scroll.diff.displacement):t},Sit=function(t){var r=t.impact,n=t.draggable,a=t.droppable,i=t.draggables,o=t.afterCritical,l=n.page.borderBox.center,c=r.at;return!a||!c?l:c.type==="REORDER"?Nit({impact:r,draggable:n,draggables:i,droppable:a,afterCritical:o}):xit({impact:r,draggables:i,afterCritical:o})},pN=function(e){var t=Sit(e),r=e.droppable,n=r?D4(r,t):t;return n},jK=function(e,t){var r=ri(t,e.scroll.initial),n=_p(r),a=mo({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),i={frame:a,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:r,displacement:n}}};return i};function x9(e,t){return e.map(function(r){return t[r]})}function Cit(e,t){for(var r=0;r<t.length;r++){var n=t[r].visible[e];if(n)return n}return null}var kit=function(e){var t=e.impact,r=e.viewport,n=e.destination,a=e.draggables,i=e.maxScrollChange,o=jK(r,Ja(r.scroll.current,i)),l=n.frame?VA(n,Ja(n.frame.scroll.current,i)):n,c=t.displaced,u=Iy({afterDragging:x9(c.all,a),destination:n,displacedBy:t.displacedBy,viewport:o.frame,last:c,forceShouldAnimate:!1}),d=Iy({afterDragging:x9(c.all,a),destination:l,displacedBy:t.displacedBy,viewport:r.frame,last:c,forceShouldAnimate:!1}),f={},m={},h=[c,u,d];c.all.forEach(function(g){var y=Cit(g,h);if(y){m[g]=y;return}f[g]=!0});var p=Gt({},t,{displaced:{all:c.all,invisible:f,visible:m}});return p},Mit=function(e,t){return Ja(e.scroll.diff.displacement,t)},QA=function(e){var t=e.pageBorderBoxCenter,r=e.draggable,n=e.viewport,a=Mit(n,t),i=ri(a,r.page.borderBox.center);return Ja(r.client.borderBox.center,i)},NK=function(e){var t=e.draggable,r=e.destination,n=e.newPageBorderBoxCenter,a=e.viewport,i=e.withDroppableDisplacement,o=e.onlyOnMainAxis,l=o===void 0?!1:o,c=ri(n,t.page.borderBox.center),u=Pb(t.page.borderBox,c),d={target:u,destination:r,withDroppableDisplacement:i,viewport:a};return l?fit(d):xK(d)},Iit=function(e){var t=e.isMovingForward,r=e.draggable,n=e.destination,a=e.draggables,i=e.previousImpact,o=e.viewport,l=e.previousPageBorderBoxCenter,c=e.previousClientSelection,u=e.afterCritical;if(!n.isEnabled)return null;var d=Lp(n.descriptor.id,a),f=Dp(r,n),m=ait({isMovingForward:t,draggable:r,destination:n,insideDestination:d,previousImpact:i})||bit({isMovingForward:t,isInHomeList:f,draggable:r,draggables:a,destination:n,insideDestination:d,previousImpact:i,viewport:o,afterCritical:u});if(!m)return null;var h=pN({impact:m,draggable:r,droppable:n,draggables:a,afterCritical:u}
3977),p=NK({draggable:r,destination:n,newPageBorderBoxCenter:h,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(p){var g=QA({pageBorderBoxCenter:h,draggable:r,viewport:o});return{clientSelection:g,impact:m,scrollJumpRequest:null}}var y=ri(h,l),v=kit({impact:m,viewport:o,destination:n,draggables:a,maxScrollChange:y});return{clientSelection:c,impact:v,scrollJumpRequest:y}},ws=function(t){var r=t.subject.active;return r||ht(),r},Eit=function(e){var t=e.isMovingForward,r=e.pageBorderBoxCenter,n=e.source,a=e.droppables,i=e.viewport,o=n.subject.active;if(!o)return null;var l=n.axis,c=Oi(o[l.start],o[l.end]),u=fN(a).filter(function(f){return f!==n}).filter(function(f){return f.isEnabled}).filter(function(f){return!!f.subject.active}).filter(function(f){return bK(i.frame)(ws(f))}).filter(function(f){var m=ws(f);return t?o[l.crossAxisEnd]<m[l.crossAxisEnd]:m[l.crossAxisStart]<o[l.crossAxisStart]}).filter(function(f){var m=ws(f),h=Oi(m[l.start],m[l.end]);return c(m[l.start])||c(m[l.end])||h(o[l.start])||h(o[l.end])}).sort(function(f,m){var h=ws(f)[l.crossAxisStart],p=ws(m)[l.crossAxisStart];return t?h-p:p-h}).filter(function(f,m,h){return ws(f)[l.crossAxisStart]===ws(h[0])[l.crossAxisStart]});if(!u.length)return null;if(u.length===1)return u[0];var d=u.filter(function(f){var m=Oi(ws(f)[l.start],ws(f)[l.end]);return m(r[l.line])});return d.length===1?d[0]:d.length>1?d.sort(function(f,m){return ws(f)[l.start]-ws(m)[l.start]})[0]:u.sort(function(f,m){var h=p9(r,g9(ws(f))),p=p9(r,g9(ws(m)));return h!==p?h-p:ws(f)[l.start]-ws(m)[l.start]})[0]},w9=function(t,r){var n=t.page.borderBox.center;return Ru(t.descriptor.id,r)?ri(n,r.displacedBy.point):n},Tit=function(t,r){var n=t.page.borderBox;return Ru(t.descriptor.id,r)?Pb(n,_p(r.displacedBy.point)):n},Ait=function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,a=e.insideDestination,i=e.afterCritical,o=a.filter(function(l){return xK({target:Tit(l,i),destination:n,viewport:r.frame,withDroppableDisplacement:!0})}).sort(function(l,c){var u=ky(t,D4(n,w9(l,i))),d=ky(t,D4(n,w9(c,i)));return u<d?-1:d<u?1:l.descriptor.index-c.descriptor.index});return o[0]||null},_b=za(function(t,r){var n=r[t.line];return{value:n,point:hf(t.line,n)}}),Pit=function(t,r,n){var a=t.axis;if(t.descriptor.mode==="virtual")return hf(a.line,r[a.line]);var i=t.subject.page.contentBox[a.size],o=Lp(t.descriptor.id,n),l=o.reduce(function(d,f){return d+f.client.marginBox[a.size]},0),c=l+r[a.line],u=c-i;return u<=0?null:hf(a.line,u)},SK=function(t,r){return Gt({},t,{scroll:Gt({},t.scroll,{max:r})})},CK=function(t,r,n){var a=t.frame;Dp(r,t)&&ht(),t.subject.withPlaceholder&&ht();var i=_b(t.axis,r.displaceBy).point,o=Pit(t,i,n),l={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:t.frame?t.frame.scroll.max:null};if(!a){var c=Wh({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:t.frame});return Gt({},t,{subject:c})}var u=o?Ja(a.scroll.max,o):a.scroll.max,d=SK(a,u),f=Wh({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:d});return Gt({},t,{subject:f,frame:d})},_it=function(t){var r=t.subject.withPlaceholder;r||ht();var n=t.frame;if(!n){var a=Wh({page:t.subject.page,axis:t.axis,frame:null,withPlaceholder:null});return Gt({},t,{subject:a})}var i=r.oldFrameMaxScroll;i||ht();var o=SK(n,i),l=Wh({page:t.subject.page,axis:t.axis,frame:o,withPlaceholder:null});return Gt({},t,{subject:l,frame:o})},Lit=function(e){var t=e.previousPageBorderBoxCenter,r=e.moveRelativeTo,n=e.insideDestination,a=e.draggable,i=e.draggables,o=e.destination,l=e.viewport,c=e.afterCritical;if(!r){if(n.length)return null;var u={displaced:My,displacedBy:yK,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},d=pN({impact:u,draggable:a,droppable:o,draggables:i,afterCritical:c}),f=Dp(a,o)?o:CK(o,a,i),m=NK({draggable:a,destination:f,newPageBorderBoxCenter:d,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return m?u:null}var h=t[o.axis.line]<=r.page.borderBox.center[o.axis.line],p=function(){var y=r.descriptor.index;return r.descriptor.id===a.descriptor.id||h?y:y+1}(),g=_b(o.axis,a.displaceBy);return Aw({draggable:a,insideDestination:n,destination:o,viewport:l,displacedBy:g,last:My,index:p})},Dit=function(e){var t=e.isMovingForward,r=e.previousPageBorderBoxCenter,n=e.draggable,a=e.isOver,i=e.draggables,o=e.droppables,l=e.viewport,c=e.afterCritical,u=Eit({isMovingForward:t,pageBorderBoxCenter:r,source:a,droppables:o,viewport:l});if(!u)return null;var d=Lp(u.descriptor.id,i),f=Ait({pageBorderBoxCenter:r,viewport:l,destination:u,insideDestination:d,afterCritical:c}),m=Lit({previousPageBorderBoxCenter:r,destination:u,draggable:n,draggables:i,moveRelativeTo:f,insideDestination:d,viewport:l,afterCritical:c});if(!m)return null;var h=pN({impact:m,draggable:n,droppable:u,draggables:i,afterCritical:c}),p=QA({pageBorderBoxCenter:h,draggable:n,viewport:l});return{clientSelection:p,impact:m,scrollJumpRequest:null}},ii=function(e){var t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null},Oit=function(t,r){var n=ii(t);return n?r[n]:null},Rit=function(e){var t=e.state,r=e.type,n=Oit(t.impact,t.dimensions.droppables),a=!!n,i=t.dimensions.droppables[t.critical.droppable.
3977id],o=n||i,l=o.axis.direction,c=l==="vertical"&&(r==="MOVE_UP"||r==="MOVE_DOWN")||l==="horizontal"&&(r==="MOVE_LEFT"||r==="MOVE_RIGHT");if(c&&!a)return null;var u=r==="MOVE_DOWN"||r==="MOVE_RIGHT",d=t.dimensions.draggables[t.critical.draggable.id],f=t.current.page.borderBoxCenter,m=t.dimensions,h=m.draggables,p=m.droppables;return c?Iit({isMovingForward:u,previousPageBorderBoxCenter:f,draggable:d,destination:o,draggables:h,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):Dit({isMovingForward:u,previousPageBorderBoxCenter:f,draggable:d,isOver:o,draggables:h,droppables:p,viewport:t.viewport,afterCritical:t.afterCritical})};function dd(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function kK(e){var t=Oi(e.top,e.bottom),r=Oi(e.left,e.right);return function(a){return t(a.y)&&r(a.x)}}function $it(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Fit(e){var t=e.pageBorderBox,r=e.draggable,n=e.candidates,a=r.page.borderBox.center,i=n.map(function(o){var l=o.axis,c=hf(o.axis.line,t.center[l.line],o.page.borderBox.center[l.crossAxisLine]);return{id:o.descriptor.id,distance:ky(a,c)}}).sort(function(o,l){return l.distance-o.distance});return i[0]?i[0].id:null}function zit(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,a=fN(n).filter(function(i){if(!i.isEnabled)return!1;var o=i.subject.active;if(!o||!$it(t,o))return!1;if(kK(o)(t.center))return!0;var l=i.axis,c=o.center[l.crossAxisLine],u=t[l.crossAxisStart],d=t[l.crossAxisEnd],f=Oi(o[l.crossAxisStart],o[l.crossAxisEnd]),m=f(u),h=f(d);return!m&&!h?!0:m?u<c:d>c});return a.length?a.length===1?a[0].descriptor.id:Fit({pageBorderBox:t,draggable:r,candidates:a}):null}var MK=function(t,r){return mo(Pb(t,r))},Bit=function(e,t){var r=e.frame;return r?MK(t,r.scroll.diff.value):t};function IK(e){var t=e.displaced,r=e.id;return!!(t.visible[r]||t.invisible[r])}function Uit(e){var t=e.draggable,r=e.closest,n=e.inHomeList;return r?n&&r.descriptor.index>t.descriptor.index?r.descriptor.index-1:r.descriptor.index:null}var Vit=function(e){var t=e.pageBorderBoxWithDroppableScroll,r=e.draggable,n=e.destination,a=e.insideDestination,i=e.last,o=e.viewport,l=e.afterCritical,c=n.axis,u=_b(n.axis,r.displaceBy),d=u.value,f=t[c.start],m=t[c.end],h=hN(r,a),p=Hu(h,function(y){var v=y.descriptor.id,x=y.page.borderBox.center[c.line],j=Ru(v,l),C=IK({displaced:i,id:v});return j?C?m<=x:f<x-d:C?m<=x+d:f<x}),g=Uit({draggable:r,closest:p,inHomeList:Dp(r,n)});return Aw({draggable:r,insideDestination:a,destination:n,viewport:o,last:i,displacedBy:u,index:g})},Wit=4,qit=function(e){var t=e.draggable,r=e.pageBorderBoxWithDroppableScroll,n=e.previousImpact,a=e.destination,i=e.insideDestination,o=e.afterCritical;if(!a.isCombineEnabled)return null;var l=a.axis,c=_b(a.axis,t.displaceBy),u=c.value,d=r[l.start],f=r[l.end],m=hN(t,i),h=Hu(m,function(g){var y=g.descriptor.id,v=g.page.borderBox,x=v[l.size],j=x/Wit,C=Ru(y,o),N=IK({displaced:n.displaced,id:y});return C?N?f>v[l.start]+j&&f<v[l.end]-j:d>v[l.start]-u+j&&d<v[l.end]-u-j:N?f>v[l.start]+u+j&&f<v[l.end]+u-j:d>v[l.start]+j&&d<v[l.end]-j});if(!h)return null;var p={displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:h.descriptor.id,droppableId:a.descriptor.id}}};return p},EK=function(e){var t=e.pageOffset,r=e.draggable,n=e.draggables,a=e.droppables,i=e.previousImpact,o=e.viewport,l=e.afterCritical,c=MK(r.page.borderBox,t),u=zit({pageBorderBox:c,draggable:r,droppables:a});if(!u)return sit;var d=a[u],f=Lp(d.descriptor.id,n),m=Bit(d,c);return qit({pageBorderBoxWithDroppableScroll:m,draggable:r,previousImpact:i,destination:d,insideDestination:f,afterCritical:l})||Vit({pageBorderBoxWithDroppableScroll:m,draggable:r,destination:d,insideDestination:f,last:i.displaced,viewport:o,afterCritical:l})},KA=function(e,t){var r;return Gt({},e,(r={},r[t.descriptor.id]=t,r))},Git=function(t){var r=t.previousImpact,n=t.impact,a=t.droppables,i=ii(r),o=ii(n);if(!i||i===o)return a;var l=a[i];if(!l.subject.withPlaceholder)return a;var c=_it(l);return KA(a,c)},Hit=function(e){var t=e.draggable,r=e.draggables,n=e.droppables,a=e.previousImpact,i=e.impact,o=Git({previousImpact:a,impact:i,droppables:n}),l=ii(i);if(!l)return o;var c=n[l];if(Dp(t,c)||c.subject.withPlaceholder)return o;var u=CK(c,t,r);return KA(o,u)},t0=function(e){var t=e.state,r=e.clientSelection,n=e.dimensions,a=e.viewport,i=e.impact,o=e.scrollJumpRequest,l=a||t.viewport,c=n||t.dimensions,u=r||t.current.client.selection,d=ri(u,t.initial.client.selection),f={offset:d,selection:u,borderBoxCenter:Ja(t.initial.client.borderBoxCenter,d)},m={selection:Ja(f.selection,l.scroll.current),borderBoxCenter:Ja(f.borderBoxCenter,l.scroll.current),offset:Ja(f.offset,l.scroll.diff.value)},h={client:f,page:m};if(t.phase==="COLLECTING")return Gt({phase:"COLLECTING"},t,{dimensions:c,viewport:l,current:h});var p=c.draggables[t.critical.draggable.id],g=i||EK({pageOffset:m.offset,draggable:p,draggables:c.draggables,droppables:c.droppables,previousImpact:t.impact,viewport:l,afterCritical:t.afterCritical}),y=Hit({draggable:p,impact:g,previousImpact:t.impact,draggables:c.draggables,droppables:c.droppables}),v=Gt({},t,{current:h,dimensions:{draggables:c.draggables,droppables:y},impact:g,viewport:l,scrollJumpRequest:o||null,forceShouldAnimate:o?!1:null});return v};function Yit(e,t){return e.map(function(r){return t[r]})}var TK=function(e){var t=e.impact,r=e.viewport,n=e.draggables,a=e.destination,i=e.forceShouldAnimate,o=t.displaced,l=Yit(o.all,n),c=Iy({afterDragging:l,destination:a,displacedBy:t.displacedBy,viewport:r.frame,forceShouldAnimate:i,last:o});return Gt({},t,{displaced:c})},AK=function(e){var t=e.impact,r=e.draggable,n=e.droppable,a=e.draggables,i=e.viewport,o=e.afterCritical,l=pN({impact:t,draggable:r,draggables:a,droppable:n,afterCritical:
3977o});return QA({pageBorderBoxCenter:l,draggable:r,viewport:i})},PK=function(e){var t=e.state,r=e.dimensions,n=e.viewport;t.movementMode!=="SNAP"&&ht();var a=t.impact,i=n||t.viewport,o=r||t.dimensions,l=o.draggables,c=o.droppables,u=l[t.critical.draggable.id],d=ii(a);d||ht();var f=c[d],m=TK({impact:a,viewport:i,destination:f,draggables:l}),h=AK({impact:m,draggable:u,droppable:f,draggables:l,viewport:i,afterCritical:t.afterCritical});return t0({impact:m,clientSelection:h,state:t,dimensions:o,viewport:i})},Qit=function(e){return{index:e.index,droppableId:e.droppableId}},_K=function(e){var t=e.draggable,r=e.home,n=e.draggables,a=e.viewport,i=_b(r.axis,t.displaceBy),o=Lp(r.descriptor.id,n),l=o.indexOf(t);l===-1&&ht();var c=o.slice(l+1),u=c.reduce(function(h,p){return h[p.descriptor.id]=!0,h},{}),d={inVirtualList:r.descriptor.mode==="virtual",displacedBy:i,effected:u},f=Iy({afterDragging:c,destination:r,displacedBy:i,last:null,viewport:a.frame,forceShouldAnimate:!1}),m={displaced:f,displacedBy:i,at:{type:"REORDER",destination:Qit(t.descriptor)}};return{impact:m,afterCritical:d}},Kit=function(e,t){return{draggables:e.draggables,droppables:KA(e.droppables,t)}},Jit=function(e){var t=e.draggable,r=e.offset,n=e.initialWindowScroll,a=kw(t.client,r),i=Mw(a,n),o=Gt({},t,{placeholder:Gt({},t.placeholder,{client:a}),client:a,page:i});return o},Zit=function(e){var t=e.frame;return t||ht(),t},Xit=function(e){var t=e.additions,r=e.updatedDroppables,n=e.viewport,a=n.scroll.diff.value;return t.map(function(i){var o=i.descriptor.droppableId,l=r[o],c=Zit(l),u=c.scroll.diff.value,d=Ja(a,u),f=Jit({draggable:i,offset:d,initialWindowScroll:n.scroll.initial});return f})},eot=function(e){var t=e.state,r=e.published,n=r.modified.map(function(j){var C=t.dimensions.droppables[j.droppableId],N=VA(C,j.scroll);return N}),a=Gt({},t.dimensions.droppables,{},pK(n)),i=gK(Xit({additions:r.additions,updatedDroppables:a,viewport:t.viewport})),o=Gt({},t.dimensions.draggables,{},i);r.removals.forEach(function(j){delete o[j]});var l={droppables:a,draggables:o},c=ii(t.impact),u=c?l.droppables[c]:null,d=l.draggables[t.critical.draggable.id],f=l.droppables[t.critical.droppable.id],m=_K({draggable:d,home:f,draggables:o,viewport:t.viewport}),h=m.impact,p=m.afterCritical,g=u&&u.isCombineEnabled?t.impact:h,y=EK({pageOffset:t.current.page.offset,draggable:l.draggables[t.critical.draggable.id],draggables:l.draggables,droppables:l.droppables,previousImpact:g,viewport:t.viewport,afterCritical:p}),v=Gt({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:y,onLiftImpact:h,dimensions:l,afterCritical:p,forceShouldAnimate:!1});if(t.phase==="COLLECTING")return v;var x=Gt({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1});return x},O4=function(t){return t.movementMode==="SNAP"},lC=function(t,r,n){var a=Kit(t.dimensions,r);return!O4(t)||n?t0({state:t,dimensions:a}):PK({state:t,dimensions:a})};function cC(e){return e.isDragging&&e.movementMode==="SNAP"?Gt({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var j9={phase:"IDLE",completed:null,shouldFlush:!1},tot=function(e,t){if(e===void 0&&(e=j9),t.type==="FLUSH")return Gt({},j9,{shouldFlush:!0});if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&ht();var r=t.payload,n=r.critical,a=r.clientSelection,i=r.viewport,o=r.dimensions,l=r.movementMode,c=o.draggables[n.draggable.id],u=o.droppables[n.droppable.id],d={selection:a,borderBoxCenter:c.client.borderBox.center,offset:Ua},f={client:d,page:{selection:Ja(d.selection,i.scroll.initial),borderBoxCenter:Ja(d.selection,i.scroll.initial),offset:Ja(d.selection,i.scroll.diff.value)}},m=fN(o.droppables).every(function(Q){return!Q.isFixedOnPage}),h=_K({draggable:c,home:u,draggables:o.draggables,viewport:i}),p=h.impact,g=h.afterCritical,y={phase:"DRAGGING",isDragging:!0,critical:n,movementMode:l,dimensions:o,initial:f,current:f,isWindowScrollAllowed:m,impact:p,afterCritical:g,onLiftImpact:p,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null};return y}if(t.type==="COLLECTION_STARTING"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&ht();var v=Gt({phase:"COLLECTING"},e,{phase:"COLLECTING"});return v}if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||ht(),eot({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;dd(e)||ht();var x=t.payload.client;return wu(x,e.current.client.selection)?e:t0({state:e,clientSelection:x,impact:O4(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return cC(e);dd(e)||ht();var j=t.payload,C=j.id,N=j.newScroll,S=e.dimensions.droppables[C];if(!S)return e;var M=VA(S,N);return lC(e,M,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;dd(e)||ht();var k=t.payload,I=k.id,T=k.isEnabled,L=e.dimensions.droppables[I];L||ht(),L.isEnabled===T&&ht();var R=Gt({},L,{isEnabled:T});return lC(e,R,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;dd(e)||ht();
3977var _=t.payload,B=_.id,z=_.isCombineEnabled,D=e.dimensions.droppables[B];D||ht(),D.isCombineEnabled===z&&ht();var A=Gt({},D,{isCombineEnabled:z});return lC(e,A,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;dd(e)||ht(),e.isWindowScrollAllowed||ht();var P=t.payload.newScroll;if(wu(e.viewport.scroll.current,P))return cC(e);var E=jK(e.viewport,P);return O4(e)?PK({state:e,viewport:E}):t0({state:e,viewport:E})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!dd(e))return e;var F=t.payload.maxScroll;if(wu(F,e.viewport.scroll.max))return e;var $=Gt({},e.viewport,{scroll:Gt({},e.viewport.scroll,{max:F})});return Gt({phase:"DRAGGING"},e,{viewport:$})}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&ht();var H=Rit({state:e,type:t.type});return H?t0({state:e,impact:H.impact,clientSelection:H.clientSelection,scrollJumpRequest:H.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){var X=t.payload.reason;e.phase!=="COLLECTING"&&ht();var ue=Gt({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:X});return ue}if(t.type==="DROP_ANIMATE"){var le=t.payload,ae=le.completed,te=le.dropDuration,ne=le.newHomeClientOffset;e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||ht();var J={phase:"DROP_ANIMATING",completed:ae,dropDuration:te,newHomeClientOffset:ne,dimensions:e.dimensions};return J}if(t.type==="DROP_COMPLETE"){var G=t.payload.completed;return{phase:"IDLE",completed:G,shouldFlush:!1}}return e},rot=function(t){return{type:"BEFORE_INITIAL_CAPTURE",payload:t}},not=function(t){return{type:"LIFT",payload:t}},aot=function(t){return{type:"INITIAL_PUBLISH",payload:t}},sot=function(t){return{type:"PUBLISH_WHILE_DRAGGING",payload:t}},iot=function(){return{type:"COLLECTION_STARTING",payload:null}},oot=function(t){return{type:"UPDATE_DROPPABLE_SCROLL",payload:t}},lot=function(t){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:t}},cot=function(t){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:t}},LK=function(t){return{type:"MOVE",payload:t}},uot=function(t){return{type:"MOVE_BY_WINDOW_SCROLL",payload:t}},dot=function(t){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:t}},fot=function(){return{type:"MOVE_UP",payload:null}},mot=function(){return{type:"MOVE_DOWN",payload:null}},hot=function(){return{type:"MOVE_RIGHT",payload:null}},pot=function(){return{type:"MOVE_LEFT",payload:null}},JA=function(){return{type:"FLUSH",payload:null}},got=function(t){return{type:"DROP_ANIMATE",payload:t}},ZA=function(t){return{type:"DROP_COMPLETE",payload:t}},DK=function(t){return{type:"DROP",payload:t}},yot=function(t){return{type:"DROP_PENDING",payload:t}},OK=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}},bot=function(e){return function(t){var r=t.getState,n=t.dispatch;return function(a){return function(i){if(i.type!=="LIFT"){a(i);return}var o=i.payload,l=o.id,c=o.clientSelection,u=o.movementMode,d=r();d.phase==="DROP_ANIMATING"&&n(ZA({completed:d.completed})),r().phase!=="IDLE"&&ht(),n(JA()),n(rot({draggableId:l,movementMode:u}));var f={shouldPublishImmediately:u==="SNAP"},m={draggableId:l,scrollOptions:f},h=e.startPublishing(m),p=h.critical,g=h.dimensions,y=h.viewport;n(aot({critical:p,dimensions:g,clientSelection:c,movementMode:u,viewport:y}))}}}},vot=function(e){return function(){return function(t){return function(r){r.type==="INITIAL_PUBLISH"&&e.dragging(),r.type==="DROP_ANIMATE"&&e.dropping(r.payload.completed.result.reason),(r.type==="FLUSH"||r.type==="DROP_COMPLETE")&&e.resting(),t(r)}}}},XA={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ey={opacity:{drop:0,combining:.7},scale:{drop:.75}},eP={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},rd=eP.outOfTheWay+"s "+XA.outOfTheWay,r0={fluid:"opacity "+rd,snap:"transform "+rd+", opacity "+rd,drop:function(t){var r=t+"s "+XA.drop;return"transform "+r+", opacity "+r},outOfTheWay:"transform "+rd,placeholder:"height "+rd+", width "+rd+", margin "+rd},N9=function(t){return wu(t,Ua)?null:"translate("+t.x+"px, "+t.y+"px)"},R4={moveTo:N9,drop:function(t,r){var n=N9(t);return n?r?n+" scale("+Ey.scale.drop+")":n:null}},$4=eP.minDropTime,RK=eP.maxDropTime,xot=RK-$4,S9=1500,wot=.6,jot=function(e){var t=e.current,r=e.destination,n=e.reason,a=ky(t,r);if(a<=0)return $4;if(a>=S9)return RK;var i=a/S9,o=$4+xot*i,l=n==="CANCEL"?o*wot:o;return Number(l.toFixed(2))},Not=function(e){var t=e.impact,r=e.draggable,n=e.dimensions,a=e.viewport,i=e.afterCritical,o=n.draggables,l=n.droppables,c=ii(t),u=c?l[c]:null,d=l[r.descriptor.droppableId],f=AK({impact:t,draggable:r,draggables:o,afterCritical:i,droppable:u||d,viewport:
3977a}),m=ri(f,r.client.borderBox.center);return m},Sot=function(e){var t=e.draggables,r=e.reason,n=e.lastImpact,a=e.home,i=e.viewport,o=e.onLiftImpact;if(!n.at||r!=="DROP"){var l=TK({draggables:t,impact:o,destination:a,viewport:i,forceShouldAnimate:!0});return{impact:l,didDropInsideDroppable:!1}}if(n.at.type==="REORDER")return{impact:n,didDropInsideDroppable:!0};var c=Gt({},n,{displaced:My});return{impact:c,didDropInsideDroppable:!0}},Cot=function(e){var t=e.getState,r=e.dispatch;return function(n){return function(a){if(a.type!=="DROP"){n(a);return}var i=t(),o=a.payload.reason;if(i.phase==="COLLECTING"){r(yot({reason:o}));return}if(i.phase!=="IDLE"){var l=i.phase==="DROP_PENDING"&&i.isWaiting;l&&ht(),i.phase==="DRAGGING"||i.phase==="DROP_PENDING"||ht();var c=i.critical,u=i.dimensions,d=u.draggables[i.critical.draggable.id],f=Sot({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),m=f.impact,h=f.didDropInsideDroppable,p=h?qA(m):null,g=h?mN(m):null,y={index:c.draggable.index,droppableId:c.droppable.id},v={draggableId:d.descriptor.id,type:d.descriptor.type,source:y,reason:o,mode:i.movementMode,destination:p,combine:g},x=Not({impact:m,draggable:d,dimensions:u,viewport:i.viewport,afterCritical:i.afterCritical}),j={critical:i.critical,afterCritical:i.afterCritical,result:v,impact:m},C=!wu(i.current.client.offset,x)||!!v.combine;if(!C){r(ZA({completed:j}));return}var N=jot({current:i.current.client.offset,destination:x,reason:o}),S={newHomeClientOffset:x,dropDuration:N,completed:j};r(got(S))}}}},$K=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function kot(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(r){r.target!==window&&r.target!==window.document||e()}}}function Mot(e){var t=e.onWindowScroll;function r(){t($K())}var n=Cy(r),a=kot(n),i=xu;function o(){return i!==xu}function l(){o()&&ht(),i=Pi(window,[a])}function c(){o()||ht(),n.cancel(),i(),i=xu}return{start:l,stop:c,isActive:o}}var Iot=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},Eot=function(e){var t=Mot({onWindowScroll:function(n){e.dispatch(uot({newScroll:n}))}});return function(r){return function(n){!t.isActive()&&n.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&Iot(n)&&t.stop(),r(n)}}},Tot=function(e){var t=!1,r=!1,n=setTimeout(function(){r=!0}),a=function(o){t||r||(t=!0,e(o),clearTimeout(n))};return a.wasCalled=function(){return t},a},Aot=function(){var e=[],t=function(i){var o=WA(e,function(u){return u.timerId===i});o===-1&&ht();var l=e.splice(o,1),c=l[0];c.callback()},r=function(i){var o=setTimeout(function(){return t(o)}),l={timerId:o,callback:i};e.push(l)},n=function(){if(e.length){var i=[].concat(e);e.length=0,i.forEach(function(o){clearTimeout(o.timerId),o.callback()})}};return{add:r,flush:n}},Pot=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.droppableId===r.droppableId&&t.index===r.index},_ot=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.draggableId===r.draggableId&&t.droppableId===r.droppableId},Lot=function(t,r){if(t===r)return!0;var n=t.draggable.id===r.draggable.id&&t.draggable.droppableId===r.draggable.droppableId&&t.draggable.type===r.draggable.type&&t.draggable.index===r.draggable.index,a=t.droppable.id===r.droppable.id&&t.droppable.type===r.droppable.type;return n&&a},vg=function(t,r){r()},_v=function(t,r){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:r}},uC=function(t,r,n,a){if(!t){n(a(r));return}var i=Tot(n),o={announce:i};t(r,o),i.wasCalled()||n(a(r))},Dot=function(e,t){var r=Aot(),n=null,a=function(m,h){n&&ht(),vg("onBeforeCapture",function(){var p=e().onBeforeCapture;if(p){var g={draggableId:m,mode:h};p(g)}})},i=function(m,h){n&&ht(),vg("onBeforeDragStart",function(){var p=e().onBeforeDragStart;p&&p(_v(m,h))})},o=function(m,h){n&&ht();var p=_v(m,h);n={mode:h,lastCritical:m,lastLocation:p.source,lastCombine:null},r.add(function(){vg("onDragStart",function(){return uC(e().onDragStart,p,t,px.onDragStart)})})},l=function(m,h){var p=qA(h),g=mN(h);n||ht();var y=!Lot(m,n.lastCritical);y&&(n.lastCritical=m);var v=!Pot(n.lastLocation,p);v&&(n.lastLocation=p);var x=!_ot(n.lastCombine,g);if(x&&(n.lastCombine=g),!(!y&&!v&&!x)){var j=Gt({},_v(m,n.mode),{combine:g,destination:p});r.add(function(){vg("onDragUpdate",function(){return uC(e().onDragUpdate,j,t,px.onDragUpdate)})})}},c=function(){n||ht(),r.flush()},u=function(m){n||ht(),n=null,vg("onDragEnd",function(){return uC(e().onDragEnd,m,t,px.onDragEnd)})},d=function(){if(n){var m=Gt({},_v(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});u(m)}};return{beforeCapture:a,beforeStart:i,start:o,update:l,flush:c,drop:u,abort:d}},Oot=function(e,t){var r=Dot(e,t);return function(n){return function(a){return function(i){if(i.type==="BEFORE_INITIAL_CAPTURE"){r.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(i.type==="INITIAL_PUBLISH"){var o=i.payload.critical;r.beforeStart(o,i.payload.movementMode),a(i),r.start(o,i.payload.movementMode);return}if(i.type==="DROP_COMPLETE"){var l=i.payload.completed.result;r.flush(),a(i),r.drop(l);return}if(a(i),i.type==="FLUSH"){r.abort();return}var c=n.getState();c.phase==="DRAGGING"&&r.update(c.critical,c.impact)}}}},Rot=function(e){return function(t){return function(r){if(r.type!=="DROP_ANIMATION_FINISHED"){t(r);return}var n=e.getState();
3977n.phase!=="DROP_ANIMATING"&&ht(),e.dispatch(ZA({completed:n.completed}))}}},$ot=function(e){var t=null,r=null;function n(){r&&(cancelAnimationFrame(r),r=null),t&&(t(),t=null)}return function(a){return function(i){if((i.type==="FLUSH"||i.type==="DROP_COMPLETE"||i.type==="DROP_ANIMATION_FINISHED")&&n(),a(i),i.type==="DROP_ANIMATE"){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var c=e.getState();c.phase==="DROP_ANIMATING"&&e.dispatch(OK())}};r=requestAnimationFrame(function(){r=null,t=Pi(window,[o])})}}}},Fot=function(e){return function(){return function(t){return function(r){(r.type==="DROP_COMPLETE"||r.type==="FLUSH"||r.type==="DROP_ANIMATE")&&e.stopPublishing(),t(r)}}}},zot=function(e){var t=!1;return function(){return function(r){return function(n){if(n.type==="INITIAL_PUBLISH"){t=!0,e.tryRecordFocus(n.payload.critical.draggable.id),r(n),e.tryRestoreFocusRecorded();return}if(r(n),!!t){if(n.type==="FLUSH"){t=!1,e.tryRestoreFocusRecorded();return}if(n.type==="DROP_COMPLETE"){t=!1;var a=n.payload.completed.result;a.combine&&e.tryShiftRecord(a.draggableId,a.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}},Bot=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},Uot=function(e){return function(t){return function(r){return function(n){if(Bot(n)){e.stop(),r(n);return}if(n.type==="INITIAL_PUBLISH"){r(n);var a=t.getState();a.phase!=="DRAGGING"&&ht(),e.start(a);return}r(n),e.scroll(t.getState())}}}},Vot=function(e){return function(t){return function(r){if(t(r),r.type==="PUBLISH_WHILE_DRAGGING"){var n=e.getState();n.phase==="DROP_PENDING"&&(n.isWaiting||e.dispatch(DK({reason:n.reason})))}}}},Wot=YQ,qot=function(e){var t=e.dimensionMarshal,r=e.focusMarshal,n=e.styleMarshal,a=e.getResponders,i=e.announce,o=e.autoScroller;return HQ(tot,Wot(Hat(vot(n),Fot(t),bot(t),Cot,Rot,$ot,Vot,Uot(o),Eot,zot(r),Oot(a,i))))},dC=function(){return{additions:{},removals:{},modified:{}}};function Got(e){var t=e.registry,r=e.callbacks,n=dC(),a=null,i=function(){a||(r.collectionStarting(),a=requestAnimationFrame(function(){a=null;var d=n,f=d.additions,m=d.removals,h=d.modified,p=Object.keys(f).map(function(v){return t.draggable.getById(v).getDimension(Ua)}).sort(function(v,x){return v.descriptor.index-x.descriptor.index}),g=Object.keys(h).map(function(v){var x=t.droppable.getById(v),j=x.callbacks.getScrollWhileDragging();return{droppableId:v,scroll:j}}),y={additions:p,removals:Object.keys(m),modified:g};n=dC(),r.publish(y)}))},o=function(d){var f=d.descriptor.id;n.additions[f]=d,n.modified[d.descriptor.droppableId]=!0,n.removals[f]&&delete n.removals[f],i()},l=function(d){var f=d.descriptor;n.removals[f.id]=!0,n.modified[f.droppableId]=!0,n.additions[f.id]&&delete n.additions[f.id],i()},c=function(){a&&(cancelAnimationFrame(a),a=null,n=dC())};return{add:o,remove:l,stop:c}}var FK=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,a=e.width,i=ri({x:r,y:t},{x:a,y:n}),o={x:Math.max(0,i.x),y:Math.max(0,i.y)};return o},zK=function(){var e=document.documentElement;return e||ht(),e},BK=function(){var e=zK(),t=FK({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},Hot=function(){var e=$K(),t=BK(),r=e.y,n=e.x,a=zK(),i=a.clientWidth,o=a.clientHeight,l=n+i,c=r+o,u=mo({top:r,left:n,right:l,bottom:c}),d={frame:u,scroll:{initial:e,current:e,max:t,diff:{value:Ua,displacement:Ua}}};return d},Yot=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,a=Hot(),i=a.scroll.current,o=t.droppable,l=n.droppable.getAllByType(o.type).map(function(f){return f.callbacks.getDimensionAndWatchScroll(i,r)}),c=n.draggable.getAllByType(t.draggable.type).map(function(f){return f.getDimension(i)}),u={draggables:gK(c),droppables:pK(l)},d={dimensions:u,critical:t,viewport:a};return d};function C9(e,t,r){if(r.descriptor.id===t.id||r.descriptor.type!==t.type)return!1;var n=e.droppable.getById(r.descriptor.droppableId);return n.descriptor.mode==="virtual"}var Qot=function(e,t){var r=null,n=Got({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),a=function(h,p){e.droppable.exists(h)||ht(),r&&t.updateDroppableIsEnabled({id:h,isEnabled:p})},i=function(h,p){r&&(e.droppable.exists(h)||ht(),t.updateDroppableIsCombine
3977Enabled({id:h,isCombineEnabled:p}))},o=function(h,p){r&&(e.droppable.exists(h)||ht(),t.updateDroppableScroll({id:h,newScroll:p}))},l=function(h,p){r&&e.droppable.getById(h).callbacks.scroll(p)},c=function(){if(r){n.stop();var h=r.critical.droppable;e.droppable.getAllByType(h.type).forEach(function(p){return p.callbacks.dragStopped()}),r.unsubscribe(),r=null}},u=function(h){r||ht();var p=r.critical.draggable;h.type==="ADDITION"&&C9(e,p,h.value)&&n.add(h.value),h.type==="REMOVAL"&&C9(e,p,h.value)&&n.remove(h.value)},d=function(h){r&&ht();var p=e.draggable.getById(h.draggableId),g=e.droppable.getById(p.descriptor.droppableId),y={draggable:p.descriptor,droppable:g.descriptor},v=e.subscribe(u);return r={critical:y,unsubscribe:v},Yot({critical:y,registry:e,scrollOptions:h.scrollOptions})},f={updateDroppableIsEnabled:a,updateDroppableIsCombineEnabled:i,scrollDroppable:l,updateDroppableScroll:o,startPublishing:d,stopPublishing:c};return f},UK=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},Kot=function(e){window.scrollBy(e.x,e.y)},Jot=za(function(e){return fN(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),Zot=function(t,r){var n=Hu(Jot(r),function(a){return a.frame||ht(),kK(a.frame.pageMarginBox)(t)});return n},Xot=function(e){var t=e.center,r=e.destination,n=e.droppables;if(r){var a=n[r];return a.frame?a:null}var i=Zot(t,n);return i},ju={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},elt=function(e,t){var r=e[t.size]*ju.startFromPercentage,n=e[t.size]*ju.maxScrollAtPercentage,a={startScrollingFrom:r,maxScrollValueAt:n};return a},VK=function(e){var t=e.startOfRange,r=e.endOfRange,n=e.current,a=r-t;if(a===0)return 0;var i=n-t,o=i/a;return o},tP=1,tlt=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return ju.maxPixelScroll;if(e===t.startScrollingFrom)return tP;var r=VK({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=1-r,a=ju.maxPixelScroll*ju.ease(n);return Math.ceil(a)},k9=ju.durationDampening.accelerateAt,M9=ju.durationDampening.stopDampeningAt,rlt=function(e,t){var r=t,n=M9,a=Date.now(),i=a-r;if(i>=M9)return e;if(i<k9)return tP;var o=VK({startOfRange:k9,endOfRange:n,current:i}),l=e*ju.ease(o);return Math.ceil(l)},I9=function(e){var t=e.distanceToEdge,r=e.thresholds,n=e.dragStartTime,a=e.shouldUseTimeDampening,i=tlt(t,r);return i===0?0:a?Math.max(rlt(i,n),tP):i},E9=function(e){var t=e.container,r=e.distanceToEdges,n=e.dragStartTime,a=e.axis,i=e.shouldUseTimeDampening,o=elt(t,a),l=r[a.end]<r[a.start];return l?I9({distanceToEdge:r[a.end],thresholds:o,dragStartTime:n,shouldUseTimeDampening:i}):-1*I9({distanceToEdge:r[a.start],thresholds:o,dragStartTime:n,shouldUseTimeDampening:i})},nlt=function(e){var t=e.container,r=e.subject,n=e.proposedScroll,a=r.height>t.height,i=r.width>t.width;return!i&&!a?n:i&&a?null:{x:i?0:n.x,y:a?0:n.y}},alt=mK(function(e){return e===0?0:e}),WK=function(e){var t=e.dragStartTime,r=e.container,n=e.subject,a=e.center,i=e.shouldUseTimeDampening,o={top:a.y-r.top,right:r.right-a.x,bottom:r.bottom-a.y,left:a.x-r.left},l=E9({container:r,distanceToEdges:o,dragStartTime:t,axis:GA,shouldUseTimeDampening:i}),c=E9({container:r,distanceToEdges:o,dragStartTime:t,axis:vK,shouldUseTimeDampening:i}),u=alt({x:c,y:l});if(wu(u,Ua))return null;var d=nlt({container:r,subject:n,proposedScroll:u});return d?wu(d,Ua)?null:d:null},slt=mK(function(e){return e===0?0:e>0?1:-1}),rP=function(){var e=function(r,n){return r<0?r:r>n?r-n:0};return function(t){var r=t.current,n=t.max,a=t.change,i=Ja(r,a),o={x:e(i.x,n.x),y:e(i.y,n.y)};return wu(o,Ua)?null:o}}(),qK=function(t){var r=t.max,n=t.current,a=t.change,i={x:Math.max(n.x,r.x),y:Math.max(n.y,r.y)},o=slt(a),l=rP({max:i,current:n,change:o});return!l||o.x!==0&&l.x===0||o.y!==0&&l.y===0},nP=function(t,r){return qK({current:t.scroll.current,max:t.scroll.max,change:r})},ilt=function(t,r){if(!nP(t,r))return null;var n=t.scroll.max,a=t.scroll.current;return rP({current:a,max:n,change:r})},aP=function(t,r){var n=t.frame;return n?qK({current:n.scroll.current,max:n.scroll.max,change:r}):!1},olt=function(t,r){var n=t.frame;return!n||!aP(t,r)?null:rP({current:n.scroll.current,max:n.scroll.max,change:r})},llt=function(e){var t=e.viewport,r=e.subject,n=e.center,a=e.dragStartTime,i=e.shouldUseTimeDampening,o=WK({dragStartTime:a,container:t.frame,subject:r,center:n,shouldUseTimeDampening:i});return o&&nP(t,o)?o:null},clt=function(e){var t=e.droppable,r=e.subject,n=e.center,a=e.dragStartTime,i=e.shouldUseTimeDampening,o=t.frame;if(!o)return null;var l=WK({dragStartTime:a,container:o.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:i});return l&&aP(t,l)?l:null},T9=function(e){var t=e.state,r=e.dragStartTime,n=e.shouldUseTimeDampening,a=e.scrollWindow,i=e.scrollDroppable,o=t.current.page.borderBoxCenter,l=t.dimensions.draggables[t.critical.draggable.id],c=l.page.marginBox;if(t.isWindowScrollAllowed){var u=t.viewport,d=llt({dragStartTime:r,viewport:u,subject:c,center:o,shouldUseTimeDampening:n});if(d){a(d);return}}var f=Xot({center:o,destination:ii(t.impact),droppables:t.dimensions.droppables});if(f){var m=clt({dragStartTime:r,droppable:f,subject:c,center:o,shouldUseTimeDampening:n});m&&i(f.descriptor.id,m)}},ult=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=Cy(t),a=Cy(r),i=null,o=function(d){i||ht();var f=i,m=f.shouldUseTimeDampening,h=f.dragStartTime;T9({state:d,scrollWindow:n,scrollDroppable:a,dragStartTime:h,shouldUseTimeDampening:m})},l=function(d){i&&ht();var f=Date.now(),m=!1,h=function(){m=!0};T9({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h}),i={dragStartTime:f,shouldUseTimeDampening:m},m&&o(d)},c=function(){i&&(n.cancel(),a.cancel(),i=null)};return{start:l,stop:c,scroll:o}},dlt=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,a=function(u,d){var f=Ja(u.current.client.selection,d);t({client:f})},i=function(u,d){if(!aP(u,d))return d;var f=olt(u,d);if(!f)return r(u.descriptor.id,d),null;var m=ri(d,f);r(u.descriptor.id,m);var h=ri(d,m);return h},o=function(u,d,f){if(!u||!nP(d,f))return f;var m=ilt(d,f);if(!m)return n(f),null;var h=ri(f,m);n(h);var p=ri(f,h);return p},l=function(u){var d=u.scrollJumpRequest;if(d){var f=ii(u.impact);f||ht();var m=i(u.dimensions.droppables[f],d);if(m){var h=u.viewport,p=o(u.isWindowScrollAllowed,h,m);p&&a(u,p)}}};return l},flt=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,a=ult({scrollWindow:r,scrollDroppable:t}),i=dlt({move:n,scrollWindow:r,scrollDroppable:t}),o=function(u){if(u.phase==="DRAGGING"){if(u.movementMode==="FLUID"){a.scroll(u);return}u.scrollJumpRequest&&i(u)}},l={scroll:o,start:a.start,stop:a.stop};return l},qh="data-rbd",Gh=function(){var e=qh+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),F4=function(){var e=qh+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),mlt=function(){var e=qh+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),A9={contextId:qh+"-scroll-container-context-id"},hlt=function(t){return function(r){return"["+r+'="'+t+'"]'}},xg=function(t,r){return t.map(function(n){var a=n.styles[r];return a?n.selector+" { "+a+" }":""}).join(" ")},plt="pointer-events: none;",glt=function(e){var t=hlt(e),r=function(){var l=`
3978      cursor: -webkit-grab;
3979      cursor: grab;
3980    `;return{selector:t(Gh.contextId),styles:{always:`
3981          -webkit-touch-callout: none;
3982          -webkit-tap-highlight-color: rgba(0,0,0,0);
3983          touch-action: manipulation;
3984        `,resting:l,dragging:plt,dropAnimating:l}}}(),n=function(){var l=`
3985      transition: `+r0.outOfTheWay+`;
3986    `;return{selector:t(F4.contextId),styles:{dragging:l,dropAnimating:l,userCancel:l}}}(),a={selector:t(mlt.contextId),styles:{always:"overflow-anchor: n
3986one;"}},i={selector:"body",styles:{dragging:`
3987        cursor: grabbing;
3988        cursor: -webkit-grabbing;
3989        user-select: none;
3990        -webkit-user-select: none;
3991        -moz-user-select: none;
3992        -ms-user-select: none;
3993        overflow-anchor: none;
3994      `}},o=[n,r,a,i];return{always:xg(o,"always"),resting:xg(o,"resting"),dragging:xg(o,"dragging"),dropAnimating:xg(o,"dropAnimating"),userCancel:xg(o,"userCancel")}},oi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?b.useLayoutEffect:b.useEffect,fC=function(){var t=document.querySelector("head");return t||ht(),t},P9=function(t){var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.type="text/css",r};function ylt(e,t){var r=Kr(function(){return glt(e)},[e]),n=b.useRef(null),a=b.useRef(null),i=zt(za(function(f){var m=a.current;m||ht(),m.textContent=f}),[]),o=zt(function(f){var m=n.current;m||ht(),m.textContent=f},[]);oi(function(){!n.current&&!a.current||ht();var f=P9(t),m=P9(t);return n.current=f,a.current=m,f.setAttribute(qh+"-always",e),m.setAttribute(qh+"-dynamic",e),fC().appendChild(f),fC().appendChild(m),o(r.always),i(r.resting),function(){var h=function(g){var y=g.current;y||ht(),fC().removeChild(y),g.current=null};h(n),h(a)}},[t,o,i,r.always,r.resting,e]);var l=zt(function(){return i(r.dragging)},[i,r.dragging]),c=zt(function(f){if(f==="DROP"){i(r.dropAnimating);return}i(r.userCancel)},[i,r.dropAnimating,r.userCancel]),u=zt(function(){a.current&&i(r.resting)},[i,r.resting]),d=Kr(function(){return{dragging:l,dropping:c,resting:u}},[l,c,u]);return d}var GK=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function gN(e){return e instanceof GK(e).HTMLElement}function blt(e,t){var r="["+Gh.contextId+'="'+e+'"]',n=hK(document.querySelectorAll(r));if(!n.length)return null;var a=Hu(n,function(i){return i.getAttribute(Gh.draggableId)===t});return!a||!gN(a)?null:a}function vlt(e){var t=b.useRef({}),r=b.useRef(null),n=b.useRef(null),a=b.useRef(!1),i=zt(function(m,h){var p={id:m,focus:h};return t.current[m]=p,function(){var y=t.current,v=y[m];v!==p&&delete y[m]}},[]),o=zt(function(m){var h=blt(e,m);h&&h!==document.activeElement&&h.focus()},[e]),l=zt(function(m,h){r.current===m&&(r.current=h)},[]),c=zt(function(){n.current||a.current&&(n.current=requestAnimationFrame(function(){n.current=null;var m=r.current;m&&o(m)}))},[o]),u=zt(function(m){r.current=null;var h=document.activeElement;h&&h.getAttribute(Gh.draggableId)===m&&(r.current=m)},[]);oi(function(){return a.current=!0,function(){a.current=!1;var m=n.current;m&&cancelAnimationFrame(m)}},[]);var d=Kr(function(){return{register:i,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:l}},[i,u,c,l]);return d}function xlt(){var e={draggables:{},droppables:{}},t=[];function r(f){return t.push(f),function(){var h=t.indexOf(f);h!==-1&&t.splice(h,1)}}function n(f){t.length&&t.forEach(function(m){return m(f)})}function a(f){return e.draggables[f]||null}function i(f){var m=a(f);return m||ht(),m}var o={register:function(m){e.draggables[m.descriptor.id]=m,n({type:"ADDITION",value:m})},update:function(m,h){var p=e.draggables[h.descriptor.id];p&&p.uniqueId===m.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[m.descriptor.id]=m)},unregister:function(m){var h=m.descriptor.id,p=a(h);p&&m.uniqueId===p.uniqueId&&(delete e.draggables[h],n({type:"REMOVAL",value:m}))},getById:i,findById:a,exists:function(m){return!!a(m)},getAllByType:function(m){return Tw(e.draggables).filter(function(h){return h.descriptor.type===m})}};function l(f){return e.droppables[f]||null}function c(f){var m=l(f);return m||ht(),m}var u={register:function(m){e.droppables[m.descriptor.id]=m},unregister:function(m){var h=l(m.descriptor.id);h&&m.uniqueId===h.uniqueId&&delete e.droppables[m.descriptor.id]},getById:c,findById:l,exists:function(m){return!!l(m)},getAllByType:function(m){return Tw(e.droppables).filter(function(h){return h.descriptor.type===m})}};function d(){e.draggables={},e.droppables={},t.length=0}return{draggable:o,droppable:u,subscribe:r,clean:d}}function wlt(){var e=Kr(xlt,[]);return b.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var sP=U.createContext(null),Pw=function(){var e=document.body;return e||ht(),e},jlt={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Nlt=function(t){return"rbd-announcement-"+t};function Slt(e){var t=Kr(function(){return Nlt(e)},[e]),r=b.useRef(null);b.useEffect(function(){var i=document.createElement("div");return r.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),Gt(i.style,jlt),Pw().appendChild(i),function(){setTimeout(function(){var c=Pw();c.contains(i)&&c.removeChild(i),i===r.current&&(r.current=null)})}},[t]);var n=zt(function(a){var i=r.current;if(i){i.textContent=a;return}},[]);return n}var Clt=0,klt={separator:"::"};function iP(e,t){return t===void 0&&(t=klt),Kr(function(){return""+e+t.separator+Clt++},[t.separator,e])}function Mlt(e){var t=e.contextId,r=e.uniqueId;return"rbd-hidden-text-"+t+"-"+r}function Ilt(e){var t=e.contextId,r=e.text,n=iP("hidden-text",{separator:"-"}
3994),a=Kr(function(){return Mlt({contextId:t,uniqueId:n})},[n,t]);return b.useEffect(function(){var o=document.createElement("div");return o.id=a,o.textContent=r,o.style.display="none",Pw().appendChild(o),function(){var c=Pw();c.contains(o)&&c.removeChild(o)}},[a,r]),a}var yN=U.createContext(null);function HK(e){var t=b.useRef(e);return b.useEffect(function(){t.current=e}),t}function Elt(){var e=null;function t(){return!!e}function r(o){return o===e}function n(o){e&&ht();var l={abandon:o};return e=l,l}function a(){e||ht(),e=null}function i(){e&&(e.abandon(),a())}return{isClaimed:t,isActive:r,claim:n,release:a,tryAbandon:i}}var Tlt=9,Alt=13,oP=27,YK=32,Plt=33,_lt=34,Llt=35,Dlt=36,Olt=37,Rlt=38,$lt=39,Flt=40,Lv,zlt=(Lv={},Lv[Alt]=!0,Lv[Tlt]=!0,Lv),QK=function(e){zlt[e.keyCode]&&e.preventDefault()},bN=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],r=Hu(t,function(n){return"on"+n in document});return r||e}(),KK=0,_9=5;function Blt(e,t){return Math.abs(t.x-e.x)>=_9||Math.abs(t.y-e.y)>=_9}var L9={type:"IDLE"};function Ult(e){var t=e.cancel,r=e.completed,n=e.getPhase,a=e.setPhase;return[{eventName:"mousemove",fn:function(o){var l=o.button,c=o.clientX,u=o.clientY;if(l===KK){var d={x:c,y:u},f=n();if(f.type==="DRAGGING"){o.preventDefault(),f.actions.move(d);return}f.type!=="PENDING"&&ht();var m=f.point;if(Blt(m,d)){o.preventDefault();var h=f.actions.fluidLift(d);a({type:"DRAGGING",actions:h})}}}},{eventName:"mouseup",fn:function(o){var l=n();if(l.type!=="DRAGGING"){t();return}o.preventDefault(),l.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"mousedown",fn:function(o){n().type==="DRAGGING"&&o.preventDefault(),t()}},{eventName:"keydown",fn:function(o){var l=n();if(l.type==="PENDING"){t();return}if(o.keyCode===oP){o.preventDefault(),t();return}QK(o)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){n().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(o){var l=n();if(l.type==="IDLE"&&ht(),l.actions.shouldRespectForcePress()){t();return}o.preventDefault()}},{eventName:bN,fn:t}]}function Vlt(e){var t=b.useRef(L9),r=b.useRef(xu),n=Kr(function(){return{eventName:"mousedown",fn:function(f){if(!f.defaultPrevented&&f.button===KK&&!(f.ctrlKey||f.metaKey||f.shiftKey||f.altKey)){var m=e.findClosestDraggableId(f);if(m){var h=e.tryGetLock(m,o,{sourceEvent:f});if(h){f.preventDefault();var p={x:f.clientX,y:f.clientY};r.current(),u(h,p)}}}}}},[e]),a=Kr(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(f){if(!f.defaultPrevented){var m=e.findClosestDraggableId(f);if(m){var h=e.findOptionsForDraggable(m);h&&(h.shouldRespectForcePress||e.canGetLock(m)&&f.preventDefault())}}}}},[e]),i=zt(function(){var f={passive:!1,capture:!0};r.current=Pi(window,[a,n],f)},[a,n]),o=zt(function(){var d=t.current;d.type!=="IDLE"&&(t.current=L9,r.current(),i())},[i]),l=zt(function(){var d=t.current;o(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[o]),c=zt(function(){var f={capture:!0,passive:!1},m=Ult({cancel:l,completed:o,getPhase:function(){return t.current},setPhase:function(p){t.current=p}});r.current=Pi(window,m,f)},[l,o]),u=zt(function(f,m){t.current.type!=="IDLE"&&ht(),t.current={type:"PENDING",point:m,actions:f},c()},[c]);oi(function(){return i(),function(){r.current()}},[i])}var Zf;function Wlt(){}var qlt=(Zf={},Zf[_lt]=!0,Zf[Plt]=!0,Zf[Dlt]=!0,Zf[Llt]=!0,Zf);function Glt(e,t){function r(){t(),e.cancel()}function n(){t(),e.drop()}return[{eventName:"keydown",fn:function(i){if(i.keyCode===oP){i.preventDefault(),r();return}if(i.keyCode===YK){i.preventDefault(),n();return}if(i.keyCode===Flt){i.preventDefault(),e.moveDown();return}if(i.keyCode===Rlt){i.preventDefault(),e.moveUp();return}if(i.keyCode===$lt){i.preventDefault(),e.moveRight();return}if(i.keyCode===Olt){i.preventDefault(),e.moveLeft();return}if(qlt[i.keyCode]){i.preventDefault();return}QK(i)}},{eventName:"mousedown",fn:r},{eventName:"mouseup",fn:r},{eventName:"click",fn:r},{eventName:"touchstart",fn:r},{eventName:"resize",fn:r},{eventName:"wheel",fn:r,options:{passive:!0}},{eventName:bN,fn:r}]}function Hlt(e){var t=b.useRef(Wlt),r=Kr(function(){return{eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==YK)return;var o=e.findClosestDraggableId(i);if(!o)return;var l=e.tryGetLock(o,d,{sourceEvent:i});if(!l)return;i.preventDefault();var c=!0,u=l.snapLift();t.current();function d(){c||ht(),c=!1,t.current(),n()}t.current=Pi(window,Glt(u,d),{capture:!0,passive:!1})}}},[e]),n=zt(function(){var i={passive:!1,capture:!0};t.current=Pi(window,[r],i)},[r]);oi(function(){return n(),function(){t.current()}},[n])}var mC={type:"IDLE"},Ylt=120,Qlt=.15;function Klt(e){var t=e.cancel,r=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(a){a.preventDefault()}}
3994,{eventName:"keydown",fn:function(a){if(r().type!=="DRAGGING"){t();return}a.keyCode===oP&&a.preventDefault(),t()}},{eventName:bN,fn:t}]}function Jlt(e){var t=e.cancel,r=e.completed,n=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(i){var o=n();if(o.type!=="DRAGGING"){t();return}o.hasMoved=!0;var l=i.touches[0],c=l.clientX,u=l.clientY,d={x:c,y:u};i.preventDefault(),o.actions.move(d)}},{eventName:"touchend",fn:function(i){var o=n();if(o.type!=="DRAGGING"){t();return}i.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"touchcancel",fn:function(i){if(n().type!=="DRAGGING"){t();return}i.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(i){var o=n();o.type==="IDLE"&&ht();var l=i.touches[0];if(l){var c=l.force>=Qlt;if(c){var u=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){u&&t();return}if(u){if(o.hasMoved){i.preventDefault();return}t();return}i.preventDefault()}}}},{eventName:bN,fn:t}]}function Zlt(e){var t=b.useRef(mC),r=b.useRef(xu),n=zt(function(){return t.current},[]),a=zt(function(h){t.current=h},[]),i=Kr(function(){return{eventName:"touchstart",fn:function(h){if(!h.defaultPrevented){var p=e.findClosestDraggableId(h);if(p){var g=e.tryGetLock(p,l,{sourceEvent:h});if(g){var y=h.touches[0],v=y.clientX,x=y.clientY,j={x:v,y:x};r.current(),f(g,j)}}}}}},[e]),o=zt(function(){var h={capture:!0,passive:!1};r.current=Pi(window,[i],h)},[i]),l=zt(function(){var m=t.current;m.type!=="IDLE"&&(m.type==="PENDING"&&clearTimeout(m.longPressTimerId),a(mC),r.current(),o())},[o,a]),c=zt(function(){var m=t.current;l(),m.type==="DRAGGING"&&m.actions.cancel({shouldBlockNextClick:!0}),m.type==="PENDING"&&m.actions.abort()},[l]),u=zt(function(){var h={capture:!0,passive:!1},p={cancel:c,completed:l,getPhase:n},g=Pi(window,Jlt(p),h),y=Pi(window,Klt(p),h);r.current=function(){g(),y()}},[c,n,l]),d=zt(function(){var h=n();h.type!=="PENDING"&&ht();var p=h.actions.fluidLift(h.point);a({type:"DRAGGING",actions:p,hasMoved:!1})},[n,a]),f=zt(function(h,p){n().type!=="IDLE"&&ht();var g=setTimeout(d,Ylt);a({type:"PENDING",point:p,actions:h,longPressTimerId:g}),u()},[u,n,a,d]);oi(function(){return o(),function(){r.current();var p=n();p.type==="PENDING"&&(clearTimeout(p.longPressTimerId),a(mC))}},[n,o,a]),oi(function(){var h=Pi(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return h},[])}var Xlt={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function JK(e,t){if(t==null)return!1;var r=!!Xlt[t.tagName.toLowerCase()];if(r)return!0;var n=t.getAttribute("contenteditable");return n==="true"||n===""?!0:t===e?!1:JK(e,t.parentElement)}function ect(e,t){var r=t.target;return gN(r)?JK(e,r):!1}var tct=function(e){return mo(e.getBoundingClientRect()).center};function rct(e){return e instanceof GK(e).Element}var nct=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],r=Hu(t,function(n){return n in Element.prototype});return r||e}();function ZK(e,t){return e==null?null:e[nct](t)?e:ZK(e.parentElement,t)}function act(e,t){return e.closest?e.closest(t):ZK(e,t)}function sct(e){return"["+Gh.contextId+'="'+e+'"]'}function ict(e,t){var r=t.target;if(!rct(r))return null;var n=sct(e),a=act(r,n);return!a||!gN(a)?null:a}function oct(e,t){var r=ict(e,t);return r?r.getAttribute(Gh.draggableId):null}function lct(e,t){var r="["+F4.contextId+'="'+e+'"]',n=hK(document.querySelectorAll(r)),a=Hu(n,function(i){return i.getAttribute(F4.id)===t});return!a||!gN(a)?null:a}function cct(e){e.preventDefault()}function Dv(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!(!n()||t!==r)}function XK(e){var t=e.lockAPI,r=e.store,n=e.registry,a=e.draggableId;if(t.isClaimed())return!1;var i=n.draggable.findById(a);return!(!i||!i.options.isEnabled||!UK(r.getState(),a))}function uct(e){var t=e.lockAPI,r=e.contextId,n=e.store,a=e.registry,i=e.draggableId,o=e.forceSensorStop,l=e.sourceEvent,c=XK({lockAPI:t,store:n,registry:a,draggableId:i});if(!c)return null;var u=a.draggable.getById(i),d=lct(r,u.descriptor.id);if(!d||l&&!u.options.canDragInteractiveElements&&ect(d,l))return null;var f=t.claim(o||xu),m="PRE_DRAG";function h(){return u.options.shouldRespectForcePress}function p(){return t.isActive(f)}function g(S,M){Dv({expected:S,phase:m,isLockActive:p,shouldWarn:!0})&&n.dispatch(M())}var y=g.bind(null,"DRAGGING");function v(S){function M(){t.release(),m="COMPLETED"}m!=="PRE_DRAG"&&(M(),m!=="PRE_DRAG"&&ht()),n.dispatch(not(S.liftActionArgs)),m="DRAGGING";function k(I,T){if(T===void 0&&(T={shouldBlockNextClick:!1}),S.cleanup(),T.shouldBlockNextClick){var L=Pi(window,[{eventName:"click",fn:cct,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(L)}M(),n.dispatch(DK({reason:I}))}return Gt({isActive:function(){return Dv({expected:"DRAGGING",phase:m,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:h,drop:function(T){return k("DROP",T)},cancel:function(T){return k("CANCEL",T)}},S.actions)}function x(S){var M=Cy(function(I){y(function(){return LK({client:I})})}),k=v({liftActionArgs:{id:i,clientSelection:S,movementMode:"FLUID"},cleanup:function(){return M.cancel()},actions:{move:M}});return Gt({},k,{move:M})}function j(){var S={moveUp:function(){return y(fot)},moveRight:function(){return y(hot)},moveDown:function(){return y(mot)},moveLeft:function(){return y(pot)}};return v({liftActionArgs:{id:i,clientSelection:tct(d),movementMode:"SNAP"}
3994,cleanup:xu,actions:S})}function C(){var S=Dv({expected:"PRE_DRAG",phase:m,isLockActive:p,shouldWarn:!0});S&&t.release()}var N={isActive:function(){return Dv({expected:"PRE_DRAG",phase:m,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:h,fluidLift:x,snapLift:j,abort:C};return N}var dct=[Vlt,Hlt,Zlt];function fct(e){var t=e.contextId,r=e.store,n=e.registry,a=e.customSensors,i=e.enableDefaultSensors,o=[].concat(i?dct:[],a||[]),l=b.useState(function(){return Elt()})[0],c=zt(function(x,j){x.isDragging&&!j.isDragging&&l.tryAbandon()},[l]);oi(function(){var x=r.getState(),j=r.subscribe(function(){var C=r.getState();c(x,C),x=C});return j},[l,r,c]),oi(function(){return l.tryAbandon},[l.tryAbandon]);for(var u=zt(function(v){return XK({lockAPI:l,registry:n,store:r,draggableId:v})},[l,n,r]),d=zt(function(v,x,j){return uct({lockAPI:l,registry:n,contextId:t,store:r,draggableId:v,forceSensorStop:x,sourceEvent:j&&j.sourceEvent?j.sourceEvent:null})},[t,l,n,r]),f=zt(function(v){return oct(t,v)},[t]),m=zt(function(v){var x=n.draggable.findById(v);return x?x.options:null},[n.draggable]),h=zt(function(){l.isClaimed()&&(l.tryAbandon(),r.getState().phase!=="IDLE"&&r.dispatch(JA()))},[l,r]),p=zt(l.isClaimed,[l]),g=Kr(function(){return{canGetLock:u,tryGetLock:d,findClosestDraggableId:f,findOptionsForDraggable:m,tryReleaseLock:h,isLockClaimed:p}},[u,d,f,m,h,p]),y=0;y<o.length;y++)o[y](g)}var mct=function(t){return{onBeforeCapture:t.onBeforeCapture,onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragEnd:t.onDragEnd,onDragUpdate:t.onDragUpdate}};function wg(e){return e.current||ht(),e.current}function hct(e){var t=e.contextId,r=e.setCallbacks,n=e.sensors,a=e.nonce,i=e.dragHandleUsageInstructions,o=b.useRef(null),l=HK(e),c=zt(function(){return mct(l.current)},[l]),u=Slt(t),d=Ilt({contextId:t,text:i}),f=ylt(t,a),m=zt(function(I){wg(o).dispatch(I)},[]),h=Kr(function(){return o9({publishWhileDragging:sot,updateDroppableScroll:oot,updateDroppableIsEnabled:lot,updateDroppableIsCombineEnabled:cot,collectionStarting:iot},m)},[m]),p=wlt(),g=Kr(function(){return Qot(p,h)},[p,h]),y=Kr(function(){return flt(Gt({scrollWindow:Kot,scrollDroppable:g.scrollDroppable},o9({move:LK},m)))},[g.scrollDroppable,m]),v=vlt(t),x=Kr(function(){return qot({announce:u,autoScroller:y,dimensionMarshal:g,focusMarshal:v,getResponders:c,styleMarshal:f})},[u,y,g,v,c,f]);o.current=x;var j=zt(function(){var I=wg(o),T=I.getState();T.phase!=="IDLE"&&I.dispatch(JA())},[]),C=zt(function(){var I=wg(o).getState();return I.isDragging||I.phase==="DROP_ANIMATING"},[]),N=Kr(function(){return{isDragging:C,tryAbort:j}},[C,j]);r(N);var S=zt(function(I){return UK(wg(o).getState(),I)},[]),M=zt(function(){return dd(wg(o).getState())},[]),k=Kr(function(){return{marshal:g,focus:v,contextId:t,canLift:S,isMovementAllowed:M,dragHandleUsageInstructionsId:d,registry:p}},[t,g,d,v,S,M,p]);return fct({contextId:t,store:x,registry:p,customSensors:n,enableDefaultSensors:e.enableDefaultSensors!==!1}),b.useEffect(function(){return j},[j]),U.createElement(yN.Provider,{value:k},U.createElement(Zat,{context:sP,store:x},e.children))}var pct=0;function gct(){return Kr(function(){return""+pct++},[])}function yct(e){var t=gct(),r=e.dragHandleUsageInstructions||px.dragHandleUsageInstructions;return U.createElement(Hst,null,function(n){return U.createElement(hct,{nonce:e.nonce,contextId:t,setCallbacks:n,dragHandleUsageInstructions:r,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)})}var eJ=function(t){return function(r){return t===r}},bct=eJ("scroll"),vct=eJ("auto"),D9=function(t,r){return r(t.overflowX)||r(t.overflowY)},xct=function(t){var r=window.getComputedStyle(t),n={overflowX:r.overflowX,overflowY:r.overflowY};return D9(n,bct)||D9(n,vct)},wct=function(){return!1},jct=function e(t){return t==null?null:t===document.body?wct()?t:null:t===document.documentElement?null:xct(t)?t:e(t.parentElement)},z4=function(e){return{x:e.scrollLeft,y:e.scrollTop}},Nct=function e(t){if(!t)return!1;var r=window.getComputedStyle(t);return r.position==="fixed"?!0:e(t.parentElement)},Sct=function(e){var t=jct(e),r=Nct(e);return{closestScrollable:t,isFixedOnPage:r}}
3994,Cct=function(e){var t=e.descriptor,r=e.isEnabled,n=e.isCombineEnabled,a=e.isFixedOnPage,i=e.direction,o=e.client,l=e.page,c=e.closest,u=function(){if(!c)return null;var h=c.scrollSize,p=c.client,g=FK({scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth,height:p.paddingBox.height,width:p.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:p,scrollSize:h,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:g,diff:{value:Ua,displacement:Ua}}}}(),d=i==="vertical"?GA:vK,f=Wh({page:l,withPlaceholder:null,axis:d,frame:u}),m={descriptor:t,isCombineEnabled:n,isFixedOnPage:a,axis:d,isEnabled:r,client:o,page:l,frame:u,subject:f};return m},kct=function(t,r){var n=cK(t);if(!r||t!==r)return n;var a=n.paddingBox.top-r.scrollTop,i=n.paddingBox.left-r.scrollLeft,o=a+r.scrollHeight,l=i+r.scrollWidth,c={top:a,right:l,bottom:o,left:i},u=BA(c,n.border),d=UA({borderBox:u,margin:n.margin,border:n.border,padding:n.padding});return d},Mct=function(e){var t=e.ref,r=e.descriptor,n=e.env,a=e.windowScroll,i=e.direction,o=e.isDropDisabled,l=e.isCombineEnabled,c=e.shouldClipSubject,u=n.closestScrollable,d=kct(t,u),f=Mw(d,a),m=function(){if(!u)return null;var p=cK(u),g={scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth};return{client:p,page:Mw(p,a),scroll:z4(u),scrollSize:g,shouldClipSubject:c}}
3994(),h=Cct({descriptor:r,isEnabled:!o,isCombineEnabled:l,isFixedOnPage:n.isFixedOnPage,direction:i,client:d,page:f,closest:m});return h},Ict={passive:!1},Ect={passive:!0},O9=function(e){return e.shouldPublishImmediately?Ict:Ect};function _w(e){var t=b.useContext(e);return t||ht(),t}var Ov=function(t){return t&&t.env.closestScrollable||null};function Tct(e){var t=b.useRef(null),r=_w(yN),n=iP("droppable"),a=r.registry,i=r.marshal,o=HK(e),l=Kr(function(){return{id:e.droppableId,type:e.type,mode:e.mode}},[e.droppableId,e.mode,e.type]),c=b.useRef(l),u=Kr(function(){return za(function(C,N){t.current||ht();var S={x:C,y:N};i.updateDroppableScroll(l.id,S)})},[l.id,i]),d=zt(function(){var C=t.current;return!C||!C.env.closestScrollable?Ua:z4(C.env.closestScrollable)},[]),f=zt(function(){var C=d();u(C.x,C.y)},[d,u]),m=Kr(function(){return Cy(f)},[f]),h=zt(function(){var C=t.current,N=Ov(C);C&&N||ht();var S=C.scrollOptions;if(S.shouldPublishImmediately){f();return}m()},[m,f]),p=zt(function(C,N){t.current&&ht();var S=o.current,M=S.getDroppableRef();M||ht();var k=Sct(M),I={ref:M,descriptor:l,env:k,scrollOptions:N};t.current=I;var T=Mct({ref:M,descriptor:l,env:k,windowScroll:C,direction:S.direction,isDropDisabled:S.isDropDisabled,isCombineEnabled:S.isCombineEnabled,shouldClipSubject:!S.ignoreContainerClipping}),L=k.closestScrollable;return L&&(L.setAttribute(A9.contextId,r.contextId),L.addEventListener("scroll",h,O9(I.scrollOptions))),T},[r.contextId,l,h,o]),g=zt(function(){var C=t.current,N=Ov(C);return C&&N||ht(),z4(N)},[]),y=zt(function(){var C=t.current;C||ht();var N=Ov(C);t.current=null,N&&(m.cancel(),N.removeAttribute(A9.contextId),N.removeEventListener("scroll",h,O9(C.scrollOptions)))},[h,m]),v=zt(function(C){var N=t.current;N||ht();var S=Ov(N);S||ht(),S.scrollTop+=C.y,S.scrollLeft+=C.x},[]),x=Kr(function(){return{getDimensionAndWatchScroll:p,getScrollWhileDragging:g,dragStopped:y,scroll:v}},[y,p,g,v]),j=Kr(function(){return{uniqueId:n,descriptor:l,callbacks:x}},[x,l,n]);oi(function(){return c.current=j.descriptor,a.droppable.register(j),function(){t.current&&y(),a.droppable.unregister(j)}},[x,l,y,j,i,a.droppable]),oi(function(){t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),oi(function(){t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function hC(){}var R9={width:0,height:0,margin:Xst},Act=function(t){var r=t.isAnimatingOpenOnMount,n=t.placeholder,a=t.animate;return r||a==="close"?R9:{height:n.client.borderBox.height,width:n.client.borderBox.width,margin:n.client.margin}},Pct=function(t){var r=t.isAnimatingOpenOnMount,n=t.placeholder,a=t.animate,i=Act({isAnimatingOpenOnMount:r,placeholder:n,animate:a});return{display:n.display,boxSizing:"border-box",width:i.width,height:i.height,marginTop:i.margin.top,marginRight:i.margin.right,marginBottom:i.margin.bottom,marginLeft:i.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:a!=="none"?r0.placeholder:null}};function _ct(e){var t=b.useRef(null),r=zt(function(){t.current&&(clearTimeout(t.current),t.current=null)},[]),n=e.animate,a=e.onTransitionEnd,i=e.onClose,o=e.contextId,l=b.useState(e.animate==="open"),c=l[0],u=l[1];b.useEffect(function(){return c?n!=="open"?(r(),u(!1),hC):t.current?hC:(t.current=setTimeout(function(){t.current=null,u(!1)}
3994),r):hC},[n,c,r]);var d=zt(function(m){m.propertyName==="height"&&(a(),n==="close"&&i())},[n,i,a]),f=Pct({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return U.createElement(e.placeholder.tagName,{style:f,"data-rbd-placeholder-context-id":o,onTransitionEnd:d,ref:e.innerRef})}var Lct=U.memo(_ct),lP=U.createContext(null),Dct=function(e){Wq(t,e);function t(){for(var n,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=e.call.apply(e,[this].concat(i))||this,n.state={isVisible:!!n.props.on,data:n.props.on,animate:n.props.shouldAnimate&&n.props.on?"open":"none"},n.onClose=function(){n.state.animate==="close"&&n.setState({isVisible:!1})},n}t.getDerivedStateFromProps=function(a,i){return a.shouldAnimate?a.on?{isVisible:!0,data:a.on,animate:"open"}:i.isVisible?{isVisible:!0,data:i.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!a.on,data:a.on,animate:"none"}};var r=t.prototype;return r.render=function(){if(!this.state.isVisible)return null;var a={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(a)},t}(U.PureComponent),$9={dragging:5e3,dropAnimating:4500},Oct=function(t,r){return r?r0.drop(r.duration):t?r0.snap:r0.fluid},Rct=function(t,r){return t?r?Ey.opacity.drop:Ey.opacity.combining:null},$ct=function(t){return t.forceShouldAnimate!=null?t.forceShouldAnimate:t.mode==="SNAP"};function Fct(e){var t=e.dimension,r=t.client,n=e.offset,a=e.combineWith,i=e.dropping,o=!!a,l=$ct(e),c=!!i,u=c?R4.drop(n,o):R4.moveTo(n),d={position:"fixed",top:r.marginBox.top,left:r.marginBox.left,boxSizing:"border-box",width:r.borderBox.width,height:r.borderBox.height,transition:Oct(l,i),transform:u,opacity:Rct(o,c),zIndex:c?$9.dropAnimating:$9.dragging,pointerEvents:"none"};return d}function zct(e){return{transform:R4.moveTo(e.offset),transition:e.shouldAnimateDisplacement?null:"none"}}function Bct(e){return e.type==="DRAGGING"?Fct(e):zct(e)}function Uct(e,t,r){r===void 0&&(r=Ua);var n=window.getComputedStyle(t),a=t.getBoundingClientRect(),i=lK(a,n),o=Mw(i,r),l={client:i,tagName:t.tagName.toLowerCase(),display:n.display},c={x:i.marginBox.width,y:i.marginBox.height},u={descriptor:e,placeholder:l,displaceBy:c,client:i,page:o};return u}function Vct(e){var t=iP("draggable"),r=e.descriptor,n=e.registry,a=e.getDraggableRef,i=e.canDragInteractiveElements,o=e.shouldRespectForcePress,l=e.isEnabled,c=Kr(function(){return{canDragInteractiveElements:i,shouldRespectForcePress:o,isEnabled:l}},[i,l,o]),u=zt(function(h){var p=a();return p||ht(),Uct(r,p,h)},[r,a]),d=Kr(function(){return{uniqueId:t,descriptor:r,options:c,getDimension:u}},[r,u,c,t]),f=b.useRef(d),m=b.useRef(!0);oi(function(){return n.draggable.register(f.current),function(){return n.draggable.unregister(f.current)}},[n.draggable]),oi(function(){if(m.current){m.current=!1;return}var h=f.current;f.current=d,n.draggable.update(d,h)},[d,n.draggable])}function Wct(e){e.preventDefault()}function qct(e){var t=b.useRef(null),r=zt(function(I){t.current=I},[]),n=zt(function(){return t.current},[]),a=_w(yN),i=a.contextId,o=a.dragHandleUsageInstructionsId,l=a.registry,c=_w(lP),u=c.type,d=c.droppableId,f=Kr(function(){return{id:e.draggableId,index:e.index,type:u,droppableId:d}},[e.draggableId,e.index,u,d]),m=e.children,h=e.draggableId,p=e.isEnabled,g=e.shouldRespectForcePress,y=e.canDragInteractiveElements,v=e.isClone,x=e.mapped,j=e.dropAnimationFinished;if(!v){var C=Kr(function(){return{descriptor:f,registry:l,getDraggableRef:n,canDragInteractiveElements:y,shouldRespectForcePress:g,isEnabled:p}},[f,l,n,y,g,p]);Vct(C)}var N=Kr(function(){return p?{tabIndex:0,role:"button","aria-describedby":o,"data-rbd-drag-handle-draggable-id":h,"data-rbd-drag-handle-context-id":i,draggable:!1,onDragStart:Wct}:null},[i,o,h,p]),S=zt(function(I){x.type==="DRAGGING"&&x.dropping&&I.propertyName==="transform"&&j()},[j,x]),M=Kr(function(){var I=Bct(x),T=x.type==="DRAGGING"&&x.dropping?S:null,L={innerRef:r,draggableProps:{"data-rbd-draggable-context-id":i,"data-rbd-draggable-id":h,style:I,onTransitionEnd:T},dragHandleProps:N};return L},[i,N,h,x,S,r]),k=Kr(function(){return{draggableId:f.id,type:f.type,source:{index:f.index,droppableId:f.droppableId}}},[f.droppableId,f.id,f.index,f.type]);return m(M,x.snapshot,k)}var tJ=function(e,t){return e===t},rJ=function(e){var t=e.combine,r=e.destination;return r?r.droppableId:t?t.droppableId:null},Gct=function(t){return t.combine?t.combine.draggableId:null},Hct=function(t){return t.at&&t.at.type==="COMBINE"?t.at.combine.draggableId:null};function Yct(){var e=za(function(a,i){return{x:a,y:i}}),t=za(function(a,i,o,l,c){return{isDragging:!0,isClone:i,isDropAnimating:!!c,dropAnimation:c,mode:a,draggingOver:o,combineWith:l,combineTargetFor:null}}),r=za(function(a,i,o,l,c,u,d){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:u,mode:i,offset:a,dimension:o,forceShouldAnimate:d,snapshot:t(i,l,c,u,null)}}}),n=function(i,o){if(i.isDragging){if(i.critical.draggable.id!==o.draggableId)return null;var l=i.current.client.offset,c=i.dimensions.draggables[o.draggableId],u=ii(i.impact),d=
3994Hct(i.impact),f=i.forceShouldAnimate;return r(e(l.x,l.y),i.movementMode,c,o.isClone,u,d,f)}if(i.phase==="DROP_ANIMATING"){var m=i.completed;if(m.result.draggableId!==o.draggableId)return null;var h=o.isClone,p=i.dimensions.draggables[o.draggableId],g=m.result,y=g.mode,v=rJ(g),x=Gct(g),j=i.dropDuration,C={duration:j,curve:XA.drop,moveTo:i.newHomeClientOffset,opacity:x?Ey.opacity.drop:null,scale:x?Ey.scale.drop:null};return{mapped:{type:"DRAGGING",offset:i.newHomeClientOffset,dimension:p,dropping:C,draggingOver:v,combineWith:x,mode:y,forceShouldAnimate:null,snapshot:t(y,h,v,x,C)}}}return null};return n}function nJ(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var Qct={mapped:{type:"SECONDARY",offset:Ua,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:nJ(null)}};function Kct(){var e=za(function(o,l){return{x:o,y:l}}),t=za(nJ),r=za(function(o,l,c){return l===void 0&&(l=null),{mapped:{type:"SECONDARY",offset:o,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}}}),n=function(l){return l?r(Ua,l,!0):null},a=function(l,c,u,d){var f=u.displaced.visible[l],m=!!(d.inVirtualList&&d.effected[l]),h=mN(u),p=h&&h.draggableId===l?c:null;if(!f){if(!m)return n(p);if(u.displaced.invisible[l])return null;var g=_p(d.displacedBy.point),y=e(g.x,g.y);return r(y,p,!0)}if(m)return n(p);var v=u.displacedBy.point,x=e(v.x,v.y);return r(x,p,f.shouldAnimate)},i=function(l,c){if(l.isDragging)return l.critical.draggable.id===c.draggableId?null:a(c.draggableId,l.critical.draggable.id,l.impact,l.afterCritical);if(l.phase==="DROP_ANIMATING"){var u=l.completed;return u.result.draggableId===c.draggableId?null:a(c.draggableId,u.result.draggableId,u.impact,u.afterCritical)}return null};return i}var Jct=function(){var t=Yct(),r=Kct(),n=function(i,o){return t(i,o)||r(i,o)||Qct};return n},Zct={dropAnimationFinished:OK},Xct=iK(Jct,Zct,null,{context:sP,pure:!0,areStatePropsEqual:tJ})(qct);function aJ(e){var t=_w(lP),r=t.isUsingCloneFor;return r===e.draggableId&&!e.isClone?null:U.createElement(Xct,e)}function eut(e){var t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,r=!!e.disableInteractiveElementBlocking,n=!!e.shouldRespectForcePress;return U.createElement(aJ,Gt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}function tut(e){var t=b.useContext(yN);t||ht();var r=t.contextId,n=t.isMovementAllowed,a=b.useRef(null),i=b.useRef(null),o=e.children,l=e.droppableId,c=e.type,u=e.mode,d=e.direction,f=e.ignoreContainerClipping,m=e.isDropDisabled,h=e.isCombineEnabled,p=e.snapshot,g=e.useClone,y=e.updateViewportMaxScroll,v=e.getContainerForClone,x=zt(function(){return a.current},[]),j=zt(function(L){a.current=L},[]);zt(function(){return i.current},[]);var C=zt(function(L){i.current=L},[]),N=zt(function(){n()&&y({maxScroll:BK()})},[n,y]);Tct({droppableId:l,type:c,mode:u,direction:d,isDropDisabled:m,isCombineEnabled:h,ignoreContainerClipping:f,getDroppableRef:x});var S=U.createElement(Dct,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},function(L){var R=L.onClose,_=L.data,B=L.animate;return U.createElement(Lct,{placeholder:_,onClose:R,innerRef:C,animate:B,contextId:r,onTransitionEnd:N})}),M=Kr(function(){return{innerRef:j,placeholder:S,droppableProps:{"data-rbd-droppable-id":l,"data-rbd-droppable-context-id":r}}},[r,l,S,j]),k=g?g.dragging.draggableId:null,I=Kr(function(){return{droppableId:l,type:c,isUsingCloneFor:k}},[l,k,c]);function T(){if(!g)return null;var L=g.dragging,R=g.render,_=U.createElement(aJ,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(B,z){return R(B,z,L)});return tF.createPortal(_,v())}return U.createElement(lP.Provider,{value:I},o(M,p),T())}var pC=function(t,r){return t===r.droppable.type},F9=function(t,r){return r.draggables[t.draggable.id]},rut=function(){var t={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},r=Gt({},t,{shouldAnimatePlaceholder:!1}),n=za(function(o){return{draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}}}),a=za(function(o,l,c,u,d,f){var m=d.descriptor.id,h=d.descriptor.droppableId===o;if(h){var p=f?{render:f,dragging:n(d.descriptor)}:null,g={isDraggingOver:c,draggingOverWith:c?m:null,draggingFromThisWith:m,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:g,useClone:p}}if(!l)return r;if(!u)return t;var y={isDraggingOver:c,draggingOverWith:m,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:y,useClone:null}}),i=function(l,c){var u=c.droppableId,d=c.type,f=!c.isDropDisabled,m=c.renderClone;if(l.isDragging){var h=l.critical;if(!pC(d,h))return r;var p=F9(h,l.dimensions),g=ii(l.impact)===u;return a(u,f,g,g,p,m)}if(l.phase==="DROP_ANIMATING"){var y=l.completed;if(!pC(d,y.critical))return r;var v=F9(y.critical,l.dimensions);return a(u,f,rJ(y.result)===u,ii(y.impact)===u,v,m)}if(l.phase==="IDLE"&&l.completed&&!l.shouldFlush){var x=l.completed;if(!pC(d,x.critical))return r;var j=ii(x.impact)===u,C=!!(x.impact.at&&x.impact.at.type==="COMBINE"),N=x.critical.droppable.
3994id===u;return j?C?t:r:N?t:r}return r};return i},nut={updateViewportMaxScroll:dot};function aut(){return document.body||ht(),document.body}var sut={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:aut},sJ=iK(rut,nut,null,{context:sP,pure:!0,areStatePropsEqual:tJ})(tut);sJ.defaultProps=sut;const B4=({title:e="Your content gallery is empty",message:t="Time to showcase your creativity! Create your first post and watch your social media presence grow.",icon:r="image",isFiltered:n=!1})=>{const a=pn(),i=n?"We couldn't find any posts that match your current filters. Try adjusting your filter settings or create something new.":t,o=()=>{switch(r){case"calendar":return s.jsx("svg",{className:"w-10 h-10 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})});case"list":return s.jsx("svg",{className:"w-10 h-10 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})});case"board":return s.jsx("svg",{className:"w-10 h-10 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})});case"image":default:return s.jsx("svg",{className:"w-10 h-10 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}};return s.jsx("div",{className:"bg-white rounded-xl border border-black shadow-lg p-12 text-center",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("div",{className:"mb-4 w-20 h-20 bg-gray-100 rounded-full flex items-center justify-center",children:o()}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e}),s.jsx("p",{className:"mt-3 text-base text-gray-500 max-w-md mx-auto",children:i}),s.jsxs("button",{onClick:()=>a("/posts/new"),className:"mt-8 inline-flex items-center px-6 py-3 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),"Create Your First Post"]})]})})},iut=({posts:e,onPostClick:t})=>{pn();const r=e.reduce((d,f)=>{const m=f.status||"draft";return d[m]||(d[m]=[]),d[m].push(f),d},{}),n=d=>{switch(d){case"draft":return"bg-gray-100 text-gray-800";case"scheduled":return"bg-blue-100 text-blue-800";
3994case"pending":return"bg-yellow-100 text-yellow-800";case"waiting":return"bg-orange-100 text-orange-800";case"processing":return"bg-purple-100 text-purple-800";case"published":return"bg-green-100 text-green-800";default:return"bg-gray-100 text-gray-800"}},a=d=>{switch(d){case"draft":return"📝";case"scheduled":return"📅";case"pending":return"🚧";case"waiting":return"⏳";case"processing":return"⚙️";case"published":return"✅";default:return""}},i=d=>d.charAt(0).toUpperCase()+d.slice(1),o=["draft","scheduled","pending","waiting","processing","published"],[l,c]=b.useState(r),u=d=>{const{destination:f,source:m,draggableId:h}=d;if(!f||f.droppableId===m.droppableId&&f.index===m.index)return;const p=e.find(x=>x.id===h);if(!p)return;const g={...l},y=[...g[m.droppableId]||[]];y.splice(m.index,1),g[m.droppableId]=y;const v=[...g[f.droppableId]||[]];v.splice(f.index,0,p),g[f.droppableId]=v,c(g),console.log(`Moving post ${h} from ${m.droppableId} to ${f.droppableId}`)};return e.length===0?s.jsx(B4,{title:"Your content board is empty",message:"Create your first post to see it displayed on this board. You'll be able to track your content's status from draft to published!",icon:"board",isFiltered:!1}):s.jsx("div",{className:"overflow-x-auto pb-4",children:s.jsx(yct,{onDragEnd:u,children:s.jsx("div",{className:"grid grid-flow-col auto-cols-[minmax(300px,1fr)] gap-4 min-w-full",children:o.map(d=>s.jsx(sJ,{droppableId:d,children:f=>{var m,h;return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg overflow-hidden h-[calc(100vh-280px)]",ref:f.innerRef,...f.droppableProps,children:[s.jsxs("div",{className:`p-3 ${n(d)} flex items-center justify-between sticky top-0`,children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"mr-2",children:a(d)}),s.jsx("span",{className:"font-medium",children:i(d)})]}),s.jsx("span",{className:"text-sm bg-white bg-opacity-80 px-2 py-0.5 rounded-full",children:((m=l[d])==null?void 0:m.length)||0})]}),s.jsxs("div",{className:"p-2 overflow-y-auto h-[calc(100%-56px)]",children:[(h=l[d])==null?void 0:h.map((p,g)=>s.jsx(eut,{draggableId:p.id,index:g,children:y=>s.jsxs("div",{ref:y.innerRef,...y.draggableProps,...y.dragHandleProps,className:"mb-2 p-3 bg-white rounded-lg border border-gray-200 shadow-sm hover:border-primary-300 cursor-pointer",onClick:()=>t(p),children:[s.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[(()=>{const v=Xn(p.media);if(!v)return null;const x=/\.pdf(\?|#|$)/i.test(v.url);return s.jsx("div",{className:"w-10 h-10 rounded bg-gray-100 flex-shrink-0 overflow-hidden",children:x?s.jsx(Ef,{src:v.url,className:"w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:v.url,altText:"Post media",type:v.type,className:"w-full h-full",objectFit:"cover",controls:!1,autoPlayOnMount:!1,muted:!0})})})(),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-xs text-gray-900 line-clamp-2",children:p.content})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex gap-1",children:p.platforms.map(v=>s.jsx("span",{className:"text-xs bg-gray-100 px-1.5 py-0.5 rounded",children:v},v))}),p.brandName&&s.jsx("span",{className:"text-xs text-gray-500",children:p.brandName})]})]})},p.id)),f.placeholder,(!l[d]||l[d].length===0)&&s.jsx("div",{className:"p-4 text-center text-gray-500 text-sm border-2 border-dashed border-gray-200 rounded-lg mt-2",children:s.jsx("p",{children:"Drop posts here"})})]})]})}},d))})})})},out=({brands:e,selectedBrand:t,onBrandSelect:r})=>s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 gap-2",children:e.map(n=>s.jsxs("button",{onClick:()=>r(n.id),className:`flex flex-col items-center justify-center gap-2 p-2 h-28 w-full rounded-lg border border-black ${t===n.id?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[s.jsx("img",{src:n.logo,alt:n.name,className:"w-8 h-8 rounded-lg"}),s.jsx("span",{className:"text-xs text-gray-700 text-center line-clamp-2 overflow-hidden",children:n.name})]},n.id))}),lut=({selectedBrand:e,isLoading:t=!1,onBrandSelect:r,brands:n})=>{const{t:a}
3994=Te(),i=n.length<=9;return t?s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(x0,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:a("cards.brands.title","Brands")})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[1,2,3].map(o=>s.jsxs("div",{className:"animate-pulse flex flex-col items-center gap-2 p-3 rounded-lg border border-gray-200",children:[s.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-lg"}),s.jsx("div",{className:"h-4 w-16 bg-gray-200 rounded"})]},o))})]}):s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(x0,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:a("cards.brands.title","Brands")})]}),i?s.jsx(out,{brands:n,selectedBrand:e,onBrandSelect:r}):s.jsxs("select",{value:e,onChange:o=>r(o.target.value),className:"w-full px-3 py-2 border border-black rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[s.jsx("option",{value:"",disabled:!0,children:a("cards.brands.selectPlaceholder","Select a brand...")}),n.map(o=>s.jsx("option",{value:o.id,children:o.name},o.id))]})]})},cut=({selectedPlatforms:e,onPlatformToggle:t,onFormatChange:r,format:n="text",connectedAccounts:a=[],tiktokAccount:i})=>{const{t:o}=Te(),{availablePlatforms:l}=eA(),c=U.useMemo(()=>{const p=[...a];return i!=null&&i.username&&!p.some(g=>g.platform==="tiktok")&&p.push({platform:"tiktok",username:i.username,picture_url:i.picture_url}),p},[a,i]),u=p=>{t(p),(p==="youtube"||p==="tiktok")&&r&&(e.includes(p)||r("reel"))},d=b.useMemo(()=>{const p=[...l],g=ub.filter(y=>(y.id==="facebook"||y.id==="instagram")&&y.status==="coming-soon"&&!l.some(v=>v.id===y.id)).map(y=>({id:y.id,name:y.name,status:y.status,icon:y.icon}));for(const y of g)p.some(v=>v.id===y.id)||p.push(y);return p},[l]),f=n==="reel"?l.filter(p=>["facebook","instagram","youtube","tiktok","linkedin"].includes(p.id)):d,m=p=>c.find(g=>g.platform===p),h=p=>{const g=e.includes(p.id),y=m(p.id);return y?s.jsxs("button",{onClick:()=>u(p.id),className:`flex flex-col items-center justify-center gap-1 sm:gap-2 p-1 sm:p-2 py-4 w-full h-24 rounded-lg border border-black min-w-0 max-w-full ${g?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[s.jsx(Du,{pictureUrl:y.picture_url,username:y.username,platform:p.id,size:"md"}),s.jsxs("span",{className:"text-xs text-gray-700 w-full text-center line-clamp-2 overflow-hidden whitespace-normal break-words",children:["@",y.username]})]},p.id):s.jsxs("button",{onClick:()=>u(p.id),className:`flex flex-col items-center justify-center gap-1 sm:gap-2 p-1 sm:p-2 py-4 w-full h-24 rounded-lg border border-black min-w-0 max-w-full ${g?"border-primary-600 bg-primary-50":"hover:border-primary-600"}`,children:[s.jsx(cr,{platform:p.id,size:24}),s.jsx("span",{className:"text-xs text-gray-700 w-full text-center line-clamp-2 overflow-hidden whitespace-normal break-words",children:p.name})]},p.id)};return s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-4 sm:p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(li,{className:"w-5 h-5 text-gray-400"}),s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:o("cards.platforms.title","Platforms")})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:f.map(p=>h(p))})]})},uut=({isOpen:e,onClose:t,onSubmit:r,initialData:n})=>{var W,Y;const{t:a}=Te(),[i,o]=b.useState((n==null?void 0:n.content)||""),[l,c]=b.useState((n==null?void 0:n.brandId)||""),[u,d]=b.useState((n==null?void 0:n.platforms)||[]),[f,m]=b.useState((n==null?void 0:n.format)||"regular"),[h,p]=b.useState(null),[g,y]=b.useState(((W=n==null?void 0:n.media)==null?void 0:W.url)||null),[v,x]=b.useState(((Y=n==null?void 0:n.media)==null?void 0:Y.type)||null),[j,C]=b.useState((n==null?void 0:n.status)||"draft"),[N,S]=b.useState((n==null?void 0:n.scheduledAt)||""),[M,k]=b.useState({show:!1}),[I,T]=b.useState(null),[L,R]=b.useState(!1),[_,B]=b.useState((n==null?void 0:n.tiktokSettings)||{allowComments:!1,allowDuets:!1,allowStitch:!1,discloseContent:!1,privacy:"",disclosureType:[],userAgreedToTerms:!1}),[z,D]=b.useState((n==null?void 0:n.youtubeSettings)||{title:"",tags:[],privacy:"public"}),[A,P]=b.useState((n==null?void 0:n.linkedinSettings)||{organizationId:"",visibility:"PUBLIC"}),[E,F]=b.useState((n==null?void 0:n.pinterestSettings)||{title:"",link:"",selectedBoardId:"",allowComments:!0,availableBoards:[]}),{data:$,isLoading:H}=oa(),X=($==null?void 0:$.brands)||[];
3994if(U.useEffect(()=>{var q,Z;o((n==null?void 0:n.content)||""),c((n==null?void 0:n.brandId)||""),d((n==null?void 0:n.platforms)||[]),m((n==null?void 0:n.format)||"regular"),y(((q=n==null?void 0:n.media)==null?void 0:q.url)||null),x(((Z=n==null?void 0:n.media)==null?void 0:Z.type)||null),C((n==null?void 0:n.status)||"draft"),S((n==null?void 0:n.scheduledAt)||""),B((n==null?void 0:n.tiktokSettings)||{allowComments:!1,allowDuets:!1,allowStitch:!1,discloseContent:!1,privacy:"",disclosureType:[],userAgreedToTerms:!1}),D((n==null?void 0:n.youtubeSettings)||{title:"",tags:[],privacy:"public"}),P((n==null?void 0:n.linkedinSettings)||{organizationId:"",visibility:"PUBLIC"})},[n]),!e)return null;const ue=async(q=!1)=>{var Z,me,we,he,ie,ye,pe;try{if(R(!0),T(null),!l)throw new Error("Please select a brand");if(!i.trim())throw new Error("Content cannot be empty");console.log("Media values before submission:",{media:h,mediaUrl:g,mediaType:v,hasMedia:!!(h||g)});const ce={};u.includes("tiktok")&&(ce.tiktok={settings:{privacy_level:_.privacy,disable_duet:!_.allowDuets,disable_comment:!_.allowComments,disable_stitch:!_.allowStitch,brand_safety_brand_owned:((Z=_.disclosureType)==null?void 0:Z.includes("brand"))||!1,brand_safety_paid_partnership:((me=_.disclosureType)==null?void 0:me.includes("branded"))||!1}}),u.includes("instagram")&&(ce.instagram={settings:{video_cover_timestamp_ms:1e3,share_to_feed:!0}}),u.includes("youtube")&&(ce.youtube={settings:{title:z.title||i.substring(0,100),privacy:z.privacy,tags:z.tags,category_id:"22"}}),u.includes("facebook")&&(ce.facebook={settings:{title:i.substring(0,100)}}),u.includes("linkedin")&&(ce.linkedin={settings:{organizationId:A.organizationId,visibility:A.visibility}}),u.includes("pinterest")&&(ce.pinterest={settings:{title:E.title||i.substring(0,100),link:E.link,board_id:E.selectedBoardId,allow_comments:E.allowComments}});const xe={brandId:l,title:"",content:i,format:v==="video"?"reel":"regular",platforms:ce,media:g?[{url:g,type:(v||"image").toUpperCase(),thumbnailUrl:g,description:""}]:void 0,tags:[],hashtags:[],scheduledFor:N||null,status:q?"pending":"draft",publishNow:!1};if(console.log("Submitting post with brand ID:",l),!await((we=Qe.currentUser)==null?void 0:we.getIdToken()))throw new Error("No authentication token available");n!=null&&n.id&&Object.assign(xe,{id:n.id});let Ye;if(h){const fe=new FormData;fe.append("file",h),fe.append("postData",JSON.stringify(xe)),Ye=await Rk(fe,!0)}else Ye=await Rk(xe,!1);if(!Ye.success)throw new Error(Ye.error||"Failed to save post");q?(console.log("Setting up publish confirmation with media:",{mediaUrl:((he=Ye.post.media)==null?void 0:he.url)||g,mediaType:((ie=Ye.post.media)==null?void 0:ie.type)||v,hasMedia:!!(Ye.post.media||h||g)}),(ye=Ye.post.media)!=null&&ye.url&&!g&&y(Ye.post.media.url),(pe=Ye.post.media)!=null&&pe.type&&!v&&x(Ye.post.media.type),k({show:!0,postId:Ye.post.id})):(alert(`Draft ${n?"updated":"saved"} successfully!`),r(Ye.post),t())}catch(ce){console.error("Error saving post:",ce),T(ce instanceof Error?ce.message:"Failed to save post. Please try again.")}finally{R(!1)}},le=q=>{c(q);const Z=X.find(me=>me.id===q);Z!=null&&Z.social_accounts&&Z.social_accounts.some(we=>we.platform.toLowerCase()==="tiktok")&&!u.includes("tiktok")&&d([...u,"tiktok"])},ae=()=>{const q=X.find(me=>me.id===l);if(!q||!q.social_accounts)return{username:"",picture_url:""};const Z=q.social_accounts.find(me=>me.platform.toLowerCase()==="tiktok");return Z?{username:Z.username||"",picture_url:Z.profile_url||Z.picture_url||""}:{username:"",picture_url:""}},te=()=>{const q=X.find(Z=>Z.id===l);return!q||!q.social_accounts?[]:q.social_accounts.filter(Z=>Z.platform&&Z.username).map(Z=>({platform:Z.platform.toLowerCase(),username:Z.username,picture_url:Z.profile_url||Z.picture_url||""}))},ne=ae(),J=te(),G=()=>!(!l||!i.trim()||u.length===0||u.includes("tiktok")&&(!_.userAgreedToTerms||!_.privacy||_.discloseContent&&_.disclosureType.length===0)),Q=()=>l?i.trim()?u.length===0?"Select at least one platform":u.includes("tiktok")&&!_.userAgreedToTerms?"Agree to TikTok's terms to publish":u.includes("tiktok")&&!_.privacy?"Select a privacy level for TikTok":u.includes("tiktok")&&_.discloseContent&&_.disclosureType.length===0?"You need to indicate if your content promotes yourself or a brand partner to proceed":"Publish post now":"Add content to your post":"Select a brand to publish";return s.jsxs("div",{className:"fixed inset-0 z-50 bg-white lg:pl-16",children:[s.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200",children:s.jsxs("div",{className:"max-w-[1600px] mx-auto px-4 sm:px-6 py-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:text-primary-600 transition-colors",children:s.jsx(lh,{className:"w-6 h-6"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-semibold text-gray-900 font-title",children:n?"Edit Post":"Create Post"}),s.jsx("p",{className:"text-sm text-gray-500",children:n?"Update your social media post":"Create a new social media post"})]})]}),s.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[s.jsxs("button",{onClick:()=>ue(!1),className:"flex-1 sm:flex-initial inline-flex items-center px-4 py-2 text-primary-600 bg-white border border-primary-600 rounded-lg hover:bg-primary-50 transition-colors",disabled:L,children:[s.jsx(il,{className:"w-5 h-5 mr-2"}),"Save Draft"]}),s.jsxs("div",{className:"relative group",children:[s.jsxs("button",{onClick:()=>ue(!0),className:`flex-1 sm:flex-initial inline-flex items-center px-4 py-2 ${G()?"bg-primary-600 hover:bg-primary-700":"bg-gray-300 cursor-not-allowed opacity-50"} text-white rounded-lg transition-colors`,disabled:L||!G(),title:Q(),children:[s.jsx(nf,{className:`w-5 h-5 mr-2 ${G()?"":"opacity-50"}`}),"Publish Now"]}),u.includes("tiktok")&&_.discloseContent&&_.disclosureType.length===0&&s.jsx("div",{className:"absolute top-full right-0 mt-2 w-64 p-2 bg-yellow-50 border border-yellow-200 rounded-md text-yellow-800 text-xs shadow-lg op
3994acity-0 group-hover:opacity-100 transition-opacity z-50",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0 w-4 h-4 text-yellow-600 mr-1 mt-0.5",children:s.jsx("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),s.jsx("span",{children:"You need to indicate if your content promotes yourself or a brand partner to proceed."})]})})]})]})]}),I&&s.jsx("div",{className:"mt-2 p-2 bg-red-50 text-red-600 text-sm rounded-lg",children:I})]})}),s.jsx("div",{className:"h-[calc(100vh-73px)] overflow-y-auto",children:s.jsx("div",{className:"max-w-[1600px] mx-auto px-4 sm:px-6 py-6",children:s.jsxs("div",{className:"grid grid-cols-12 gap-4 sm:gap-6",children:[s.jsxs("div",{className:"col-span-12 lg:col-span-8 space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[s.jsx(lut,{selectedBrand:l,onBrandSelect:le,isLoading:H,brands:X}),s.jsx(cut,{selectedPlatforms:u,onPlatformToggle:q=>{u.includes(q)?d(u.filter(Z=>Z!==q)):d([...u,q])},onFormatChange:m,format:f,connectedAccounts:J,tiktokAccount:ne})]}),s.jsx(RQ,{content:i,onContentChange:o,media:h,onMediaChange:p,existingMediaUrl:g,existingMediaType:v,status:j,format:f,onFormatChange:m,brandId:l}),u.includes("tiktok")&&s.jsx(FQ,{..._,tiktokUsername:ne.username,tiktokProfileImage:ne.picture_url,onAllowCommentsChange:q=>B({..._,allowComments:q}),onAllowDuetsChange:q=>B({..._,allowDuets:q}),onAllowStitchChange:q=>B({..._,allowStitch:q}),onPrivacyChange:q=>B({..._,privacy:q}),onDiscloseContentChange:(q,Z)=>B({..._,discloseContent:q,disclosureType:Z?Z.split(","):[]}),onUserAgreedToTermsChange:q=>B({..._,userAgreedToTerms:q})}),u.includes("youtube")&&s.jsx(zQ,{privacy:z.privacy,title:z.title,tags:z.tags,onTitleChange:q=>D({...z,title:q}),onPrivacyChange:q=>D({...z,privacy:q}),onTagsChange:q=>D({...z,tags:q})}),u.includes("linkedin")&&s.jsx(BQ,{organizationId:A.organizationId,visibility:A.visibility,selectedBrandId:l,onOrganizationIdChange:q=>P({...A,organizationId:q}),onVisibilityChange:q=>P({...A,visibility:q})}),u.includes("pinterest")&&s.jsx(UQ,{title:E.title,link:E.link,selectedBoardId:E.selectedBoardId,allowComments:E.allowComments,availableBoards:E.availableBoards,onTitleChange:q=>F({...E,title:q}),onLinkChange:q=>F({...E,link:q}),onBoardChange:q=>F({...E,selectedBoardId:q}),onAllowCommentsChange:q=>F({...E,allowComments:q})})]}),s.jsxs("div",{className:"col-span-12 lg:col-span-4 space-y-4 sm:space-y-6",children:[s.jsx(fA,{scheduledFor:N,onScheduleChange:S}),s.jsx($Q,{content:i,selectedPlatforms:u,media:h,existingMediaUrl:g,existingMediaType:v,format:f,selectedBrand:l,brands:X})]})]})})}),s.jsx(Hj,{isOpen:L,title:"Saving Draft",message:"Please wait while we save your post...",videoSrc:"/Panda Riding Horse for GIF.mov",gifUrl:"https://media.socialness.ai/loading/unicorn.gif"}),s.jsx(WQ,{isOpen:M.show,onClose:()=>k({show:!1}),onConfirm:async()=>{try{r({id:M.postId}),t()}catch(q){console.error("Error publishing post:",q)}k({show:!1})},postId:M.postId||"",content:i,platforms:u,brand:X.find(q=>q.id===l)||{id:l,name:"Unknown Brand",logo:""},hasMedia:!!(h||g),mediaType:v,format:f,scheduledFor:N,media:h,mediaUrl:g,tiktokSettings:_})]})},dut=({isOpen:e,onClose:t,status:r,autoCloseDelay:n=4e3})=>{const{t:a,i18n:i}=Te();if(b.useEffect(()=>{if(e&&n>0){const d=setTimeout(()=>{t()},n);return()=>clearTimeout(d)}},[e,t,n]),!e)return null;const o={publish_complete:{label:a("status.published",i.language==="fr"?"Post publié":"Post Published"),color:"green"},published:{label:a("status.published",i.language==="fr"?"Post publié":"Post Published"),color:"green"},success:{label:a("status.published",i.language==="fr"?"Post publié":"Post Published"),color:"green"}},l=r.toLowerCase(),c=o[l]||null,u=!!(c&&c.color==="green");return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg p-6 max-w-md w-full mx-4 relative",children:[s.jsx("button",{onClick:t,className:"absolute top-3 right-3 text-gray-500 hover:text-gray-700",children:s.jsx(_t,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:`w-16 h-16 rounded-full flex items-center justify-center mb-4 ${u?"bg-green-100":"bg-blue-100"}`,children:u?s.jsx(Ba,{className:"w-10 h-10 text-green-600"}):s.jsx(bs,{className:"w-10 h-10 text-blue-600"})}),s.jsx("h3",{className:"text-xl font-semibold mb-2",children:a("common.postStatusModalTitle","Post Status")}),s.jsx("div",{className:`px-4 py-2 rounded-full text-sm font-medium mb-4 ${u?"bg-green-100 text-green-700":"bg-blue-100 text-blue-700"}`,children:c?c.label:a(`statusDropdown.${l}`,a(`status.${l}`,r))}),s.jsx("p",{className:"text-gray-600 text-sm",children:u?a("common.postStatusSuccess","Your post has been successfully published!"):a("common.postStatusProcessing","Your post is currently being processed.")})]})]})})},fut=wf((e,t)=>{const r=lp(new Date);return{dateRange:"this-month",customDateRange:{start:Pu(r),end:op(r)},selectedBrand:"all",view:"list-simplified",statusFilter:"all",setDateRange:n=>e(a=>a.dateRange===n?a:{dateRange:n}),setCustomDateRange:n=>e({customDateRange:n}),setSelectedBrand:n=>e(a=>a.selectedBrand===n?a:{selectedBrand:n}
3994),setView:n=>e(a=>a.view===n?a:{view:n}),setStatusFilter:n=>e(a=>a.statusFilter===n?a:{statusFilter:n})}});function mut(){const e=fut(),[t,r]=ui(),n=b.useRef(!0),a=b.useRef(!1),i=b.useRef(e);b.useEffect(()=>{i.current=e},[e]),b.useEffect(()=>{let S=!1;const M=new URLSearchParams(t);M.has("platform")&&(M.delete("platform"),S=!0),M.has("tab")&&(M.delete("tab"),S=!0),S&&r(M)},[t,r]);const o=b.useRef({skipSync:!1}).current,l=b.useRef({skipSync:!1}).current,c=b.useRef({skipSync:!1}).current,u=b.useRef({skipSync:!1}).current,[d,f]=fa("view",e.view,o),[m,h]=fa("status",e.statusFilter,l),[p,g]=fa("brand",e.selectedBrand,c),[y,v]=fa("dateRange",e.dateRange,u);b.useEffect(()=>{if(n.current){const S=i.current;d!==S.view&&S.setView(d),m!==S.statusFilter&&S.setStatusFilter(m),p!==S.selectedBrand&&S.setSelectedBrand(p),y!==S.dateRange&&S.setDateRange(y),n.current=!1}},[]);const x=b.useCallback(S=>{S!==d&&(f(S),a.current=!0,i.current.setView(S),a.current=!1)},[d,f]),j=b.useCallback(S=>{S!==m&&(h(S),a.current=!0,i.current.setStatusFilter(S),a.current=!1)},[m,h]),C=b.useCallback(S=>{S!==p&&(g(S),a.current=!0,i.current.setSelectedBrand(S),a.current=!1)},[p,g]),N=b.useCallback(S=>{S!==y&&(v(S),a.current=!0,i.current.setDateRange(S),a.current=!1)},[y,v]);return b.useEffect(()=>{!n.current&&!a.current&&d!==i.current.view&&i.current.setView(d)},[d]),b.useEffect(()=>{!n.current&&!a.current&&m!==i.current.statusFilter&&i.current.setStatusFilter(m)},[m]),b.useEffect(()=>{!n.current&&!a.current&&p!==i.current.selectedBrand&&i.current.setSelectedBrand(p)},[p]),b.useEffect(()=>{!n.current&&!a.current&&y!==i.current.dateRange&&i.current.setDateRange(y)},[y]),{view:d,statusFilter:m,selectedBrand:p,dateRange:y,setView:x,setStatusFilter:j,setSelectedBrand:C,setDateRange:N,customDateRange:e.customDateRange,setCustomDateRange:e.setCustomDateRange}}const hut=()=>{const e=qr();return mn({mutationFn:async({postIds:t,updateData:r})=>{try{Ie.info("useBulkUpdatePosts",`Bulk updating ${t.length} posts`);const n=await bje(t,r);return Ie.info("useBulkUpdatePosts",`Bulk update completed: ${n.updated} updated, ${n.failed.length} failed`),n}catch(n){throw Ie.error("useBulkUpdatePosts","Error in bulk update:",n),n}},onSuccess:t=>{e.invalidateQueries({queryKey:["posts"]}),Ie.info("useBulkUpdatePosts","Posts queries invalidated")}})},gC=(e,t=70)=>e.length<=t?e:e.substring(0,t-3)+"...",put=e=>typeof e!="string"||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),kl=e=>!e||!e.platforms?[]:Array.isArray(e.platforms)?e.platforms:typeof e.platforms=="object"?Object.keys(e.platforms):[],z9=(e,t)=>
3994{var r,n,a,i,o,l;if(e.platforms&&!Array.isArray(e.platforms)&&typeof e.platforms=="object"){const c=(a=(n=(r=e.platforms)==null?void 0:r[t])==null?void 0:n.results)==null?void 0:a.status;if(c)return c}if(e.platformData&&typeof e.platformData=="object"){const c=(l=(o=(i=e.platformData)==null?void 0:i[t])==null?void 0:o.results)==null?void 0:l.status;if(c)return c}return e.status},gut=e=>{var t,r;if(e.status==="published"){if(e.publishedAt)return e.publishedAt;const n=e.platforms;if(n&&!Array.isArray(n)&&typeof n=="object")for(const a in n){const i=(t=n[a])==null?void 0:t.results;if(i!=null&&i.publishedAt)return i.publishedAt}if(e.platformData&&typeof e.platformData=="object"){const a=e.platformData;for(const i in a){const o=(r=a[i])==null?void 0:r.results;if(o!=null&&o.publishedAt)return o.publishedAt}}return e.updatedAt||""}return e.status==="scheduled"&&e.scheduledAt?e.scheduledAt:e.updatedAt||""},B9=e=>e.scheduledAt?e.scheduledAt:e.publishedAt?e.publishedAt:"",U9=(e,t,r)=>{const n=e.status;if(n==="waiting_for_approval")return t&&t===e.reviewerId?{name:r("pages.status.needsYourApproval","Needs Your Review"),emoji:"🔔",colorClasses:"bg-orange-200 text-orange-800 border border-orange-400"}:t&&t===e.userId?{name:r("pages.status.waiting_for_approval","Waiting Approval"),emoji:"⏳",colorClasses:"bg-orange-100 text-orange-700"}:{name:r("pages.status.waiting_for_approval","Waiting Approval"),emoji:"⏳",colorClasses:"bg-orange-100 text-orange-700"};switch(n){case"draft":return{name:r("pages.status.draft","Draft"),emoji:"📝",colorClasses:"bg-gray-100 text-gray-700"};case"scheduled":return{name:r("pages.status.scheduled","Scheduled"),emoji:"📅",colorClasses:"bg-blue-100 text-blue-700"};case"ready_to_publish":return{name:r("pages.status.ready_to_publish","Ready to Publish"),emoji:"🚀",colorClasses:"bg-teal-100 text-teal-700"};case"processing":return{name:r("pages.status.processing","Processing"),emoji:"⚙️",colorClasses:"bg-purple-100 text-purple-700"};case"published":return{name:r("pages.status.published","Published"),emoji:"✅",colorClasses:"bg-green-100 text-green-700"};case"rejected":return{name:r("pages.status.rejected","Rejected"),emoji:"❌",colorClasses:"bg-red-100 text-red-700"};case"error":return{name:r("pages.status.error","Error"),emoji:"⚠️",colorClasses:"bg-red-100 text-red-700"};default:return{name:put(n),emoji:"❓",colorClasses:"bg-gray-100 text-gray-700"}}},yut=()=>{const{t:e,i18n:t}=Te(),r=pn(),n=rA(e),{dateRange:a,setDateRange:i,customDateRange:o,setCustomDateRange:l,selectedBrand:c,setSelectedBrand:u,view:d,setView:f,statusFilter:m,setStatusFilter:h}=mut(),p=b.useMemo(()=>{const se=new Date;if(a==="custom")return{start:uo(o.start),end:Hc(o.end)};if(a==="this-month")return{start:Pu(se),end:Hc(se)};if(a==="last-month"){const at=lp(se);return{start:Pu(at),end:op(at)}}if(a==="this-year"){const at=new Date(se.getFullYear(),0,1);return{start:uo(at),end:Hc(se)}}const Be=Number(a);return Number.isFinite(Be)&&Be>0?{start:uo(zc(se,Be)),end:Hc(se)}:{start:uo(zc(se,30)),end:Hc(se)}},[a,o.start,o.end]),[g,y]=b.useState(!1),[v,x]=b.useState(!1),j=V2(),[C,N]=b.useState(!1),[S,M]=b.useState(null),[k,I]=b.useState([]),[T,L]=b.useState(!1),R=b.useRef(!1),[_,B]=b.useState(!1),[z,D]=b.useState(!1),[A,P]=b.useState(""),[E,F]=b.useState(!1),[$,H]=b.useState(!1),[X,ue]=b.useState([]),[le,ae]=b.useState([]),[te,ne]=b.useState([]),[J,G]=fa("sort","published-date"),[Q,W]=fa("order","desc"),[Y,q]=b.useState({brand:!0,created:!0,updated:!0,published:!0}),Z=se=>se==="creation-date"?"createdAt":se==="published-date"?"publishedOn":"updatedAt",me=se=>se==="createdAt"?"creation-date":se==="publishedOn"?"published-date":"update-date",[we,he]=b.useState(()=>Z(J)),[ie,ye]=b.useState(()=>Q==="asc"?"asc":"desc");b.useEffect(()=>{const se=Z(J);se!==we&&he(se),Q!==ie&&ye(Q)},[J,Q]);const[pe,ce]=b.useState(null),[xe,Ee]=b.useState({x:0,y:0}),Ye=b.useRef(null),[fe,je]=b.useState({width:0,height:0}),[We,yt]=b.useState({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}),gt=rY({start:p.start,end:p.end,applanguage:t.language||"en",sort:we==="createdAt"?"creation-date":we==="updatedAt"?"update-date":we==="publishedOn"?"published-date":void 0,order:ie}),{data:qe,isLoading:ze,isFetching:$e,error:ct}=gt,oe=(qe==null?void 0:qe.posts)||[],Ne=se=>{const Be=[],at=/(https?:\/\/[^\s]+|www\.[^\s]+|#[\p{L}\d_]+)/giu;let Ke=0,ee;
3994for(;(ee=at.exec(se))!==null;){const de=ee.index;de>Ke&&Be.push(se.slice(Ke,de));const Se=ee[0];if(Se.startsWith("#"))Be.push(s.jsx("span",{className:"text-[#0B65C2]",children:Se},`hash-${de}`));else{const Ue=Se.startsWith("http")?Se:`http://${Se}`;Be.push(s.jsx("a",{href:Ue,target:"_blank",rel:"noreferrer",className:"text-[#0B65C2] hover:underline",children:Se},`link-${de}`))}Ke=at.lastIndex}return Ke<se.length&&Be.push(se.slice(Ke)),Be},Ae=nY(),lt=mA(),Mt=hut(),{showToast:jt}=bc(),Xe=async se=>{try{await lt.mutateAsync({postId:se.id,postData:{status:"draft"},isFormData:!1}),jt(e("contentHub.promotedToDraft","Idea promoted to draft!"),"success")}catch(Be){console.error("Error promoting idea to draft:",Be),jt(e("contentHub.promoteError","Failed to promote idea."),"error")}},Bt=async se=>{try{await lt.mutateAsync({postId:se.id,postData:{hiddenByUser:!0},isFormData:!1}),jt(e("contentHub.hiddenExternal","Post masqué de votre contenu"),"success")}catch(Be){console.error("Error hiding external post:",Be),jt(e("contentHub.hideError","Impossible de masquer le post."),"error")}},ve=se=>{const Be=(se==null?void 0:se.platformData)||{},at=(se==null?void 0:se.platformResults)||{};return[...Object.values(at).map(de=>(de==null?void 0:de.postUrl)||(de==null?void 0:de.permalink)),...Object.values(Be).map(de=>{var Se,Ue;return((Se=de==null?void 0:de.results)==null?void 0:Se.postUrl)||((Ue=de==null?void 0:de.results)==null?void 0:Ue.permalink)})].find(de=>typeof de=="string"&&de.length>0)||null},Fe=b.useMemo(()=>[{id:"all",label:e("statusDropdown.all","All Statuses"),emoji:"🌐",description:e("statusDropdown.allDesc","View posts across all their current states.")},{id:"idea",label:e("statusDropdown.idea","Idea"),emoji:"💡",description:e("statusDropdown.ideaDesc","A post idea saved for later with an optional reminder date.")},{id:"draft",label:e("statusDropdown.draft","Draft"),emoji:"📝",description:e("statusDropdown.draftDesc","Post is in progress, not yet submitted for review or scheduling.")},{id:"scheduled",label:e("statusDropdown.scheduled","Scheduled"),emoji:"📆",description:e("statusDropdown.scheduledDesc","Post is approved and set for automatic publishing at a future time.")},{id:"ready_to_publish",label:e("statusDropdown.ready_to_publish","Ready to Publish"),emoji:"🚀",description:e("statusDropdown.ready_to_publishDesc","Post is complete, approved, and awaiting its scheduled time or manual publishing.")},{id:"waiting_for_approval",label:e("statusDropdown.waiting_for_approval","Waiting for approval"),emoji:"⏳",description:e("statusDropdown.waiting_for_approvalDesc","Post has been submitted and is awaiting review by an approver.")},{id:"published",label:e("statusDropdown.published","Published"),emoji:"✅",description:e("statusDropdown.publishedDesc","Post has been successfully shared on the selected platforms.")},{id:"rejected",label:e("statusDropdown.rejected","Rejected"),emoji:"❌",description:e("statusDropdown.rejectedDesc","Post was reviewed but not approved for publishing by an approver.")},{id:"error",label:e("statusDropdown.error","Error"),emoji:"⚠️",description:e("statusDropdown.errorDesc","An error occurred while trying to publish or process the post.")},{id:"processing",label:e("statusDropdown.processing","Processing"),emoji:"⚙️",description:e("statusDropdown.processingDesc","Post is currently being processed by the system (e.g., media upload, API submission).")},{id:"pending",label:e("statusDropdown.pending","Pending"),emoji:"🚧",description:e("statusDropdown.pendingDesc","Post is awaiting system action or external confirmation before proceeding.")}],[e,t.language]),nt=b.useMemo(()=>oe.filter(se=>{if(X.length>0){if(!X.includes(se.status))return!1}else if(m!=="all"&&se.status!==m)return!1;return!0}),[oe,X,m]),At=b.useMemo(()=>{const se={};for(const Be of nt){const at=Be.brandId||"unknown";se[at]=(se[at]||0)+1}return se},[nt]),Wt=b.useMemo(()=>oe.filter(se=>{if(le.length>0&&!le.includes("all")){if(!le.includes(se.brandId))return!1}else if(c!=="all"&&se.brandId!==c)return!1;return!0}),[oe,le,c]),In=b.useMemo(()=>{const se={};for(const Be of Wt){const at=Be.status||"unknown";se[at]=(se[at]||0)+1}return se},[Wt]),ir=b.useMemo(()=>oe.filter(se=>{if(le.length>0&&!le.includes("all")){if(!le.includes(se.brandId))return!1}else if(c!=="all"&&se.brandId!==c)return!1;if(X.length>0){if(!X.includes(se.status))return!1}else if(m!=="all"&&se.status!==m)return!1;return!0}),[oe,le,c,X,m]),Qt=b.useMemo(()=>{const se={};for(const Be of ir){const at=kl(Be);for(const Ke of at)se[Ke]=(se[Ke]||0)+1}return se},[ir]),Sn=se=>{if(we===se){const Be=ie==="asc"?"desc":"asc";ye(Be),W(Be)}else he(se),G(me(se)),ye("desc"),W("desc")},nn=se=>`inline-flex items-center gap-1 ${we===se?"text-primary-700 font-semibold":""} hover:text-primary-600`;if(b.useEffect(()=>{$&&(le.length===0&&ae(c!=="all"?[c]:["all"]),X.length===0&&m!=="all"&&ue([m]))},[$]),b.useEffect(()=>{document.title=e("contentHub.title","My Content Hub")},[e]),b.useEffect(()=>{d!=="list"&&d!=="list-simplified"&&d!=="grid"&&d!=="board"&&f("list-simplified")},[d]),b.useEffect(()=>{if(!Ye.current)return;const se=new ResizeObserver(Be=>{for(const at of Be){const Ke=at.contentRect;je({width:Ke.width,height:Ke.height})}});return se.observe(Ye.current),()=>se.disconnect()},[pe]),b.useEffect(()=>{const se=()=>yt({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[]),ze)return s.jsx(rs,{title:e("contentHub.title","My Content Hub"),subtitle:e("contentHub.subtitle","Manage all your content in one place"),actions:s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-32"})}),children:s.jsx("div",{className:"bg-white rounded-xl border border-gray-200 shadow-lg overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsx("tr",{children:[1,2,3,4,5,6,7,8].map(se=>s.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})},se))})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:[1,2,3,4,5].map(se=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("div",{className:"h-4 w-4 bg-gray-200 rounded"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"h-10 w-10 bg-gray-200 rounded mr-4"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap hidden sm:table-cell",children:s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"h-4 w-4 bg-gray-200 rounded-full"}),s.jsx("div",{className:"h-4 w-4 bg-gray-200 rounded-full"})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap hidden md:table-cell",children:s.jsx("div",{className:"h-6 w-24 bg-gray-200 rounded"})}),s.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:s.jsx("div",{className:"h-5 w-16 bg-gray-200 rounded-full"})}),s.jsx("td",{className:"px-3 py-4 whitespace-nowrap",children:s.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap hidden lg:table-cell",children:s.jsx("div",{className:"h-4 w-20 bg-gray-200 rounded"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right",children:s.jsx("div",{className:"h-5 w-5 bg-gray-200 rounded"})})]},se))})]})})})});if(ct)return s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8 flex items-center justify-center h-96",children:s.jsx("p",{className:"text-red-600",children:"Failed to load posts. Please try again later."})})});const Lt=[{id:"all",name:e("brandDropdown.allBrands","All Brands"),logo:"/logo.svg"},...Array.from(new Map(oe.map(se=>[se.brandId,{id:se.brandId||"unknown",name:se.brandName||"Unknown Brand",logo:se.brandLogo||"/logo.svg"}])).values())],_e=oe.filter(se=>{if(le.length>0&&!le.includes("all")){if(!le.includes(se.brandId))return!1}else if(c!=="all"&&se.brandId!==c)return!1;if(X.length>0){if(!X.includes(se.status))return!1}else if(m!=="all"&&se.status!==m)return!1;return!(te.length>0&&!kl(se).some(at=>te.includes(at)))}),et=[..._e].sort((se,Be)=>{const at=de=>{let Se;if(we==="createdAt"?Se=de.createdAt:we==="updatedAt"?Se=de.updatedAt:we==="publishedOn"?Se=B9(de):Se=gut(de),!Se)return-1/0;try{const Ue=Xa(Se);return Gn(Ue)?Ue.getTime():-1/0}catch{return-1/0}},Ke=at(se),ee=at(Be);return ie==="asc"?Ke-ee:ee-Ke}),ft=new Date,pt=et.find(se=>{const Be=se.scheduledFor;return Be&&typeof Be=="string"&&Be.trim()&&Gn(Xa(Be))&&vke(Xa(Be),ft)}),$t=se=>{if(se.source==="external"){const Be=ve(se);Be&&window.open(Be,"_blank","noopener,noreferrer");return}r(`/posts/${se.id}/edit`,{state:{post:se}})},Pt=(se,Be)=>{Be.stopPropagation(),I(at=>at.includes(se)?at.filter(Ke=>Ke!==se):[...at,se])},Ft=se=>{I(se.target.checked?_e.map(Be=>Be.id):[])},Dr=async()=>
3994{if(k.length===0||R.current)return;R.current=!0,L(!0);const se=[...new Set(k)];try{const Be=await Promise.allSettled(se.map(ee=>Ae.mutateAsync(ee))),at=new Set(se.filter((ee,de)=>Be[de].status==="fulfilled")),Ke=Be.filter(ee=>ee.status==="rejected");if(Ie.info("MyContentHub",`Deleted ${at.size} posts; ${Ke.length} failed`),I(ee=>ee.filter(de=>!at.has(de))),ce(ee=>ee&&at.has(ee)?null:ee),Ke.length>0){const ee=[...new Set(Ke.map(Se=>wD(Se.reason,e)))].join(`
3995`),de=at.size>0?e("postDeleteErrors.partial",{deleted:at.size,failed:Ke.length,defaultValue:"{{deleted}} posts deleted; {{failed}} could not be deleted."})+`
3996`:"";alert(de+ee)}}catch(Be){Ie.error("MyContentHub","Error deleting posts",Be),alert(wD(Be,e))}finally{R.current=!1,L(!1)}},K=async se=>{if(k.length!==0)try{const Be=await Mt.mutateAsync({postIds:k,updateData:{status:se.status,brandId:se.brandId,platforms:se.platforms}});Ie.info("MyContentHub",`Bulk edit completed: ${Be.updated} updated, ${Be.failed.length} failed`),Be.success?(I([]),F(!1),Be.failed.length>0?alert(`${Be.updated} posts updated successfully. ${Be.failed.length} posts failed to update.`):alert(`All ${Be.updated} posts updated successfully!`)):alert(`Failed to update posts. ${Be.errors.length} errors occurred.`)}catch(Be){Ie.error("MyContentHub","Error in bulk edit",Be),alert("Failed to update posts. Please try again.")}},ke=se=>{R.current||(I([se]),B(!0),ce(null))},Ze=se=>{const Be=`[COPY] ${se.content||""}`,at=Xn(se.media),Ke=kl(se)[0]||null;r("/posts/new",{state:{content:Be,platform:Ke,brandId:se.brandId||se.brand_id||void 0,imageUrl:at?at.url:null}})},bt=async()=>{try{P("Checking status..."),D(!0)}catch(se){Ie.error("MyContentHub","Failed to check post status",se),P("Error checking status"),D(!0)}},Re=(se,Be)=>{ce(Be),Ee({x:se.clientX,y:se.clientY})},dt=se=>{Ee({x:se.clientX,y:se.clientY})},Et=()=>{ce(null)},xt=()=>{const Be=fe.width||Math.min(800,We.width*.9),at=fe.height||Math.min(500,We.height*.8),Ke=Math.max(0,We.width-16*2),ee=Math.max(0,We.height-16*2),de=Math.min(1,Ke/Be,ee/at),Se=Be*de,Ue=at*de;let Pe=xe.x+12;Pe+Se+16>We.width&&(Pe=xe.x-Se-12);let tt=xe.y-Ue*.3;return Pe=Math.min(Math.max(16,Pe),We.width-16-Se),tt=Math.min(Math.max(16,tt),We.height-16-Ue),{x:Pe,y:tt,scale:de}},qt=()=>{D(!1)},Gr=()=>{if(k.length===1){const se=oe.find(Be=>Be.id===k[0]);return`Are you sure you want to delete the post "${gC((se==null?void 0:se.content)||"",30)}"? This action cannot be undone.`}return`Are you sure you want to delete ${k.length} selected posts? This action cannot be undone.`},la=()=>{Ie.info("MyContentHub","Creating post with AI"),y(!1),r("/content-creation")},$n=()=>{y(!1),r("/posts/new")},Rt=()=>{y(!1),x(!0)},rr=async se=>{Ie.info("MyContentHub","Post submitted in Content Hub (needs implementation)"),N(!1),M(null)};return s.jsxs(s.Fragment,{children:[$e&&s.jsx(Wu,{title:e("contentHub.loading.title","Loading your content..."),currentStep:e("contentHub.loading.refreshing","Refreshing posts..."),videoSrc:"/Panda - Gold Digger.mov"}),s.jsxs(rs,{title:e("contentHub.title","My Content Hub"),subtitle:e("contentHub.subtitle","Manage all your content in one place"),actions:s.jsxs("div",{className:"flex items-center gap-3",children:[k.length>0&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:()=>F(!0),className:"inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[s.jsx(no,{className:"w-5 h-5 mr-2"}),"Edit ",k.length," ",k.length===1?"Post":"Posts"]}),s.jsxs("button",{disabled:T,onClick:()=>{B(!0),ce(null)},className:"inline-flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(lc,{className:"w-5 h-5 mr-2"}),"Delete ",k.length," ",k.length===1?"Post":"Posts"]})]}),s.jsxs("button",{onClick:()=>y(!0),className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("sidebar.createContent")]})]}),children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>{ue([]),h("all")},className:`inline-flex items-center px-3 py-1.5 rounded-lg ${m==="all"&&X.length===0?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,title:e("statusDropdown.allDesc","View posts across all their current states."),children:e("statusDropdown.all","All")}),s.jsx("button",{onClick:()=>{ue([]),h("idea")},className:`inline-flex items-center px-3 py-1.5 rounded-lg ${m==="idea"&&X.length===0?"bg-amber-100 text-amber-700":"text-gray-600 hover:bg-gray-100"}`,title:e("statusDropdown.ideaDesc","A post idea saved for later with an optional reminder date."),children:e("statusDropdown.idea","Ideas")}),s.jsx("button",{onClick:()=>{ue([]),h("draft")},className:`inline-flex items-center px-3 py-1.5 rounded-lg ${m==="draft"&&X.length===0?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}
3996`,title:e("statusDropdown.draftDesc","Post is in progress, not yet submitted for review or scheduling."),children:e("statusDropdown.draft","Drafts")}),s.jsx("button",{onClick:()=>{ue([]),h("scheduled")},className:`inline-flex items-center px-3 py-1.5 rounded-lg ${m==="scheduled"&&X.length===0?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,title:e("statusDropdown.scheduledDesc","Post is approved and set for automatic publishing at a future time."),children:e("statusDropdown.scheduled","Scheduled")}),s.jsx("button",{onClick:()=>{ue([]),h("published")},className:`inline-flex items-center px-3 py-1.5 rounded-lg ${m==="published"&&X.length===0?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,title:e("statusDropdown.publishedDesc","Post has been successfully shared on the selected platforms."),children:e("statusDropdown.published","Published")})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 w-full sm:w-auto sm:ml-auto",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>f("list-simplified"),className:`group relative inline-flex items-center px-3 py-1.5 rounded-lg ${d==="list-simplified"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,"aria-label":e("contentHub.view.list_simplified","List simplified"),children:[s.jsx(_7,{className:"w-4 h-4"}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("contentHub.view.list_simplified","List simplified")})]}),s.jsxs("button",{onClick:()=>f("list"),className:`group relative inline-flex items-center px-3 py-1.5 rounded-lg ${d==="list"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,"aria-label":e("contentHub.view.list","List"),children:[s.jsx(Jme,{className:"w-4 h-4"}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("contentHub.view.list","List")})]}),s.jsxs("button",{onClick:()=>f("grid"),className:`group relative inline-flex items-center px-3 py-1.5 rounded-lg ${d==="grid"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,"aria-label":e("contentHub.view.grid","Grid"),children:[s.jsx(P7,{className:"w-4 h-4"}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("contentHub.view.grid","Grid")})]}),s.jsxs("button",{onClick:()=>f("board"),className:`group relative inline-flex items-center px-3 py-1.5 rounded-lg ${d==="board"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,"aria-label":e("contentHub.view.board","Board"),children:[s.jsx(NE,{className:"w-4 h-4"}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("contentHub.view.board","Board")})]})]}),(()=>{const se=(X.length||(m!=="all"?1:0))+(le.length||(c!=="all"?1:0))+(te.length||0);return s.jsx("div",{className:"relative",children:s.jsxs("button",{onClick:()=>H(Be=>!Be),className:"inline-flex items-center px-4 py-2 border border-gray-300 rounded-lg bg-white text-sm font-medium text-gray-700 hover:text-primary-600","aria-expanded":$,children:[s.jsx(k2,{className:"w-4 h-4 mr-2 text-primary-500"}),e("contentHub.filters","Filtres"),se>0&&s.jsx("span",{className:"ml-2 inline-flex items-center justify-center rounded-full bg-primary-600 text-white text-xs w-5 h-5",children:se})]})})})()]})]}),s.jsx("div",{className:"w-full mx-auto py-2",children:s.jsx("div",{className:"",children:d==="list"||d==="list-simplified"?s.jsxs("div",{className:"bg-white rounded-xl border border-black shadow-lg overflow-hidden",children:[k.length>0&&s.jsxs("div",{className:"px-6 py-3 bg-primary-50 border-b border-primary-100 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-primary-700 font-medium",children:[k.length," ",k.length===1?"post":"posts"," selected"]}),s.jsx("button",{onClick:()=>I([]),className:"text-primary-600 text-sm hover:text-primary-800 ml-2",children:"Clear selection"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>F(!0),className:"inline-flex items-center px-3 py-1 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700",children:[s.jsx(no,{className:"w-4 h-4 mr-1"})," Edit ",k.length," posts"]}),s.jsxs("button",{disabled:T,onClick:()=>B(!0),className:"inline-flex items-center px-3 py-1 bg-red-600 text-white text-sm rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(lc,{className:"w-4 h-4 mr-1"})," Delete selected"]})]})]}),pt&&s.jsxs("div",{className:"px-6 py-3 bg-blue-50 border-b border-blue-100 flex items-center gap-2",children:[s.jsx(ql,{className:"w-4 h-4 text-blue-600"}),s.jsxs("span",{className:"text-sm text-blue-700",children:["Next scheduled post: ",lu(pt==null?void 0:pt.scheduledFor,t.language)]})]}),_e.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full divide-y divide-gray-200",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-10",children:s.jsx("input",{type:"checkbox",checked:k.length>0&&k.length===_e.length,onChange:Ft,className:"h-4 w-4 text-primary-600 border-gray-300 rounded cursor-pointer",title:"Select all posts"})}),s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("contentHub.table.content","Content")}),s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden sm:table-cell",children:e("contentHub.table.platforms","Platforms")}),Y.brand&&s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden md:table-cell",children:e("contentHub.table.brand","Brand")}),s.jsx("th",{scope:"col",className:"px-3 sm:px-4 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("contentHub.table.status","Status")}),s.jsx("th",{scope:"col",className:"px-2 sm:px-3 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("contentHub.table.stats","Stats")}
3996),Y.created&&d!=="list-simplified"&&s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden lg:table-cell",children:s.jsxs("button",{onClick:()=>Sn("createdAt"),className:nn("createdAt"),children:[e("contentHub.table.created","CREATED"),s.jsx("span",{className:"text-[10px]",children:we==="createdAt"?ie==="asc"?"▲":"▼":""})]})}),Y.updated&&d!=="list-simplified"&&s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden lg:table-cell",children:s.jsxs("button",{onClick:()=>Sn("updatedAt"),className:nn("updatedAt"),children:[e("contentHub.table.updated","UPDATED"),s.jsx("span",{className:"text-[10px]",children:we==="updatedAt"?ie==="asc"?"▲":"▼":""})]})}),Y.published&&s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider hidden lg:table-cell",children:s.jsxs("button",{onClick:()=>Sn("publishedOn"),className:nn("publishedOn"),children:[e("contentHub.table.publishedOn","PUBLISHED"),s.jsx("span",{className:"text-[10px]",children:we==="publishedOn"?ie==="asc"?"▲":"▼":""})]})}),s.jsx("th",{scope:"col",className:"px-3 sm:px-6 py-2 sm:py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:e("contentHub.table.actions","Actions")})]})}),s.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:et.map(se=>{var Ue,Pe,tt,kt,or,Nr,Fr,Sr,Zt,kr,Ce,Ge,Je,Xt,pr;const Be=(pt==null?void 0:pt.id)===se.id,at=(Ue=Qe.currentUser)==null?void 0:Ue.uid,{name:Ke,emoji:ee,colorClasses:de}=U9(se,at,e),Se=se.status==="processing"||Object.values(se.platforms||{}).some(ot=>{var Ut;return((Ut=ot==null?void 0:ot.results)==null?void 0:Ut.status)==="processing"});return s.jsxs("tr",{onClick:()=>$t(se),className:`hover:bg-gray-50 cursor-pointer ${Be?"bg-blue-50":""} ${k.includes(se.id)?"bg-primary-50":""}`,children:[s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4",onClick:ot=>ot.stopPropagation(),children:s.jsx("input",{type:"checkbox",checked:k.includes(se.id),onChange:ot=>Pt(se.id,ot),className:"h-4 w-4 text-primary-600 border-gray-300 rounded cursor-pointer"})}),s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4",onMouseEnter:ot=>Re(ot,se.id),onMouseMove:ot=>dt(ot),onMouseLeave:Et,children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"flex flex-col items-center gap-1 flex-shrink-0",children:[(()=>{const ot=Xn(se.media);if(!ot)return null;const Ut=/\.pdf(\?|#|$)/i.test(ot.url);return s.jsx("div",{className:"w-14 h-14 sm:w-14 sm:h-14 rounded bg-gray-100 overflow-hidden",children:Ut?s.jsx(Ef,{src:ot.url,className:"w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:ot.url,altText:"Post media",type:ot.type,objectFit:"cover",controls:!1,autoPlayOnMount:ot.type==="video",muted:!0})})})(),se.brandLogo&&s.jsx("div",{className:"sm:hidden",children:s.jsx("img",{src:se.brandLogo,alt:se.brandName||"Brand",className:"w-4 h-3 rounded-md object-contain"})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm text-gray-900",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:se.status==="idea"?Ne(gC(se.title||se.content||"",140)):Ne(gC(se.content,140))}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[se.source==="external"&&s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] border bg-gray-100 text-gray-600 border-gray-200",title:e("contentHub.externalPostTooltip","Cette publication a été faite directement sur la plateforme, sans passer par Socialness."),children:[s.jsx("span",{children:"🔗"}),s.jsx("span",{children:e("contentHub.externalBadge","Publié hors Socialness")})]}),(()=>{const ot=se.format==="reel"?"reel":"regular",Ut=py[ot];return s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] border ${Ut.bg} ${Ut.text} ${Ut.border}`,children:[s.jsx("span",{children:gy[ot]}),s.jsx("span",{children:n[ot]})]})})(),(()=>{const ot=(se.postMediaType||"").toString().toLowerCase();let Ut;if(ot)ot.includes("multi")?Ut="multi":ot==="document"||ot==="pdf"||ot==="file"?Ut="document":ot==="video"?Ut="video":ot==="image"?Ut="image":Ut="text";else{const en=Xn(se.media);Ut=qG(en==null?void 0:en.url,en==null?void 0:en.type)}const mr=py[Ut];return s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] border ${mr.bg} ${mr.text} ${mr.border}`,children:[s.jsx("span",{children:gy[Ut]}
3996),s.jsx("span",{children:n[Ut]})]})})()]}),s.jsx("div",{className:"flex items-center gap-1 mt-1 sm:hidden",children:kl(se).map(ot=>s.jsx(cr,{platform:ot,size:12},ot))})]})]})}),s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 hidden sm:table-cell",children:s.jsx("div",{className:"flex gap-1",children:kl(se).map(ot=>s.jsx(cr,{platform:ot,size:16},ot))})}),Y.brand&&s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 hidden md:table-cell",children:se.brandLogo?s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:se.brandLogo,alt:se.brandName||"Brand",className:"w-8 h-6 rounded-lg object-contain"})}):s.jsx("span",{className:"text-sm text-gray-500",children:"No brand"})}),s.jsx("td",{className:"px-3 sm:px-4 py-2 sm:py-4",children:s.jsxs("div",{className:"relative group inline-block",children:[kl(se).length>1?s.jsx("div",{className:"flex flex-wrap gap-1",children:kl(se).map(ot=>{var qn,En;const Ut=z9(se,ot),{name:mr,emoji:en,colorClasses:er}=U9({...se,status:Ut},(qn=Qe.currentUser)==null?void 0:qn.uid,e);return s.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 sm:px-2.5 py-0.5 rounded-full text-xs font-medium ${er}`,title:((En=Fe.find(Mr=>Mr.id===Ut))==null?void 0:En.description)||"",children:[s.jsx(cr,{platform:ot,size:14}),s.jsx("span",{children:en}),s.jsx("span",{className:"hidden sm:inline ml-1",children:mr})]},ot)})}):s.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 sm:px-2.5 py-0.5 rounded-full text-xs font-medium ${de}`,children:[s.jsx("span",{children:ee}),s.jsx("span",{className:"hidden sm:inline ml-1",children:Ke})]}),s.jsx("div",{className:"absolute left-1/2 z-20 -translate-x-1/2 mt-2 w-56 bg-black text-white text-xs rounded-lg px-3 py-2 opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity duration-200 shadow-lg whitespace-normal",children:kl(se).length>1?kl(se).map(ot=>{var mr;const Ut=z9(se,ot);return s.jsxs("div",{className:"flex items-center gap-1 mb-1 last:mb-0",children:[s.jsx(cr,{platform:ot,size:12}),s.jsx("span",{children:((mr=Fe.find(en=>en.id===Ut))==null?void 0:mr.description)||""})]},ot)}):((Pe=Fe.find(ot=>ot.id===se.status))==null?void 0:Pe.description)||""})]})}),s.jsx("td",{className:"px-2 sm:px-3 py-2 sm:py-4 text-sm text-gray-500",children:se.status==="published"?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 text-xs",children:[s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{className:"text-red-500",children:"❤️"}),((tt=se.engagement)==null?void 0:tt.likes)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.likes","Likes")})]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{className:"text-blue-500",children:"💬"}),((kt=se.engagement)==null?void 0:kt.comments)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.comments","Comments")})]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{className:"text-purple-500",children:"👁️"}),((or=se.engagement)==null?void 0:or.views)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.views","Views")})]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-xs sm:hidden",children:[s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{className:"text-green-500",children:"🔗"}),((Nr=se.engagement)==null?void 0:Nr.shares)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.shares","Shares")}
3996)]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{children:"👉"}),((Fr=se.engagement)==null?void 0:Fr.clicks)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.clicks","Clicks")})]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{children:"🔍"}),((Sr=se.engagement)==null?void 0:Sr.unique_views)||((Zt=se.engagement)==null?void 0:Zt.uniqueViews)||((kr=se.engagement)==null?void 0:kr.uniqueImpressions)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.uniqueViews","Unique Views")})]})]}),s.jsxs("div",{className:"hidden sm:flex items-center gap-4 text-xs",children:[s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{className:"text-green-500",children:"🔗"}),((Ce=se.engagement)==null?void 0:Ce.shares)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.shares","Shares")}
3996)]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{children:"👉"}),((Ge=se.engagement)==null?void 0:Ge.clicks)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.clicks","Clicks")})]}),s.jsxs("span",{className:"group relative inline-flex items-center gap-1",children:[s.jsx("span",{children:"🔍"}),((Je=se.engagement)==null?void 0:Je.unique_views)||((Xt=se.engagement)==null?void 0:Xt.uniqueViews)||((pr=se.engagement)==null?void 0:pr.uniqueImpressions)||0,s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:e("analytics.metrics.uniqueViews","Unique Views")})]})]})]}):s.jsx("span",{className:"text-gray-400 text-xs",children:e("contentHub.noStatsYet","No stats yet")})}),Y.created&&d!=="list-simplified"&&s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 text-sm text-gray-500 hidden lg:table-cell",children:se.createdAt?lu(se.createdAt,t.language):"-"}),Y.updated&&d!=="list-simplified"&&s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 text-sm text-gray-500 hidden lg:table-cell",children:se.updatedAt?lu(se.updatedAt,t.language):"-"}),Y.published&&s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 text-sm text-gray-500 hidden lg:table-cell",children:(()=>{const ot=B9(se);return ot?lu(ot,t.language):"-"})()}),s.jsx("td",{className:"px-3 sm:px-6 py-2 sm:py-4 text-right",children:s.jsx(GQ,{onModify:()=>$t(se),onDelete:()=>ke(se.id),onDuplicate:()=>Ze(se),onCheckStatus:Se?()=>bt():void 0,onPromoteToDraft:se.status==="idea"?()=>Xe(se):void 0,status:se.status,menuPosition:"top",isAnyProcessing:Se,isExternal:se.source==="external",externalPermalink:se.source==="external"?ve(se):null,onHide:se.source==="external"?()=>Bt(se):void 0})})]},se.id)})})]})}):s.jsx(B4,{title:"No posts found",message:"You haven't created any posts yet. Get started by creating your first post!",icon:"list",isFiltered:c!=="all"||m!=="all"})]}):d==="grid"?s.jsx(s.Fragment,{children:_e.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:_e.map(se=>s.jsx("div",{onClick:()=>$t(se),className:"cursor-pointer transform transition-transform hover:scale-[1.02]",children:s.jsx(Wat,{post:se,brandLogo:se.brandLogo,username:se.brandName?se.brandName.toLowerCase().replace(/\s/g,""):"",brandName:se.brandName,onDelete:ke,onHide:Be=>{const at=_e.find(Ke=>Ke.id===Be);at&&Bt(at)}})},se.id))}):s.jsx(B4,{title:"Your content gallery is empty",message:"Time to showcase your creativity! Create your first post and watch your social media presence grow.",icon:"image",isFiltered:c!=="all"||m!=="all"})}):d==="board"?s.jsx(iut,{posts:_e,onPostClick:$t}):s.jsx("p",{children:"Unknown view selected"})})})]}),$&&s.jsxs("div",{className:"fixed inset-0 z-50",children:[s.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:()=>H(!1)}),s.jsx("div",{className:"absolute right-0 top-0 h-full w-full sm:w-[380px] bg-white shadow-2xl border-l border-gray-200 transform transition-transform duration-300 ease-out",children:s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"px-5 py-4 border-b border-gray-200 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e("contentHub.filters","Filtres")}),s.jsx("button",{onClick:()=>H(!1),className:"text-gray-500 hover:text-gray-700","aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("contentHub.filter.dateRange","Période")}),s.jsx(nV,{dateRange:a,customDateRange:o,onDateRangeChange:i,onCustomDateRangeChange:l,fullWidth:!0})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("contentHub.filter.status","Statut")}),s.jsx("div",{className:"space-y-3",children:Fe.filter(se=>se.id!=="all").map(se=>{var Be;return s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 rounded border-gray-300 text-primary-600",checked:X.includes(se.id),onChange:at=>{ue(Ke=>at.target.checked?[...Ke,se.id]:Ke.filter(ee=>ee!==se.id))}}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0",children:se.emoji}),s.jsxs("span",{className:"truncate font-semibold",children:[se.label," (",In[se.id]??0,")"]})]}),s.jsx("div",{className:"text-[11px] text-gray-500 mt-0.5 leading-snug",children:((Be=Fe.find(at=>at.id===se.id))==null?void 0:Be.description)||""})]})]},se.id)})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("contentHub.filter.brands","Marques")}),s.jsx("div",{className:"space-y-3",children:Lt.map(se=>s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:le.includes(se.id),onChange:Be=>{if(se.id==="all"){ae(Be.target.checked?["all"]:[]);return}ae(at=>{const Ke=at.filter(ee=>ee!=="all");return Be.target.checked?Ke.includes(se.id)?Ke:[...Ke,se.id]:Ke.filter(ee=>ee!==se.id)})}}),s.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[se.id!=="all"&&se.logo?s.jsx("img",{src:se.logo,alt:se.name,className:"w-5 h-5 rounded object-contain shrink-0"}):null,s.jsx("span",{className:"truncate max-w-[180px]",title:se.name,children:se.name}),se.id!=="all"&&s.jsxs("span",{className:"shrink-0 text-gray-500",children:["(",At[se.id]??0,")"]})]})]},se.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("contentHub.filter.platforms","Plateformes")}),s.jsx("div",{className:"space-y-3",children:["instagram","linkedin","facebook","tiktok","youtube","twitter","pinterest","google_business"].filter(se=>(Qt[se]??0)>0).map(se=>s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:te.includes(se),onChange:Be=>{ne(at=>Be.target.checked?[...at,se]:at.filter(Ke=>Ke!==se))}}),s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(cr,{platform:se,size:14}),s.jsxs("span",{className:"truncate capitalize max-w-[220px]",children:[se.replace("_"," ")," (",Qt[se]??0,")"]})]})]},se))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("contentHub.filter.columns","Colonnes")}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:Y.brand,onChange:se=>q(Be=>({...Be,brand:se.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("contentHub.columns.brand","Marque")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:Y.created,onChange:se=>q(Be=>({...Be,created:se.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("contentHub.columns.created","Créé")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:Y.updated,onChange:se=>q(Be=>({...Be,updated:se.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("contentHub.columns.updated","Modifié")})]}),s.jsxs("label",{className:"flex items-center gap-3 text-sm text-gray-700",children:[s.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-primary-600",checked:Y.published,onChange:se=>q(Be=>({...Be,published:se.target.checked}))}),s.jsx("span",{className:"truncate max-w-[220px]",children:e("contentHub.columns.published","Publié")})]})]})]})]}),s.jsxs("div",{className:"px-5 py-4 border-t border-gray-200 flex items-center justify-between",children:[s.jsx("button",{type:"button",onClick:()=>{ue([]),ae([]),h("all"),u("all"),ne([]),q({brand:!0,created:!0,updated:!0,published:!0})},className:"px-4 py-2 text-sm rounded-lg text-gray-700 hover:text-primary-600",children:e("common.reset","Réinitialiser")}),s.jsx("div",{})]})]})})]}),s.jsx(np,{isOpen:g,onClose:()=>y(!1),onCreateWithAI:la,onCreateManually:$n,onCreateIdea:Rt}),s.jsx(UE,{isOpen:v,onClose:()=>x(!1),isLoading:j.isPending,onSave:async se=>
3996{try{await j.mutateAsync({postData:{title:se.title,description:se.description,brandId:se.brandId,status:"idea",reminderAt:se.reminderAt,platforms:{},content:""}}),jt(e("calendar.ideaSaved","Idea saved!"),"success"),x(!1)}catch(Be){console.error("Error saving idea:",Be),jt(e("calendar.ideaError","Failed to save idea."),"error")}}}),s.jsx(uut,{isOpen:C,onClose:()=>{N(!1),M(null)},onSubmit:rr,initialData:S}),s.jsx(Pj,{isOpen:_,onClose:()=>B(!1),onConfirm:Dr,title:`Delete ${k.length===1?"Post":"Selected Posts"}`,message:Gr(),warning:"All associated data and media files will be permanently deleted."}),s.jsx(dut,{isOpen:z,onClose:qt,status:A,autoCloseDelay:4e3}),s.jsx(RQe,{isOpen:E,onClose:()=>F(!1),onConfirm:K,selectedPostsCount:k.length,brands:Lt,isLoading:Mt.isPending}),d==="list"&&pe&&!_&&!E&&!z&&(()=>{const se=et.find(Be=>Be.id===pe);return se?s.jsx("div",{ref:Ye,className:"fixed pointer-events-none z-50",style:{left:xt().x,top:xt().y,transform:`scale(${xt().scale})`,transformOrigin:"top left"},children:s.jsx(db,{post:se})}):null})()]})},but=async e=>(await ul.get("/management/dashboard",{params:{applanguage:e}})).data,V9=({title:e,description:t,drafts:r,onCreate:n})=>{const{t:a}=Te(),i=pn(),o=c=>c?Array.isArray(c)?c:Object.keys(c):[],l=c=>{c!=null&&c.id&&i(`/posts/${c.id}/edit`)};return!r||r.length===0?s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"bg-orange-100 text-orange-700 text-xs font-medium px-2.5 py-0.5 rounded-full",children:"0"}),s.jsx("h3",{className:"font-semibold text-gray-900",children:e||a("dashboard.drafts.title","Non planifiés")})]}),s.jsx("p",{className:"text-sm text-gray-500",children:t||a("dashboard.drafts.description","Glissez et déposez ces brouillons sur le calendrier pour les programmer.")}),s.jsxs("div",{className:"min-h-[160px] flex flex-col items-center justify-center text-center",children:[s.jsx("div",{className:"text-sm text-gray-600 mb-4",children:a("dashboard.drafts.empty","No drafts post need your attention")}),s.jsxs("button",{onClick:()=>n?n():i("/content-creation"),className:"inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-lg hover:bg-indigo-700 transition-colors",children:[s.jsx(tn,{className:"w-4 h-4"}),a("sidebar.createContent","Create Content")]})]})]}):s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("span",{className:"bg-orange-100 text-orange-700 text-xs font-medium px-2.5 py-0.5 rounded-full",children:r.length}),s.jsx("h3",{className:"font-semibold text-gray-900",children:e||a("dashboard.drafts.title","Non planifiés")})]}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:t||a("dashboard.drafts.description","Glissez et déposez ces brouillons sur le calendrier pour les programmer.")}),s.jsx("div",{className:"space-y-3",children:r.map(c=>{const u=Xn(c.media),d=o(c.platforms);return s.jsx("button",{onClick:()=>l(c),className:"w-full text-left p-3 border border-black rounded-lg hover:bg-gray-50 transition-colors bg-white",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex-shrink-0 w-16 h-16 bg-gray-100 rounded overflow-hidden relative",children:u?/\.pdf(\?|#|$)/i.test(u.url)?s.jsx(Ef,{src:u.url,className:"w-full h-full",frame:"square"}):s.jsx(Un,{mediaUrl:u.url,altText:"Post media",type:u.type,className:"w-full h-full",objectFit:"cover",controls:!1,autoPlayOnMount:u.type==="video",muted:!0}):null}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[s.jsx("p",{className:"text-sm text-gray-900 line-clamp-2 flex-1",children:c.content||""}),!u&&s.jsx("span",{className:"text-[10px] bg-gray-100 px-1 py-0.5 rounded flex-shrink-0",children:"📝"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[c.brandLogo&&s.jsx("img",{src:c.brandLogo,alt:c.brandName||"Brand logo",className:"w-4 h-4 rounded object-cover"}),s.jsx("div",{className:"flex gap-1",children:d.map(f=>s.jsx(cr,{platform:f,size:14},f))})]})]})]})},c.id)})})]})},vut=e=>{if(!e)return"📝";const t=e.toLowerCase();return/(\.mp4|\.mov|\.webm|\.avi|\.mkv|\.m4v)(\?|$)/.test(t)?"🎬":"🖼️"},xut=e=>{if(!e)return"Text";const t=e.toLowerCase();return/(\.mp4|\.mov|\.webm|\.avi|\.mkv|\.m4v)(\?|$)/.test(t)?"Video":"Image"},wut=e=>{var a,i,o,l;const r=((e==null?void 0:e.type)||((a=e==null?void 0:e.content)==null?void 0:a.type)||"").toString().toLowerCase();if(r==="video")return{emoji:"🎬",label:"Video"};if(r==="image"||r==="photo"||r==="picture")return{emoji:"🖼️",label:"Image"};if(r==="text"||r==="status")return{emoji:"📝",label:"Text"};const n=((i=e==null?void 0:e.content)==null?void 0:i.media_url)||((o=e==null?void 0:e.content)==null?void 0:o.thumbnail_url)||((l=e==null?void 0:e.content)==null?void 0:l.permalink);return{emoji:vut(n),label:xut(n)}},jut=({posts:e,onCreate:t})=>{const{t:r,i18n:n}=Te(),a=pn();return console.log("TopPostsCard - Current language:",n.language),console.log("TopPostsCard - Title translation:",r("analytics.topPosts.title")),!Array.isArray(e)||e.length===0?s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4",children:[s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:r("analytics.topPosts.title","🏆 Your top posts from the last 30 days")})}),s.jsx("p",{className:"text-sm text-gray-500",children:r("analytics.topPosts.subtitle","Your most engaging content for the selected period.")}),s.jsxs("div",{className:"min-h-[160px] flex flex-col items-center justify-center text-center",children:[s.jsx("div",{className:"text-sm text-gray-600 mb-4",children:r("analytics.topPosts.empty","No posts have been published last month.")}),s.jsxs("button",{onClick:()=>t?t():a("/content-creation"),className:"inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-lg hover:bg-indigo-700 transition-colors",children:[s.jsx(tn,{className:"w-4 h-4"}),r("sidebar.createContent","Create Content")]})]})]}):s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4",children:[s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:r("analytics.topPosts.title","🏆 Your top posts from the last 30 days")})}),s.jsx("div",{className:"space-y-3",children:e.slice(0,5).map((i,o)=>{var x,j,C,N;const l=((x=i==null?void 0:i.content)==null?void 0:x.thumbnail_url)||((j=i==null?void 0:i.content)==null?void 0:j.media_url)||"",u=((C=i==null?void 0:i.content)==null?void 0:C.text)||"",d=i!=null&&i.created_at?new Date(i.created_at):null,f=d&&!isNaN(d.getTime())?d.toLocaleDateString():"",m=(N=i==null?void 0:i.content)==null?void 0:N.permalink,h=(i==null?void 0:i.metrics)||{},p=i==null?void 0:i.platform,{emoji:g,label:y}=wut(i),v=o===0?"🥇":o===1?"🥈":o===2?"🥉":"";return s.jsxs("div",{className:"flex gap-3 p-3 border border-black rounded-lg bg-white",children:[s.jsxs("div",{className:"relative w-24 h-24 flex-shrink-0",children:[s.jsx("div",{className:"w-full h-full border border-black overflow-hidden rounded-md bg-gray-50",children:l?s.jsx("img",{src:l,alt:"post",className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-400",children:"No image"})}),v&&s.jsx("div",{className:"absolute -top-2 -right-2 w-9 h-9 bg-white border border-black rounded-md flex items-center justify-center shadow-sm z-10",children:s.jsx("span",{className:"text-2xl leading-none","aria-hidden":"true",children:v})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("p",{className:"flex-1 min-w-0 text-sm font-medium text-gray-900 line-clamp-2 overflow-hidden",children:u||r("analytics.topPosts.noText","No text")}),m&&s.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-600 hover:underline flex-shrink-0 ml-2",children:r("analytics.topPosts.view","Open")})]}),s.jsxs("div",{className:"mt-1 text-xs text-gray-500 flex items-center gap-2",children:[s.jsx("span",{children:f}),p&&s.jsx("span",{className:"group relative inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-white border border-gray-300 text-gray-700",children:s.jsx(cr,{platform:p,size:12})}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-primary-50 border border-primary-200 text-primary-700",children:[g," ",y]})]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:["likes"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"❤️"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.likes}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.likes","Likes")})]}),"comments"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"💬"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.comments}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.comments","Comments")})]}),"shares"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔗"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.shares}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.shares","Shares")}
3996)]}),"clicks"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"👉"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.clicks}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r(p==="facebook"?"analytics.metrics.pageClicks":"analytics.metrics.clicks",p==="facebook"?"Page Clicks":"Clicks")})]}),"views"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"👁️"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.views}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.views","Views")})]}),"unique_views"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔍"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:h.unique_views}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-primary-100 text-gray-900 text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.uniqueViews","Unique Views")})]}),"engagement_rate"in h&&s.jsxs("span",{className:"group relative inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border border-black bg-white",children:[s.jsx("span",{className:"text-[13px]",children:"🔥"})," ",s.jsx("strong",{className:"font-semibold",style:{fontFamily:"Bricolage Grotesque, ui-sans-serif, system-ui"},children:`${Math.round(typeof h.engagement_rate=="number"?h.engagement_rate:Number(h.engagement_rate||0))}%`}),s.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 bg-gray-900 text-white text-[10px] rounded shadow opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-20",children:r("analytics.metrics.engagementRate","Engagement Rate")})]})]})]})]},i.id)})})]})},Nut=({activeBrandId:e,onBrandChange:t,brands:r})=>{const{t:n}=Te(),a=[{id:"",name:n("brandDropdown.allBrands","All Brands")},...r];return s.jsx("div",{className:"mb-4 overflow-x-auto",children:s.jsx("div",{className:"flex border-b border-gray-200 min-w-max lg:min-w-0",children:a.map(i=>s.jsx("button",{onClick:()=>t(i.id),className:`px-3 lg:px-4 py-2 font-medium text-sm flex items-center gap-2 whitespace-nowrap ${e===i.id?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:i.id===""?s.jsxs(s.Fragment,{children:[s.jsx(NE,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden lg:inline",children:i.name})]}):i.logo?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:i.logo,alt:i.name,className:"w-4 h-4 rounded object-cover"}),s.jsx("span",{className:"hidden lg:inline",children:i.name})]}):s.jsxs(s.Fragment,{children:[s.jsx(Jr,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden lg:inline",children:i.name})]})},i.id||"all"))})})},W9=({personas:e})=>{const{t}=Te();if(!Array.isArray(e)||e.length===0)return null;const r=a=>{if(!a)return"🌐";switch(a.toLowerCase()){case"en":case"en-gb":return"🇬🇧";case"en-us":return"🇺🇸";case"fr":return"🇫🇷";case"de":return"🇩🇪";case"es":return"🇪🇸";case"it":return"🇮🇹";case"pt":return"🇵🇹";case"pt-br":return"🇧🇷";case"nl":return"🇳🇱";case"pl":return"🇵🇱";case"ru":return"🇷🇺";case"zh":case"zh-cn":return"🇨🇳";case"zh-tw":return"🇹🇼";case"ja":return"🇯🇵";case"ko":return"🇰🇷";case"ar":return"🇸🇦";case"tr":return"🇹🇷";case"hi":return"🇮🇳";default:return"🌐"}},n=a=>a?a.charAt(0).toUpperCase()+a.slice(1):"";return s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-3 sm:p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("dashboard.personas.title","Personas")}),s.jsx("span",{className:"bg-indigo-100 text-indigo-700 text-xs font-medium px-2.5 py-0.5 rounded-full",children:e.length})]}),s.jsx("div",{className:"grid grid-cols-1 gap-3",children:e.map(a=>
3996{const i=[a.firstName,a.lastName].filter(Boolean).join(" ")||t("dashboard.personas.unknown","Unknown"),o=Array.isArray(a.socialNetworks)?a.socialNetworks:[];return s.jsxs("div",{className:"flex gap-3 p-3 border border-black rounded-lg bg-white",children:[s.jsx("div",{className:"w-16 h-16 rounded-md overflow-hidden bg-gray-100 flex-shrink-0",children:a.avatarURL?s.jsx("img",{src:a.avatarURL,alt:i,className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:"👤"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:i}),Array.isArray(a.languages)&&a.languages.length>0&&s.jsx("span",{className:"ml-1 text-base leading-none flex-shrink-0",children:a.languages.slice(0,4).map((l,c)=>s.jsx("span",{className:"ml-0.5",children:r(l)},`${a.id}-lang-${c}`))})]}),a.country&&s.jsx("span",{className:"text-[11px] text-gray-500 ml-2 truncate",children:a.country})]}),a.jobTitle&&s.jsx("p",{className:"text-[11px] italic text-gray-600 truncate",children:a.jobTitle}),a.quote&&s.jsx("p",{className:"mt-1 text-xs text-gray-600 line-clamp-2",children:a.quote}),o.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:o.map((l,c)=>s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-white border border-gray-300 text-gray-700",children:[s.jsx(cr,{platform:W2(l.platform),size:12}),s.jsx("span",{className:"hidden sm:inline",children:n(l.frequency)})]},`${a.id}-${l.platform}-${c}`))})]})]},a.id)})})]})},Sut=({data:e})=>{const{t}=Te(),r=(e==null?void 0:e.brand)||{},n=r.goToMarketStrategy||{},a=c=>c?c.charAt(0).toUpperCase()+c.slice(1):"",i=Array.isArray(r.recommendedSocialNetworks)?r.recommendedSocialNetworks:[],o=[];if(n.marketScope){const c=(n.marketScope||"").toLowerCase();o.push({emoji:c==="local"?"🏠":c==="national"?"🇱🇺":"🌍",text:n.marketScope})}if(n.businessModel){const c=(n.businessModel||"").toUpperCase();o.push({emoji:c==="B2B"?"🏢":c==="B2C"?"👥":"💼",text:n.businessModel})}if(n.distributionType){const c=(n.distributionType||"").toLowerCase();o.push({emoji:c==="physical"?"🏪":c==="digital"?"💻":"🔄",text:n.distributionType})}return(Array.isArray(r.priorityMarkets)?r.priorityMarkets.filter(Boolean):[]).forEach(c=>o.push({emoji:"🎯",text:c})),s.jsxs("section",{className:"w-full bg-white rounded-xl border border-black shadow-lg p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t("brands.marketingStrategy","Marketing Strategy")}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(e==null?void 0:e.logo)&&s.jsx("img",{src:e.logo,alt:(e==null?void 0:e.name)||"Brand",className:"w-6 h-6 rounded object-cover"}),s.jsx("span",{className:"truncate",children:e==null?void 0:e.name})]})]}),o.length>0&&s.jsxs("div",{className:"mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.marketScope","Market Scope")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((c,u)=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-green-50 to-emerald-50 text-green-700 rounded-lg text-sm",children:[s.jsx("span",{className:"text-sm",children:c.emoji}),s.jsx("span",{className:"capitalize",children:c.text})]},`${c.text}-${u}`))})]}),Array.isArray(r.personaTypes)&&r.personaTypes.filter(Boolean).length>0&&s.jsxs("div",{className:"mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.personaTypes","Persona Types")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:r.personaTypes.filter(Boolean).map((c,u)=>s.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-blue-50 to-indigo-50 text-blue-700 rounded-lg text-sm",children:s.jsx("span",{children:c})},`${c}-${u}`))})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.contentTone","Content Tone")}),s.jsx("p",{className:"text-sm text-gray-800",children:a(r.contentTone)||t("common.notAvailable","N/A")})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.imageStyle","Image Style")}),s.jsx("p",{className:"text-sm text-gray-800",children:a(r.imageStyle)||t("common.notAvailable","N/A")})]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.usp","Unique Selling Proposition")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:(Array.isArray(r.usp)?r.usp.filter(
3996Boolean):[]).map((c,u)=>s.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-purple-50 to-indigo-50 text-indigo-700 rounded-lg text-sm",children:c},`${c}-${u}`))})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:t("brand.contentThemes","Content Themes")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:(Array.isArray(r.contentThemes)?r.contentThemes.filter(Boolean):[]).map((c,u)=>s.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-purple-50 to-indigo-50 text-indigo-700 rounded-lg text-sm",children:c},`${c}-${u}`))})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:t("brand.recommendedNetworks","Recommended Social Networks")}),i.length===0?s.jsx("p",{className:"text-sm text-gray-500",children:t("common.notAvailable","N/A")}):s.jsx("div",{className:"flex flex-wrap gap-2",children:i.map((c,u)=>{const d=W2(c.platform);return s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] px-1.5 py-0.5 rounded-full bg-white border border-gray-300 text-gray-700",children:[s.jsx(cr,{platform:d,size:12}),s.jsx("span",{className:"hidden sm:inline",children:c.frequency||""})]},`${c.platform}-${u}`)})})]})]})},Cut=()=>{var $,H;const{t:e}=Te(),{user:t}=Ps(),{data:r,isLoading:n}=oa(),[a,i]=b.useState("");b.useEffect(()=>{document.title=e("dashboard.pageTitle","Dashboard")},[e]),b.useEffect(()=>{var ue;const X=Array.isArray(r==null?void 0:r.brands)?r.brands:[];if(X.length===1){const le=((ue=X[0])==null?void 0:ue.id)||"";le&&a!==le&&i(le)}},[r,a]);const o=t!=null&&t.name?t.name.split(" ")[0]:"",l=o.charAt(0).toUpperCase()+o.slice(1),c=e("dashboard.title","Hello {{firstName}}, Here's your Social Media overview",{firstName:l||"there"}),u=e("dashboard.subtitle","This is your content command center. Track, plan and optimize your content with the help of AI insights and recommendations."),[d,f]=b.useState(null),[m,h]=b.useState(!1),[p,g]=b.useState(null),y=m||!d&&!p,[v,x]=b.useState([]),[j,C]=b.useState({}),[N,S]=b.useState([]),[M,k]=b.useState({}),[I,T]=b.useState({}),[L,R]=b.useState([]),[_,B]=b.useState({}),[z,D]=b.useState(!1);b.useEffect(()=>{let X=!1;return(async()=>{var ne,J,G,Q;h(!0),g(null);const le=600,ae=Date.now();let te=null;try{const W=(typeof(navigator==null?void 0:navigator.language)=="string"?navigator.language.split("-")[0]:"en")||"en",Y=await but(W);if(console.log("[Dashboard] /management/dashboard response",Y),X)return;const q=Array.isArray(Y==null?void 0:Y.brands)?Y.brands:[],Z={},me=[],we={},he={},ie=[],ye={};for(const pe of q){const ce=((ne=pe==null?void 0:pe.followers)==null?void 0:ne.followers)||null,xe=((J=pe==null?void 0:pe.metrics)==null?void 0:J.byPlatform)||{};let Ee=ce?{...ce}:{total:(G=pe==null?void 0:pe.metrics)==null?void 0:G.totalFollowers,youtube:xe.youtube,facebook:xe.facebook,instagram:xe.instagram,linkedin:xe.linkedin,tiktok:xe.tiktok};if(typeof Ee.total!="number"){const fe=Object.entries(Ee).filter(([je])=>je!=="total").reduce((je,[,We])=>Array.isArray(We)?je+We.reduce((yt,gt)=>yt+(typeof gt=="number"?gt:0),0):typeof We=="number"?je+We:je,0);Ee.total=fe}Z[pe.id]={brandName:pe.name,brandLogo:pe.logo,followers:Ee};try{ye[pe.id]={id:pe.id,name:pe.name,logo:pe.logo,brand:pe.brand||{}}}catch{}if(Array.isArray(pe==null?void 0:pe.recentDrafts)){const fe=pe.recentDrafts.map(je=>({id:je.id,content:je.content||je.title||"",media:je.media||null,platforms:Array.isArray(je.platforms)?je.platforms:je.platforms?Object.keys(je.platforms):[],brandId:je.brandId||pe.id,brandName:je.brandName||pe.name,brandLogo:je.brandLogo||pe.logo}));me.push(...fe),we[pe.id]=fe}else we[pe.id]=[];const Ye=Array.isArray(pe==null?void 0:pe.topPosts)?pe.topPosts:Array.isArray((Q=pe==null?void 0:pe.topPosts)==null?void 0:Q.posts)?pe.topPosts.posts:[];if(Array.isArray(Ye)&&Ye.length>0&&(Ye.forEach(fe=>{!fe.platform&&typeof fe.platformType=="string"&&(fe.platform=fe.platformType.toLowerCase())}),S(fe=>fe.length>0?fe:Ye),k(fe=>({...fe,[pe.id]:Ye}))),Array.isArray(pe==null?void 0:pe.personas)){const fe=pe.personas.map(je=>({...je,brandId:pe.id,brandName:pe.name,brandLogo:pe.logo}));he[pe.id]=fe,ie.push(...fe)}else he[pe.id]=[]}console.log("[Dashboard] Parsed followers brands (normalized)",Z),f({brands:Z}),x(me),C(we),T(he),R(ie),B(ye)}catch(W){X||g((W==null?void 0:W.message)||"Failed to load")}finally{const W=Date.now()-ae,Y=Math.max(le-W,0),q=()=>{X||h(!1)};return Y>0?te=setTimeout(q,Y):q(),()=>{te&&clearTimeout(te)}}})(),()=>{X=!0}},[]);const A=b.useMemo(()=>{var ae;const X=[],ue=(d==null?void 0:d.brands)||{};for(const[te,ne]of Object.entries(ue)){const J=ne.followers||{},G=[];for(const[Q,W]of Object.entries(J)){if(Q==="total")continue;let Y=null;Array.isArray(W)?Y=W.reduce((q,Z)=>q+(typeof Z=="number"?Z:0),0):typeof W=="number"?Y=W:Y=null,typeof Y=="number"&&!Number.isNaN(Y)&&G.push({platform:Q,followers:Y})}X.push({brandId:te,brandName:ne.brandName,brandLogo:ne.brandLogo,totalFollowers:((ae=ne.followers)==null?void 0:ae.total)??0,platforms:G})}const le=X.sort((te,ne)=>(ne.totalFollowers||0)-(te.totalFollowers||0));return a?le.filter(te=>te.brandId===a):le},[d,a]),P=b.useMemo(()=>{var ue,le;const X=(d==null?void 0:d.brands)||{};return a&&X[a]?Number(((le=(ue=X[a])==null?void 0:ue.followers)==null?void 0:le.total)??0):Object.values(X).reduce((ae,te)=>{var ne;return ae+Number(((ne=te==null?void 0:te.followers)==null?void 0:ne.total)??0)},0)},[d,a]),E=a?((($=I[a])==null?void 0:$.length)||0)>0:L.length>0,F=!!(a&&_[a]);return s.jsxs(rs,{title:e("dashboard.pageTitle","Dashboard"),subtitle:e("dashboard.pageSubtitle","Have a quick overview of your social media"),actions:s.jsxs("button",{onClick:()=>D(!0),className:"inline-flex items-center px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors",children:[s.jsx(tn,{className:"w-5 h-5 mr-2"}),e("sidebar.createContent","Create Content")]}),children:[s.jsxs("div",{className:"mb-4 grid grid-cols-1 lg:grid-cols-5 ga
3996p-4",children:[s.jsxs("div",{className:"lg:col-span-4 rounded-xl border border-primary-200 p-6 bg-primary-50",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-1",children:c}),s.jsx("p",{className:"text-gray-700",children:u})]}),s.jsx("div",{className:"lg:col-span-1",children:s.jsxs("div",{className:"rounded-xl border border-primary-600 shadow-lg bg-white p-4 h-full flex flex-col justify-center",children:[s.jsx("div",{className:"flex items-center justify-between mb-1",children:s.jsx("h3",{className:"text-sm font-medium text-gray-500",children:e("analytics.metrics.followersTotal","Total Followers")})}),s.jsx("div",{className:"text-4xl font-bold text-gray-900 text-right",children:y?s.jsx("span",{className:"inline-block w-20 h-7 bg-gray-200 rounded animate-pulse"}):P.toLocaleString()})]})})]}),Array.isArray(r==null?void 0:r.brands)&&r.brands.length>1&&(()=>{const X=ae=>{const te=((d==null?void 0:d.brands)||{})[ae],ne=(te==null?void 0:te.followers)||{};let J=0;for(const[G,Q]of Object.entries(ne)){if(G==="total")continue;let W=0;Array.isArray(Q)?W=Q.reduce((Y,q)=>Y+(typeof q=="number"?q:0),0):typeof Q=="number"&&(W=Q),W>0&&(J+=1)}return J},le=((r==null?void 0:r.brands)||[]).slice().sort((ae,te)=>X(te.id)-X(ae.id)).map(ae=>({id:ae.id,name:ae.name,logo:ae.logo}));return s.jsx(Nut,{activeBrandId:a,onBrandChange:i,brands:le})})(),p&&s.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 mb-4 text-sm text-red-700",children:p}),y?s.jsx("div",{className:"space-y-8",children:Array(2).fill(0).map((X,ue)=>s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-md bg-gray-200 animate-pulse"}),s.jsx("div",{className:"h-5 w-64 bg-gray-200 rounded animate-pulse"})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:Array(5).fill(0).map((le,ae)=>s.jsxs("div",{className:"rounded-xl p-4 border border-black bg-white",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-6 w-6 rounded bg-gray-200 animate-pulse"}),s.jsx("div",{className:"h-4 w-32 rounded bg-gray-200 animate-pulse"})]}),s.jsx("div",{className:"mt-2 flex justify-end",children:s.jsx("div",{className:"h-7 w-16 rounded bg-gray-200 animate-pulse"})})]},ae))}),s.jsx("div",{className:"mt-6 border-t border-gray-200"})]},ue))}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-8",children:A.length===0?s.jsx("div",{className:"mt-6",children:s.jsx(P0,{message:e("analytics.connectAccountFirst","Connect a social media account to view analytics")})}):A.map(X=>{const ue=["youtube","facebook","instagram","linkedin","tiktok"],le=te=>{const ne=X.platforms.find(J=>J.platform===te);return ne?typeof ne.followers=="number"?ne.followers:ne.followers??0:0},ae=te=>{switch(te){case"youtube":return e("dashboard.metrics.youtubeSubscribers","YouTube Subscribers");case"facebook":return e("dashboard.metrics.facebookFollowers","Facebook Followers");case"instagram":return e("dashboard.metrics.instagramFollowers","Instagram Followers");case"linkedin":return e("dashboard.metrics.linkedinFollowers","LinkedIn Followers");case"tiktok":return e("dashboard.metrics.tiktokFollowers","TikTok Followers");default:return te}};return s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[X.brandLogo?s.jsx("img",{src:X.brandLogo,alt:X.brandName,className:"w-8 h-8 rounded-md object-cover"}):s.jsx("div",{className:"w-8 h-8 rounded-md bg-gray-100 flex items-center justify-center",children:s.jsx(Jr,{className:"w-5 h-5 text-gray-500"})}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:X.brandName})]}),(()=>{const te=ue.filter(ne=>X.platforms.some(J=>J.platform===ne&&typeof J.followers=="number"));return te.length===0?s.jsx("div",{className:"mt-2",children:s.jsx(P0,{message:e("analytics.connectAccountFirst","Connect a social media account to view analytics")})}):s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[te.map(ne=>{const J=le(ne);return s.jsxs("div",{className:"rounded-xl p-4 border border-black shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"p-2 rounded-lg bg-blue-50",children:s.jsx(cr,{platform:ne,size:20})}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:ae(ne)})]}),s.jsx("div",{className:"mt-2 text-3xl font-bold text-gray-900 text-right",children:J===null?",":J.toLocaleStr
3996ing()})]},ne)}),!a&&s.jsxs("div",{className:"rounded-xl p-4 border border-primary-600 shadow-lg hover:shadow-xl transition-shadow bg-white",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"p-2 rounded-lg bg-blue-50",children:s.jsx(Jr,{className:"w-5 h-5 text-gray-700"})}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:e("analytics.metrics.followersTotal","Total Followers")})]}),s.jsx("div",{className:"mt-2 text-3xl font-bold text-gray-900 text-right",children:(X.totalFollowers||0).toLocaleString()})]})]})})(),(()=>{const te=ue.filter(J=>X.platforms.some(G=>G.platform===J&&typeof G.followers=="number")),ne=te.some(J=>{const G=le(J);return typeof G=="number"&&G>0});return te.length===0||!ne?null:s.jsx("div",{className:"mt-4 flex justify-center",children:s.jsxs("a",{href:"/analytics",className:"inline-flex items-center px-4 py-2 bg-white border border-primary-600 text-primary-700 rounded-lg shadow-sm hover:bg-primary-50 transition-colors",children:[s.jsx(xE,{className:"w-4 h-4 mr-2"}),e("dashboard.seeAnalytics","See my analytics")]})})})(),s.jsx("div",{className:"mt-6 border-t border-gray-200"})]},X.brandId)})}),s.jsxs("div",{className:"mt-4 grid grid-cols-1 lg:grid-cols-3 gap-4",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(jut,{posts:a?M[a]||[]:N,onCreate:()=>D(!0)})}),s.jsx("div",{className:"lg:col-span-1",children:a&&_[a]?s.jsx(Sut,{data:_[a]}):s.jsx(V9,{drafts:a?j[a]||[]:v,onCreate:()=>D(!0)})}),!F&&(a?(((H=I[a])==null?void 0:H.length)||0)>0:L.length>0)&&s.jsx("div",{className:"lg:col-span-3",children:s.jsx(W9,{personas:a?I[a]||[]:L})})]}),F&&s.jsxs("div",{className:"mt-4 grid grid-cols-1 lg:grid-cols-3 gap-4",children:[s.jsx("div",{className:"lg:col-span-1",children:E?s.jsx(W9,{personas:a?I[a]||[]:L}):null}),s.jsx("div",{className:E?"lg:col-span-2":"lg:col-span-3",children:s.jsx(V9,{drafts:a?j[a]||[]:v,onCreate:()=>D(!0)})})]}),s.jsx(np,{isOpen:z,onClose:()=>D(!1),onCreateWithAI:()=>{D(!1),window.location.href="/content-creation"},onCreateManually:()=>{D(!1),window.location.href="/posts/new"}})]})]})},kut=async()=>{const e=Qe.currentUser;if(!e)throw new Error("User not authenticated");const t=await e.getIdToken(),r=await fetch("https://api.socialness.ai/management/integrations",{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch integrations: ${r.status}`);return await r.json()},Mut=()=>Wa({queryKey:["integrations"],queryFn:kut,staleTime:5*60*1e3,gcTime:10*60*1e3,retry:3}),Iut=e=>{if(!e)return"bg-gray-100 text-gray-700 border-gray-200";switch(e.toLowerCase()){case"connected":case"active":return"bg-green-100 text-green-700 border-green-200";case"disconnected":case"inactive":return"bg-red-100 text-red-700 border-red-200";
3996case"pending":return"bg-orange-100 text-orange-700 border-orange-200";case"available":return"bg-green-100 text-green-700 border-green-200";case"beta":return"bg-blue-100 text-blue-700 border-blue-200";case"coming_soon":return"bg-purple-100 text-purple-700 border-purple-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}},Eut=(e,t)=>{if(!e)return"";const r=t(`integrations.categories.${e}`,e.replace(/_/g," "));return r.charAt(0).toUpperCase()+r.slice(1)},Tut=(e,t)=>{if(!e)return"";const r=t(`integrations.statuses.${e}`,e.replace(/_/g," "));return r.charAt(0).toUpperCase()+r.slice(1)},Aut=async(e,t,r,n)=>{try{r(!0);const a=await ul.get(`/management/integrations/${e}/config`);a.data.success&&a.data.authUrl?window.location.href=a.data.authUrl:t(n("integrations.configError","Failed to configure integration. Please try again."),"error")}catch(a){console.error("Error configuring integration:",a),t(n("integrations.configError","Failed to configure integration. Please try again."),"error")}finally{r(!1)}},Put=({isOpen:e,onClose:t,onConfirm:r,integrationName:n,integrationLogo:a,isLoading:i})=>{const{t:o}=Te();return e?s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25",onClick:t}),s.jsxs("div",{className:"relative bg-white rounded-xl border border-black shadow-xl max-w-md w-full p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Jx,{className:"w-5 h-5"}),s.jsx("h2",{className:"text-xl font-semibold",children:o("integrations.disconnect.title","Disconnect Integration")})]}),s.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500",children:"×"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-700",children:o("integrations.disconnect.message","Are you sure you want to disconnect {{integrationName}}?",{integrationName:n})}),s.jsxs("div",{className:"flex items-center gap-3 my-4",children:[a?s.jsx("img",{src:a,alt:n,className:"w-12 h-12 rounded-lg object-contain bg-gray-100"}):s.jsx("div",{className:"w-12 h-12 rounded-lg bg-gray-100 flex items-center justify-center",children:s.jsx(I2,{className:"w-6 h-6 text-gray-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-700 font-semibold",children:n}),s.jsx("p",{className:"text-sm text-gray-500",children:o("integrations.connected","Connected")})]})]}),s.jsx("p",{className:"text-sm text-red-600",children:o("integrations.disconnect.warning","This action cannot be undone. You will need to reconnect it to use its features.")})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-800",disabled:i,children:o("common.cancel","Cancel")}),s.jsx("button",{onClick:()=>{r(),t()},disabled:i,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700 disabled:opacity-50",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-4 h-4 mr-2 animate-spin"}),o("common.disconnecting","Disconnecting...")]}):o("common.confirm","Confirm")})]})]})]})}):null},_ut=({integration:e})=>{const{t}=Te(),{showToast:r}=bc(),[n,a]=b.useState(!1),[i,o]=b.useState(!1),[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,m]=b.useState([]),[h,p]=b.useState(!1),g=U.useMemo(()=>e.category?Array.isArray(e.category)?e.category:typeof e.category=="string"?[e.category]:[]:[],[e.category]),y=async()=>{var j;o(!1);try{a(!0);const C=await ul.get(`/management/integrations/${((j=e.name)==null?void 0:j.toLowerCase())||""}/config`);C.data.success&&C.data.authUrl?(sessionStorage.setItem("oauth_redirect_after_auth","/integrations"),sessionStorage.setItem("oauth_redirect_timestamp",Date.now().toString()),window.location.href=C.data.authUrl):r(t("integrations.configError","Failed to configure integration. Please try again."),"error")}catch(C){console.error("Error configuring integration:",C),r(t("integrations.configError","Failed to configure integration. Please try again."),"error")}finally{a(!1)}},v=async()=>{o(!1),c(!0)},x=async()=>{var j;d(!0);try{const C=await ul.post(`/management/integrations/${((j=e.name)==null?void 0:j.toLowerCase())||""}/revoke`);if(C.data.success)r(t("integrations.disconnect.success","Integration disconnected successfully"),"success"),window.location.reload();else throw new Error(C.data.message||"Failed to disconnect integration")}catch(C){console.error("Error disconnecting integration:",C),r(t("integrations.disconnect.error","Failed to disconnect integration. Please try again."),"error")}finally{d(!1),c(!1)}};return s.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm hover:shadow-md transition-shadow p-6 relative",children:[e.status&&(e.status.toLowerCase()==="beta"||e.status.toLowerCase()==="available")&&s.jsx("div",{className:"absolute top-6 right-6",children:e.accounts&&e.accounts.length>0?s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>o(!i),className:"flex items-center justify-center gap-2 px-3 py-1.5 bg-transparent text-green-600 text-sm font-medium hover:bg-green-50 rounded-lg transition-colors",children:[s.jsxs("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M7 12l3 3L17 9"})]}),t("integrations.connected","Connected"),s.jsx(M2,{className:"w-4 h-4 ml-1"})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),s.jsx("div",{className:"absolute right-0 mt-2 w-48 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsxs("div",{className:"py-1",children:[s.jsx("button",{onClick:y,disabled:n,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-purple-50 disabled:opacity-50",children:n?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-4 h-4 mr-2 animate-spin"}),t("integrations.reconnecting","Reconnecting...")]}):s.jsxs(s.Fragment,{children:[s.jsx(ai,{className:"w-4 h-4 mr-2"}),t("integrations.reconnect","Reconnect account")]})}),s.jsxs("button",{onClick:v,className:"flex items-center w-full px-4 py-2 text-sm text-red-600 hover:bg-red-50",children:[s.jsx(Jx,{className:"w-4 h-4 mr-2"}),t("integrations.disconnect","Disconnect account")]})]})})]})]}):s.jsx("button",{onClick:()=>{var j;return Aut(((j=e.name)==null?void 0:j.toLowerCase())||"",r,a,t)},disabled:n,className:"flex items-center justify-center gap-2 px-3 py-1.5 bg-primary-600 text-white text-xs font-medium rounded-lg hover:bg-primary-700 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:n?s.jsxs(s.Fragment,{children:[s.jsx(Rn,{className:"w-3 h-3 animate-spin"}),t("integrations.configuring","Configuring...")]}):s.jsxs(s.Fragment,{children:[s.jsx(C2,{className:"w-3 h-3"}),t("integrations.connect","Connect")]})})}),s.jsx("div",{className:"flex justify-start mb-4 pr-20",children:s.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden bg-gray-100 flex items-center justify-center",children:e.logoUrl?s.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-full h-full object-contain",onError:j=>{const C=j.target;C.style.display="none";const N=C.parentElement;N&&(N.innerHTML='<div class="w-8 h-8 text-gray-400"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" /></svg></div>')}}):s.jsx(I2,{className:"w-8 h-8 text-gray-400"})})}),s.jsx("div",{className:"text-left mb-3",children:s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.name})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[g.length>0&&s.jsx(s.Fragment,{children:g.map((j,C)=>s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-700",children:Eut(j,t)},C))}),s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${Iut(e.status||"")}`,children:Tut(e.status||"",t)})]}),e.description&&s.jsx("div",{className:"text-left mb-4",children:s.jsx("p",{className:"text-sm text-gray-500 line-clamp-3",children:e.description})}),s.jsx(Put,{isOpen:l,onClose:()=>
3996c(!1),onConfirm:x,integrationName:e.name||"this integration",integrationLogo:e.logoUrl,isLoading:u})]})},Lut=[{id:"available",label:"Available",emoji:"🔵",description:"Integration is available for connection. Click to set up and start using it."},{id:"beta",label:"Beta",emoji:"🧪",description:"This integration is in beta testing phase. Features may be limited or unstable."},{id:"coming_soon",label:"Coming Soon",emoji:"🚀",description:"This integration is under development and will be available soon."},{id:"maintenance",label:"Maintenance",emoji:"🔧",description:"Integration is temporarily unavailable due to maintenance. Check back later."},{id:"disconnected",label:"Disconnected",emoji:"❌",description:"Integration was connected but is now disconnected. Reconnect to restore functionality."},{id:"pending",label:"Pending",emoji:"⏳",description:"Integration setup is in progress. Please wait while we complete the connection."}],Dut={social_media:{label:"Social Media",emoji:"📱",description:"Connect your social media accounts to manage posts, analytics, and engagement across platforms."},analytics:{label:"Analytics",emoji:"📊",description:"Track performance, audience insights, and engagement metrics for your content."},email_marketing:{label:"Email Marketing",emoji:"📧",description:"Manage email campaigns, subscriber lists, and newsletter automation."},crm:{label:"CRM",emoji:"👥",description:"Customer relationship management tools to organize contacts and interactions."},payment:{label:"Payment",emoji:"💳",description:"Payment processors and financial tools for transactions and billing."},productivity:{label:"Productivity",emoji:"⚡",description:"Tools to streamline workflows, task management, and team collaboration."},design:{label:"Design",emoji:"🎨",description:"Creative tools for graphic design, content creation, and media editing."},communication:{label:"Communication",emoji:"💬",description:"Messaging, chat, and communication platforms for team coordination."},automation:{label:"Automation",emoji:"🤖",description:"Workflow automation, API integrations, and process optimization tools."},link_shortener:{label:"Link Shortener",emoji:"🔗",description:"URL shortening and link management tools for tracking and analytics."}},Out=()=>{var C;const{t:e}=Te(),t=pn(),r=vs(),[n,a]=b.useState(""),[i,o]=b.useState([]),[l,c]=b.useState([]),[u,d]=b.useState(!1),[f,m]=b.useState(!1),{data:h,isLoading:p,error:g}=Mut(),y=((C=h==null?void 0:h.data)==null?void 0:C.integrations)||[];b.useEffect(()=>
3996{const N=new URLSearchParams(r.search),S=N.get("platform"),M=N.get("status"),k=N.get("userId");if(S&&M==="success"&&k){console.log("🔄 Integrations: Detected OAuth redirect for platform:",S);const I=sessionStorage.getItem("oauth_redirect_after_auth");if(I&&I!=="/integrations"){console.log("🔄 Integrations: Redirecting to stored path:",I),sessionStorage.removeItem("oauth_redirect_after_auth"),sessionStorage.removeItem("oauth_redirect_timestamp"),t(I,{replace:!0});return}}},[r.search,t]),b.useEffect(()=>{document.title=e("integrations.title","Integrations")},[e]);const v=U.useMemo(()=>{const N=new Set;return y.forEach(S=>{S.category&&(Array.isArray(S.category)?S.category.forEach(M=>N.add(M)):typeof S.category=="string"&&N.add(S.category))}),Array.from(N).sort()},[y]),x=U.useMemo(()=>v.map(N=>{const S=Dut[N];if(S)return{id:N,label:e(`integrations.categories.${N}`,S.label),emoji:S.emoji,description:e(`integrations.categories.${N}Desc`,S.description)};const M=N.replace(/_/g," ").replace(/\b\w/g,k=>k.toUpperCase());return{id:N,label:e(`integrations.categories.${N}`,M),emoji:"📁",description:e(`integrations.categories.${N}Desc`,`${M} integration tools and services`)}}),[v,e]),j=U.useMemo(()=>y.filter(N=>{const S=!n||N.name&&N.name.toLowerCase().includes(n.toLowerCase())||N.description&&N.description.toLowerCase().includes(n.toLowerCase()),M=i.length===0||N.status&&i.includes(N.status),k=l.length===0||(N.category?Array.isArray(N.category)?N.category.some(T=>l.includes(T)):typeof N.category=="string"?l.includes(N.category):!1:!1),I=!f||N.accounts&&N.accounts.length>0;return S&&M&&k&&I}),[y,n,i,l,f]);return p?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsxs("div",{className:"w-[95%] mx-auto py-8",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/3 mb-2 animate-pulse"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 animate-pulse"})]}),s.jsxs("div",{className:"mb-6 flex flex-col md:flex-row gap-4",children:[s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg flex-1 animate-pulse"}),s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-48 animate-pulse"}),s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-48 animate-pulse"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:Array.from({length:8}).map((N,S)=>s.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6 animate-pulse",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[s.jsx("div",{className:"w-12 h-12 bg-gray-200 rounded-lg"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"h-5 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-full"})]})]}),s.jsxs("div",{className:"flex gap-2 mb-4",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-16"}),s.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-20"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-16"}),s.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-20"})]})]},S))})]})}):g?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8 flex items-center justify-center h-96",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:"Failed to load integrations"}),s.jsx("p",{className:"text-gray-500",children:g.message})]})})}):s.jsxs(s.Fragment,{children:[s.jsxs(rs,{title:e("integrations.title","Integrations"),subtitle:e("integrations.subtitle","Connect your favorite tools and services"),children:[s.jsxs("div",{className:"mb-6 flex flex-col md:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx($i,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),s.jsx("input",{type:"text",placeholder:e("integrations.searchPlaceholder","Search integrations..."),value:n,onChange:N=>a(N.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),(()=>{const N=i.length+l.length+(f?1:0);return s.jsx("div",{className:"relative",children:s.jsxs("button",{onClick:()=>d(!u),className:"inline-flex items-center px-4 py-2 border border-gray-300 rounded-lg bg-white text-sm font-medium text-gray-700 hover:text-primary-600","aria-expanded":u,children:[s.jsx(k2,{className:"w-4 h-4 mr-2 text-primary-500"}),e("integrations.filters","Filtres"),N>0&&s.jsx("span",{className:"ml-2 inline-flex items-center justify-center rounded-full bg-primary-600 text-white text-xs w-5 h-5",children:N})]})})})()]}),s.jsx("div",{className:"mb-6",children:s.jsx("p",{className:"text-sm text-gray-500",children:e("integrations.resultsCount",{count:j.length,total:y.length,defaultValue:"Showing {{count}} of {{total}} integrations"})})}),j.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-6",children:j.map(N=>s.jsx(_ut,{integration:N},N.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx(I2,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:e("integrations.noResults","N
3996o integrations found")}),s.jsx("p",{className:"text-gray-500",children:n||i.length>0||l.length>0?e("integrations.noResultsFiltered","Try adjusting your search or filter criteria"):e("integrations.noIntegrations","No integrations are available at the moment")})]})]}),u&&s.jsxs("div",{className:"fixed inset-0 z-50",children:[s.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:()=>d(!1)}),s.jsx("div",{className:"absolute right-0 top-0 h-full w-full sm:w-[380px] bg-white shadow-2xl border-l border-gray-200 transform transition-transform duration-300 ease-out",children:s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"px-5 py-4 border-b border-gray-200 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e("integrations.filters","Filtres")}),s.jsx("button",{onClick:()=>d(!1),className:"text-gray-500 hover:text-gray-700","aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[s.jsx("div",{children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("button",{type:"button",onClick:()=>m(!f),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 mt-1 ${f?"bg-primary-600":"bg-gray-200"}`,children:s.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${f?"translate-x-6":"translate-x-1"}`})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0",children:"✅"}),s.jsx("span",{className:"font-semibold",children:e("integrations.showOnlyConnected","Show only connected")})]}),s.jsx("div",{className:"text-[11px] text-gray-500 mt-0.5 leading-snug",children:e("integrations.showOnlyConnectedDesc","Only show integrations that have connected accounts")})]})]})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("integrations.filterByStatus","Filter by Status")}),s.jsx("div",{className:"space-y-3",children:Lut.map(N=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 rounded border-gray-300 text-primary-600",checked:i.includes(N.id),onChange:S=>{S.target.checked?o([...i,N.id]):o(i.filter(M=>M!==N.id))}}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0",children:N.emoji}),s.jsx("span",{className:"truncate font-semibold",children:e(`integrations.statuses.${N.id}`,N.label)})]}),s.jsx("div",{className:"text-[11px] text-gray-500 mt-0.5 leading-snug",children:e(`integrations.statuses.${N.id}Desc`,N.description)})]})]},N.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-3",children:e("integrations.filterByCategory","Filter by Category")}),s.jsx("div",{className:"space-y-3",children:x.map(N=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 rounded border-gray-300 text-primary-600",checked:l.includes(N.id),onChange:S=>{S.target.checked?c([...l,N.id]):c(l.filter(M=>M!==N.id))}}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-sm text-gray-900 flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0",children:N.emoji}),s.jsx("span",{className:"truncate font-semibold",children:N.label})]}),s.jsx("div",{className:"text-[11px] text-gray-500 mt-0.5 leading-snug",children:N.description})]})]},N.id))})]})]}),s.jsxs("div",{className:"px-5 py-4 border-t border-gray-200 flex items-center justify-between",children:[s.jsx("button",{type:"button",onClick:()=>{o([]),c([]),m(!1)},className:"px-4 py-2 text-sm rounded-lg text-gray-700 hover:text-primary-600",children:e("integrations.clearFilters","Clear all filters")}),s.jsx("div",{})]})]})})]})]})},Rut=({analytics:e,totalLinks:t,totalClicks:r})=>{const{t:n}=Te();return s.jsx("div",{className:"space-y-6 mb-8",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsx("div",{className:"bg-white rounded-xl border border-black p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:n("links.analytics.totalClicks","Total Clicks")}),s.jsx("p",{className:"text-2xl font-bold text-gray-900 mt-1",children:(r??e.totalClicks).toLocaleStr
3996ing()})]}),s.jsx("div",{className:"p-3 bg-primary-50 rounded-lg",children:s.jsx(C0,{className:"w-6 h-6 text-primary-600"})})]})}),s.jsx("div",{className:"bg-white rounded-xl border border-black p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:n("links.analytics.uniqueUsers","Unique Users")}),s.jsx("p",{className:"text-2xl font-bold text-gray-900 mt-1",children:e.uniqueUsers.toLocaleString()})]}),s.jsx("div",{className:"p-3 bg-green-50 rounded-lg",children:s.jsx(Jr,{className:"w-6 h-6 text-green-600"})})]})}),s.jsx("div",{className:"bg-white rounded-xl border border-black p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:n("links.analytics.totalLinks","Total Links")}),s.jsx("p",{className:"text-2xl font-bold text-gray-900 mt-1",children:t.toLocaleString()})]}),s.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:s.jsx(Ti,{className:"w-6 h-6 text-blue-600"})})]})})]})})},$ut=e=>{switch(e.toLowerCase()){case"active":return"bg-green-100 text-green-700 border-green-200";case"inactive":return"bg-red-100 text-red-700 border-red-200";
3996case"pending":return"bg-orange-100 text-orange-700 border-orange-200";case"expired":return"bg-gray-100 text-gray-700 border-gray-200";default:return"bg-blue-100 text-blue-700 border-blue-200"}},Fut=({link:e,onDelete:t,isDeleting:r,onDuplicate:n,onEditRequest:a,onQRCodeRequest:i,onUpdateStatus:o,isUpdatingStatus:l})=>{const{t:c,i18n:u}=Te(),[d,f]=b.useState(!1),[m,h]=b.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(e.newURL),f(!0),setTimeout(()=>f(!1),2e3)}catch(M){console.error("Failed to copy URL:",M)}},g=()=>{a(e),h(!1)},y=()=>{i(e),h(!1)},v=()=>{n(e),h(!1)},x=()=>{const M=e.status==="archived"?"active":"archived";o(e.id,M),h(!1)},j=()=>{t(e.id),h(!1)},C=e.status==="archived",N=C?c("common.activate","Activate"):c("common.archive","Archive"),S=C?c("common.activating","Activating..."):c("common.archiving","Archiving...");return s.jsxs(zG,{className:`relative ${r||l?"pointer-events-none":""}`,children:[(r||l)&&s.jsx("div",{className:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center z-10 rounded-xl",children:s.jsxs("div",{className:`flex items-center gap-3 ${r?"text-red-600":"text-gray-600"}`,children:[s.jsx("div",{className:`w-6 h-6 border-2 ${r?"border-red-600":"border-gray-600"} border-t-transparent rounded-full animate-spin`}),s.jsx("span",{className:"text-sm font-medium",children:r?c("common.deleting","Deleting..."):S})]})}),s.jsxs("div",{className:`flex items-start gap-4 ${r||l?"opacity-50":""} relative pr-14`,children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"w-12 h-12 rounded-lg overflow-hidden bg-gray-100 border border-black",children:s.jsx("img",{src:e.brandLogo,alt:e.brandName,title:e.brandName,className:"w-full h-full object-cover",onError:M=>{const k=M.target;k.src=`https://ui-avatars.com/api/?name=${encodeURIComponent(e.brandName)}&background=f3f4f6&color=6b7280&size=48`}})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex flex-col items-start gap-3 mb-3 md:flex-row md:items-center md:gap-4",children:[s.jsxs("div",{className:"flex-1 w-full",children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 mb-2",children:[s.jsx("a",{href:e.newURL,target:"_blank",rel:"noopener noreferrer",className:"text-lg font-medium text-primary-600 break-all hover:underline cursor-pointer",children:e.newURL}),s.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:s.jsx("button",{onClick:p,className:`w-8 h-8 flex items-center justify-center rounded border transition-colors flex-shrink-0 ${d?"bg-green-50 hover:bg-green-100 border-green-200":"bg-primary-50 hover:bg-primary-100 border-primary-200"}`,title:d?c("common.copied","Copied!"):c("links.copyUrl","Copy URL"),children:d?s.jsx(Ba,{className:"w-4 h-4 text-green-600"}):s.jsx(Iu,{className:"w-4 h-4 text-primary-600"})})})]}),s.jsx("div",{className:"mb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Jy,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),s.jsx("a",{href:e.oldURL,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-500 break-all hover:underline hover:text-gray-700 cursor-pointer transition-colors",children:e.oldURL})]})})]}),s.jsx("div",{className:"flex-shrink-0 md:self-center w-full md:w-auto",children:s.jsxs("div",{className:"flex items-center justify-center gap-1 px-2.5 py-1 bg-gray-50 border border-black rounded-lg",children:[s.jsx(C0,{className:"w-4 h-4 text-gray-600"}),s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:e.clickCount.toLocaleString()}),s.jsx("span",{className:"text-sm text-gray-500",children:c("links.clicks","clicks")})]})})]})," ",s.jsxs("div",{className:"flex flex-row items-start justify-between md:items-center gap-3 pt-3 border-t border-gray-100",children:[s.jsxs("div",{className:"flex flex-col items-start gap-3 md:flex-row md:items-center",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 rounded-full overflow-hidden bg-gray-100",children:s.jsx("img",{src:e.userPicture,alt:e.userName,className:"w-full h-full object-cover",onError:M=>{const k=M.target;
3996k.src=`https://ui-avatars.com/api/?name=${encodeURIComponent(e.userName)}&background=f3f4f6&color=6b7280&size=24`}})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-gray-500",children:c("links.createdBy","Created by")}),s.jsx("p",{className:"text-xs font-medium text-gray-700",children:e.userName})]})]}),s.jsxs("div",{children:[e.lastClicked?s.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[s.jsx(vo,{className:"w-3 h-3"}),c("links.lastClicked","Last clicked")," ",lu(e.lastClicked,u.language,{dateFormat:"PP"})]}):s.jsx("div",{className:"h-4"}),s.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[s.jsx(vo,{className:"w-3 h-3"}),"Created on ",lu(e.createdAt,u.language,{dateFormat:"PP"})]})]})]}),s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${$ut(e.status)}`,children:c(`links.statuses.${e.status}`,e.status)})]})]})," ",s.jsxs("div",{className:"absolute top-2 right-4",children:[s.jsx("button",{onClick:()=>h(!m),className:"p-2 rounded-lg hover:bg-gray-100 transition-colors",children:s.jsx(M2,{className:"w-5 h-5 text-gray-500"})}),m&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>h(!1)}),s.jsx("div",{className:"absolute right-0 mt-2 w-48 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-20",children:s.jsxs("div",{className:"py-1",children:[s.jsxs("button",{onClick:g,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[s.jsx(S0,{className:"w-4 h-4 mr-3"}),c("common.edit","Edit")]}),s.jsxs("button",{onClick:y,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[s.jsx(D7,{className:"w-4 h-4 mr-3"}),c("qrCode.title","QR Code")]}),s.jsxs("button",{onClick:v,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[s.jsx(Iu,{className:"w-4 h-4 mr-3"}),c("common.duplicate","Duplicate")]}),s.jsxs("button",{onClick:x,disabled:r||l,className:"flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:[l?s.jsx("div",{className:"w-4 h-4 mr-3 border-2 border-gray-600 border-t-transparent rounded-full animate-spin"}):C?s.jsx(ahe,{className:"w-4 h-4 mr-3 text-green-600"}):s.jsx(Fme,{className:"w-4 h-4 mr-3"}),l?S:N]}),s.jsxs("button",{onClick:j,disabled:r||l,className:"flex items-center w-full px-4 py-2 text-sm text-red-600 hover:bg-red-50 disabled:opacity-50 disabled:cursor-not-allowed",children:[r?s.jsx("div",{className:"w-4 h-4 mr-3 border-2 border-red-600 border-t-transparent rounded-full animate-spin"}):s.jsx(lc,{className:"w-4 h-4 mr-3"}),r?c("common.deleting","Deleting..."):c("common.delete","Delete")]})]})})]})]})]})," "]})},zut=({isOpen:e,onClose:t,onSubmit:r,brands:n,isCreating:a,initialLinkData:i,isEditMode:o})=>{const{t:l}=Te(),[c,u]=b.useState(""),[d,f]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(""),[y,v]=b.useState(!1),[x,j]=b.useState(null),[C,N]=b.useState(!1),[S,M]=b.useState(""),[k,I]=b.useState(""),[T,L]=b.useState(""),[R,_]=b.useState(""),[B,z]=b.useState(""),[D,A]=b.useState(""),[P,E]=b.useState(!1),F=b.useCallback(()=>{const G=Math.random().toString(36).substring(2,8);f(G),j(null),g(G)},[]),$=G=>{h(G)},H=b.useCallback(G=>{const Q={};let W=G;try{const Y=!G.startsWith("http://")&&!G.startsWith("https://")&&G.includes(".")?`https://${G}`:G,q=new URL(Y);let Z=q.pathname;if(q.pathname==="/"&&!q.search&&!q.hash){const he=q.hostname;let ie="";const ye=Y.replace(/^https?:\/\//,""),pe=ye.indexOf(he);pe!==-1&&(ie=ye.substring(pe+he.length).split("?")[0].split("#")[0]),(ie===""||ie==="/")&&(Z="")}W=`${q.origin}${Z}${q.hash}`;const me=new URLSearchParams;q.searchParams.forEach((he,ie)=>{ie.startsWith("utm_")?Q[ie]=he:me.append(ie,he)});const we=me.toString();we&&(W+=`?${we}`)}catch(Y){console.warn("[parseUtmParams] Error parsing URL:",G,Y);const q=G.indexOf("?");if(q!==-1){W=G.substring(0,q);const Z=G.substring(q+1);try{const me=new URLSearchParams(Z),we=new URLSearchParams;me.forEach((ie,ye)=>{ye.startsWith("utm_")?Q[ye]=ie:we.append(ye,ie)});const he=we.toString();he&&(W+=`?${he}`)}catch{}}else W=G}return{baseUrl:W,utms:Q}},[]);b.useEffect(()=>{let G=c.trim();const Q=new URLSearchParams;S&&Q.append("utm_source",S),k&&Q.append("utm_medium",k),T&&Q.append("utm_campaign",T),R&&Q.append("utm_term",R),B&&Q.append("utm_c
3996ontent",B);const W=Q.toString();if(!G&&!W){A("");return}if(!G&&W){A(`?${W}`);return}try{const Y=G.startsWith("http://")||G.startsWith("https://")||!G.includes(".")||G.startsWith("/")?G:`https://${G}`,q=new URL(Y),Z=new URLSearchParams(q.search),me=new URLSearchParams;Z.forEach((ie,ye)=>{ye.startsWith("utm_")||me.append(ye,ie)}),Q.forEach((ie,ye)=>{me.set(ye,ie)}),q.search=me.toString();let we=q.toString();!G.startsWith("http://")&&!G.startsWith("https://")&&Y.startsWith("https://")&&we.startsWith("https://")&&(we=we.substring(8));const he=G.split("?")[0].split("#")[0];q.pathname==="/"&&!he.endsWith("/")&&!q.search&&!q.hash&&we.endsWith("/")&&(we=we.substring(0,we.length-1)),me.toString()===""&&we.endsWith("?")&&(we=we.substring(0,we.length-1)),A(we.replace(/&$/,""))}catch(Y){console.warn("[useEffect liveUrlToDisplay] Error constructing live URL:",Y);const q=G.includes("?")?"&":"?";A(W?`${G}${q}${W}`:G)}},[c,S,k,T,R,B]),b.useEffect(()=>{const G=setTimeout(()=>{g(d.trim())},750);return()=>clearTimeout(G)},[d]),b.useEffect(()=>{e&&(p||j(null))},[p,e,l]),b.useEffect(()=>{if(e){if(a&&!i&&!o)return;if(j(null),v(!1),N(!1),M(""),I(""),L(""),_(""),z(""),E(!1),i){const{baseUrl:G,utms:Q}=H(i.oldURL);u(G),Object.keys(Q).length>0&&(M(Q.utm_source||""),I(Q.utm_medium||""),L(Q.utm_campaign||""),_(Q.utm_term||""),z(Q.utm_content||""),N(!0));const W=i.newURL.split("/"),Y=W[W.length-1];if(o)f(Y||""),g(Y||"");else{const q=Math.random().toString(36).substring(2,9),Z=Y?`${Y}-copy`:q;f(Z),g(Z)}h(i.brandId||"")}else u(""),F()}},[e,i,o,F,H,a]),b.useEffect(()=>{var G;e&&!i&&!m&&n.length>0&&((G=n[0])!=null&&G.id)&&h(n[0].id)},[e,i,m,n]);const X=async G=>{if(G.preventDefault(),!(c.trim()===""||d.trim()==="")){if(!o&&x&&!x.available){alert(l("links.errors.slugTakenOnSubmit"));return}r({destinationUrl:D,shortCode:d.trim(),brandId:m})}},ue=()=>{u(""),f(""),h(""),j(null),v(!1),g(""),N(!1),M(""),I(""),L(""),_(""),z(""),A(""),E(!1),t()},le=()=>{D&&(navigator.clipboard.writeText(D),E(!0),setTimeout(()=>E(!1),2e3))};if(!e)return null;const ae=o?l("links.editSmartLink","Edit Smart Link"):l("links.createSmartLink","Create a smart link"),te=o?a?l("common.saving","Saving..."):l("common.saveChanges","Save Changes"):a?l("common.creating","Creating..."):l("links.createLinkButton","Create Link"),ne=c.trim()!==""&&d.trim()!==""&&!a&&(o||y===!1)&&(o||x===null||x.available),J=S||k||T||R||B;return s.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:ue,children:s.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25","aria-hidden":"true"}),s.jsxs("div",{className:"relative bg-white rounded-xl border-2 border-black shadow-xl w-full max-w-lg p-6",onClick:G=>G.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-gray-900",children:[s.jsx(j0,{className:"w-5 h-5 text-primary-600"}),ae]}),s.jsx("button",{onClick:ue,className:"text-gray-400 hover:text-gray-600",children:s.jsx(_t,{size:20})})]}),s.jsxs("form",{onSubmit:X,className:"space-y-5",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"destination-url-input",className:"flex items-center text-sm font-medium text-gray-700 mb-1",children:[s.jsx(Zs,{className:"w-4 h-4 mr-1.5 text-gray-400"}),l("links.destinationUrlLabel","Destination URL")]}),s.jsxs("div",{className:"relative",children:[s.jsx("textarea",{id:"destination-url-input",value:D,onChange:G=>{const{baseUrl:Q,utms:W}=H(G.target.value);u(Q),M(W.utm_source||""),I(W.utm_medium||""),L(W.utm_campaign||""),_(W.utm_term||""),z(W.utm_content||"")},placeholder:l("links.destinationUrlPlaceholder","https://www.socialness.ai/features/ai-link-builder"),className:`w-full text-sm rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent shadow-sm disabled:opacity-50 disabled:cursor-not-allowed border placeholder-gray-400 resize-none overflow-hidden ${J?"bg-primary-50 !border-primary-600 text-gray-700":"border-gray-300"} ${D?"p-2.5 pr-10":"p-2.5"}`,rows:J?3:1,required:!0,disabled:a}),D&&s.jsx("button",{type:"button",onClick:le,className:"absolute top-1/2 right-2 transform -translate-y-1/2 p-1 text-primary-600 hover:text-primary-800 focus:outline-none",title:P?l("common.copied","Copied!"):l("common.copy","Copy"),children:P?s.jsx(Ba,{className:"w-5 h-5 text-green-500"}):s.jsx(Iu,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"short-code-input",className:"block text-sm font-medium text-gray-700 mb-1",children:l("links.shortLinkLabel","Short Link")}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"inline-flex items-center px-3 h-[38px] border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm rounded-l-md",children:"go.socialness.ai/"}),s.jsx("input",{type:"text",id:"short-code-input",value:d,onChange:G=>{f(G.target.value),x&&j(null)},placeholder:l("links.shortCodePlaceholder","custom-slug"),className:"flex-1 block w-full px-3 h-[38px] border border-gray-300 focus:ring-2 focus:ring-primary-500 focus:border-transparent text-sm placeholder-gray-400 disabled:opacity-50 disabled:cursor-not-allowed",required:!0,disabled:a||o,minLength:3}),s.jsx("button",{type:"button",onClick:F,disabled:a||o,className:"inline-flex items-center px-3 h-[38px] border border-l-0 border-gray-300 bg-gray-50 hover:bg-gray-100 text-gray-700 text-sm rounded-r-md disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:l("links.generateButton","Generate")})]}),!o&&s.jsxs("div",{className:"h-5 text-xs px-1 mt-1",children:[y&&s.jsx("p",{className:"text-gray-500",children:l("links.checkingSlug","Checking availability...")}),x&&!y&&s.jsx("p",{className:`${x.isError||!x.available?"text-red-600":"text-green-600"}`,children:x.message})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"brand-select-modal",className:"block text-sm font-medium text-gray-700 mb-1",children:l("links.brandLabel","Brand")}),s.jsx(hl,{brands:n,selectedBrandId:m,onBrandSelect:$,isLoading:a,className:"h-[38px]"})]}),s.jsx("div",{className:"border-t border-gray-200 pt-4 mt-4",children:s.jsxs("button",{type:"button",onClick:()=>N(!C),className:"flex items-center justify-between w-full text-sm font-medium text-gray-700 hover:text-primary-600",children:[s.jsx("span",{children:l("links.advancedOptions","Advanced Options")}),C?s.jsx(T7,{size:18}):s.jsx(Vr,{size:18})]})}),C&&s.jsxs("div",{className:"pt-3",children:[s.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:l("links.utmParameters","UTM Parameters:")}),s.jsxs("div",{className:"p-3 border border-gray-300 rounded-md bg-gray-50 space-y-2",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-source",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[l("links.source","Source (utm_source)"),":"]}),s.jsx("input",{type:"text",id:"utm-source",value:S,onChange:G=>M(G.target.value),placeholder:"e.g., newsletter, google",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:a})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-medium",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[l("links.medium","Medium (utm_medium)"),":"]}),s.jsx("input",{type:"text",id:"utm-medium",value:k,onChange:G=>I(G.target.value),placeholder:"e.g., email, cpc",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:a})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-campaign",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[l("links.campaign","Campaign (utm_campaign)"),":"]}),s.jsx("input",{type:"text",id:"utm-campaign",value:T,onChange:G=>L(G.target.value),placeholder:"e.g., summer_sale",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:a})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-term",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[l("links.term","Term (utm_term)"),":"]}),s.jsx("input",{type:"text",id:"utm-term",value:R,onChange:G=>_(G.target.value),placeholder:"e.g., running+shoes",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:a})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("label",{htmlFor:"utm-content",className:"w-1/3 text-xs text-gray-600 truncate pr-2",children:[l("links.content","Content (utm_content)"),":"]}),s.jsx("input",{type:"text",id:"utm-content",value:B,onChange:G=>z(G.target.value),placeholder:"e.g., logolink, textlink",className:"w-2/3 p-1.5 border border-gray-300 rounded-md text-xs focus:ring-1 focus:ring-primary-500 focus:border-primary-500 placeholder-gray-400",disabled:a})]})]})]}),s.jsxs("div",{className:"flex justify-end items-center gap-3 pt-5 border-t border-gray-200 mt-1",children:[s.jsx("button",{type:"button",onClick:ue,disabled:a,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:l("common.cancel","Cancel")}),s.jsx("button",{type:"submit",disabled:!ne,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 border border-transparent roun
3996ded-lg hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-primary-500 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center",children:a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2"}),o?l("common.saving","Saving..."):l("common.creating","Creating...")]}):te})]})]})]})]})})},But=()=>{var ae;const{t:e,i18n:t}=Te(),[r,n]=b.useState(""),[a,i]=b.useState(""),[o,l]=hb("modal",""),c=o==="create",[u,d]=b.useState(null),[f,m]=b.useState(null),[h,p]=b.useState(!1),[g,y]=b.useState(null),[v,x]=b.useState(!1),[j,C]=b.useState(null),{data:N,isLoading:S,error:M,refetch:k}=$et(),{data:I,isLoading:T}=oa(),L=pY(),R=Fet(),_=zet(),B=Bet(),z=(N==null?void 0:N.links)||[],D=I?((ae=I.brands)==null?void 0:ae.map(te=>({id:te.id,name:te.name,logo:te.logo})))||[]:[],A=b.useMemo(()=>{if(!z.length)return D;const te=[...new Set(z.map(ne=>ne.brandId).filter(Boolean))];return D.filter(ne=>te.includes(ne.id))},[D,z]);b.useEffect(()=>{document.title=e("links.title","AI Links Builder")},[e]);const P=U.useMemo(()=>z.filter(te=>a!==""&&te.brandId!==a?!1:!r||te.oldURL.toLowerCase().includes(r.toLowerCase())||te.newURL.toLowerCase().includes(r.toLowerCase())),[z,r,a]),E=te=>{m(te),p(!1),l("create")},F=te=>{m(te),p(!0),l("create")},$=te=>{C(te),x(!0)},H=async te=>{try{const ne=`https://go.socialness.ai/${te.shortCode}`,J={oldURL:te.destinationUrl,newURL:ne,brandId:te.brandId||""};await L.mutateAsync(J,{onSuccess:()=>k()}),setIsCreateModalOpen(!1),m(null),p(!1)}catch(ne){console.error("Failed to create smart link:",ne)}},X=async te=>{if(!f||!f.id){console.error("No active link data found for update.");return}const ne={oldURL:te.destinationUrl,brandId:te.brandId||""};try{await B.mutateAsync({linkId:f.id,payload:ne}),setIsCreateModalOpen(!1),m(null),p(!1)}catch(J){console.error("Failed to update smart link (in component):",J)}},ue=async te=>{try{d(te),await R.mutateAsync(te,{onSuccess:()=>k()})}catch(ne){console.error("Failed to delete link:",ne)}},le=async(te,ne)=>{y(te);try{await _.mutateAsync({linkId:te,status:ne},{onSuccess:()=>k()})}catch(J){console.error(`Failed to update status to ${ne} for link ${te}:`,J)}finally{y(null)}};return S?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsxs("div",{className:"w-[95%] mx-auto py-8",children:[s.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/3 mb-2 animate-pulse"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 animate-pulse"})]}),s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-48 animate-pulse"})]}),s.jsxs("div",{className:"space-y-6 mb-8",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Array.from({length:3}).map((te,ne)=>s.jsx("div",{className:"bg-white rounded-xl border border-black p-6 animate-pulse",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-24 mb-2"}),s.jsx("div",{className:"h-8 bg-gray-200 rounded w-16"})]}),s.jsx("div",{className:"w-12 h-12 bg-gray-200 rounded-lg"})]})},ne))}),s.jsxs("div",{className:"bg-white rounded-xl border border-black p-6 animate-pulse",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"h-6 bg-gray-200 rounded w-48 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-32"})]}),s.jsx("div",{className:"h-80 bg-gray-200 rounded"})]})]}),s.jsx("div",{className:"mb-6",children:s.jsx("div",{className:"h-10 bg-gray-200 rounded-lg w-96 animate-pulse"})}),s.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((te,ne)=>s.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6 animate-pulse",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),s.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-16"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-full"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-gray-100",children:[s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-20"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-32"})]}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-16"})]})]},ne))})]})}):M?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsx("div",{className:"w-[95%] mx-auto py-8 flex items-center justify-center h-96",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:e("links.errorLoading","Failed to load links")}),s.jsx("p",{className:"text-gray-500",children:M.message})]})})}):s.jsxs(rs,{title:e("links.title","AI Links Builder"),subtitle:e("links.subtitle","Manage and track y
3996our shortened links"),actions:s.jsxs("button",{onClick:()=>l("create"),className:"flex items-center gap-2 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:[s.jsx(tn,{className:"w-4 h-4"}),e("links.createSmartLink","Create a smart link")]}),children:[(N==null?void 0:N.analytics)&&s.jsx(Rut,{analytics:N.analytics,totalLinks:N.count,totalClicks:N.TotalClicks}),s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsxs("div",{className:"relative max-w-md",children:[s.jsx($i,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),s.jsx("input",{type:"text",placeholder:e("links.searchPlaceholder","Search links by URL..."),value:r,onChange:te=>n(te.target.value),className:"w-full pl-10 pr-4 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),s.jsx("div",{className:"w-64",children:s.jsx(hl,{brands:A,selectedBrandId:a,onBrandSelect:i,showAllBrandsOption:!0,showRedirectionCard:!1})})]})}),s.jsx("div",{className:"mb-6",children:s.jsx("p",{className:"text-sm text-gray-500",children:e("links.resultsCount",{count:P.length,total:z.length,defaultValue:"Showing {{count}} of {{total}} links"})})}),P.length>0?s.jsx("div",{className:"space-y-4",children:P.map(te=>s.jsx(Fut,{link:te,onDelete:ue,isDeleting:R.isPending&&u===te.id,onDuplicate:E,onEditRequest:F,onQRCodeRequest:$,onUpdateStatus:le,isUpdatingStatus:_.isPending&&g===te.id},te.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ti,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:e("links.noResults","No links found")}),s.jsx("p",{className:"text-gray-500 mb-6",children:r?e("links.noResultsFiltered","Try adjusting your search criteria"):e("links.noLinks","You haven't created any smart links yet")}),!r&&s.jsxs("button",{onClick:()=>l("create"),className:"flex items-center gap-2 px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors mx-auto",children:[s.jsx(tn,{className:"w-4 h-4"}),e("links.createFirstLink","Create your first smart link")]})]}),s.jsx(zut,{isOpen:c,onClose:()=>{l(""),m(null),p(!1)},onSubmit:h?X:H,brands:D,isCreating:L.isPending||B.isPending,initialLinkData:f,isEditMode:h}),s.jsx(_Qe,{isOpen:v,onClose:()=>{x(!1),C(null)},url:(j==null?void 0:j.newURL)||"",brandLogo:j==null?void 0:j.brandLogo,brandName:j==null?void 0:j.brandName})]})},Uut=()=>{const{t:e}=Te(),t=pn(),[r]=ui(),n=r.get("editUrl")||void 0;r.get("postId");const[a,i]=b.useState(n),[o,l]=b.useState(!1),{createNewDesign:c}=qQ();b.useEffect(()=>{(async()=>{if(!a){const f=await c();f?i(f):t(-1)}})()},[]);const u=b.useMemo(()=>e("canva.editor","Canva Editor"),[e]);return s.jsxs("div",{className:"fixed inset-0 z-[100] bg-white",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b border-gray-200",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("button",{onClick:()=>t(-1),className:"text-gray-600 hover:text-gray-800","aria-label":e("common.close","Close"),children:"×"}),s.jsx("div",{className:"text-sm text-gray-600 truncate",title:a,children:u})]}),s.jsx("div",{className:"flex items-center gap-2",children:a&&s.jsx("button",{onClick:()=>window.open(a,"_blank","noopener,noreferrer"),className:"text-sm text-primary-600 hover:text-primary-700",children:e("common.openInNewTab","Open in new tab")})})]}),s.jsx("div",{className:"w-full h-[calc(100vh-48px)] relative",children:a?s.jsxs(s.Fragment,{children:[s.jsx("iframe",{src:a,className:"w-full h-full",title:"Canva Editor",allow:"clipboard-read; clipboard-write; fullscreen; autoplay; encrypted-media; picture-in-picture; web-share",sandbox:"allow-same-origin allow-scripts allow-forms allow-popups allow-presentation allow-downloads allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",onError:()=>l(!0),onLoad:()=>l(!1)}),o&&s.jsx("div",{className:"absolute inset-0 bg-white/95 flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-gray-700 mb-3",children:e("canva.embedBlocked","The editor refused to load in an embedded view.")}),s.jsx("button",{onClick:()=>window.open(a,"_blank","noopener,noreferrer"),className:"inline-flex items-center px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700",children:e("actions.openInCanva","Open in Canva")})]})})]}):s.jsx("div",{className:"w-full h-full flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary-600"})})})]})},Vut=()=>{const e=pn(),[t]=ui(),{i18n:r}=Te(),[n,a]=b.useState(null);return b.useEffect(()=>{(async()=>{var o;try{const l=t.get("correlation_jwt");if(!l){a("Missing correlation_jwt parameter");return}const c=Qe.currentUser;if(!c||!c.email){a("User not authenticated");return}const u=await c.getIdToken(),d=await fetch("https://api.socialness.ai/management/integrations/canva/return-nav",{method:"POST",headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"},body:JSON.stringify({correlation_jwt:l})});if(!d.ok)throw new Error(`API call failed: ${d.status} ${d.statusText}`);const f=await d.json();if(!f.success||!((o=f.data)!=null&&o.redirectionUrl))throw new Error("Invalid API response: missing redirectionUrl");f.data.exportUrl&&sessionStorage.setItem("canva_export_url",f.data.exportUrl),e(f.data.redirectionUrl,{replace:!0})}catch(l){console.error("Error handling Canva return:",l),a(l instanceof Error?l.message:"Unknown error occurred"),setTimeout(()=>{e("/dashboard",{replace:!0})},3e3)}})()},[t,e]),n?s.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center",children:s.jsx("div",{className:"max-w-md w-full space-y-4 p-8 bg-white rounded-lg shadow-lg border border-red-200",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:r.t("canvaReturn.error.title","Canva Integration Error")}),s.jsx("p",{className:"text-sm text-gray-600 mb-4",children:n}),s.jsx("p",{className:"text-xs text-gray-500",children:r.t("canvaReturn.error.redirecting","Redirecting to dashboard...")})]})})}):s.jsx("div",{className:"min-h-screen bg-white",children:s.jsx(Wu,{title:r.t("canvaReturn.loading.title","Processing Canva Integration..."),currentStep:r.t("canvaReturn.loading.processing","Connecting your design..."),videoSrc:"/Panda - Gold Digger.mov"})})},Wut=()=>{var f,m,h;const{t:e}=Te(),t=pn(),[r]=ui(),[n,a]=b.useState(15),{data:i,isLoading:o}=T2();Ip(e("paymentSuccess.title")),r.get("session_id");const l=i==null?void 0:i.subscription;let c="Premium Plan",u="";if(l!=null&&l.plan){const{amount:p,currency:g,interval:y}=l.plan;u=`${p/100} ${g.toUpperCase()}`;const x=[...((f=i==null?void 0:i.planOptions)==null?void 0:f.monthly)||[],...((m=i==null?void 0:i.planOptions)==null?void 0:m.yearly)||[]].find(j=>{const C=parseFloat(j.formattedPrice.replace(/[^\d.]/g,"")),N=p/100;return Math.abs(C-N)<.01});x?c=x.productName:c=`${u} Plan`}const d=((h=l==null?void 0:l.plan)==null?void 0:h.interval)==="year"?"yearly":"monthly";return b.useEffect(()=>{const p=setInterval(()=>{a(g=>g<=1?(t("/billing"),0):g-1)},1e3);return()=>clearInterval(p)},[t]),o?s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Rn,{className:"w-12 h-12 text-primary-600 animate-spin mx-auto mb-4"}),s.jsx("p",{className:"text-gray-600",children:e("paymentSuccess.loading")})]})})}):s.jsx("div",{className:"min-h-screen bg-white lg:ml-16 pt-4 lg:pt-0",children:s.jsx("div",{className:"flex items-center justify-center min-h-screen px-4",children:s.jsxs("div",{className:"max-w-md w-full text-center",children:[s.jsxs("div",{className:"relative mb-8",children:[s.jsx("div",{className:"w-24 h-24 mx-auto rounded-full bg-green-100 flex items-center justify-center animate-pulse",children:s.jsx(Nm,{className:"w-16 h-16 text-green-600"})}),s.jsx("div",{className:"absolute inset-0 w-24 h-24 mx-auto rounded-full border-4 border-green-200 animate-ping"})]}),s.jsxs("div",{className:"bg-white rounded-xl shadow-2xl border border-gray-100 p-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:e("paymentSuccess.successTitle")}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-lg text-gray-700 mb-2",children:e("paymentSuccess.successMessage")}),s.jsx("p",{className:"text-lg text-gray-700",children:e("paymentSuccess.subscriptionMessage",{billingInterval:e(d==="yearly"?"paymentSuccess.yearly":"paymentSuccess.monthly"),planName:c})})]}),s.jsxs("div",{className:"bg-primary-50 rounded-lg p-4 mb-6",children:[s.jsx("h3",{className:"font-semibold text-primary-900 mb-2",children:e("paymentSuccess.subscriptionDetail
3996s")}),s.jsxs("div",{className:"text-sm text-primary-700 space-y-1",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:e("paymentSuccess.plan")})," ",c]}),u&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:e("paymentSuccess.price")})," ",u]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:e("paymentSuccess.billing")})," ",e(d==="yearly"?"paymentSuccess.yearly":"paymentSuccess.monthly")]}),(l==null?void 0:l.current_period_end)&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:e("paymentSuccess.nextBilling")})," ",new Date(l.current_period_end*1e3).toLocaleDateString()]})]})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-gray-600 mb-4",children:s.jsx(k0,{i18nKey:"paymentSuccess.redirectMessage",values:{countdown:n},components:{1:s.jsx("span",{className:"font-bold text-primary-600"})}})}),s.jsx("button",{onClick:()=>t("/billing"),className:"inline-flex items-center px-6 py-3 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors font-medium",children:e("paymentSuccess.goToBilling")})]})]}),s.jsx("div",{className:"mt-6 text-sm text-gray-500",children:s.jsx("p",{children:e("paymentSuccess.welcomeMessage")})})]})})})},qut=()=>{const{t:e}=Te(),t=pn(),[r,n]=b.useState(10);Ip(e("paymentCancel.title")),b.useEffect(()=>{const i=setInterval(()=>{n(o=>o<=1?(clearInterval(i),t("/billing"),0):o-1)},1e3);return()=>clearInterval(i)},[t]);const a=()=>{t("/billing")};return s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center px-4",children:s.jsx("div",{className:"max-w-2xl w-full",children:s.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl p-8 md:p-12 text-center",children:[s.jsx("div",{className:"flex justify-center mb-6",children:s.jsx("div",{className:"w-20 h-20 bg-red-100 rounded-full flex items-center justify-center",children:s.jsx(_t,{className:"w-12 h-12 text-red-600"})})}),s.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-6",children:e("paymentCancel.cancelTitle")}),s.jsx("p",{className:"text-lg text-gray-600 mb-8",children:e("paymentCancel.supportMessage")}),s.jsx("div",{className:"bg-gray-50 rounded-xl p-6 mb-8",children:s.jsx("p",{className:"text-gray-700",children:s.jsx(k0,{i18nKey:"paymentCancel.redirectMessage",values:{countdown:r},components:{1:s.jsx("strong",{className:"font-semibold text-red-600"})}})})}),s.jsxs("button",{onClick:a,className:"inline-flex items-center px-8 py-3 bg-primary-600 text-white font-semibold rounded-xl hover:bg-primary-700 transition-colors duration-200 shadow-lg hover:shadow-xl",children:[e("paymentCancel.goToBilling"),s.jsx(Jy,{className:"ml-2 w-5 h-5"})]})]})})})},Gut=()=>{const[e,t]=b.useState(null),[r,n]=b.useState(!1),[a,i]=b.useState(""),[o,l]=b.useState(null),[c,u]=b.useState("unknown"),[d,f]=b.useState("unknown"),[m,h]=b.useState("idle");b.useEffect(()=>{(()=>{navigator.onLine?u("online"):(u("offline"),l("Vous êtes hors ligne. La reconnaissance vocale nécessite une connexion internet."))})(),window.addEventListener("online",()=>u("online")),window.addEventListener("offline",()=>{u("offline"),l("Connexion perdue. La reconnaissance vocale nécessite une connexion internet.")});const j=!!(window.SpeechRecognition||window.webkitSpeechRecognition);t(j),j||l("Web Speech API non supportée dans ce navigateur.");const C=window.location.protocol==="https:",N=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1";return console.log("🔍 Diagnostic Speech-to-Text:"),console.log("• HTTPS:",C),console.log("• Localhost:",N),console.log("• API Supportée:",j),console.log("• Connexion:",navigator.onLine?"Online":"Offline"),console.log("• User Agent:",navigator.userAgent),()=>{window.removeEventListener("online",()=>u("online")),window.removeEventListener("offline",()=>u("offline"))}},[]);const p=async()=>{try{h("testing-mic");const v=await navigator.permissions.query({name:"microphone"});return f(v.state),v.state==="denied"?(l("Microphone bloqué. Autorisez l'accès dans les paramètres du navigateur."),!1):v.state==="prompt"?(l(`Cliquez sur "Autoriser" quand le navigateur demande l'accès au microphone.`),!1):!0}catch{return console.warn("Permissions API non supportée, test manuel nécessaire"),f("unknown"),!0}},g=async()=>
3996{if(!e){l("Web Speech API non supportée.");return}if(!navigator.onLine){l("Vous êtes hors ligne. Connexion requise.");return}if(l(null),i(""),!!await p()){h("testing-recognition");try{const x=window.SpeechRecognition||window.webkitSpeechRecognition,j=new x;j.continuous=!1,j.interimResults=!0,j.lang="fr-FR",j.onstart=()=>{n(!0),console.log("🎤 Reconnaissance démarrée")},j.onresult=C=>{let N="",S="";for(let M=C.resultIndex;M<C.results.length;M++){const k=C.results[M];k.isFinal?N+=k[0].transcript:S+=k[0].transcript}i(N||S)},j.onerror=C=>{n(!1),console.error("❌ Erreur reconnaissance:",C.error),l({network:"Erreur réseau - Vérifiez votre connexion internet","not-allowed":"Microphone non autorisé - Cliquez sur le cadenas dans la barre d'adresse","no-speech":"Aucune parole détectée","audio-capture":"Problème de capture audio","service-not-allowed":"Service non autorisé par le navigateur",aborted:"Reconnaissance annulée","language-not-supported":"Langue non supportée"}[C.error]||`Erreur inconnue: ${C.error}`)},j.onend=()=>{n(!1),console.log("🎤 Reconnaissance terminée")},j.start()}catch(x){console.error("❌ Erreur lors du démarrage:",x),l("Erreur lors du démarrage de la reconnaissance vocale")}}},y=()=>{n(!1)};return s.jsxs("div",{className:"p-6 max-w-md mx-auto bg-white rounded-lg shadow-lg",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"🧪 Test Speech-to-Text"}),s.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"🔍 Diagnostic:"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"API Supportée:"}),s.jsx("span",{className:e?"text-green-600":"text-red-600",children:e===null?"...":e?"✅":"❌"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Connexion:"}),s.jsx("span",{className:c==="online"?"text-green-600":"text-red-600",children:c==="online"?"✅ Online":c==="offline"?"❌ Offline":"..."})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"HTTPS:"}),s.jsx("span",{className:window.location.protocol==="https:"?"text-green-600":"text-yellow-600",children:window.location.protocol==="https:"?"✅":"⚠️ HTTP"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Localhost:"}),s.jsx("span",{className:window.location.hostname==="localhost"?"text-yellow-600":"text-green-600",children:window.location.hostname==="localhost"?"⚠️ Oui":"✅ Non"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Microphone:"}),s.jsx("span",{className:d==="granted"?"text-green-600":d==="denied"?"text-red-600":d==="prompt"?"text-yellow-600":"text-gray-500",children:d==="granted"?"✅ Autorisé":d==="denied"?"❌ Bloqué":d==="prompt"?"⚠️ À autoriser":"❓ Inconnu"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Étape test:"}),s.jsx("span",{className:"text-blue-600",children:m==="idle"?"🏠 Prêt":m==="testing-mic"?"🎤 Test micro":m==="testing-recognition"?"🎧 Test reconnaissance":"Inconnu"})]})]})]}),s.jsxs("div",{className:"mb-4 space-y-2",children:[s.jsx("button",{onClick:()=>p(),className:"w-full py-2 px-4 rounded-lg font-medium bg-purple-500 text-white hover:bg-purple-600 transition-all",children:"🔍 Tester le microphone seulement"}),s.jsx("button",{onClick:r?y:g,disabled:!e||c==="offline",className:`
3997            w-full py-3 px-4 rounded-lg font-medium transition-all
3998            ${r?"bg-red-500 text-white animate-pulse":"bg-blue-500 text-white hover:bg-blue-600"}
3999            ${!e||c==="offline"?"opacity-50 cursor-not-allowed":"cursor-pointer"}
4000          `,children:r?"⏹️ Arrêter":"🎤 Test complet (micro + reconnaissance)"})]}),a&&s.jsxs("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded",children:[s.jsx("h3",{className:"font-semibold text-green-800 mb-1",children:"📝 Transcription:"}),s.jsx("p",{className:"text-green-700",children:a})]}),o&&s.jsxs("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded",children:[s.jsx("h3",{className:"font-semibold text-red-800 mb
4000-1",children:"❌ Erreur:"}),s.jsx("p",{className:"text-red-700 text-sm",children:o})]}),s.jsxs("div",{className:"text-xs text-gray-600 space-y-1",children:[s.jsx("p",{children:s.jsx("strong",{children:"🔧 Solutions selon votre situation:"})}),window.location.hostname==="localhost"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:s.jsx("strong",{children:"📍 Développement local:"})}),s.jsx("p",{children:"• HTTPS requis: Configurez HTTPS dans vite.config.ts"}),s.jsxs("p",{children:["• Alternative: ",s.jsx("code",{children:"npm install -g serve && serve -s dist -l 3000"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{children:s.jsx("strong",{children:"🌐 Production:"})}),s.jsx("p",{children:"• Vérifiez que HTTPS est bien activé sur votre domaine"}),s.jsx("p",{children:"• Testez sur différents navigateurs (Chrome recommandé)"})]}),s.jsx("p",{children:s.jsx("strong",{children:"🎤 Microphone:"})}),s.jsx("p",{children:"• Cliquez sur le 🔒 dans la barre d'adresse"}),s.jsx("p",{children:'• Réglez "Microphone" sur "Autoriser"'}),s.jsx("p",{children:"• Rafraîchissez la page après changement"}),s.jsx("p",{children:s.jsx("strong",{children:"🌍 Navigateurs supportés:"})}),s.jsx("p",{children:"• ✅ Chrome/Chromium (meilleur support)"}),s.jsx("p",{children:"• ✅ Edge (bon support)"}),s.jsx("p",{children:"• ⚠️ Firefox (support limité)"}),s.jsx("p",{children:"• ❌ Safari (non supporté)"})]})]})},Hut=5*60*1e3,Yut=()=>{const e=vs(),t=pn();b.useEffect(()=>{const r=sessionStorage.getItem("oauth_redirect_after_auth"),n=sessionStorage.getItem("oauth_redirect_timestamp");if(!r||!n)return;if(Date.now()-parseInt(n,10)>Hut){sessionStorage.removeItem("oauth_redirect_after_auth"),sessionStorage.removeItem("oauth_redirect_timestamp");return}if(e.pathname+e.search===r||e.pathname===r){sessionStorage.removeItem("oauth_redirect_after_auth"),sessionStorage.removeItem("oauth_redirect_timestamp");return}sessionStorage.removeItem("oauth_redirect_after_auth"),sessionStorage.removeItem("oauth_redirect_timestamp"),t(r,{replace:!0})},[e.pathname,e.search,t])},Qut=new Ose;Lme().catch(e=>{console.error("Failed to initialize PostHog:",e)});typeof window<"u"&&(window.addEventListener("unhandledrejection",e=>{const t=e.reason;Gc(t)&&(console.error("Global IndexedDB error caught:",t),Ei(t,"global-unhandled-rejection"),e.preventDefault());try{(t&&(t.message||String(t))||"").includes("Failed to execute 'removeChild' on 'Node'")&&(console.warn("Suppressing benign removeChild error from third-party script/blocker"),e.preventDefault())}catch{}}),window.addEventListener("error",e=>{const t=e.error;Gc(t)&&(console.error("Global IndexedDB error (error event):",t),Ei(t,"global-error-event"));try{(((e==null?void 0:e.message)||"")+" "+(t&&(t.message||"")||"")).includes("Failed to execute 'removeChild' on 'Node'")&&(console.warn("Suppressing benign removeChild error from third-party blocker"),e.preventDefault())}catch{}}),document.addEventListener("visibilitychange",()=>{}));const Kut=()=>{const[e,t]=b.useState(!1),{t:r}=Te(),n=async()=>{if(Qe.currentUser){t(!0);try{await Mve(Qe.currentUser),alert(r("auth.verification.resendSuccess"))}catch(a){console.error("Error sending verification email:",a),alert(r("auth.verification.resendError"))}finally{t(!1)}}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:s.jsxs("div",{className:"max-w-md w-full space-y-8 p-8 bg-white rounded-lg shadow",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("img",{src:"/assets/Socialness-Logo/Socialness-Icon-1024x1024.png",alt:"Socialness",className:"mx-auto h-16 w-16"}),s.jsx("h2",{className:"mt-6 text-center text-2xl font-extrabold text-gray-900",children:r("auth.verification.title")}),s.jsx("p",{className:"mt-2 text-center text-sm text-gray-600",children:r("auth.verification.subtitle")})]}),s.jsxs("div",{className:"mt-8 space-y-6",children:[s.jsx("div",{className:"rounded-md bg-blue-50 p-4",children:s.jsx("div",{className:"flex",children:s.jsx("div",{className:"ml-3 flex-1 md:flex md:justify-between",children:s.jsx("p",{className:"text-sm text-blue-700",children:r("auth.verification.checkInbox")})})})}),s.jsx("div",{className:"text-sm text-center",children:s.jsx("button",{onClick:n,disabled:e,className:"font-medium text-primary-600 hover:text-primary-500 disabled:opacity-50",children:r(e?"auth.verification.resending":"auth.verification.resend")})}),s.jsx("div",{className:"text-center",children:s.jsx("button",{onClick:()=>Qe.signOut(),className:"text-sm font-medium text-gray-600 hover:text-gray-500",children:r("auth.verification.signOut")})})]})]})})},Jut=async e=>{var t;try{const r=fE(vE,"users",e),n=await Zfe(r);if(n.exists()){const a=n.data(),i=a.counts||{},o=i.onboardingProcess??i.onboarding??a.onboardingProcess??((t=a.onboarding)==null?void 0:t.progress)??a.progress,l=typeof o=="number"?o:typeof o=="str
4000ing"?parseFloat(o):0,c=Number.isFinite(l)?Math.max(0,Math.min(100,l)):0;let u=a.firstName,d=a.lastName;if((!u||!d)&&a.name){const f=a.name.split(" ");u=u||f[0],d=d||f.slice(1).join(" ")}return{...a,id:n.id,firstName:u,lastName:d,counts:{...i,onboardingProcess:c}}}else return console.log("No such user document!",e),null}catch(r){return console.error("Error fetching user document:",r),null}},Zut=()=>(Yut(),null),Xut=()=>{const{user:e,isLoading:t}=Ps(),{onboardingProgress:r,isLoading:n}=ME(),a=vs();if(t||n)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-primary-600"})});const i=r==null?void 0:r.percentageCompleted;return console.log("AuthRedirector Debug:",{user:e?{id:e.id,email:e.email}:null,onboardingProgress:r,onboardingProcess:i,userCounts:e==null?void 0:e.counts,isFinite:Number.isFinite(i)}),typeof i=="number"&&Number.isFinite(i)?(console.log(`Onboarding progress: ${i}% - Redirecting to ${i>60?"dashboard":"onboarding"}`),i>60?s.jsx(Bl,{to:"/dashboard",state:{from:a},replace:!0}):s.jsx(Bl,{to:"/onboarding",state:{from:a},replace:!0})):(console.warn("Onboarding status unknown, defaulting to dashboard."),s.jsx(Bl,{to:"/dashboard",state:{from:a},replace:!0}))},edt=()=>{const{user:e,isLoading:t}=Ps();return t?null:e?s.jsx(Bl,{to:"/",replace:!0}):s.jsx(fJ,{})},tdt=()=>{const{setUser:e,setLoading:t,user:r}=Ps(),[n,a]=b.useState(!0),{t:i,i18n:o}=Te();return Ip("Socialness.ai - Social Media Management"),b.useEffect(()=>{sL(window.location.pathname);const l=()=>{sL(window.location.pathname)};return window.addEventListener("popstate",l),()=>{window.removeEventListener("popstate",l)}},[]),b.useEffect(()=>{t(!0);const l=Rle(Qe,async c=>{var u;if(c){BP({id:c.uid,email:c.email||void 0});const d=await Jut(c.uid),f={id:c.uid,email:c.email||"",name:c.displayName||(d==null?void 0:d.name)||"",photoURL:c.photoURL||(d==null?void 0:d.photoURL)||"",role:(d==null?void 0:d.role)||"writer"},m={...f,...d,id:f.id,firstName:(d==null?void 0:d.firstName)||f.name.split(" ")[0]||"",lastName:(d==null?void 0:d.lastName)||f.name.split(" ").slice(1).join(" ")||"",counts:{onboardingProcess:((u=d==null?void 0:d.counts)==null?void 0:u.onboardingProcess)??0,...(d==null?void 0:d.counts)||{}}};(!m.id||!m.email||!m.name)&&console.error("User object missing required fields:",m),e(m),a(c.emailVerified),E7(c.uid,{email:m.email,name:m.name})}else BP(null),e(null),a(!0);t(!1)});return()=>l()},[e,t]),r&&!n?s.jsx(Kut,{}):s.jsx(Ome,{children:s.jsxs(jP,{children:[s.jsxs(Cr,{element:s.jsx(edt,{}),children:[s.jsx(Cr,{path:"/auth/login",element:s.jsx(C$,{})}),s.jsx(Cr,{path:"/auth/signup",element:s.jsx(M$,{})}),s.jsx(Cr,{path:"/auth/forgot-password",element:s.jsx(I$,{})}),s.jsx(Cr,{path:"/auth/connexion",element:s.jsx(C$,{})}),s.jsx(Cr,{path:"/auth/inscription",element:s.jsx(M$,{})}),s.jsx(Cr,{path:"/auth/mot-de-passe-oublie",element:s.jsx(I$,{})})]}),s.jsx(Cr,{path:"/*",element:s.jsx(rdt,{children:s.jsxs("div",{className:"flex flex-col bg-white min-h-screen",children:[s.jsx(Whe,{}),s.jsxs("div",{className:"flex flex-1",children:[s.jsx(vje,{}),s.jsxs("main",{className:"flex-1 bg-white",children:[s.jsx(Zut,{}),s.jsxs(jP,{children:[s.jsx(Cr,{path:"/",element:s.jsx(Xut,{})})," ",s.jsx(Cr,{path:"/dashboard",element:s.jsx(Cut,{})}),s.jsx(Cr,{path:"/onboarding",element:s.jsx(Uat,{})}),s.jsx(Cr,{path:"/analytics",element:s.jsx(DHe,{})}),s.jsx(Cr,{path:"/brand-strategy-lab",element:s.jsx(FQe,{})}),s.jsx(Cr,{path:"/brand-strategy-lab/new",element:s.jsx(D5,{})}),s.jsx(Cr,{path:"/brand-strategy-lab/:brandId/edit",element:s.jsx(D5,{})}),s.jsx(Cr,{path:"/social-media-hub",element:s.jsx(iZe,{})}),s.jsx(Cr,{path:"/accounts",element:s.jsx(Bl,{to:"/social-media-hub",replace:!0})}),s.jsx(Cr,{path:"/team",element:s.jsx(jZe,{})}),s.jsx(Cr,{path:"/billing",element:s.jsx(qJe,{})}),s.jsx(Cr,{path:"/payment/success",element:s.jsx(Wut,{})}),s.jsx(Cr,{path:"/payment/cancel",element:s.jsx(qut,{})}),s.jsx(Cr,{path:"/test-speech",element:s.jsx(Gut,{})}),s.jsx(Cr,{path:"/settings",element:s.jsx(CZe,{})}),s.jsx(Cr,{path:"/admin",element:s.jsx(IZe,{})}),s.jsx(Cr,{path:"/ai-personas-builder",element:s.jsx(HS,{})}),s.jsx(Cr,{path:"/ai-personas-builder/new",element:s.jsx(HS,{})}),s.jsx(Cr,{path:"/ai-personas-builder/:personaId/edit",element:s.jsx(HS,{})}),s.jsx(Cr,{path:"/calendar",element:s.jsx(OXe,{})}),s.jsx(Cr,{path:"/my-content-hub",element:s.jsx(yut,{})}),s.jsx(Cr,{path:"/content-creation",element:s.jsx(bet,{},`content-${o.language}`)}),s.jsx(Cr,{path:"/boost-mode",element:s.jsx(Met,{})}),s.jsx(Cr,{path:"/media",element:s.jsx(Oet,{})}),s.jsx(Cr,{path:"/posts/new",element:s.jsx(e9,{})}),s.jsx(Cr,{path:"/posts/:postId/edit",element:s.jsx(e9,{})}),s.jsx(Cr,{path:"/callback/return-from-canva",element:s.jsx(Vut,{})}),s.jsx(Cr,{path:"/integrations",element:s.jsx(Out,{})}),s.jsx(Cr,{path:"/canva/editor",element:s.jsx(Uut,{})}),s.jsx(Cr,{path:"/ai-links-builder",element:s.jsx(But,{})})]})]})]})]})})})]})})},rdt=({children:e})=>{var g,y,v,x,j;const{user:t,isLoading:r}=Ps(),n=vs(),{data:a,isLoading:i}=T2(),{data:o,isLoading:l}=Q7(),u=(()=>{var T,L;const C=(L=(T=Qe.currentUser)==null?void 0:T.metadata)==null?void 0:L.creationTime;if(!C)return null;const N=new Date(C);if(Number.isNaN(N.getTime()))return null;
4000const k=(new Date().getTime()-N.getTime())/(1e3*60*60*24);return Math.max(0,Math.min(7,7-Math.floor(k-1)))})(),d=(((g=a==null?void 0:a.currentSubscription)==null?void 0:g.status)||"").toLowerCase(),f=!!(a!=null&&a.hasSubscription&&((y=a==null?void 0:a.currentSubscription)!=null&&y.isActive||d==="active"||d==="trialing")&&(!((v=a==null?void 0:a.currentSubscription)!=null&&v.currentPlan)||(((x=a.currentSubscription.currentPlan)==null?void 0:x.productName)||"").toLowerCase()!=="free")),m=!!((j=o==null?void 0:o.access)!=null&&j.isEntitled),h=typeof u=="number"&&u<=0,p=h&&!f&&!m;if(r)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-primary-600"})});if(!t){const C=`/auth/login${n.search}`;return s.jsx(Bl,{to:C,state:{from:n},replace:!0})}if(h&&(i||l))return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-primary-600"})});if(p){const C=n.pathname||"";if(!["/billing","/payment/success","/payment/cancel"].some(M=>C.startsWith(M)))return s.jsx(Bl,{to:"/billing",replace:!0})}return s.jsx(s.Fragment,{children:e})};function ndt(){return s.jsx(Bse,{client:Qut,children:s.jsx(mhe,{children:s.jsx(phe,{children:s.jsx(ghe,{children:s.jsxs(dJ,{children:[s.jsx(tdt,{}),s.jsx(vhe,{})]})})})})})}rse({dsn:"https://3606db806ef06107dabb1e013cced6d1@o4509286492536832.ingest.de.sentry.io/4509286496927824",tracesSampleRate:0,sendDefaultPii:!1,integrations:[new tse({maskAllText:!0,blockAllMedia:!0})],replaysSessionSampleRate:1,replaysOnErrorSampleRate:1,beforeSend(e){var r,n,a;return e.user&&(e.user.ip_address=void 0),(((a=(n=(r=e.exception)==null?void 0:r.values)==null?void 0:n[0])==null?void 0:a.value)??"").includes("Failed to execute 'removeChild' on 'Node'")?null:e}});hje();function adt(){return s.jsx("h1",{children:"Something went wrong."})}function sdt(e,t){(typeof t=="string"?t:(t==null?void 0:t.message)??"").includes("Failed to execute 'removeChild' on 'Node'")&&e.setExtra("ignored_removechild",!0)}aF(document.getElementById("root")).render(s.jsx(b.StrictMode,{children:s.jsx(xse,{fallback:adt,beforeCapture:sdt,onError:e=>{((e==null?void 0:e.message)??"").includes("Failed to execute 'removeChild' on 'Node'")&&console.warn("Suppressed benign removeChild error from third-party script/extension")},children:s.jsx(ndt,{})})}));
4001//# sourceMappingURL=index-DsBLc1Xm.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.