@buildbase/sdk 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -2
- package/dist/css/styles.css +1 -1
- package/dist/index.d.ts +114 -44
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react/index.d.ts +121 -12
- package/dist/react/index.js +6 -6
- package/dist/react/index.mjs +4 -4
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),s=n(r);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function o(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}const c=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),l="-",u=[],d=e=>{const t=h(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return m(e);const r=e.split(l),n=""===r[0]&&r.length>1?1:0;return p(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],a=r[e];return t?a?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(a,t):t:a||u}return r[e]||u}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=p(e,t+1,a);if(r)return r}const s=r.validators;if(null===s)return;const i=0===t?e.join(l):e.slice(t).join(l),o=s.length;for(let e=0;e<o;e++){const t=s[e];if(t.validator(i))return t.classGroupId}},m=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),h=e=>{const{theme:t,classGroups:r}=e;return f(r,t)},f=(e,t)=>{const r=c();for(const n in e){const a=e[n];g(a,r,n,t)}return r},g=(e,t,r,n)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];b(a,t,r,n)}},b=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?x(e,t,r,n):y(e,t,r,n):v(e,t,r)},v=(e,t,r)=>{(""===e?t:w(t,e)).classGroupId=r},y=(e,t,r,n)=>{S(e)?g(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},x=(e,t,r,n)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,i]=a[e];g(i,w(t,s),r,n)}},w=(e,t)=>{let r=e;const n=t.split(l),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=c(),r.nextPart.set(t,a)),r=a}return r},S=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,s)=>{r[a]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},E=[],C=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),N=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,s=0;const i=e.length;for(let o=0;o<i;o++){const i=e[o];if(0===n&&0===a){if(":"===i){t.push(e.slice(s,o)),s=o+1;continue}if("/"===i){r=o;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const o=0===t.length?e:e.slice(s);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return C(t,l,c,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):C(E,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let a=0;a<e.length;a++){const s=e[a],i="["===s[0],o=t.has(s);i||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(s)):n.push(s)}return n.length>0&&(n.sort(),r.push(...n)),r}},j=/\s+/,P=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=P(e[n]))&&(r&&(r+=" "),r+=t);return r},T=(e,...t)=>{let r,n,a,s;const i=e=>{const t=n(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(j);let c="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:m}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let h=!!m,f=n(h?p.substring(0,m):p);if(!f){if(!h){c=t+(c.length>0?" "+c:c);continue}if(f=n(p),!f){c=t+(c.length>0?" "+c:c);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:s(u).join(":"),b=d?g+"!":g,v=b+f;if(i.indexOf(v)>-1)continue;i.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,s),s};return s=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:k(e.cacheSize),parseClassName:N(e),sortModifiers:A(e),...d(e)}))(c),n=r.cache.get,a=r.cache.set,s=i,i(o)},(...e)=>s(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=P(t))&&(a&&(a+=" "),a+=r);return a})(...e))},_=[],R=e=>{const t=t=>t[e]||_;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,U=/^\d+\/\d+$/,M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>U.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),H=e=>e.endsWith("%")&&W(e.slice(0,-1)),G=e=>M.test(e),$=()=>!0,K=e=>L.test(e)&&!O.test(e),q=()=>!1,Z=e=>z.test(e),J=e=>F.test(e),Y=e=>!Q(e)&&!se(e),X=e=>pe(e,ge,q),Q=e=>D.test(e),ee=e=>pe(e,be,K),te=e=>pe(e,ve,W),re=e=>pe(e,he,q),ne=e=>pe(e,fe,J),ae=e=>pe(e,xe,Z),se=e=>I.test(e),ie=e=>me(e,be),oe=e=>me(e,ye),ce=e=>me(e,he),le=e=>me(e,ge),ue=e=>me(e,fe),de=e=>me(e,xe,!0),pe=(e,t,r)=>{const n=D.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},me=(e,t,r=!1)=>{const n=I.exec(e);return!!n&&(n[1]?t(n[1]):r)},he=e=>"position"===e||"percentage"===e,fe=e=>"image"===e||"url"===e,ge=e=>"length"===e||"size"===e||"bg-size"===e,be=e=>"length"===e,ve=e=>"number"===e,ye=e=>"family-name"===e,xe=e=>"shadow"===e,we=T(()=>{const e=R("color"),t=R("font"),r=R("text"),n=R("font-weight"),a=R("tracking"),s=R("leading"),i=R("breakpoint"),o=R("container"),c=R("spacing"),l=R("radius"),u=R("shadow"),d=R("inset-shadow"),p=R("text-shadow"),m=R("drop-shadow"),h=R("blur"),f=R("perspective"),g=R("aspect"),b=R("ease"),v=R("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",se,Q],x=()=>[se,Q,c],w=()=>[B,"full","auto",...x()],S=()=>[V,"none","subgrid",se,Q],k=()=>["auto",{span:["full",V,se,Q]},V,se,Q],E=()=>[V,"auto",se,Q],C=()=>["auto","min","max","fr",se,Q],N=()=>["auto",...x()],A=()=>[B,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[e,se,Q],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ce,re,{position:[se,Q]}],T=()=>["auto","cover","contain",le,X,{size:[se,Q]}],_=()=>[H,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],U=()=>[W,H,ce,re],M=()=>["","none",h,se,Q],L=()=>["none",W,se,Q],O=()=>["none",W,se,Q],z=()=>[W,se,Q],F=()=>[B,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[$],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",W],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",B,Q,se,g]}],container:["container"],columns:[{columns:[W,Q,se,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",se,Q]}],basis:[{basis:[B,"full","auto",o,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,B,"auto","initial","none",Q]}],grow:[{grow:["",W,se,Q]}],shrink:[{shrink:["",W,se,Q]}],order:[{order:[V,"first","last","none",se,Q]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[o,"screen",...A()]}],"min-w":[{"min-w":[o,"screen","none",...A()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,ie,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,se,te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",H,Q]}],"font-family":[{font:[oe,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,se,Q]}],"line-clamp":[{"line-clamp":[W,"none",se,te]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[W,"from-font","auto",se,ee]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[W,"auto",se,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},ue,ne]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[W,se,Q]}],"outline-w":[{outline:["",W,ie,ee]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,de,ae]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",d,de,ae]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[W,ee]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,de,ae]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[W,se,Q]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[se,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:M()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,de,ae]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",W,se,Q]}],"hue-rotate":[{"hue-rotate":[W,se,Q]}],invert:[{invert:["",W,se,Q]}],saturate:[{saturate:[W,se,Q]}],sepia:[{sepia:["",W,se,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",se,Q]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[W,se,Q]}],"backdrop-contrast":[{"backdrop-contrast":[W,se,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,se,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,se,Q]}],"backdrop-invert":[{"backdrop-invert":["",W,se,Q]}],"backdrop-opacity":[{"backdrop-opacity":[W,se,Q]}],"backdrop-saturate":[{"backdrop-saturate":[W,se,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",W,se,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",se,Q]}],ease:[{ease:["linear","initial",b,se,Q]}],delay:[{delay:[W,se,Q]}],animate:[{animate:["none",v,se,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,se,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[se,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se,Q]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[W,ie,ee,te]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Se(...e){return we(o(e))}let ke=!0;function Ee(e,...t){ke&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Ce(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function je(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function Pe(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await je(e);r=t.message||t.error||r}catch{r=function(e,t){const r={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${r})`)}(e,t).message}throw new Error(r)}try{return await je(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Te extends Error{constructor(e,t,r,n){super(e),this.code=t,this.context=r,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,Te)}}const _e=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(ke=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(Ne(e))return;const r=e instanceof Error?e:new Te("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Te?r:new Te(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ee(`[SDK Error] ${t.component||"Unknown"}:`,{message:n.message,code:n.code,context:n.context,originalError:n.originalError,stack:n.stack}),this.config.onError)try{this.config.onError(n,t)}catch(e){Ce("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(n,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...r)=>e(...r).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...r)=>{try{return e(...r)}catch(e){throw this.handleError(e,t),e}}}};function Re(e,t={}){_e.handleError(e,t)}function De(e,t={}){return!Ne(e)&&(_e.handleError(e,t),!0)}class Ie extends t.Component{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(Re(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ce("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const Ue=()=>({type:"AUTHENTICATION_STARTED"}),Me=()=>({type:"AUTHENTICATION_PROCESSING"}),Le=()=>({type:"AUTHENTICATION_FAILED"}),Oe=e=>({type:"SET_SESSION",payload:e}),ze=()=>({type:"REMOVE_SESSION"});function Fe(e,r,n){const a=t.useRef(r),s=t.useRef(n),i=t.useRef(void 0),o=t.useRef(!1);return a.current=r,s.current=n,t.useMemo(()=>{const t=a.current(e);if(o.current){if(s.current?s.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function Be({name:r,initialState:n,reducer:a,initializer:s}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:r})=>{const[l,u]=t.useReducer(a,n,s||(e=>e)),d=t.useMemo(()=>({state:l,dispatch:u}),[l,u]);return e.jsx(c.Provider,{value:d,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:u,children:r})})})});l.displayName=`${r}Provider`;const u=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),d=()=>{const e=t.useContext(i);if(null===e)throw u("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw u("Context");return e},useState:d,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw u("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(d(),r,t)}}}var We;function Ve(e){return{isAuthenticated:e===We.authenticated,isLoading:e===We.loading||e===We.redirecting||e===We.authenticating,isRedirecting:e===We.redirecting}}function He(e,t,r){return{...e,[t]:r}}function Ge(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(We||(We={}));const $e=()=>({session:null,status:We.loading}),{Provider:Ke,useState:qe,useDispatch:Ze}=Be({name:"Auth",initialState:$e(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return He(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return He(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return Ge(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return Ge(e,{session:t.payload,status:We.authenticated});default:return e}},initializer:$e}),Je=Ke,Ye=qe,Xe=Ze,Qe=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),et=e=>({type:"SET_SETTINGS",payload:e});var tt;function rt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(tt||(tt={}));const nt=()=>({serverUrl:"",version:tt.V1,orgId:"",settings:null}),{Provider:at,useState:st,useDispatch:it}=Be({name:"OS",initialState:nt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return Ge(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return He(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,ut=e=>({type:"SET_WORKSPACES",payload:e}),dt=e=>({type:"ADD_WORKSPACE",payload:e}),pt=e=>({type:"UPDATE_WORKSPACE",payload:e}),mt=e=>({type:"REMOVE_WORKSPACE",payload:e}),ht=e=>({type:"SET_ALL_FEATURES",payload:e}),ft=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),gt=()=>({type:"RESET_CURRENT_WORKSPACE"}),bt=e=>({type:"SET_IS_INITIALIZED",payload:e}),vt=e=>({type:"SET_LOADING",payload:e}),yt=e=>({type:"SET_ERROR",payload:e}),xt=e=>({type:"SET_REFRESHING",payload:e}),wt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:St,useState:kt,useDispatch:Et}=Be({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return He(e,"workspaces",t.payload);case"ADD_WORKSPACE":return He(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return He(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return He(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return He(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return He(e,"isInitialized",t.payload);case"SET_LOADING":return He(e,"loading",t.payload);case"SET_ERROR":return He(e,"error",t.payload);case"SET_REFRESHING":return He(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return He(e,"switchingToId",t.payload);default:return e}}}),Ct=St,Nt=kt,At=Et,jt=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Ct,{children:t})})}));function Pt(e,r){const n=ct(),a=Ye(),s=Nt(),i=e||(e=>e);return Fe(t.useMemo(()=>({os:n,auth:a,workspaces:s}),[n,a,s]),i,r)}jt.displayName="SDKContextProvider";const Tt=new Set;function _t(){Tt.forEach(e=>e())}const Rt=new Set;function Dt(){Rt.forEach(e=>e())}function It(e,t){const r=t&&t.cache?t.cache:Bt,n=t&&t.serializer?t.serializer:zt;return(t&&t.strategy?t.strategy:Ot)(e,{cache:r,serializer:n})}function Ut(e,t,r,n){const a=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:r(n);var s;let i=t.get(a);return void 0===i&&(i=e.call(this,n),t.set(a,i)),i}function Mt(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let s=t.get(a);return void 0===s&&(s=e.apply(this,n),t.set(a,s)),s}function Lt(e,t,r,n,a){return r.bind(t,e,n,a)}function Ot(e,t){return Lt(e,this,1===e.length?Ut:Mt,t.cache.create(),t.serializer)}const zt=function(){return JSON.stringify(arguments)};class Ft{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Bt={create:function(){return new Ft}},Wt={variadic:function(e,t){return Lt(e,this,Mt,t.cache.create(),t.serializer)}},Vt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Ht(e){const t={};return e.replace(Vt,e=>{const r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const Gt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function $t(e){return e.replace(/^(.*?)-/,"")}const Kt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,qt=/^(@+)?(\+|#+)?[rs]?$/g,Zt=/(\*)(0+)|(#+)(0+)|(0+)/g,Jt=/^(0+)$/;function Yt(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(qt,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function Xt(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Qt(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Jt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function er(e){const t=Xt(e);return t||{}}function tr(e){let t={};for(const r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=$t(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Zt,function(e,r,n,a,s,i){if(r)t.minimumIntegerDigits=n.length;else{if(a&&s)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Jt.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Kt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Kt,function(e,r,n,a,s,i){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:s&&i?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+i.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...Yt(e)});continue}if(qt.test(r.stem)){t={...t,...Yt(r.stem)};continue}const e=Xt(r.stem);e&&(t={...t,...e});const n=Qt(r.stem);n&&(t={...t,...n})}return t}let rr=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),nr=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function ar(e){return e.type===rr.literal}function sr(e){return e.type===rr.argument}function ir(e){return e.type===rr.number}function or(e){return e.type===rr.date}function cr(e){return e.type===rr.time}function lr(e){return e.type===rr.select}function ur(e){return e.type===rr.plural}function dr(e){return e.type===rr.pound}function pr(e){return e.type===rr.tag}function mr(e){return!(!e||"object"!=typeof e||e.type!==nr.number)}function hr(e){return!(!e||"object"!=typeof e||e.type!==nr.dateTime)}let fr=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const gr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,br={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function vr(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const r=e.language;let n;"root"!==r&&(n=e.maximize().region);return(br[n||""]||br[r||""]||br[`${r}-001`]||br["001"])[0]}const yr=new RegExp(`^${gr.source}*`),xr=new RegExp(`${gr.source}*$`);function wr(e,t){return{start:e,end:t}}const Sr=!!Object.fromEntries,kr=!!String.prototype.trimStart,Er=!!String.prototype.trimEnd,Cr=Sr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Nr=kr?function(e){return e.trimStart()}:function(e){return e.replace(yr,"")},Ar=Er?function(e){return e.trimEnd()}:function(e){return e.replace(xr,"")},jr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Pr{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const a=this.char();if(123===a){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===a&&e>0)break;if(35!==a||"plural"!==t&&"selectordinal"!==t){if(60===a&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(fr.UNMATCHED_CLOSING_TAG,wr(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Tr(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:rr.pound,location:wr(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:rr.literal,value:`<${n}/>`,location:wr(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const s=a.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Tr(this.char()))return this.error(fr.INVALID_TAG,wr(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(fr.UNMATCHED_CLOSING_TAG,wr(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:rr.tag,value:n,children:s,location:wr(r,this.clonePosition())},err:null}:this.error(fr.INVALID_TAG,wr(i,this.clonePosition())))}return this.error(fr.UNCLOSED_TAG,wr(r,this.clonePosition()))}return this.error(fr.INVALID_TAG,wr(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&_r(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n="";for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const a=this.tryParseUnquoted(e,t);if(a){n+=a;continue}const s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}const a=wr(r,this.clonePosition());return{val:{type:rr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Tr(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(fr.EMPTY_ARGUMENT,wr(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:rr.argument,value:n,location:wr(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return jr.lastIndex=t,jr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:wr(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(s){case"":return this.error(fr.EXPECT_ARGUMENT_TYPE,wr(a,i));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=Ar(r.val);if(0===n.length)return this.error(fr.EXPECT_ARGUMENT_STYLE,wr(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:wr(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=wr(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Nr(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:rr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(fr.EXPECT_DATE_TIME_SKELETON,a);let n=t;this.locale&&(n=function(e,t){let r="";for(let n=0;n<e.length;n++){const a=e.charAt(n);if("j"===a){let s=0;for(;n+1<e.length&&e.charAt(n+1)===a;)s++,n++;let i=1+(1&s),o=s<2?1:3+(s>>1),c="a",l=vr(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;i-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const i={type:nr.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ht(n):{}};return{val:{type:"date"===s?rr.date:rr.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?rr.number:"date"===s?rr.date:rr.time,value:r,location:a,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const a=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(fr.EXPECT_SELECT_ARGUMENT_OPTIONS,wr(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,wr(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,s,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const u=wr(n,this.clonePosition());return"select"===s?{val:{type:rr.select,value:r,options:Cr(c.val),location:u},err:null}:{val:{type:rr.plural,value:r,options:Cr(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(fr.INVALID_ARGUMENT_TYPE,wr(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(fr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,wr(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(Gt).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[n,...a]=t;for(const e of a)if(0===e.length)throw new Error("Invalid number skeleton");r.push({stem:n,options:a})}return r}(e)}catch{return this.error(fr.INVALID_NUMBER_SKELETON,t)}return{val:{type:nr.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?tr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const s=[],i=new Set;let{value:o,location:c}=n;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,fr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=wr(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?fr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:fr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,wr(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const u=this.tryParseArgumentClose(n);if(u.err)return u;s.push([o,{value:l.val,location:wr(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,wr(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(fr.MISSING_OTHER_CLAUSE,wr(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,s=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,s=10*s+(e-48),this.bump()}const i=wr(n,this.clonePosition());return a?(s*=r,Number.isSafeInteger(s)?{val:s,err:null}:this.error(t,i)):this.error(e,i)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Rr(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function Tr(e){return e>=97&&e<=122||e>=65&&e<=90}function _r(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Rr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Dr(e){e.forEach(e=>{if(delete e.location,lr(e)||ur(e))for(const t in e.options)delete e.options[t].location,Dr(e.options[t].value);else ir(e)&&mr(e.style)||(or(e)||cr(e))&&hr(e.style)?delete e.style.location:pr(e)&&Dr(e.children)})}function Ir(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Pr(e,t).parse();if(r.err){const e=SyntaxError(fr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Dr(r.val),r.val}let Ur=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Mr extends Error{code;originalMessage;constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class Lr extends Mr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Ur.INVALID_VALUE,n)}}class Or extends Mr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Ur.INVALID_VALUE,r)}}class zr extends Mr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Ur.MISSING_VALUE,t)}}let Fr=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Br(e){return"function"==typeof e}function Wr(e,t,r,n,a,s,i){if(1===e.length&&ar(e[0]))return[{type:Fr.literal,value:e[0].value}];const o=[];for(const c of e){if(ar(c)){o.push({type:Fr.literal,value:c.value});continue}if(dr(c)){"number"==typeof s&&o.push({type:Fr.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new zr(e,i);let l=a[e];if(sr(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?Fr.literal:Fr.object,value:l});else{if(or(c)){const e="string"==typeof c.style?n.date[c.style]:hr(c.style)?c.style.parsedOptions:void 0;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(cr(c)){const e="string"==typeof c.style?n.time[c.style]:hr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(ir(c)){const e="string"==typeof c.style?n.number[c.style]:mr(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:Fr.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(pr(c)){const{children:e,value:l}=c,u=a[l];if(!Br(u))throw new Or(l,"function",i);let d=u(Wr(e,t,r,n,a,s).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?Fr.literal:Fr.object,value:e})))}if(lr(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);o.push(...Wr(s.value,t,r,n,a));continue}if(ur(c)){const e=`=${l}`;let s=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!s){if(!Intl.PluralRules)throw new Mr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Ur.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));s=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);const u="bigint"==typeof l?Number(l):l;o.push(...Wr(s.value,t,r,n,a,u-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===Fr.literal&&t.type===Fr.literal?r.value+=t.value:e.push(t),e},[]);var c}function Vr(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,s;return r[n]=(a=e[n],(s=t[n])?{...a,...s,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...s[t]},e),{})}:a),r},{...e}):e}function Hr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class Gr{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=Gr.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=Gr.resolveLocale(t),"string"==typeof e){if(this.message=e,!Gr.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=Gr.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Vr(Gr.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:It((...e)=>new Intl.NumberFormat(...e),{cache:Hr(e.number),strategy:Wt.variadic}),getDateTimeFormat:It((...e)=>new Intl.DateTimeFormat(...e),{cache:Hr(e.dateTime),strategy:Wt.variadic}),getPluralRules:It((...e)=>new Intl.PluralRules(...e),{cache:Hr(e.pluralRules),strategy:Wt.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===Fr.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r};formatToParts=e=>Wr(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return Gr.memoizedDefaultLocale||(Gr.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),Gr.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Ir;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const $r={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",features:"Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}"}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",resumeTitle:"Resume Subscription",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number} included",includedWithOverage:"{count, number} included, then {price} / {unit}",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs"}},Kr={en:async()=>$r,es:async()=>(await Promise.resolve().then(function(){return XE})).es,fr:async()=>(await Promise.resolve().then(function(){return QE})).fr,de:async()=>(await Promise.resolve().then(function(){return eC})).de,ja:async()=>(await Promise.resolve().then(function(){return tC})).ja,zh:async()=>(await Promise.resolve().then(function(){return rC})).zh,hi:async()=>(await Promise.resolve().then(function(){return nC})).hi,ar:async()=>(await Promise.resolve().then(function(){return aC})).ar},qr=["en","es","fr","de","ja","zh","hi","ar"];const Zr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const Jr=t.createContext({messages:$r,locale:"en",formattingLocale:"en"});function Yr({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(qr.includes(t))return t;const r=t.split("-")[0];return qr.includes(r)?r:"en"}(e),[a,s]=t.useState($r);t.useEffect(()=>{if("en"===n)return void s($r);let e=!1;const t=Kr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Zr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(Jr.Provider,{value:o},r)}const Xr=new Map,Qr=new Map,en=new Map;function tn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const rn={getNumberFormat(e,t){const r=tn(e,t);let n=Xr.get(r);return n||(n=new Intl.NumberFormat(e,t),Xr.set(r,n)),n},getDateTimeFormat(e,t){const r=tn(e,t);let n=Qr.get(r);return n||(n=new Intl.DateTimeFormat(e,t),Qr.set(r,n)),n},getPluralRules(e,t){const r=tn(e,t);let n=en.get(r);return n||(n=new Intl.PluralRules(e,t),en.set(r,n)),n}},nn=new Map;function an(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(Jr),a=t.useMemo(()=>(t,r)=>{const a=t.split(".");let s=e;for(const e of a){if(!s||"object"!=typeof s||!(e in s))return t;s=s[e]}const i="string"==typeof s?s:t;if(!r)return i;try{const e=function(e,t){const r=`${t}:${e}`;let n=nn.get(r);return n||(n=new Gr(e,t,void 0,{formatters:rn}),nn.set(r,n)),n}(i,n),t=e.format(r);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??`{${t}}`))}},[e,n]),s="ar"===r?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(n),[n]),o=t.useMemo(()=>(e,t)=>{const r=(t??"").trim().toUpperCase();if(!r)return(e/100).toLocaleString(n,{minimumFractionDigits:2});try{return new Intl.NumberFormat(n,{style:"currency",currency:r,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(n,{minimumFractionDigits:2})}},[n]);return{t:a,locale:r,formattingLocale:n,dir:s,fmtNum:i,fmtCents:o,messages:e}}function sn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Re(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function on(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Re(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function cn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Re(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const ln="saas-session-id",un="code";function dn(e){on(ln,e)}function pn(){return function(){if("undefined"==typeof window)return null;try{return sn(ln)}catch(e){return Re(e,{component:"auth-utils",action:"getSessionId",metadata:{key:ln}}),null}}()}function mn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(un)}catch(e){return Re(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:un}}),null}}const hn="SDK is not ready (missing serverUrl, version, or orgId)";class fn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(hn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(hn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=pn(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const r=this.url(e),n=(t.method??"GET").toUpperCase(),a=this.buildHeaders(t),s={...t,headers:a};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),s.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),a=await e(r,s);if(this._debug&&console.log(`[BuildBase] ${n} ${r} → ${a.status}`),a.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return a}catch(r){if(r instanceof Error&&"AbortError"===r.name){if(void 0!==i){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw r}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw r instanceof Error&&this._onError?.(r,{method:n,path:e}),r}};try{return await o(0)}finally{void 0!==i&&clearTimeout(i)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await Pe(n,r)}catch(r){throw r instanceof Error&&this._onError?.(r,{method:(t.method??"GET").toUpperCase(),path:e}),r}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class gn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,r){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(r)},"Failed to update user")}async updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,r){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:r}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch subscription");return r.data||r}return r}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group");return r.data||r}return r}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch plan group version";try{e=(await r.json()).message||e}catch{e=404===r.status?"Plan group version not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group versions");return r.data||r}return r}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let r="Failed to fetch plans";try{r=(await t.json()).message||r}catch{r=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(r)}const r=await t.json();if(void 0!==r.success&&!r.success)throw new Error(r.message||"Failed to fetch plans");return r.data??r}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group version");return r.data||r}return r}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to create checkout session";try{e=(await r.json()).message||e}catch{e=`Failed to create checkout session (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to create checkout session");return n.data||n}return n}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!r.ok){let e="Failed to update subscription";try{e=(await r.json()).message||e}catch{e=`Failed to update subscription (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to update subscription");return n.data?.checkoutUrl||n.checkoutUrl,n.data||n}return n.checkoutUrl,n}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,r){const n=new URLSearchParams;n.append("limit",t.toString()),r&&n.append("starting_after",r);const a=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`,{});if(!a.ok){let e="Failed to fetch invoices";try{e=(await a.json()).message||e}catch{e=404===a.status?"Workspace not found or no invoices available":401===a.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${a.status}: ${a.statusText})`}throw new Error(e)}const s=await a.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch invoices");return s}return s}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!r.ok){let e="Failed to fetch invoice";try{e=(await r.json()).message||e}catch{e=404===r.status?"Invoice not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch invoice");return n}return n}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to cancel subscription");return r.data||r}return r}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to resume subscription");return r.data||r}return r}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record usage";try{e=(await r.json()).message||e}catch{e=`Failed to record usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to record usage");return n.data||n}return n}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record batch usage";try{e=(await r.json()).message||e}catch{e=`Failed to record batch usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();return n.data||n}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch quota usage status";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no subscription available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch quota usage status");return n.data||n}return n}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch all quota usage");return r.data||r}return r}async getUsageLogs(e,t){const r=new URLSearchParams;t?.quotaSlug&&r.append("quotaSlug",t.quotaSlug),t?.from&&r.append("from",t.from),t?.to&&r.append("to",t.to),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch usage logs";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found":401===s.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}}function bn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function vn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Re(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class yn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function xn(){return Pt(e=>e.os)}let wn=null;function Sn(){const e=bn(),r=xn(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new yn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?wn||(wn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return De(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{wn=null}})(),wn):null,[o,e,n,a,s]);return vn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>De(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function kn(){const e=xn(),r=function(e){return t.useMemo(()=>new gn(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:r}),[e,r])}function En(e,t,r){return e instanceof Error?e.message:r(t)}const Cn=e=>{const{t:r}=an(),{os:n,api:a}=kn(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),d(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=En(t,"errors.fetchPlans",r);d(n),Re(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[a,e,s]);t.useEffect(()=>{p()},[p]);const m=e&&!s||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:m,error:u,refetch:p}},Nn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=En(t,"errors.fetchSubscription",r);l(n),Re(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{subscription:a,loading:i,error:c,refetch:u}},An=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e){c(!0),u(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=En(t,"errors.fetchPlanGroup",n);u(a),Re(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{planGroup:s,loading:o,error:l,refetch:d}},jn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersions",r);l(n),Re(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{versions:a,loading:i,error:c,refetch:u}},Pn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.createCheckoutSession(e,t);return"trial_started"===r.type&&(Dt(),_t()),r}catch(n){const a=En(n,"errors.createCheckout",r);throw o(a),Re(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Tn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null),c=t.useCallback(async(t,a)=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r={planVersionId:t,...a?.billingInterval&&{billingInterval:a.billingInterval},...a?.successUrl&&{successUrl:a.successUrl},...a?.cancelUrl&&{cancelUrl:a.cancelUrl}},s=await n.updateSubscription(e,r);return Dt(),s}catch(n){const s=En(n,"errors.updateSubscription",r);throw o(s),Re(n,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:a}}),n}finally{s(!1)}},[n,e]);return{updateSubscription:c,loading:a,error:i}},_n=(e,r)=>{const n=Nn(e),a=An(e,r),s=Tn(e),i=t.useCallback(async()=>{await Promise.all([n.refetch(),a.refetch()])},[n.refetch,a.refetch]);return{subscription:n.subscription,planGroup:a.planGroup,loading:n.loading||a.loading||s.loading,error:n.error||a.error||s.error,updateSubscription:s.updateSubscription,refetch:i}},Rn=(e,r=10,n)=>{const{t:a}=an(),{api:s}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);d(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=En(t,"errors.fetchInvoices",a);m(s),Re(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{d(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:u,error:p,refetch:h}},Dn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=t||window.location.href,a=await n.createBillingPortalSession(e,r);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(t){const n=En(t,"errors.openBillingPortal",r);throw o(n),Re(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},In=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.cancelSubscriptionAtPeriodEnd(e);return Dt(),t}catch(t){const n=En(t,"errors.cancelSubscription",r);throw o(n),Re(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Un=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.resumeSubscription(e);return Dt(),t}catch(t){const n=En(t,"errors.resumeSubscription",r);throw o(n),Re(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Mn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=En(t,"errors.fetchAllQuotaUsage",r);l(n),Re(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{quotas:a,loading:i,error:c,refetch:u}},Ln=t.createContext(null);Ln.displayName="SubscriptionContext";const On=t.memo(function({children:r}){const n=Pt(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=Nn(n?._id);t.useEffect(()=>{return e=o,Rt.add(e),()=>{Rt.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Ln.Provider,{value:c,children:r})});function zn(){const e=t.useContext(Ln);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}On.displayName="SubscriptionContextProvider";const Fn={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Bn="active",Wn="trialing",Vn="canceled",Hn="past_due",Gn="paused",$n="draft",Kn="open",qn="paid",Zn="uncollectible",Jn="void",Yn="feature",Xn="limit",Qn="quota",ea="none",ta="final",ra="suspended";function na(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function aa(e,t,r){const n=na(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function sa(e,t,r,n){const a=na(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function ia(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=sa(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i}}}function oa(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function ca(e,t){const r=na(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function la(e,t,r){const n=ca(e,t);return n?.perSeat?n.perSeat[r]??null:null}function ua(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=ca(t,r);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function da(e){const{memberCount:t,maxUsersConfig:r,hasSubscription:n=!0,requireSubscription:a=!1}=e;if(a&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:s,source:i}=r;if(s<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=s){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:s}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const pa="user:created",ma="user:updated",ha="workspace:changed",fa="workspace:updated",ga="workspace:user-added",ba="workspace:user-removed",va="workspace:user-role-changed",ya="workspace:created",xa="workspace:deleted";const wa=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){Re(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(pa,{user:e})}async emitUserUpdated(e,t){await this.emit(ma,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(ha,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(fa,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(ga,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(ba,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(va,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(ya,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(xa,{workspace:e})}},Sa="saas-workspace-current",ka=e=>{e?on(Sa,e._id):cn(Sa)},Ea=()=>sn(Sa),Ca=()=>{cn(Sa)},Na=(e,t)=>!!e&&t.some(t=>t._id===e);function Aa(e,t){if(!t)return!1;const r=(n=e.createdBy)?"string"==typeof n?n:"object"==typeof n&&"_id"in n&&"string"==typeof n._id?n._id:null:null;var n;return null!==r&&r===t}function ja(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const r=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return r&&"object"==typeof r&&"role"in r&&"string"==typeof r.role?r.role:null}const Pa=()=>{const e=bn(),{os:r,api:n}=kn(),{settings:a}=Sn(),s=Pt(e=>e.workspaces),i=Pt(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;ka(t),e.workspaces(ft(t)),wa.emitWorkspaceChanged(t,r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++p.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=ja(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Re(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==p.current)return}o(t,n)}finally{a===p.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!s.isInitialized){const t=Ea();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[s.isInitialized,s.workspaces,s.currentWorkspace,e,c]);const l=t.useCallback(()=>{Ca(),e.workspaces(gt())},[e]),u=t.useRef(!1),d=t.useRef(!1),p=t.useRef(0),m=t.useCallback(async()=>{if(!s.loading&&!u.current){u.current=!0,e.workspaces(vt(!0)),e.workspaces(yt(null));try{const t=await n.getWorkspaces();if(e.workspaces(ut(t)),t.length>0){const e=Ea();if(e&&Na(e,t)){const r=t.find(t=>t._id===e);if(r)try{await c(r,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(yt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(vt(!1)),u.current=!1}}},[n,s.loading,e,c]),h=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(ut(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,s.refreshing,e]),f=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(dt(a)),wa.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})})},[n,e]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),wa.emitWorkspaceUpdated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),b=t.useCallback(async()=>{if(d.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;d.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Re(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{d.current=!1}},[n,e,s.allFeatures]),v=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),y=t.useCallback(async e=>n.updateSettings(e),[n]),x=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await h(),r},[n,h]);t.useEffect(()=>{if(!s.currentWorkspace?._id||0===s.workspaces.length)return;const t=s.currentWorkspace._id,r=s.workspaces.find(e=>e._id===t);if(r)r!==s.currentWorkspace&&(ka(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[s.workspaces,s.currentWorkspace,e,c]);const w=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),S=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=ua({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=da({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await n.addUser(e,{email:t,role:r});return i&&wa.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),Dt(),o},[n,s.workspaces,h,a]),k=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&Aa(r,t))throw new Error("Cannot remove the workspace owner");const a=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await n.removeUser(e,t);if(r&&a){const t=a.role;wa.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),Dt(),i},[n,s.workspaces,h]),E=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&Aa(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=r?.role}const i=await n.updateUser(e,t,r);return r.role&&a&&a!==r.role&&wa.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Re(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),C=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return wa.emitUserUpdated(r,t||void 0).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),N=t.useCallback(async()=>await n.getProfile(),[n]),A=t.useCallback(async e=>await n.getWorkspace(e),[n]),j=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const r=s.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!Aa(r,i.id))throw new Error("Only the workspace creator can delete the workspace");const a=await n.deleteWorkspace(t);return e.workspaces(mt(t)),s.currentWorkspace?._id===t&&(Ca(),e.workspaces(gt())),r&&wa.emitWorkspaceDeleted(r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[n,s.workspaces,s.currentWorkspace,e,i]);return{workspaces:s.workspaces,loading:s.loading,error:s.error,fetchWorkspaces:m,refreshWorkspaces:h,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:f,allFeatures:s.allFeatures,getFeatures:b,updateFeature:v,updateWorkspaceSettings:y,updateWorkspacePermissions:x,getWorkspace:A,updateWorkspace:g,getUsers:w,addUser:S,removeUser:k,updateUser:E,getProfile:N,updateUserProfile:C,deleteWorkspace:j,switching:null!==s.switchingToId,switchingToId:s.switchingToId}},Ta=t.createContext(null);Ta.displayName="QuotaUsageContext";const _a=t.memo(function({children:r}){const{currentWorkspace:n}=Pa(),{quotas:a,loading:s,error:i,refetch:o}=Mn(n?._id);t.useEffect(()=>{return e=o,Tt.add(e),()=>{Tt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Ta.Provider,{value:c,children:r})});function Ra(){const e=t.useContext(Ta);if(null===e)throw new Error("useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).");return e}_a.displayName="QuotaUsageContextProvider";class Da extends fn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e="Failed to initiate authentication";try{e=(await r.json()).message||e}catch{e=`Failed to initiate authentication (${r.status}: ${r.statusText})`}throw new Error(e)}return r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}function Ia(e,t="/"){const r=function(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}(e);window.location.href=r||t}
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var s=n(t),a=n(r);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function o(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}const c=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),l="-",u=[],d=e=>{const t=h(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return m(e);const r=e.split(l),n=""===r[0]&&r.length>1?1:0;return p(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],s=r[e];return t?s?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(s,t):t:s||u}return r[e]||u}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],s=r.nextPart.get(n);if(s){const r=p(e,t+1,s);if(r)return r}const a=r.validators;if(null===a)return;const i=0===t?e.join(l):e.slice(t).join(l),o=a.length;for(let e=0;e<o;e++){const t=a[e];if(t.validator(i))return t.classGroupId}},m=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),h=e=>{const{theme:t,classGroups:r}=e;return f(r,t)},f=(e,t)=>{const r=c();for(const n in e){const s=e[n];g(s,r,n,t)}return r},g=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const s=e[a];b(s,t,r,n)}},b=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?x(e,t,r,n):y(e,t,r,n):v(e,t,r)},v=(e,t,r)=>{(""===e?t:w(t,e)).classGroupId=r},y=(e,t,r,n)=>{S(e)?g(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},x=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let e=0;e<a;e++){const[a,i]=s[e];g(i,w(t,a),r,n)}},w=(e,t)=>{let r=e;const n=t.split(l),s=n.length;for(let e=0;e<s;e++){const t=n[e];let s=r.nextPart.get(t);s||(s=c(),r.nextPart.set(t,s)),r=s}return r},S=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(s,a)=>{r[s]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(s(e,t),t):void 0},set(e,t){e in r?r[e]=t:s(e,t)}}},E=[],C=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),N=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,s=0,a=0;const i=e.length;for(let o=0;o<i;o++){const i=e[o];if(0===n&&0===s){if(":"===i){t.push(e.slice(a,o)),a=o+1;continue}if("/"===i){r=o;continue}}"["===i?n++:"]"===i?n--:"("===i?s++:")"===i&&s--}const o=0===t.length?e:e.slice(a);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return C(t,l,c,r&&r>a?r-a:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):C(E,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let s=0;s<e.length;s++){const a=e[s],i="["===a[0],o=t.has(a);i||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(a)):n.push(a)}return n.length>0&&(n.sort(),r.push(...n)),r}},_=/\s+/,j=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=j(e[n]))&&(r&&(r+=" "),r+=t);return r},P=(e,...t)=>{let r,n,s,a;const i=e=>{const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(_);let c="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:m}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let h=!!m,f=n(h?p.substring(0,m):p);if(!f){if(!h){c=t+(c.length>0?" "+c:c);continue}if(f=n(p),!f){c=t+(c.length>0?" "+c:c);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:a(u).join(":"),b=d?g+"!":g,v=b+f;if(i.indexOf(v)>-1)continue;i.push(v);const y=s(f,h);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return s(e,a),a};return a=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:k(e.cacheSize),parseClassName:N(e),sortModifiers:A(e),...d(e)}))(c),n=r.cache.get,s=r.cache.set,a=i,i(o)},(...e)=>a(((...e)=>{let t,r,n=0,s="";for(;n<e.length;)(t=e[n++])&&(r=j(t))&&(s&&(s+=" "),s+=r);return s})(...e))},T=[],R=e=>{const t=t=>t[e]||T;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,U=/^\d+\/\d+$/,M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>U.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),H=e=>e.endsWith("%")&&B(e.slice(0,-1)),G=e=>M.test(e),$=()=>!0,K=e=>L.test(e)&&!O.test(e),q=()=>!1,Z=e=>z.test(e),J=e=>F.test(e),Y=e=>!Q(e)&&!ae(e),X=e=>pe(e,ge,q),Q=e=>D.test(e),ee=e=>pe(e,be,K),te=e=>pe(e,ve,B),re=e=>pe(e,he,q),ne=e=>pe(e,fe,J),se=e=>pe(e,xe,Z),ae=e=>I.test(e),ie=e=>me(e,be),oe=e=>me(e,ye),ce=e=>me(e,he),le=e=>me(e,ge),ue=e=>me(e,fe),de=e=>me(e,xe,!0),pe=(e,t,r)=>{const n=D.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},me=(e,t,r=!1)=>{const n=I.exec(e);return!!n&&(n[1]?t(n[1]):r)},he=e=>"position"===e||"percentage"===e,fe=e=>"image"===e||"url"===e,ge=e=>"length"===e||"size"===e||"bg-size"===e,be=e=>"length"===e,ve=e=>"number"===e,ye=e=>"family-name"===e,xe=e=>"shadow"===e,we=P(()=>{const e=R("color"),t=R("font"),r=R("text"),n=R("font-weight"),s=R("tracking"),a=R("leading"),i=R("breakpoint"),o=R("container"),c=R("spacing"),l=R("radius"),u=R("shadow"),d=R("inset-shadow"),p=R("text-shadow"),m=R("drop-shadow"),h=R("blur"),f=R("perspective"),g=R("aspect"),b=R("ease"),v=R("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ae,Q],x=()=>[ae,Q,c],w=()=>[W,"full","auto",...x()],S=()=>[V,"none","subgrid",ae,Q],k=()=>["auto",{span:["full",V,ae,Q]},V,ae,Q],E=()=>[V,"auto",ae,Q],C=()=>["auto","min","max","fr",ae,Q],N=()=>["auto",...x()],A=()=>[W,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],_=()=>[e,ae,Q],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ce,re,{position:[ae,Q]}],P=()=>["auto","cover","contain",le,X,{size:[ae,Q]}],T=()=>[H,ie,ee],D=()=>["","none","full",l,ae,Q],I=()=>["",B,ie,ee],U=()=>[B,H,ce,re],M=()=>["","none",h,ae,Q],L=()=>["none",B,ae,Q],O=()=>["none",B,ae,Q],z=()=>[B,ae,Q],F=()=>[W,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[$],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",B],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",W,Q,ae,g]}],container:["container"],columns:[{columns:[B,Q,ae,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",ae,Q]}],basis:[{basis:[W,"full","auto",o,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[B,W,"auto","initial","none",Q]}],grow:[{grow:["",B,ae,Q]}],shrink:[{shrink:["",B,ae,Q]}],order:[{order:[V,"first","last","none",ae,Q]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[o,"screen",...A()]}],"min-w":[{"min-w":[o,"screen","none",...A()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,ie,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ae,te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",H,Q]}],"font-family":[{font:[oe,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ae,Q]}],"line-clamp":[{"line-clamp":[B,"none",ae,te]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",ae,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ae,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[B,"from-font","auto",ae,ee]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[B,"auto",ae,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ae,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,ae,Q],radial:["",ae,Q],conic:[V,ae,Q]},ue,ne]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[B,ae,Q]}],"outline-w":[{outline:["",B,ie,ee]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,de,se]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,de,se]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[B,ee]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,de,se]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[B,ae,Q]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ae,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ae,Q]}],filter:[{filter:["","none",ae,Q]}],blur:[{blur:M()}],brightness:[{brightness:[B,ae,Q]}],contrast:[{contrast:[B,ae,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,de,se]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",B,ae,Q]}],"hue-rotate":[{"hue-rotate":[B,ae,Q]}],invert:[{invert:["",B,ae,Q]}],saturate:[{saturate:[B,ae,Q]}],sepia:[{sepia:["",B,ae,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ae,Q]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[B,ae,Q]}],"backdrop-contrast":[{"backdrop-contrast":[B,ae,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",B,ae,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,ae,Q]}],"backdrop-invert":[{"backdrop-invert":["",B,ae,Q]}],"backdrop-opacity":[{"backdrop-opacity":[B,ae,Q]}],"backdrop-saturate":[{"backdrop-saturate":[B,ae,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",B,ae,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ae,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[B,"initial",ae,Q]}],ease:[{ease:["linear","initial",b,ae,Q]}],delay:[{delay:[B,ae,Q]}],animate:[{animate:["none",v,ae,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,ae,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[ae,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ae,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ae,Q]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[B,ie,ee,te]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Se(...e){return we(o(e))}let ke=!0;function Ee(e,...t){ke&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Ce(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function _e(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function je(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await _e(e);r=t.message||t.error||r}catch{r=function(e,t){const r={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${r})`)}(e,t).message}throw new Error(r)}try{return await _e(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Pe extends Error{constructor(e,t,r,n){super(e),this.code=t,this.context=r,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,Pe)}}const Te=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(ke=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(Ne(e))return;const r=e instanceof Error?e:new Pe("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Pe?r:new Pe(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ee(`[SDK Error] ${t.component||"Unknown"}:`,{message:n.message,code:n.code,context:n.context,originalError:n.originalError,stack:n.stack}),this.config.onError)try{this.config.onError(n,t)}catch(e){Ce("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(n,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...r)=>e(...r).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...r)=>{try{return e(...r)}catch(e){throw this.handleError(e,t),e}}}};function Re(e,t={}){Te.handleError(e,t)}function De(e,t={}){return!Ne(e)&&(Te.handleError(e,t),!0)}class Ie extends t.Component{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(Re(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ce("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const Ue=()=>({type:"AUTHENTICATION_STARTED"}),Me=()=>({type:"AUTHENTICATION_PROCESSING"}),Le=()=>({type:"AUTHENTICATION_FAILED"}),Oe=e=>({type:"SET_SESSION",payload:e}),ze=()=>({type:"REMOVE_SESSION"});function Fe(e,r,n){const s=t.useRef(r),a=t.useRef(n),i=t.useRef(void 0),o=t.useRef(!1);return s.current=r,a.current=n,t.useMemo(()=>{const t=s.current(e);if(o.current){if(a.current?a.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function We({name:r,initialState:n,reducer:s,initializer:a}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:r})=>{const[l,u]=t.useReducer(s,n,a||(e=>e)),d=t.useMemo(()=>({state:l,dispatch:u}),[l,u]);return e.jsx(c.Provider,{value:d,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:u,children:r})})})});l.displayName=`${r}Provider`;const u=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),d=()=>{const e=t.useContext(i);if(null===e)throw u("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw u("Context");return e},useState:d,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw u("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(d(),r,t)}}}var Be;function Ve(e){return{isAuthenticated:e===Be.authenticated,isLoading:e===Be.loading||e===Be.redirecting||e===Be.authenticating,isRedirecting:e===Be.redirecting}}function He(e,t,r){return{...e,[t]:r}}function Ge(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(Be||(Be={}));const $e=()=>({session:null,status:Be.loading}),{Provider:Ke,useState:qe,useDispatch:Ze}=We({name:"Auth",initialState:$e(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return He(e,"status",Be.redirecting);case"AUTHENTICATION_PROCESSING":return He(e,"status",Be.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return Ge(e,{session:null,status:Be.unauthenticated});case"SET_SESSION":return Ge(e,{session:t.payload,status:Be.authenticated});default:return e}},initializer:$e}),Je=Ke,Ye=qe,Xe=Ze,Qe=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),et=e=>({type:"SET_SETTINGS",payload:e});var tt;function rt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(tt||(tt={}));const nt=()=>({serverUrl:"",version:tt.V1,orgId:"",settings:null}),{Provider:st,useState:at,useDispatch:it}=We({name:"OS",initialState:nt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return Ge(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return He(e,"settings",t.payload);default:return e}}}),ot=st,ct=at,lt=it,ut=e=>({type:"SET_WORKSPACES",payload:e}),dt=e=>({type:"ADD_WORKSPACE",payload:e}),pt=e=>({type:"UPDATE_WORKSPACE",payload:e}),mt=e=>({type:"REMOVE_WORKSPACE",payload:e}),ht=e=>({type:"SET_ALL_FEATURES",payload:e}),ft=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),gt=()=>({type:"RESET_CURRENT_WORKSPACE"}),bt=e=>({type:"SET_IS_INITIALIZED",payload:e}),vt=e=>({type:"SET_LOADING",payload:e}),yt=e=>({type:"SET_ERROR",payload:e}),xt=e=>({type:"SET_REFRESHING",payload:e}),wt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:St,useState:kt,useDispatch:Et}=We({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return He(e,"workspaces",t.payload);case"ADD_WORKSPACE":return He(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return He(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return He(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return He(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return He(e,"isInitialized",t.payload);case"SET_LOADING":return He(e,"loading",t.payload);case"SET_ERROR":return He(e,"error",t.payload);case"SET_REFRESHING":return He(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return He(e,"switchingToId",t.payload);default:return e}}}),Ct=St,Nt=kt,At=Et,_t=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Ct,{children:t})})}));function jt(e,r){const n=ct(),s=Ye(),a=Nt(),i=e||(e=>e);return Fe(t.useMemo(()=>({os:n,auth:s,workspaces:a}),[n,s,a]),i,r)}_t.displayName="SDKContextProvider";const Pt=new Set;function Tt(){Pt.forEach(e=>e())}const Rt=new Set;function Dt(){Rt.forEach(e=>e())}function It(e,t){const r=t&&t.cache?t.cache:Wt,n=t&&t.serializer?t.serializer:zt;return(t&&t.strategy?t.strategy:Ot)(e,{cache:r,serializer:n})}function Ut(e,t,r,n){const s=null==(a=n)||"number"==typeof a||"boolean"==typeof a?n:r(n);var a;let i=t.get(s);return void 0===i&&(i=e.call(this,n),t.set(s,i)),i}function Mt(e,t,r){const n=Array.prototype.slice.call(arguments,3),s=r(n);let a=t.get(s);return void 0===a&&(a=e.apply(this,n),t.set(s,a)),a}function Lt(e,t,r,n,s){return r.bind(t,e,n,s)}function Ot(e,t){return Lt(e,this,1===e.length?Ut:Mt,t.cache.create(),t.serializer)}const zt=function(){return JSON.stringify(arguments)};class Ft{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Wt={create:function(){return new Ft}},Bt={variadic:function(e,t){return Lt(e,this,Mt,t.cache.create(),t.serializer)}},Vt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Ht(e){const t={};return e.replace(Vt,e=>{const r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const Gt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function $t(e){return e.replace(/^(.*?)-/,"")}const Kt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,qt=/^(@+)?(\+|#+)?[rs]?$/g,Zt=/(\*)(0+)|(#+)(0+)|(0+)/g,Jt=/^(0+)$/;function Yt(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(qt,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function Xt(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Qt(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Jt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function er(e){const t=Xt(e);return t||{}}function tr(e){let t={};for(const r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=$t(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Zt,function(e,r,n,s,a,i){if(r)t.minimumIntegerDigits=n.length;else{if(s&&a)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Jt.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Kt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Kt,function(e,r,n,s,a,i){return"*"===n?t.minimumFractionDigits=r.length:s&&"#"===s[0]?t.maximumFractionDigits=s.length:a&&i?(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length+i.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...Yt(e)});continue}if(qt.test(r.stem)){t={...t,...Yt(r.stem)};continue}const e=Xt(r.stem);e&&(t={...t,...e});const n=Qt(r.stem);n&&(t={...t,...n})}return t}let rr=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),nr=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function sr(e){return e.type===rr.literal}function ar(e){return e.type===rr.argument}function ir(e){return e.type===rr.number}function or(e){return e.type===rr.date}function cr(e){return e.type===rr.time}function lr(e){return e.type===rr.select}function ur(e){return e.type===rr.plural}function dr(e){return e.type===rr.pound}function pr(e){return e.type===rr.tag}function mr(e){return!(!e||"object"!=typeof e||e.type!==nr.number)}function hr(e){return!(!e||"object"!=typeof e||e.type!==nr.dateTime)}let fr=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const gr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,br={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function vr(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const r=e.language;let n;"root"!==r&&(n=e.maximize().region);return(br[n||""]||br[r||""]||br[`${r}-001`]||br["001"])[0]}const yr=new RegExp(`^${gr.source}*`),xr=new RegExp(`${gr.source}*$`);function wr(e,t){return{start:e,end:t}}const Sr=!!Object.fromEntries,kr=!!String.prototype.trimStart,Er=!!String.prototype.trimEnd,Cr=Sr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Nr=kr?function(e){return e.trimStart()}:function(e){return e.replace(yr,"")},Ar=Er?function(e){return e.trimEnd()}:function(e){return e.replace(xr,"")},_r=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class jr{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const s=this.char();if(123===s){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===s&&e>0)break;if(35!==s||"plural"!==t&&"selectordinal"!==t){if(60===s&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(fr.UNMATCHED_CLOSING_TAG,wr(this.clonePosition(),this.clonePosition()))}if(60===s&&!this.ignoreTag&&Pr(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:rr.pound,location:wr(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:rr.literal,value:`<${n}/>`,location:wr(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const s=this.parseMessage(e+1,t,!0);if(s.err)return s;const a=s.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Pr(this.char()))return this.error(fr.INVALID_TAG,wr(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(fr.UNMATCHED_CLOSING_TAG,wr(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:rr.tag,value:n,children:a,location:wr(r,this.clonePosition())},err:null}:this.error(fr.INVALID_TAG,wr(i,this.clonePosition())))}return this.error(fr.UNCLOSED_TAG,wr(r,this.clonePosition()))}return this.error(fr.INVALID_TAG,wr(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Tr(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n="";for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const s=this.tryParseUnquoted(e,t);if(s){n+=s;continue}const a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}const s=wr(r,this.clonePosition());return{val:{type:rr.literal,value:n,location:s},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Pr(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(fr.EMPTY_ARGUMENT,wr(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:rr.argument,value:n,location:wr(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return _r.lastIndex=t,_r.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:wr(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(a){case"":return this.error(fr.EXPECT_ARGUMENT_TYPE,wr(s,i));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=Ar(r.val);if(0===n.length)return this.error(fr.EXPECT_ARGUMENT_STYLE,wr(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:wr(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const s=wr(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Nr(e.style.slice(2));if("number"===a){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:rr.number,value:r,location:s,style:n.val},err:null}}{if(0===t.length)return this.error(fr.EXPECT_DATE_TIME_SKELETON,s);let n=t;this.locale&&(n=function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);if("j"===s){let a=0;for(;n+1<e.length&&e.charAt(n+1)===s;)a++,n++;let i=1+(1&a),o=a<2?1:3+(a>>1),c="a",l=vr(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;i-- >0;)r=l+r}else r+="J"===s?"H":s}return r}(t,this.locale));const i={type:nr.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ht(n):{}};return{val:{type:"date"===a?rr.date:rr.time,value:r,location:s,style:i},err:null}}}return{val:{type:"number"===a?rr.number:"date"===a?rr.date:rr.time,value:r,location:s,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const s=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(fr.EXPECT_SELECT_ARGUMENT_OPTIONS,wr(s,{...s}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==a&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,wr(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,a,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const u=wr(n,this.clonePosition());return"select"===a?{val:{type:rr.select,value:r,options:Cr(c.val),location:u},err:null}:{val:{type:rr.plural,value:r,options:Cr(c.val),offset:o,pluralType:"plural"===a?"cardinal":"ordinal",location:u},err:null}}default:return this.error(fr.INVALID_ARGUMENT_TYPE,wr(s,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(fr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,wr(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(Gt).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[n,...s]=t;for(const e of s)if(0===e.length)throw new Error("Invalid number skeleton");r.push({stem:n,options:s})}return r}(e)}catch{return this.error(fr.INVALID_NUMBER_SKELETON,t)}return{val:{type:nr.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?tr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let s=!1;const a=[],i=new Set;let{value:o,location:c}=n;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,fr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=wr(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?fr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:fr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(s=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,wr(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const u=this.tryParseArgumentClose(n);if(u.err)return u;a.push([o,{value:l.val,location:wr(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===a.length?this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,wr(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(fr.MISSING_OTHER_CLAUSE,wr(this.clonePosition(),this.clonePosition())):{val:a,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let s=!1,a=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;s=!0,a=10*a+(e-48),this.bump()}const i=wr(n,this.clonePosition());return s?(a*=r,Number.isSafeInteger(a)?{val:a,err:null}:this.error(t,i)):this.error(e,i)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Rr(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function Pr(e){return e>=97&&e<=122||e>=65&&e<=90}function Tr(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Rr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Dr(e){e.forEach(e=>{if(delete e.location,lr(e)||ur(e))for(const t in e.options)delete e.options[t].location,Dr(e.options[t].value);else ir(e)&&mr(e.style)||(or(e)||cr(e))&&hr(e.style)?delete e.style.location:pr(e)&&Dr(e.children)})}function Ir(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new jr(e,t).parse();if(r.err){const e=SyntaxError(fr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Dr(r.val),r.val}let Ur=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Mr extends Error{code;originalMessage;constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class Lr extends Mr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Ur.INVALID_VALUE,n)}}class Or extends Mr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Ur.INVALID_VALUE,r)}}class zr extends Mr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Ur.MISSING_VALUE,t)}}let Fr=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Wr(e){return"function"==typeof e}function Br(e,t,r,n,s,a,i){if(1===e.length&&sr(e[0]))return[{type:Fr.literal,value:e[0].value}];const o=[];for(const c of e){if(sr(c)){o.push({type:Fr.literal,value:c.value});continue}if(dr(c)){"number"==typeof a&&o.push({type:Fr.literal,value:r.getNumberFormat(t).format(a)});continue}const{value:e}=c;if(!s||!(e in s))throw new zr(e,i);let l=s[e];if(ar(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?Fr.literal:Fr.object,value:l});else{if(or(c)){const e="string"==typeof c.style?n.date[c.style]:hr(c.style)?c.style.parsedOptions:void 0;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(cr(c)){const e="string"==typeof c.style?n.time[c.style]:hr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(ir(c)){const e="string"==typeof c.style?n.number[c.style]:mr(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:Fr.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(pr(c)){const{children:e,value:l}=c,u=s[l];if(!Wr(u))throw new Or(l,"function",i);let d=u(Br(e,t,r,n,s,a).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?Fr.literal:Fr.object,value:e})))}if(lr(c)){const e=l,a=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!a)throw new Lr(c.value,l,Object.keys(c.options),i);o.push(...Br(a.value,t,r,n,s));continue}if(ur(c)){const e=`=${l}`;let a=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!a){if(!Intl.PluralRules)throw new Mr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Ur.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));a=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!a)throw new Lr(c.value,l,Object.keys(c.options),i);const u="bigint"==typeof l?Number(l):l;o.push(...Br(a.value,t,r,n,s,u-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===Fr.literal&&t.type===Fr.literal?r.value+=t.value:e.push(t),e},[]);var c}function Vr(e,t){return t?Object.keys(e).reduce((r,n)=>{var s,a;return r[n]=(s=e[n],(a=t[n])?{...s,...a,...Object.keys(s).reduce((e,t)=>(e[t]={...s[t],...a[t]},e),{})}:s),r},{...e}):e}function Hr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class Gr{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=Gr.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=Gr.resolveLocale(t),"string"==typeof e){if(this.message=e,!Gr.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=Gr.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Vr(Gr.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:It((...e)=>new Intl.NumberFormat(...e),{cache:Hr(e.number),strategy:Bt.variadic}),getDateTimeFormat:It((...e)=>new Intl.DateTimeFormat(...e),{cache:Hr(e.dateTime),strategy:Bt.variadic}),getPluralRules:It((...e)=>new Intl.PluralRules(...e),{cache:Hr(e.pluralRules),strategy:Bt.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===Fr.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r};formatToParts=e=>Br(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return Gr.memoizedDefaultLocale||(Gr.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),Gr.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Ir;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const $r={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",features:"Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}"}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",resumeTitle:"Resume Subscription",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number} included",includedWithOverage:"{count, number} included, then {price} / {unit}",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs"}},Kr={en:async()=>$r,es:async()=>(await Promise.resolve().then(function(){return eC})).es,fr:async()=>(await Promise.resolve().then(function(){return tC})).fr,de:async()=>(await Promise.resolve().then(function(){return rC})).de,ja:async()=>(await Promise.resolve().then(function(){return nC})).ja,zh:async()=>(await Promise.resolve().then(function(){return sC})).zh,hi:async()=>(await Promise.resolve().then(function(){return aC})).hi,ar:async()=>(await Promise.resolve().then(function(){return iC})).ar},qr=["en","es","fr","de","ja","zh","hi","ar"];const Zr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const Jr=t.createContext({messages:$r,locale:"en",formattingLocale:"en"});function Yr({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(qr.includes(t))return t;const r=t.split("-")[0];return qr.includes(r)?r:"en"}(e),[s,a]=t.useState($r);t.useEffect(()=>{if("en"===n)return void a($r);let e=!1;const t=Kr[n];return t&&t().then(t=>{e||a(t)}),()=>{e=!0}},[n]);const i=function(e){return Zr[e]??e}(n),o=t.useMemo(()=>({messages:s,locale:n,formattingLocale:i}),[s,n,i]);return t.createElement(Jr.Provider,{value:o},r)}const Xr=new Map,Qr=new Map,en=new Map;function tn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const rn={getNumberFormat(e,t){const r=tn(e,t);let n=Xr.get(r);return n||(n=new Intl.NumberFormat(e,t),Xr.set(r,n)),n},getDateTimeFormat(e,t){const r=tn(e,t);let n=Qr.get(r);return n||(n=new Intl.DateTimeFormat(e,t),Qr.set(r,n)),n},getPluralRules(e,t){const r=tn(e,t);let n=en.get(r);return n||(n=new Intl.PluralRules(e,t),en.set(r,n)),n}},nn=new Map;function sn(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(Jr),s=t.useMemo(()=>(t,r)=>{const s=t.split(".");let a=e;for(const e of s){if(!a||"object"!=typeof a||!(e in a))return t;a=a[e]}const i="string"==typeof a?a:t;if(!r)return i;try{const e=function(e,t){const r=`${t}:${e}`;let n=nn.get(r);return n||(n=new Gr(e,t,void 0,{formatters:rn}),nn.set(r,n)),n}(i,n),t=e.format(r);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??`{${t}}`))}},[e,n]),a="ar"===r?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(n),[n]),o=t.useMemo(()=>(e,t)=>{const r=(t??"").trim().toUpperCase();if(!r)return(e/100).toLocaleString(n,{minimumFractionDigits:2});try{return new Intl.NumberFormat(n,{style:"currency",currency:r,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(n,{minimumFractionDigits:2})}},[n]);return{t:s,locale:r,formattingLocale:n,dir:a,fmtNum:i,fmtCents:o,messages:e}}function an(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Re(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function on(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Re(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function cn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Re(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const ln="saas-session-id",un="code";function dn(e){on(ln,e)}function pn(){return function(){if("undefined"==typeof window)return null;try{return an(ln)}catch(e){return Re(e,{component:"auth-utils",action:"getSessionId",metadata:{key:ln}}),null}}()}function mn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(un)}catch(e){return Re(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:un}}),null}}const hn="SDK is not ready (missing serverUrl, version, or orgId)";class fn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(hn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(hn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=pn(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const r=this.url(e),n=(t.method??"GET").toUpperCase(),s=this.buildHeaders(t),a={...t,headers:s};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),a.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),s=await e(r,a);if(this._debug&&console.log(`[BuildBase] ${n} ${r} → ${s.status}`),s.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return s}catch(r){if(r instanceof Error&&"AbortError"===r.name){if(void 0!==i){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw r}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw r instanceof Error&&this._onError?.(r,{method:n,path:e}),r}};try{return await o(0)}finally{void 0!==i&&clearTimeout(i)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await je(n,r)}catch(r){throw r instanceof Error&&this._onError?.(r,{method:(t.method??"GET").toUpperCase(),path:e}),r}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class gn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,r){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(r)},"Failed to update user")}async updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,r){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:r}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch subscription");return r.data||r}return r}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group");return r.data||r}return r}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch plan group version";try{e=(await r.json()).message||e}catch{e=404===r.status?"Plan group version not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group versions");return r.data||r}return r}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let r="Failed to fetch plans";try{r=(await t.json()).message||r}catch{r=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(r)}const r=await t.json();if(void 0!==r.success&&!r.success)throw new Error(r.message||"Failed to fetch plans");return r.data??r}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group version");return r.data||r}return r}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to create checkout session";try{e=(await r.json()).message||e}catch{e=`Failed to create checkout session (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to create checkout session");return n.data||n}return n}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!r.ok){let e="Failed to update subscription";try{e=(await r.json()).message||e}catch{e=`Failed to update subscription (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to update subscription");return n.data?.checkoutUrl||n.checkoutUrl,n.data||n}return n.checkoutUrl,n}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,r){const n=new URLSearchParams;n.append("limit",t.toString()),r&&n.append("starting_after",r);const s=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`,{});if(!s.ok){let e="Failed to fetch invoices";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found or no invoices available":401===s.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${s.status}: ${s.statusText})`}throw new Error(e)}const a=await s.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch invoices");return a}return a}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!r.ok){let e="Failed to fetch invoice";try{e=(await r.json()).message||e}catch{e=404===r.status?"Invoice not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch invoice");return n}return n}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to cancel subscription");return r.data||r}return r}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to resume subscription");return r.data||r}return r}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record usage";try{e=(await r.json()).message||e}catch{e=`Failed to record usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to record usage");return n.data||n}return n}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record batch usage";try{e=(await r.json()).message||e}catch{e=`Failed to record batch usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();return n.data||n}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch quota usage status";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no subscription available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch quota usage status");return n.data||n}return n}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch all quota usage");return r.data||r}return r}async getUsageLogs(e,t){const r=new URLSearchParams;t?.quotaSlug&&r.append("quotaSlug",t.quotaSlug),t?.from&&r.append("from",t.from),t?.to&&r.append("to",t.to),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),s=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,a=await this.fetchResponse(s);if(!a.ok){let e="Failed to fetch usage logs";try{e=(await a.json()).message||e}catch{e=404===a.status?"Workspace not found":401===a.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${a.status}: ${a.statusText})`}throw new Error(e)}const i=await a.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}async sendNotification(e,t,r,n){const s={event:t};return r&&(s.userId=r),n&&(s.data=n),this.fetchJson(`workspaces/${e}/notifications/send`,{method:"POST",body:JSON.stringify(s)},"Failed to send notification")}async getNotificationEvents(e){return this.fetchJson(`workspaces/${e}/notification-events`,{},"Failed to fetch notification events")}async getNotificationPreferences(e){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{},"Failed to fetch notification preferences")).notificationPreferences??{}}async updateNotificationPreferences(e,t){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{method:"PATCH",body:JSON.stringify({notificationPreferences:t})},"Failed to update notification preferences")).notificationPreferences??{}}}function bn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function vn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Re(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class yn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function xn(){return jt(e=>e.os)}let wn=null;function Sn(){const e=bn(),r=xn(),{serverUrl:n,version:s,orgId:a,settings:i}=r,o=t.useMemo(()=>rt(r)?new yn({serverUrl:n,version:s,orgId:a}):null,[n,s,a]),c=t.useCallback(async t=>o?wn||(wn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return De(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:s,orgId:a}}),null}finally{wn=null}})(),wn):null,[o,e,n,s,a]);return vn(async e=>{i||rt(r)&&await c(e)},[n,s,a],{onError:e=>De(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:s,orgId:a}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function kn(){const e=xn(),r=function(e){return t.useMemo(()=>new gn(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:r}),[e,r])}function En(e,t,r){return e instanceof Error?e.message:r(t)}const Cn=e=>{const{t:r}=sn(),{os:n,api:s}=kn(),a=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useCallback(async()=>{if(e&&a){l(!0),d(null);try{const t=await s.getPublicPlans(e);o(t)}catch(t){const n=En(t,"errors.fetchPlans",r);d(n),Re(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[s,e,a]);t.useEffect(()=>{p()},[p]);const m=e&&!a||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:m,error:u,refetch:p}},Nn=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);a(t)}catch(t){const n=En(t,"errors.fetchSubscription",r);l(n),Re(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else a(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{subscription:s,loading:i,error:c,refetch:u}},An=(e,r)=>{const{t:n}=sn(),{api:s}=kn(),[a,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e){c(!0),u(null);try{const t=r?await s.getPlanGroupByVersion(e,r):await s.getPlanGroup(e);i(t)}catch(t){const s=En(t,"errors.fetchPlanGroup",n);u(s),Re(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[s,e,r]);return t.useEffect(()=>{d()},[d]),{planGroup:a,loading:o,error:l,refetch:d}},_n=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);a(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersions",r);l(n),Re(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else a(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{versions:s,loading:i,error:c,refetch:u}},jn=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const r=await n.createCheckoutSession(e,t);return"trial_started"===r.type&&(Dt(),Tt()),r}catch(n){const s=En(n,"errors.createCheckout",r);throw o(s),Re(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{a(!1)}},[n,e]),loading:s,error:i}},Pn=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null),c=t.useCallback(async(t,s)=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const r={planVersionId:t,...s?.billingInterval&&{billingInterval:s.billingInterval},...s?.successUrl&&{successUrl:s.successUrl},...s?.cancelUrl&&{cancelUrl:s.cancelUrl}},a=await n.updateSubscription(e,r);return Dt(),a}catch(n){const a=En(n,"errors.updateSubscription",r);throw o(a),Re(n,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:s}}),n}finally{a(!1)}},[n,e]);return{updateSubscription:c,loading:s,error:i}},Tn=(e,r)=>{const n=Nn(e),s=An(e,r),a=Pn(e),i=t.useCallback(async()=>{await Promise.all([n.refetch(),s.refetch()])},[n.refetch,s.refetch]);return{subscription:n.subscription,planGroup:s.planGroup,loading:n.loading||s.loading||a.loading,error:n.error||s.error||a.error,updateSubscription:a.updateSubscription,refetch:i}},Rn=(e,r=10,n)=>{const{t:s}=sn(),{api:a}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);d(!0),m(null);try{const t=await a.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const a=En(t,"errors.fetchInvoices",s);m(a),Re(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{d(!1)}},[a,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:u,error:p,refetch:h}},Dn=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const r=t||window.location.href,s=await n.createBillingPortalSession(e,r);return s.url&&window.open(s.url,"_blank","noopener,noreferrer"),s}catch(t){const n=En(t,"errors.openBillingPortal",r);throw o(n),Re(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{a(!1)}},[e,n]),loading:s,error:i}},In=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const t=await n.cancelSubscriptionAtPeriodEnd(e);return Dt(),t}catch(t){const n=En(t,"errors.cancelSubscription",r);throw o(n),Re(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{a(!1)}},[n,e]),loading:s,error:i}},Un=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const t=await n.resumeSubscription(e);return Dt(),t}catch(t){const n=En(t,"errors.resumeSubscription",r);throw o(n),Re(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{a(!1)}},[n,e]),loading:s,error:i}},Mn=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);a(t.quotas)}catch(t){const n=En(t,"errors.fetchAllQuotaUsage",r);l(n),Re(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else a(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{quotas:s,loading:i,error:c,refetch:u}},Ln=t.createContext(null);Ln.displayName="SubscriptionContext";const On=t.memo(function({children:r}){const n=jt(e=>e.workspaces.currentWorkspace),{subscription:s,loading:a,error:i,refetch:o}=Nn(n?._id);t.useEffect(()=>{return e=o,Rt.add(e),()=>{Rt.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:s,loading:a,error:i,refetch:o}),[s,a,i,o]);return e.jsx(Ln.Provider,{value:c,children:r})});function zn(){const e=t.useContext(Ln);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}On.displayName="SubscriptionContextProvider";const Fn={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Wn="active",Bn="trialing",Vn="canceled",Hn="past_due",Gn="paused",$n="draft",Kn="open",qn="paid",Zn="uncollectible",Jn="void",Yn="feature",Xn="limit",Qn="quota",es="none",ts="final",rs="suspended";function ns(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function ss(e,t,r){const n=ns(e,t);if(!n?.basePricing)return null;const s=n.basePricing[r];return null!=s?s:null}function as(e,t,r,n){const s=ns(e,t),a=s?.quotaOverages?.[r];if(a)return a[n]}function is(e,t,r,n){const s=e.quotas?.[r];if(null==s)return null;const a=s[n];if(!a)return null;const i=as(e,t,r,n);return{included:a.included,...void 0!==a.unitSize&&{unitSize:a.unitSize},...void 0!==i&&{overage:i}}}function os(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function cs(e,t){const r=ns(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function ls(e,t,r){const n=cs(e,t);return n?.perSeat?n.perSeat[r]??null:null}function us(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=cs(t,r);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function ds(e){const{memberCount:t,maxUsersConfig:r,hasSubscription:n=!0,requireSubscription:s=!1}=e;if(s&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:a,source:i}=r;if(a<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=a){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:a}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const ps="user:created",ms="user:updated",hs="workspace:changed",fs="workspace:updated",gs="workspace:user-added",bs="workspace:user-removed",vs="workspace:user-role-changed",ys="workspace:created",xs="workspace:deleted";const ws=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){Re(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(ps,{user:e})}async emitUserUpdated(e,t){await this.emit(ms,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(hs,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(fs,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(gs,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(bs,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(vs,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(ys,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(xs,{workspace:e})}},Ss="saas-workspace-current",ks=e=>{e?on(Ss,e._id):cn(Ss)},Es=()=>an(Ss),Cs=()=>{cn(Ss)},Ns=(e,t)=>!!e&&t.some(t=>t._id===e);function As(e,t){if(!t)return!1;const r=(n=e.createdBy)?"string"==typeof n?n:"object"==typeof n&&"_id"in n&&"string"==typeof n._id?n._id:null:null;var n;return null!==r&&r===t}function _s(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const r=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return r&&"object"==typeof r&&"role"in r&&"string"==typeof r.role?r.role:null}const js=()=>{const e=bn(),{os:r,api:n}=kn(),{settings:s}=Sn(),a=jt(e=>e.workspaces),i=jt(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===a.currentWorkspace?._id)||r?.forceEmit)&&t){const r=a.currentWorkspace;ks(t),e.workspaces(ft(t)),ws.emitWorkspaceChanged(t,r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[a.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const s=++p.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=_s(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Re(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(s!==p.current)return}o(t,n)}finally{s===p.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!a.isInitialized){const t=Es();if(e.workspaces(bt(!0)),t){const e=a.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[a.isInitialized,a.workspaces,a.currentWorkspace,e,c]);const l=t.useCallback(()=>{Cs(),e.workspaces(gt())},[e]),u=t.useRef(!1),d=t.useRef(!1),p=t.useRef(0),m=t.useCallback(async()=>{if(!a.loading&&!u.current){u.current=!0,e.workspaces(vt(!0)),e.workspaces(yt(null));try{const t=await n.getWorkspaces();if(e.workspaces(ut(t)),t.length>0){const e=Es();if(e&&Ns(e,t)){const r=t.find(t=>t._id===e);if(r)try{await c(r,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(yt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(vt(!1)),u.current=!1}}},[n,a.loading,e,c]),h=t.useCallback(async()=>{if(!a.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(ut(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,a.refreshing,e]),f=t.useCallback(async(t,r)=>{const s=await n.createWorkspace({name:t,image:r});e.workspaces(dt(s)),ws.emitWorkspaceCreated(s).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:s._id}})})},[n,e]),g=t.useCallback(async(t,r)=>{const s=await n.updateWorkspace(t._id,r);e.workspaces(pt(s)),ws.emitWorkspaceUpdated(s).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:s._id}})})},[n,e]),b=t.useCallback(async()=>{if(d.current)return a.allFeatures.length>0?a.allFeatures:null;if(a.allFeatures.length>0)return a.allFeatures;d.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Re(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{d.current=!1}},[n,e,a.allFeatures]),v=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),y=t.useCallback(async e=>n.updateSettings(e),[n]),x=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await h(),r},[n,h]);t.useEffect(()=>{if(!a.currentWorkspace?._id||0===a.workspaces.length)return;const t=a.currentWorkspace._id,r=a.workspaces.find(e=>e._id===t);if(r)r!==a.currentWorkspace&&(ks(r),e.workspaces(ft(r)));else if(a.workspaces.length>0){const e=a.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[a.workspaces,a.currentWorkspace,e,c]);const w=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),S=t.useCallback(async(e,t,r)=>{const i=a.workspaces.find(t=>t._id===e);if(i){const e=us({settingsMaxUsers:s?.workspace?.maxWorkspaceUsers}),t=ds({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await n.addUser(e,{email:t,role:r});return i&&ws.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),Dt(),o},[n,a.workspaces,h,s]),k=t.useCallback(async(e,t)=>{const r=a.workspaces.find(t=>t._id===e);if(r&&As(r,t))throw new Error("Cannot remove the workspace owner");const s=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await n.removeUser(e,t);if(r&&s){const t=s.role;ws.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),Dt(),i},[n,a.workspaces,h]),E=t.useCallback(async(e,t,r)=>{if(r.role){const r=a.workspaces.find(t=>t._id===e);if(r&&As(r,t))throw new Error("Cannot change the role of the workspace owner")}let s;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);s=r?.role}const i=await n.updateUser(e,t,r);return r.role&&s&&s!==r.role&&ws.emitWorkspaceUserRoleChanged(i.userId,i.workspace,s,r.role).catch(n=>{Re(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:s,newRole:r.role}})}),i},[n,a.workspaces]),C=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return ws.emitUserUpdated(r,t||void 0).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),N=t.useCallback(async()=>await n.getProfile(),[n]),A=t.useCallback(async e=>await n.getWorkspace(e),[n]),_=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const r=a.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!As(r,i.id))throw new Error("Only the workspace creator can delete the workspace");const s=await n.deleteWorkspace(t);return e.workspaces(mt(t)),a.currentWorkspace?._id===t&&(Cs(),e.workspaces(gt())),r&&ws.emitWorkspaceDeleted(r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),s},[n,a.workspaces,a.currentWorkspace,e,i]);return{workspaces:a.workspaces,loading:a.loading,error:a.error,fetchWorkspaces:m,refreshWorkspaces:h,refreshing:a.refreshing,currentWorkspace:a.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:f,allFeatures:a.allFeatures,getFeatures:b,updateFeature:v,updateWorkspaceSettings:y,updateWorkspacePermissions:x,getWorkspace:A,updateWorkspace:g,getUsers:w,addUser:S,removeUser:k,updateUser:E,getProfile:N,updateUserProfile:C,deleteWorkspace:_,switching:null!==a.switchingToId,switchingToId:a.switchingToId}},Ps=t.createContext(null);Ps.displayName="QuotaUsageContext";const Ts=t.memo(function({children:r}){const{currentWorkspace:n}=js(),{quotas:s,loading:a,error:i,refetch:o}=Mn(n?._id);t.useEffect(()=>{return e=o,Pt.add(e),()=>{Pt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:s,loading:a,error:i,refetch:o}),[s,a,i,o]);return e.jsx(Ps.Provider,{value:c,children:r})});function Rs(){const e=t.useContext(Ps);if(null===e)throw new Error("useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).");return e}Ts.displayName="QuotaUsageContextProvider";class Ds extends fn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e="Failed to initiate authentication";try{e=(await r.json()).message||e}catch{e=`Failed to initiate authentication (${r.status}: ${r.statusText})`}throw new Error(e)}return r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}function Is(e,t="/"){const r=function(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}(e);window.location.href=r||t}
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.544.0 - ISC
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the ISC license.
|
|
7
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/const
|
|
8
|
+
*/const Us=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ms=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ls=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Os=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.544.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var zs={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"};
|
|
16
16
|
/**
|
|
17
17
|
* @license lucide-react v0.544.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const Fs=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:i,iconNode:o,...c},l)=>t.createElement("svg",{ref:l,...zs,width:r,height:r,stroke:e,strokeWidth:s?24*Number(n)/Number(r):n,className:Ls("lucide",a),...!i&&!Os(c)&&{"aria-hidden":"true"},...c},[...o.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Ws=(e,r)=>{const n=t.forwardRef(({className:n,...s},a)=>t.createElement(Fs,{ref:a,iconNode:r,className:Ls(`lucide-${Us(Ms(e))}`,`lucide-${e}`,n),...s}));return n.displayName=Ms(e),n},Bs=Ws("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),Vs=Ws("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),Hs=Ws("building-2",[["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"}]]),Gs=Ws("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"}]]),$s=Ws("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),Ks=Ws("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),qs=Ws("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Zs=Ws("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),Js=Ws("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Ys=Ws("external-link",[["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"}]]),Xs=Ws("file-text",[["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"}]]),Qs=Ws("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"}]]),ea=Ws("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ta=Ws("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),ra=Ws("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),na=Ws("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),sa=Ws("refresh-cw",[["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"}]]),aa=Ws("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ia=Ws("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),oa=Ws("shield-alert",[["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"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),ca=Ws("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"}]]),la=Ws("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),ua=Ws("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"}]]),da=Ws("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),pa=Ws("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ma=Ws("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ha=Ws("triangle-alert",[["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-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),fa=Ws("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"}]]),ga=Ws("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.544.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/function fs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function gs(...e){return t=>{let r=!1;const n=e.map(e=>{const n=fs(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():fs(e[t],null)}}}}function bs(...e){return a.useCallback(gs(...e),e)}var vs=Symbol.for("react.lazy"),ys=a[" use ".trim().toString()];function xs(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===vs&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function ws(t){const r=ks(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;xs(s)&&"function"==typeof ys&&(s=ys(s._payload));const o=a.Children.toArray(s),c=o.find(Cs);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}var Ss=ws("Slot");function ks(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(xs(r)&&"function"==typeof ys&&(r=ys(r._payload)),a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Es=Symbol("radix.slottable");function Cs(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Es}const Ns=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,As=o,js=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return As(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const i=Ns(t)||Ns(n);return a[e][i]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...s,...o}[t]):{...s,...o}[t]===r})?[...e,r,n]:e},[]);return As(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},Ps=js("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Ts=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?Ss:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(d,{disabled:n||l.disabled,className:Se(Ps({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx(es,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function _s(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Rs(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s),o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Ds(s,...r)]}function Ds(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Ts.displayName="Button";var Is=globalThis?.document?a.useLayoutEffect:()=>{},Us=a[" useId ".trim().toString()]||(()=>{}),Ms=0;function Ls(e){const[t,r]=a.useState(Us());return Is(()=>{r(e=>e??String(Ms++))},[e]),e||(t?`radix-${t}`:"")}var Os=a[" useInsertionEffect ".trim().toString()]||Is;function zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),s=a.useRef(r),i=a.useRef(t);return Os(()=>{i.current=t},[t]),a.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,n,i]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:s;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,n])}const u=a.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[c,e,i,o]);return[l,u]}function Fs(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bs=Symbol("radix.slottable");function Ws(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Bs}var Vs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=function(t){const r=Fs(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Ws);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{});function Hs(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Gs,$s="dismissableLayer.update",Ks="dismissableLayer.pointerDownOutside",qs="dismissableLayer.focusOutside",Zs=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Js=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=a.useContext(Zs),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=bs(r,e=>m(e)),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=Hs(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Xs(Ks,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",s.current),s.current=n,t.addEventListener("click",s.current,{once:!0})):n()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),E=function(e,t=globalThis?.document){const r=Hs(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Xs(qs,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=Hs(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{x===d.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Gs=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Ys(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Gs)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Ys())},[p,d]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener($s,e),()=>document.removeEventListener($s,e)},[]),e.jsx(Vs.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:_s(t.onFocusCapture,E.onFocusCapture),onBlurCapture:_s(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:_s(t.onPointerDownCapture,k.onPointerDownCapture)})});Js.displayName="DismissableLayer";function Ys(){const e=new CustomEvent($s);document.dispatchEvent(e)}function Xs(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}a.forwardRef((t,r)=>{const n=a.useContext(Zs),s=a.useRef(null),i=bs(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Vs.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Qs="focusScope.autoFocusOnMount",ei="focusScope.autoFocusOnUnmount",ti={bubbles:!1,cancelable:!0},ri=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=a.useState(null),d=Hs(i),p=Hs(o),m=a.useRef(null),h=bs(r,e=>u(e)),f=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(s){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:ii(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ii(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ii(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[s,l,f.paused]),a.useEffect(()=>{if(l){oi.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Qs,ti);l.addEventListener(Qs,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ii(n,{select:t}),document.activeElement!==r)return}((e=ni(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ii(l))}return()=>{l.removeEventListener(Qs,d),setTimeout(()=>{const e=new CustomEvent(ei,ti);l.addEventListener(ei,p),l.dispatchEvent(e),e.defaultPrevented||ii(t??document.body,{select:!0}),l.removeEventListener(ei,p),oi.remove(f)},0)}}var e},[l,d,p,f]);const g=a.useCallback(e=>{if(!n&&!s)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[a,s]=function(e){const t=ni(e),r=ai(t,e),n=ai(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&ii(s,{select:!0})):(e.preventDefault(),n&&ii(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Vs.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function ni(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ai(e,t){for(const r of e)if(!si(r,{upTo:t}))return r}function si(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ii(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ri.displayName="FocusScope";var oi=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ci(e,t),e.unshift(t)},remove(t){e=ci(e,t),e[0]?.resume()}}}();function ci(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var li=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Is(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Vs.div,{...i,ref:n}),l):null});li.displayName="Portal";var ui=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),s=a.useRef(e),i=a.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=di(n.current);i.current="mounted"===c?e:"none"},[c]),Is(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=di(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),Is(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=di(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!s.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(i.current=di(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),s="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=bs(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(s));return"function"==typeof r||n.isPresent?a.cloneElement(s,{ref:i}):null};function di(e){return e?.animationName||"none"}ui.displayName="Presence";var pi=0;function mi(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hi()),document.body.insertAdjacentElement("beforeend",e[1]??hi()),pi++,()=>{1===pi&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),pi--}},[])}function hi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fi=function(){return fi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},fi.apply(this,arguments)};function gi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(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"==typeof SuppressedError&&SuppressedError;var bi="right-scroll-bar-position",vi="width-before-scroll-bar";function yi(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var xi="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,wi=new WeakMap;function Si(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return yi(e,t)})},(s=t.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(e){var t=s.value;t!==e&&(s.value=e,s.callback(e,t))}}}})[0]).callback=a,s.facade);return xi(function(){var t=wi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||yi(e,null)}),n.forEach(function(e){r.has(e)||yi(e,a)})}wi.set(i,e)},[e]),i}function ki(e){return e}var Ei=function(e){var t=e.sideCar,r=gi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,fi({},r))};Ei.isSideCarExport=!0;var Ci=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ki);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var s=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(s)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=fi({async:!0,ssr:!1},e),t}(),Ni=function(){},Ai=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Ni,onWheelCapture:Ni,onTouchMoveCapture:Ni}),s=n[0],i=n[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,f=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,x=e.gapMode,w=gi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Si([r,t]),E=fi(fi({},w),s);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:Ci,removeScrollBar:u,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),fi(fi({},E),{ref:k})):a.createElement(y,fi({},E,{className:l,ref:k}),c))});Ai.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ai.classNames={fullWidth:vi,zeroRight:bi};function ji(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Pi=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=ji())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ti=function(){var e,t=(e=Pi(),function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},_i={left:0,top:0,right:0,gap:0},Ri=function(e){return parseInt(e||"",10)||0},Di=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return _i;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[Ri(r),Ri(n),Ri(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Ii=Ti(),Ui="data-scroll-locked",Mi=function(e,t,r,n){var a=e.left,s=e.top,i=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(Ui,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(s,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(bi," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(vi," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(bi," .").concat(bi," {\n right: 0 ").concat(n,";\n }\n \n .").concat(vi," .").concat(vi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Ui,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Li=function(){var e=parseInt(document.body.getAttribute(Ui)||"0",10);return isFinite(e)?e:0},Oi=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(Ui,(Li()+1).toString()),function(){var e=Li()-1;e<=0?document.body.removeAttribute(Ui):document.body.setAttribute(Ui,e.toString())}},[]);var i=a.useMemo(function(){return Di(s)},[s]);return a.createElement(Ii,{styles:Mi(i,!t,s,r?"":"!important")})},zi=!1;if("undefined"!=typeof window)try{var Fi=Object.defineProperty({},"passive",{get:function(){return zi=!0,!0}});window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch(e){zi=!1}var Bi=!!zi&&{passive:!1},Wi=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Vi=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Hi(e,n)){var a=Gi(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Hi=function(e,t){return"v"===e?function(e){return Wi(e,"overflowY")}(t):function(e){return Wi(e,"overflowX")}(t)},Gi=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},$i=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ki=function(e){return[e.deltaX,e.deltaY]},qi=function(e){return e&&"current"in e?e.current:e},Zi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ji=0,Yi=[];function Xi(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qi,eo=(Qi=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Ji++)[0],i=a.useState(Ti)[0],o=a.useRef(e);a.useEffect(function(){o.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(qi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=$i(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===u||m.contains(u)))return!1;var h=Vi(d,u);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=Vi(d,u)),!h)return!1;if(!n.current&&"changedTouches"in e&&(c||l)&&(n.current=a),!a)return!0;var f=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=a*n,i=r.target,o=t.contains(i),c=!1,l=s>0,u=0,d=0;do{if(!i)break;var p=Gi(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Hi(e,i)&&(u+=h,d+=m);var f=i.parentNode;i=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&i!==document.body||o&&(t.contains(i)||t===i));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(Yi.length&&Yi[Yi.length-1]===i){var n="deltaY"in r?Ki(r):$i(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var s=(o.current.shards||[]).map(qi).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:Xi(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=a.useCallback(function(e){r.current=$i(e),n.current=void 0},[]),p=a.useCallback(function(t){u(t.type,Ki(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,$i(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Yi.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Bi),document.addEventListener("touchmove",l,Bi),document.addEventListener("touchstart",d,Bi),function(){Yi=Yi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Bi),document.removeEventListener("touchmove",l,Bi),document.removeEventListener("touchstart",d,Bi)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Zi(s)}):null,h?a.createElement(Oi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Ci.useMedium(Qi),Ei),to=a.forwardRef(function(e,t){return a.createElement(Ai,fi({},e,{ref:t,sideCar:eo}))});to.classNames=Ai.classNames;var ro=new WeakMap,no=new WeakMap,ao={},so=0,io=function(e){return e&&(e.host||io(e.parentNode))},oo=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=io(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);ao[r]||(ao[r]=new WeakMap);var s=ao[r],i=[],o=new Set,c=new Set(a),l=function(e){e&&!o.has(e)&&(o.add(e),l(e.parentNode))};a.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(ro.get(e)||0)+1,l=(s.get(e)||0)+1;ro.set(e,c),s.set(e,l),i.push(e),1===c&&a&&no.set(e,!0),1===l&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),o.clear(),so++,function(){i.forEach(function(e){var t=ro.get(e)-1,a=s.get(e)-1;ro.set(e,t),s.set(e,a),t||(no.has(e)||e.removeAttribute(n),no.delete(e)),a||e.removeAttribute(r)}),--so||(ro=new WeakMap,ro=new WeakMap,no=new WeakMap,ao={})}},co=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),oo(n,a,r,"aria-hidden")):function(){return null}};function lo(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uo=Symbol("radix.slottable");function po(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uo}var mo="Dialog",[ho,fo]=Rs(mo),[go,bo]=ho(mo),vo=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),u=a.useRef(null),[d,p]=zs({prop:s,defaultProp:i??!1,onChange:o,caller:mo});return e.jsx(go,{scope:r,triggerRef:l,contentRef:u,contentId:Ls(),titleId:Ls(),descriptionId:Ls(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};vo.displayName=mo;var yo="DialogTrigger",xo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=bo(yo,n),i=bs(r,s.triggerRef);return e.jsx(Vs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Fo(s.open),...a,ref:i,onClick:_s(t.onClick,s.onOpenToggle)})});xo.displayName=yo;var wo="DialogPortal",[So,ko]=ho(wo,{forceMount:void 0}),Eo=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=bo(wo,r);return e.jsx(So,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(ui,{present:n||o.open,children:e.jsx(li,{asChild:!0,container:i,children:t})}))})};Eo.displayName=wo;var Co="DialogOverlay",No=a.forwardRef((t,r)=>{const n=ko(Co,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=bo(Co,t.__scopeDialog);return i.modal?e.jsx(ui,{present:a||i.open,children:e.jsx(jo,{...s,ref:r})}):null});No.displayName=Co;var Ao=function(t){const r=lo(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(po);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("DialogOverlay.RemoveScroll"),jo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=bo(Co,n);return e.jsx(to,{as:Ao,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Vs.div,{"data-state":Fo(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Po="DialogContent",To=a.forwardRef((t,r)=>{const n=ko(Po,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=bo(Po,t.__scopeDialog);return e.jsx(ui,{present:a||i.open,children:i.modal?e.jsx(_o,{...s,ref:r}):e.jsx(Ro,{...s,ref:r})})});To.displayName=Po;var _o=a.forwardRef((t,r)=>{const n=bo(Po,t.__scopeDialog),s=a.useRef(null),i=bs(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return co(e)},[]),e.jsx(Do,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_s(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_s(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:_s(t.onFocusOutside,e=>e.preventDefault())})}),Ro=a.forwardRef((t,r)=>{const n=bo(Po,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Do,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Do=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=bo(Po,n),u=a.useRef(null),d=bs(r,u);return mi(),e.jsxs(e.Fragment,{children:[e.jsx(ri,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Js,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Fo(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ho,{titleId:l.titleId}),e.jsx(Go,{contentRef:u,descriptionId:l.descriptionId})]})]})}),Io="DialogTitle",Uo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=bo(Io,n);return e.jsx(Vs.h2,{id:s.titleId,...a,ref:r})});Uo.displayName=Io;var Mo="DialogDescription",Lo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=bo(Mo,n);return e.jsx(Vs.p,{id:s.descriptionId,...a,ref:r})});Lo.displayName=Mo;var Oo="DialogClose",zo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=bo(Oo,n);return e.jsx(Vs.button,{type:"button",...a,ref:r,onClick:_s(t.onClick,()=>s.onOpenChange(!1))})});function Fo(e){return e?"open":"closed"}zo.displayName=Oo;var Bo="DialogTitleWarning",[Wo,Vo]=function(t,r){const n=a.createContext(r),s=t=>{const{children:r,...s}=t,i=a.useMemo(()=>s,Object.values(s));return e.jsx(n.Provider,{value:i,children:r})};return s.displayName=t+"Provider",[s,function(e){const s=a.useContext(n);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(Bo,{contentName:Po,titleName:Io,docsSlug:"dialog"}),Ho=({titleId:e})=>{const t=Vo(Bo),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},Go=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vo("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},$o=vo,Ko=xo,qo=Eo,Zo=No,Jo=To,Yo=Uo,Xo=Lo,Qo=zo;function ec(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var tc=["color"],rc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=ec(e,tc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),nc=["color"],ac=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=ec(e,nc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),sc=["color"],ic=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=ec(e,sc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),oc=["color"],cc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=ec(e,oc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});const lc=t.createContext({container:null,setContainer:()=>{}}),uc=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]),i=t.useMemo(()=>r,[r]);return e.jsxs(lc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});uc.displayName="PortalProvider";const dc=$o,pc=Ko,mc=qo,hc=a.forwardRef(({className:t,...r},n)=>e.jsx(Zo,{ref:n,className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));hc.displayName=Zo.displayName;const fc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(lc);return e.jsxs(mc,{container:i,children:[e.jsx(hc,{}),e.jsxs(Jo,{ref:s,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[r,e.jsxs(Qo,{className:"absolute right-4 rtl:right-auto rtl:left-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(ic,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});fc.displayName=Jo.displayName;const gc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});gc.displayName="DialogHeader";const bc=a.forwardRef(({className:t,...r},n)=>e.jsx(Yo,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));bc.displayName=Yo.displayName;const vc=a.forwardRef(({className:t,...r},n)=>e.jsx(Xo,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));vc.displayName=Xo.displayName;var yc=Symbol("radix.slottable");var xc="AlertDialog",[wc]=Rs(xc,[fo]),Sc=fo(),kc=t=>{const{__scopeAlertDialog:r,...n}=t,a=Sc(r);return e.jsx($o,{...a,...n,modal:!0})};kc.displayName=xc;var Ec=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Sc(n);return e.jsx(Ko,{...s,...a,ref:r})});Ec.displayName="AlertDialogTrigger";var Cc=t=>{const{__scopeAlertDialog:r,...n}=t,a=Sc(r);return e.jsx(qo,{...a,...n})};Cc.displayName="AlertDialogPortal";var Nc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Sc(n);return e.jsx(Zo,{...s,...a,ref:r})});Nc.displayName="AlertDialogOverlay";var Ac="AlertDialogContent",[jc,Pc]=wc(Ac),Tc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=yc,r}("AlertDialogContent"),_c=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=Sc(n),c=a.useRef(null),l=bs(r,c),u=a.useRef(null);return e.jsx(Wo,{contentName:Ac,titleName:Rc,docsSlug:"alert-dialog",children:e.jsx(jc,{scope:n,cancelRef:u,children:e.jsxs(Jo,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:_s(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Tc,{children:s}),e.jsx(zc,{contentRef:c})]})})})});_c.displayName=Ac;var Rc="AlertDialogTitle",Dc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Sc(n);return e.jsx(Yo,{...s,...a,ref:r})});Dc.displayName=Rc;var Ic="AlertDialogDescription",Uc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Sc(n);return e.jsx(Xo,{...s,...a,ref:r})});Uc.displayName=Ic;var Mc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Sc(n);return e.jsx(Qo,{...s,...a,ref:r})});Mc.displayName="AlertDialogAction";var Lc="AlertDialogCancel",Oc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=Pc(Lc,n),i=Sc(n),o=bs(r,s);return e.jsx(Qo,{...i,...a,ref:o})});Oc.displayName=Lc;var zc=({contentRef:e})=>{const t=`\`${Ac}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Ac}\` by passing a \`${Ic}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ac}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Fc=Nc,Bc=_c,Wc=Mc,Vc=Oc,Hc=Dc,Gc=Uc;const $c=kc,Kc=Ec,qc=Cc,Zc=a.forwardRef(({className:t,...r},n)=>e.jsx(Fc,{className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r,ref:n}));Zc.displayName=Fc.displayName;const Jc=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(lc);return e.jsxs(qc,{container:s,children:[e.jsx(Zc,{}),e.jsx(Bc,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r})]})});Jc.displayName=Bc.displayName;const Yc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Yc.displayName="AlertDialogHeader";const Xc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Xc.displayName="AlertDialogFooter";const Qc=a.forwardRef(({className:t,...r},n)=>e.jsx(Hc,{ref:n,className:Se("text-lg font-semibold",t),...r}));Qc.displayName=Hc.displayName;const el=a.forwardRef(({className:t,...r},n)=>e.jsx(Gc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));el.displayName=Gc.displayName;const tl=a.forwardRef(({className:t,...r},n)=>e.jsx(Wc,{ref:n,className:Se(Ps(),t),...r}));tl.displayName=Wc.displayName;const rl=a.forwardRef(({className:t,...r},n)=>e.jsx(Vc,{ref:n,className:Se(Ps({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));rl.displayName=Vc.displayName;const nl=t.createContext({appPermissions:void 0});function al({appPermissions:r,children:n}){const a=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(nl.Provider,{value:a,children:n})}function sl(){return t.useContext(nl)}const il={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},ol=Object.values(il),cl={admin:ol.filter(e=>e!==il.WORKSPACE_DELETE),member:[il.WORKSPACE_SETTINGS_VIEW,il.WORKSPACE_MEMBERS_VIEW,il.WORKSPACE_FEATURES_VIEW,il.WORKSPACE_BILLING_VIEW,il.WORKSPACE_USAGE_VIEW],viewer:[il.WORKSPACE_SETTINGS_VIEW,il.WORKSPACE_MEMBERS_VIEW]};function ll(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function ul(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(Aa(r,t)){const e=new Set(ol);if(a)for(const t of ll(a))e.add(t);if(r.permissions)for(const t of ll(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of ll(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??ja(r,t);if(!s)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),u=i?.[s]?c(i[s]):[],d=o?.[s]?c(o[s]):[],p=cl[s]??[];let m;if(u.length>0)m=u;else if(d.length>0)m=d;else if(p.length>0)m=p;else{m=cl[n?.workspace?.defaultRole??"member"]??cl.member??[]}const h=new Set(m),f=i?.[s]?l(i[s]):[],g=a?.[s]?l(a[s]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(il.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}function dl(e){const{user:r}=Ck(),{currentWorkspace:n}=Pa(),{settings:a}=Sn(),{appPermissions:s}=sl(),i=e??n,o=r?.id??null,c=t.useMemo(()=>ja(i,o),[i,o]),l=t.useMemo(()=>Aa(i,o),[i,o]),u=t.useMemo(()=>ul({userId:o,workspaceRole:c,workspace:i,settings:a,appPermissions:s}),[o,c,i,a,s]),d=t.useCallback(e=>Array.isArray(e)?e.every(e=>u.has(e)):u.has(e),[u]);return{can:d,permissions:u,isOwner:l,role:c}}function pl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function ml(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(pl,{className:"h-10 w-full"}),e.jsx(pl,{className:"h-10 w-full"}),e.jsx(pl,{className:"h-10 w-full"})]})}const hl=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=Pa(),{can:i}=dl(),{settings:o}=Sn(),{t:c}=an();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(ml,{});return i(il.WORKSPACE_DELETE)?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:c("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c("danger.deleteDescription")})]}),e.jsxs($c,{children:[e.jsx(Kc,{asChild:!0,children:e.jsxs(Ts,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(us,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Jc,{children:[e.jsxs(Yc,{children:[e.jsx(Qc,{children:c("danger.deleteConfirm")}),e.jsx(el,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(Xc,{children:[e.jsx(rl,{disabled:n,children:c("settings.common.cancel")}),e.jsx(tl,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Re(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:r._id}}),alert(e instanceof Error?e.message:c("danger.failedToDelete"))}finally{a(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:c("danger.adminOnly")})})};function fl(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function gl(e){const[t,r]=a.useState(void 0);return Is(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,s=t.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var bl="Switch",[vl]=Rs(bl),[yl,xl]=vl(bl),wl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:u="on",onCheckedChange:d,form:p,...m}=t,[h,f]=a.useState(null),g=bs(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=zs({prop:i,defaultProp:o??!1,onChange:d,caller:bl});return e.jsxs(yl,{scope:n,checked:y,disabled:l,children:[e.jsx(Vs.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Cl(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:_s(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(El,{control:h,bubbles:!b.current,name:s,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});wl.displayName=bl;var Sl="SwitchThumb",kl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=xl(Sl,n);return e.jsx(Vs.span,{"data-state":Cl(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});kl.displayName=Sl;var El=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=bs(c,o),u=fl(n),d=gl(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Cl(e){return e?"checked":"unchecked"}El.displayName="SwitchBubbleInput";var Nl=wl,Al=kl;const jl=a.forwardRef(({className:t,...r},n)=>e.jsx(Nl,{className:Se("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...r,ref:n,children:e.jsx(Al,{className:Se("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));jl.displayName=Nl.displayName;const Pl=({workspaceId:r})=>{const{t:n}=an(),{allFeatures:a,updateFeature:s,getWorkspace:i}=Pa(),{can:o}=dl(),[c,l]=t.useState({}),[u,d]=t.useState(null),[p,m]=t.useState(null),h=t.useRef(null);if(t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),t.useEffect(()=>{i(r).then(m)},[r]),!p)return e.jsx(ml,{});const f=o(il.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:n("features.ownerOnly")}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const r=p?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],u=n("features.actionStatus",{action:!0===o?"enabling":!1===o?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),i?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx(es,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(jl,{disabled:!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),d(null);try{const r=await s(p._id,e,t);m(r);const i=a.find(t=>t.slug===e);d(n("features.updateSuccess",{feature:i?.name||"Feature",enabled:String(t)})),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(null)},5e3)}catch(t){Re(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var Tl=e=>"checkbox"===e.type,_l=e=>e instanceof Date,Rl=e=>null==e;const Dl=e=>"object"==typeof e;var Il=e=>!Rl(e)&&!Array.isArray(e)&&Dl(e)&&!_l(e),Ul=e=>Il(e)&&e.target?Tl(e.target)?e.target.checked:e.target.value:e,Ml=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Ll="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Ol(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Ll&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Il(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Il(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Ol(e[t]));return n}var zl=e=>/^\w*$/.test(e),Fl=e=>void 0===e,Bl=e=>Array.isArray(e)?e.filter(Boolean):[],Wl=e=>Bl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Vl=(e,t,r)=>{if(!t||!Il(e))return r;const n=(zl(t)?[t]:Wl(t)).reduce((e,t)=>Rl(e)?e:e[t],e);return Fl(n)||n===e?Fl(e[t])?r:e[t]:n},Hl=e=>"boolean"==typeof e,Gl=e=>"function"==typeof e,$l=(e,t,r)=>{let n=-1;const a=zl(t)?[t]:Wl(t),s=a.length,i=s-1;for(;++n<s;){const t=a[n];let s=r;if(n!==i){const r=e[t];s=Il(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const Kl="blur",ql="focusout",Zl="change",Jl="onBlur",Yl="onChange",Xl="onSubmit",Ql="onTouched",eu="all",tu="max",ru="min",nu="maxLength",au="minLength",su="pattern",iu="required",ou="validate",cu=t.createContext(null);cu.displayName="HookFormControlContext";const lu=()=>t.useContext(cu);var uu=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==eu&&(t._proxyFormState[a]=!n||eu),r&&(r[a]=!0),e[a]}});return a};const du="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var pu=e=>"string"==typeof e,mu=(e,t,r,n,a)=>pu(e)?(n&&t.watch.add(e),Vl(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Vl(r,e))):(n&&(t.watchAll=!0),r),hu=e=>Rl(e)||!Dl(e);function fu(e,t,r=new WeakSet){if(hu(e)||hu(t))return Object.is(e,t);if(_l(e)&&_l(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const n=e[s];if(!a.includes(s))return!1;if("ref"!==s){const e=t[s];if(_l(n)&&_l(e)||Il(n)&&Il(e)||Array.isArray(n)&&Array.isArray(e)?!fu(n,e,r):!Object.is(n,e))return!1}}return!0}function gu(e){const r=lu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Ml(s._names.array,n),u=t.useMemo(()=>Vl(s._formValues,n,Vl(s._defaultValues,n,o)),[s,n,o]),d=function(e){const r=lu(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),u=t.useRef(c),d=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);u.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return u.current?u.current(e):e}),g=t.useCallback(e=>{const t=mu(a,n._names,e||n._formValues,!1,l.current);return u.current?u.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=mu(a,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);fu(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,a]);du(()=>(p.current===n&&fu(m.current,a)||(p.current=n,m.current=a,b()),n._subscribe({name:a,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[n,o,a,b]),t.useEffect(()=>n._removeUnmounted());const v=p.current!==n,y=m.current,x=t.useMemo(()=>{if(i)return null;const e=!v&&!fu(y,a);return v||e?g():null},[i,v,a,y,g]);return null!==x?x:h}({control:s,name:n,defaultValue:u,exact:c}),p=function(e){const r=lu(),{control:n=r,disabled:a,name:s,exact:i}=e||{},[o,c]=t.useState(n._formState),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return du(()=>n._subscribe({name:s,formState:l.current,exact:i,callback:e=>{!a&&c({...n._formState,...e})}}),[s,a,i]),t.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>uu(o,n,l.current,!1),[o,n])}({control:s,name:n,exact:c}),m=t.useRef(e),h=t.useRef(void 0),f=t.useRef(s.register(n,{...e.rules,value:d,...Hl(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Vl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Vl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Vl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Vl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Vl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Ul(e),name:n},type:Zl}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Vl(s._formValues,n),name:n},type:Kl}),[n,s._formValues]),y=t.useCallback(e=>{const t=Vl(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Gl(e.focus)&&e.focus(),select:()=>Gl(e.select)&&e.select(),setCustomValidity:t=>Gl(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Gl(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:d,...Hl(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,d]);return t.useEffect(()=>{const e=s._options.shouldUnregister||i,t=h.current;t&&t!==n&&!l&&s.unregister(t),s.register(n,{...m.current.rules,...Hl(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Vl(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Ol(Vl(s._options.defaultValues,n,m.current.defaultValue));$l(s._defaultValues,n,e),Fl(Vl(s._formValues,n))&&$l(s._formValues,n,e)}return!l&&s.register(n),h.current=n,()=>{(l?e&&!s._state.action:e)?s.unregister(n):r(n,!1)}},[n,s,l,i]),t.useEffect(()=>{s._setDisabledField({disabled:a,name:n})},[a,n,s]),t.useMemo(()=>({field:x,formState:p,fieldState:g}),[x,p,g])}const bu=e=>e.render(gu(e)),vu=t.createContext(null);vu.displayName="HookFormContext";const yu=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return t.createElement(vu.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,u,s,a,m,g,p,d,i,b,c,v,l,h,n])},t.createElement(cu.Provider,{value:f},r))};var xu=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},wu=e=>Array.isArray(e)?e:[e],Su=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function ku(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&Il(a)&&s){const e=ku(a,s);Il(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Eu=e=>Il(e)&&!Object.keys(e).length,Cu=e=>"file"===e.type,Nu=e=>{if(!Ll)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Au=e=>"select-multiple"===e.type,ju=e=>"radio"===e.type,Pu=e=>Nu(e)&&e.isConnected;function Tu(e,t){const r=Array.isArray(t)?t:zl(t)?[t]:Wl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Fl(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(Il(n)&&Eu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Fl(e[t]))return!1;return!0}(n))&&Tu(e,r.slice(0,-1)),e}function _u(e){return Array.isArray(e)||Il(e)&&!(e=>{for(const t in e)if(Gl(e[t]))return!0;return!1})(e)}function Ru(e,t={}){for(const r in e){const n=e[r];_u(n)?(t[r]=Array.isArray(n)?[]:{},Ru(n,t[r])):Fl(n)||(t[r]=!0)}return t}function Du(e,t,r){r||(r=Ru(t));for(const n in e){const a=e[n];if(_u(a))Fl(t)||hu(r[n])?r[n]=Ru(a,Array.isArray(a)?[]:{}):Du(a,Rl(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!fu(a,e)}}return r}const Iu={value:!1,isValid:!1},Uu={value:!0,isValid:!0};var Mu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Fl(e[0].attributes.value)?Fl(e[0].value)||""===e[0].value?Uu:{value:e[0].value,isValid:!0}:Uu:Iu}return Iu},Lu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Fl(e)?e:t?""===e?NaN:e?+e:e:r&&pu(e)?new Date(e):n?n(e):e;const Ou={isValid:!1,value:null};var zu=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Ou):Ou;function Fu(e){const t=e.ref;return Cu(t)?t.files:ju(t)?zu(e.refs).value:Au(t)?[...t.selectedOptions].map(({value:e})=>e):Tl(t)?Mu(e.refs).value:Lu(Fl(t.value)?e.ref.value:t.value,e)}var Bu=e=>e instanceof RegExp,Wu=e=>Fl(e)?e:Bu(e)?e.source:Il(e)?Bu(e.value)?e.value.source:e.value:e,Vu=e=>({isOnSubmit:!e||e===Xl,isOnBlur:e===Jl,isOnChange:e===Yl,isOnAll:e===eu,isOnTouch:e===Ql});const Hu="AsyncFunction";var Gu=e=>!!e&&!!e.validate&&!!(Gl(e.validate)&&e.validate.constructor.name===Hu||Il(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Hu)),$u=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Ku=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Vl(e,a);if(r){const{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Ku(s,t))break}else if(Il(s)&&Ku(s,t))break}}};function qu(e,t,r){const n=Vl(e,r);if(n||zl(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Vl(t,n),i=Vl(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var Zu=(e,t,r)=>{const n=wu(Vl(e,r));return $l(n,"root",t[r]),$l(e,r,n),e};function Ju(e,t,r="validate"){if(pu(e)||Array.isArray(e)&&e.every(pu)||Hl(e)&&!e)return{type:r,message:pu(e)?e:"",ref:t}}var Yu=e=>Il(e)&&!Bu(e)?e:{value:e,message:""},Xu=async(e,t,r,n,a,s)=>{const{ref:i,refs:o,required:c,maxLength:l,minLength:u,min:d,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=Vl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Hl(e)?"":e||""),y.reportValidity())},w={},S=ju(i),k=Tl(i),E=S||k,C=(g||Cu(i))&&Fl(i.value)&&Fl(v)||Nu(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=xu.bind(null,f,n,w),A=(e,t,r,n=nu,a=au)=>{const s=e?t:r;w[f]={type:e?n:a,message:s,ref:i,...N(e?n:a,s)}};if(s?!Array.isArray(v)||!v.length:c&&(!E&&(C||Rl(v))||Hl(v)&&!v||k&&!Mu(o).isValid||S&&!zu(o).isValid)){const{value:e,message:t}=pu(c)?{value:!!c,message:c}:Yu(c);if(e&&(w[f]={type:iu,message:t,ref:y,...N(iu,t)},!n))return x(t),w}if(!(C||Rl(d)&&Rl(p))){let e,t;const r=Yu(p),a=Yu(d);if(Rl(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),s=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,c="week"==i.type;pu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),pu(a.value)&&v&&(t=o?s(v)<s(a.value):c?v<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(v?+v:v);Rl(r.value)||(e=n>r.value),Rl(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,tu,ru),!n))return x(w[f].message),w}if((l||u)&&!C&&(pu(v)||s&&Array.isArray(v))){const e=Yu(l),t=Yu(u),r=!Rl(e.value)&&v.length>+e.value,a=!Rl(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!C&&pu(v)){const{value:e,message:t}=Yu(m);if(Bu(e)&&!v.match(e)&&(w[f]={type:su,message:t,ref:i,...N(su,t)},!n))return x(t),w}if(h)if(Gl(h)){const e=Ju(await h(v,r),y);if(e&&(w[f]={...e,...N(ou,e.message)},!n))return x(e.message),w}else if(Il(h)){let e={};for(const t in h){if(!Eu(e)&&!n)break;const a=Ju(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Eu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const Qu={mode:Xl,reValidateMode:Yl,shouldFocusError:!0};function ed(e={}){let t,r={...Qu,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Gl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(Il(r.defaultValues)||Il(r.values))&&Ol(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Ol(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let p={...d};const m={array:Su(),state:Su()},h=r.criteriaMode===eu,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Eu((await x()).errors),g()):e=await w(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?$l(n.validatingFields,e,t):Tu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Eu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Vl(a,e);if(c){const a=Vl(i,e,Fl(r)?Vl(s,e):r);Fl(a)||n&&n.defaultChecked||t?$l(i,e,t?a:Fu(c._f)):E(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const u={name:e};if(!r.disabled){if(!a||i){(d.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=S(),c=l!==u.isDirty);const r=fu(Vl(s,e),t);l=!!Vl(n.dirtyFields,e),r?Tu(n.dirtyFields,e):$l(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Vl(n.touchedFields,e);t||($l(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c=c||(d.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(u)}return c?u:{}},y=(e,a,s,i)=>{const o=Vl(n.errors,e),c=(d.isValid||p.isValid)&&Hl(a)&&n.isValid!==a;var u;if(r.delayError&&s?(u=()=>((e,t)=>{$l(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(u,e)},t(r.delayError)):(clearTimeout(l),t=null,s?$l(n.errors,e,s):Tu(n.errors,e)),(s?!fu(o,s):o)||!Eu(i)||c){const t={...i,...c&&Hl(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},x=async e=>{g(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Vl(t,r);e&&$l(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},w=async(t,a,s={valid:!0})=>{for(const o in t){const l=t[o];if(l){const{_f:t,...o}=l;if(t){const o=c.array.has(t.name),u=l._f&&Gu(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await Xu(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(u&&d.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(Vl(p,t.name)?o?Zu(n.errors,p,t.name):$l(n.errors,t.name,p[t.name]):Tu(n.errors,t.name))}!Eu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&$l(i,e,t),!fu(T(),s)),k=(e,t,r)=>mu(e,c,{...o.mount?i:Fl(t)?s:pu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Vl(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&$l(i,e,Lu(t,r)),s=Nu(r.ref)&&Rl(t)?"":t,Au(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?Tl(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):r.refs.forEach(e=>e.checked=e.value===s):Cu(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Ol(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&P(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=Vl(a,i);(c.array.has(e)||Il(s)||o&&!o._f)&&!_l(s)?C(i,s,r):E(i,s,r)}},N=(e,t,r={})=>{const l=Vl(a,e),u=c.array.has(e),h=Ol(t);$l(i,e,h),u?(m.array.next({name:e,values:Ol(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Du(s,i),isDirty:S(e,h)})):!l||l._f||Rl(h)?E(e,h,r):C(e,h,r),$u(e,c)?m.state.next({...n,name:e,values:Ol(i)}):m.state.next({name:o.mount?e:void 0,values:Ol(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,u=!0;const b=Vl(a,l),S=e=>{u=Number.isNaN(e)||_l(e)&&isNaN(e.getTime())||fu(e,Vl(i,l,e))},k=Vu(r.mode),E=Vu(r.reValidateMode);if(b){let o,C;const N=s.type?Fu(b._f):Ul(e),A=e.type===Kl||e.type===ql,j=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Vl(n.errors,l)&&!b._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(A,Vl(n.touchedFields,l),n.isSubmitted,E,k),T=$u(l,c,A);$l(i,l,N),A?s&&s.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const _=v(l,N,A),R=!Eu(_)||T;if(!A&&m.state.next({name:l,type:e.type,values:Ol(i)}),j)return(d.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...T?{}:_});if(!A&&T&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),u){const t=qu(n.errors,a,l),r=qu(e,a,t.name||l);o=r.error,l=r.name,C=Eu(e)}}else g([l],!0),o=(await Xu(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),u&&(o?C=!1:(d.isValid||p.isValid)&&(C=await w(a,!0)));u&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&P(b._f.deps),y(l,C,o,_))}},j=(e,t)=>{if(Vl(n.errors,t)&&e.focus)return e.focus(),1},P=async(e,t={})=>{let s,i;const o=wu(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(g(e),e)for(const r of e){const e=Vl(t,r);e?$l(n.errors,r,e):Tu(n.errors,r)}else n.errors=t;return t})(Fl(e)?e:o);s=Eu(t),i=e?!o.some(e=>Vl(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Vl(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=s=await w(a);return m.state.next({...!pu(e)||(d.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&Ku(a,j,e?o:c.mount),i},T=(e,t)=>{let r={...o.mount?i:s};return t&&(r=ku(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Fl(e)?r:pu(e)?Vl(r,e):e.map(e=>Vl(r,e))},_=(e,t)=>({invalid:!!Vl((t||n).errors,e),isDirty:!!Vl((t||n).dirtyFields,e),error:Vl((t||n).errors,e),isValidating:!!Vl(n.validatingFields,e),isTouched:!!Vl((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Vl(a,e,{_f:{}})._f||{}).ref,i=Vl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;$l(n.errors,e,{...u,...t,ref:s}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},D=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!wu(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...s}=e;return Eu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||eu))})(t,e.formState||d,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?wu(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(Tu(a,o),Tu(i,o)),!t.keepError&&Tu(n.errors,o),!t.keepDirty&&Tu(n.dirtyFields,o),!t.keepTouched&&Tu(n.touchedFields,o),!t.keepIsValidating&&Tu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Tu(s,o);m.state.next({values:Ol(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(Hl(e)&&o.mount||e||c.disabled.has(t)){const r=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),r&&o.mount&&!o.action&&f()}},M=(e,t={})=>{let n=Vl(a,e);const i=Hl(t.disabled)||Hl(r.disabled);return $l(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:Hl(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Wu(t.min),max:Wu(t.max),minLength:Wu(t.minLength),maxLength:Wu(t.maxLength),pattern:Wu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Vl(a,e);const r=Fl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>ju(e)||Tl(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;$l(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Pu),r,...Array.isArray(Vl(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Vl(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Ml(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&Ku(a,j,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Ol(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Ol(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)Tu(l,e);if(Tu(n.errors,"root"),Eu(n.errors)){m.state.next({errors:{}});try{await e(l,s)}catch(e){o=e}}else t&&await t({...n.errors},s),L(),setTimeout(L);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Eu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Ol(e):s,u=Ol(l),p=Eu(e),h=p?s:u;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Du(s,i))]);for(const t of Array.from(e)){const e=Vl(n.dirtyFields,t),r=Vl(i,t),a=Vl(h,t);e&&!Fl(r)?$l(h,t,r):e||Fl(a)||N(t,a)}}else{if(Ll&&Fl(e))for(const e of c.mount){const t=Vl(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Nu(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Vl(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Ol(s):{}:Ol(h),m.array.next({values:{...h}}),m.state.next({values:{...h}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Eu(h),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),m.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||fu(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Du(s,i):n.dirtyFields:t.keepDefaultValues&&e?Du(s,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:s})},F=(e,t)=>z(Gl(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:M,unregister:I,getFieldState:_,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Vl(a,e))){const t=c(Vl(a,e),l.argA,l.argB);u&&$l(a,e,t)}if(h&&Array.isArray(Vl(n.errors,e))){const t=c(Vl(n.errors,e),l.argA,l.argB);u&&$l(n.errors,e,t),((e,t)=>{!Bl(Vl(e,t)).length&&Tu(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Vl(n.touchedFields,e))){const t=c(Vl(n.touchedFields,e),l.argA,l.argB);u&&$l(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Du(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $l(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Bl(Vl(o.mount?i:s,e,r.shouldUnregister?Vl(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Gl(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Vl(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Pu(e)):!Pu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Hl(e)&&(m.state.next({disabled:e}),Ku(a,(t,r)=>{const n=Vl(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:m,_proxyFormState:d,get _fields(){return a},get _formValues(){return i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return s},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(o.mount=!0,p={...p,...e.formState},D({...e,formState:{...u,...e.formState}})),trigger:P,register:M,handleSubmit:O,watch:(e,t)=>Gl(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:T,reset:F,resetField:(e,t={})=>{Vl(a,e)&&(Fl(t.defaultValue)?N(e,Ol(Vl(s,e))):(N(e,t.defaultValue),$l(s,e,Ol(t.defaultValue))),t.keepTouched||Tu(n.touchedFields,e),t.keepDirty||(Tu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Ol(Vl(s,e))):S()),t.keepError||(Tu(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&wu(e).forEach(e=>Tu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Vl(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Gl(e.select)&&e.select()})}},getFieldState:_};return{...W,formControl:W}}function td(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Gl(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Gl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Gl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=ed(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,du(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),t.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==a.isDirty&&i._subjects.state.next({isDirty:e})}},[i,a.isDirty]),t.useEffect(()=>{var t;e.values&&!fu(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),n.current=e.values,s(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),t.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=t.useMemo(()=>uu(a,i),[i,a]),r.current}const rd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Vl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},nd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?rd(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>rd(t,r,e))}},ad=(e,t)=>{t.shouldUseNativeValidation&&nd(e,t);const r={};for(const n in e){const a=Vl(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(sd(t.names||Object.keys(e),n)){const e=Object.assign({},Vl(r,n));$l(e,"root",s),$l(r,n,e)}else $l(r,n,s)}return r},sd=(e,t)=>{const r=id(t);return e.some(e=>id(e).match(`^${r}\\.\\d+`))};function id(e){return e.replace(/\]|\[/g,"")}function od(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=i.prototype,s=Object.keys(a);for(let e=0;e<s.length;e++){const t=s[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class s extends a{}function i(e){var t;const a=r?.Parent?new s:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class cd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ld extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ud={};function dd(e){return ud}function pd(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}function md(e,t){return"bigint"==typeof t?t.toString():t}function hd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fd(e){return null==e}function gd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const bd=Symbol("evaluating");function vd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bd)return void 0===n&&(n=bd,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function yd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function xd(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function wd(e){return JSON.stringify(e)}const Sd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function kd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Ed=hd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Cd(e){if(!1===kd(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const r=t.prototype;return!1!==kd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Nd(e){return Cd(e)?{...e}:Array.isArray(e)?[...e]:e}const Ad=new Set(["string","number","symbol"]);function jd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pd(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Td(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function _d(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function Rd(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Dd(e){return"string"==typeof e?e:e?.message}function Id(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Dd(e.inst?._zod.def?.error?.(e))??Dd(t?.error?.(e))??Dd(r.customError?.(e))??Dd(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ud(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Md(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Ld=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,md,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Od=od("$ZodError",Ld),zd=od("$ZodError",Ld,{Parent:Error});const Fd=e=>(t,r,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new cd;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Id(e,s,dd())));throw Sd(t,a?.callee),t}return i.value},Bd=Fd(zd),Wd=e=>async(t,r,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Id(e,s,dd())));throw Sd(t,a?.callee),t}return i.value},Vd=Wd(zd),Hd=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new cd;return s.issues.length?{success:!1,error:new(e??Od)(s.issues.map(e=>Id(e,a,dd())))}:{success:!0,data:s.value}},Gd=Hd(zd),$d=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>Id(e,a,dd())))}:{success:!0,data:s.value}},Kd=$d(zd),qd=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Fd(e)(t,r,a)},Zd=e=>(t,r,n)=>Fd(e)(t,r,n),Jd=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wd(e)(t,r,a)},Yd=e=>async(t,r,n)=>Wd(e)(t,r,n),Xd=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Hd(e)(t,r,a)},Qd=e=>(t,r,n)=>Hd(e)(t,r,n),ep=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return $d(e)(t,r,a)},tp=e=>async(t,r,n)=>$d(e)(t,r,n),rp=/^[cC][^\s-]{8,}$/,np=/^[0-9a-z]+$/,ap=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sp=/^[0-9a-vA-V]{20}$/,ip=/^[A-Za-z0-9]{27}$/,op=/^[a-zA-Z0-9_-]{21}$/,cp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,up=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,dp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const pp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bp=/^[A-Za-z0-9_-]*$/,vp=/^\+[1-9]\d{6,14}$/,yp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",xp=new RegExp(`^${yp}$`);function wp(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Sp=/^[^A-Z]*$/,kp=/^[^a-z]*$/,Ep=od("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Cp=od("$ZodCheckMaxLength",(e,t)=>{var r;Ep.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!fd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=Ud(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=od("$ZodCheckMinLength",(e,t)=>{var r;Ep.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!fd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=Ud(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ap=od("$ZodCheckLengthEquals",(e,t)=>{var r;Ep.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!fd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const s=Ud(n),i=a>t.length;r.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),jp=od("$ZodCheckStringFormat",(e,t)=>{var r,n;Ep.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Pp=od("$ZodCheckRegex",(e,t)=>{jp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Tp=od("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Sp),jp.init(e,t)}),_p=od("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kp),jp.init(e,t)}),Rp=od("$ZodCheckIncludes",(e,t)=>{Ep.init(e,t);const r=jd(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Dp=od("$ZodCheckStartsWith",(e,t)=>{Ep.init(e,t);const r=new RegExp(`^${jd(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Ip=od("$ZodCheckEndsWith",(e,t)=>{Ep.init(e,t);const r=new RegExp(`.*${jd(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Up=od("$ZodCheckOverwrite",(e,t)=>{Ep.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Mp{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Lp={major:4,minor:3,patch:6},Op=od("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Lp;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=_d(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new cd;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=_d(e,t)))});else{if(e.issues.length===t)continue;a||(a=_d(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(_d(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new cd;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if("backward"===s.direction){const t=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,s)):r(t,a,s)}const i=e._zod.parse(a,s);if(i instanceof Promise){if(!1===s.async)throw new cd;return i.then(e=>t(e,n,s))}return t(i,n,s)}}vd(e,"~standard",()=>({validate:t=>{try{const r=Gd(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Kd(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),zp=od("$ZodString",(e,t)=>{var r;Op.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Fp=od("$ZodStringFormat",(e,t)=>{jp.init(e,t),zp.init(e,t)}),Bp=od("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lp),Fp.init(e,t)}),Wp=od("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=up(e))}else t.pattern??(t.pattern=up());Fp.init(e,t)}),Vp=od("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=dp),Fp.init(e,t)}),Hp=od("$ZodURL",(e,t)=>{Fp.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Gp=od("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Fp.init(e,t)}),$p=od("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=op),Fp.init(e,t)}),Kp=od("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rp),Fp.init(e,t)}),qp=od("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=np),Fp.init(e,t)}),Zp=od("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ap),Fp.init(e,t)}),Jp=od("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sp),Fp.init(e,t)}),Yp=od("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ip),Fp.init(e,t)}),Xp=od("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=wp({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${yp}T(?:${n})$`)}(t)),Fp.init(e,t)}),Qp=od("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xp),Fp.init(e,t)}),em=od("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${wp(t)}$`)),Fp.init(e,t)}),tm=od("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cp),Fp.init(e,t)}),rm=od("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pp),Fp.init(e,t),e._zod.bag.format="ipv4"}),nm=od("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mp),Fp.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),am=od("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hp),Fp.init(e,t)}),sm=od("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=fp),Fp.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function im(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const om=od("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gp),Fp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{im(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const cm=od("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bp),Fp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!bp.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return im(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),lm=od("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vp),Fp.init(e,t)});const um=od("$ZodJWT",(e,t)=>{Fp.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),dm=od("$ZodUnknown",(e,t)=>{Op.init(e,t),e._zod.parse=e=>e}),pm=od("$ZodNever",(e,t)=>{Op.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function mm(e,t,r){e.issues.length&&t.issues.push(...Rd(r,e.issues)),t.value[r]=e.value}const hm=od("$ZodArray",(e,t)=>{Op.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const s=[];for(let e=0;e<a.length;e++){const i=a[e],o=t.element._zod.run({value:i,issues:[]},n);o instanceof Promise?s.push(o.then(t=>mm(t,r,e))):mm(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function fm(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...Rd(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function gm(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function bm(e,t,r,n,a,s){const i=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const a in t){if(o.has(a))continue;if("never"===l){i.push(a);continue}const s=c.run({value:t[a],issues:[]},n);s instanceof Promise?e.push(s.then(e=>fm(e,r,a,t,u))):fm(s,r,a,t,u)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const vm=od("$ZodObject",(e,t)=>{Op.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}const n=hd(()=>gm(t));vd(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const a=kd,s=t.catchall;let i;e._zod.parse=(t,r)=>{i??(i=n.value);const o=t.value;if(!a(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=i.shape;for(const e of i.keys){const n=l[e],a="optional"===n._zod.optout,s=n._zod.run({value:o[e],issues:[]},r);s instanceof Promise?c.push(s.then(r=>fm(r,t,e,o,a))):fm(s,t,e,o,a)}return s?bm(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ym=od("$ZodObjectJIT",(e,t)=>{vm.init(e,t);const r=e._zod.parse,n=hd(()=>gm(t));let a;const s=kd,i=!ud.jitless,o=i&&Ed.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=n.value);const p=u.value;return s(p)?i&&o&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new Mp(["shape","payload","ctx"]),r=n.value,a=e=>{const t=wd(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of r.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const n of r.keys){const r=s[n],i=wd(n),o=e[n],c="optional"===o?._zod?.optout;t.write(`const ${r} = ${a(n)};`),c?t.write(`\n if (${r}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `):t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=a(u,d),c?bm([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function xm(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!_d(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>Id(e,n,dd())))}),t)}const wm=od("$ZodUnion",(e,t)=>{Op.init(e,t),vd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),vd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),vd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),vd(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>gd(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(r)return n(a,s);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},s);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>xm(t,a,e,s)):xm(o,a,e,s)}}),Sm=od("$ZodIntersection",(e,t)=>{Op.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([t,r])=>Em(e,t,r)):Em(e,a,s)}});function km(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Cd(e)&&Cd(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=km(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=km(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Em(e,t,r){const n=new Map;let a;for(const r of t.issues)if("unrecognized_keys"===r.code){a??(a=r);for(const e of r.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(r);for(const t of r.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const s=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&a&&e.issues.push({...a,keys:s}),_d(e))return e;const i=km(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Cm=od("$ZodEnum",(e,t)=>{Op.init(e,t);const r=pd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Ad.has(typeof e)).map(e=>"string"==typeof e?jd(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),Nm=od("$ZodTransform",(e,t)=>{Op.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ld(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new cd;return r.value=a,r}});function Am(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const jm=od("$ZodOptional",(e,t)=>{Op.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${gd(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>Am(t,e.value)):Am(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Pm=od("$ZodExactOptional",(e,t)=>{jm.init(e,t),vd(e._zod,"values",()=>t.innerType._zod.values),vd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Tm=od("$ZodNullable",(e,t)=>{Op.init(e,t),vd(e._zod,"optin",()=>t.innerType._zod.optin),vd(e._zod,"optout",()=>t.innerType._zod.optout),vd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${gd(e.source)}|null)$`):void 0}),vd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),_m=od("$ZodDefault",(e,t)=>{Op.init(e,t),e._zod.optin="optional",vd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>Rm(e,t)):Rm(n,t)}});function Rm(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Dm=od("$ZodPrefault",(e,t)=>{Op.init(e,t),e._zod.optin="optional",vd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),Im=od("$ZodNonOptional",(e,t)=>{Op.init(e,t),vd(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>Um(t,e)):Um(a,e)}});function Um(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Mm=od("$ZodCatch",(e,t)=>{Op.init(e,t),vd(e._zod,"optin",()=>t.innerType._zod.optin),vd(e._zod,"optout",()=>t.innerType._zod.optout),vd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Id(e,r,dd()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Id(e,r,dd()))},input:e.value}),e.issues=[]),e)}}),Lm=od("$ZodPipe",(e,t)=>{Op.init(e,t),vd(e._zod,"values",()=>t.in._zod.values),vd(e._zod,"optin",()=>t.in._zod.optin),vd(e._zod,"optout",()=>t.out._zod.optout),vd(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>Om(e,t.in,r)):Om(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Om(e,t.out,r)):Om(n,t.out,r)}});function Om(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const zm=od("$ZodReadonly",(e,t)=>{Op.init(e,t),vd(e._zod,"propValues",()=>t.innerType._zod.propValues),vd(e._zod,"values",()=>t.innerType._zod.values),vd(e._zod,"optin",()=>t.innerType?._zod?.optin),vd(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(Fm):Fm(n)}});function Fm(e){return e.value=Object.freeze(e.value),e}const Bm=od("$ZodCustom",(e,t)=>{Ep.init(e,t),Op.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>Wm(t,r,n,e));Wm(a,r,n,e)}});function Wm(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(Md(e))}}var Vm;class Hm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(Vm=globalThis).__zod_globalRegistry??(Vm.__zod_globalRegistry=new Hm);const Gm=globalThis.__zod_globalRegistry;function $m(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Td(t)})}function Km(e,t){return new Cp({check:"max_length",...Td(t),maximum:e})}function qm(e,t){return new Np({check:"min_length",...Td(t),minimum:e})}function Zm(e,t){return new Ap({check:"length_equals",...Td(t),length:e})}function Jm(e){return new Up({check:"overwrite",tx:e})}function Ym(e){const t=function(e,t){const r=new Ep({check:"custom",...Td(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Md(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Md(n))}},e(r.value,r)));return t}function Xm(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Gm,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Qm(e,t,r={path:[],schemaPath:[]}){var n;const a=e._zod.def,s=t.seen.get(e);if(s){s.count++;return r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{const r=i.schema,s=t.processors[a.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);s(e,t,r,n)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),Qm(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&rh(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function eh(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const r=e.metadataRegistry.get(t[0])?.id;if(r){const e=n.get(r);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}const a=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:a,defId:s}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${a("__shared")}#/${n}/${s}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:a+s}})(t);n.def={...n.schema},s&&(n.defId=s);const i=n.schema;for(const e in i)delete i[e];i.$ref=a};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const n=r[1];if(t===r[0]){a(r);continue}if(e.external){const n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){a(r);continue}}const s=e.metadataRegistry.get(r[0])?.id;s?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function th(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const r=e.seen.get(t);if(null===r.ref)return;const a=r.def??r.schema,s={...a},i=r.ref;if(r.ref=null,i){n(i);const r=e.seen.get(i),o=r.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(a,o):(a.allOf=a.allOf??[],a.allOf.push(o)),Object.assign(a,s);if(t._zod.parent===i)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in s||delete a[e]);if(o.$ref&&r.def)for(const e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}const o=t._zod.parent;if(o&&o!==i){n(o);const t=e.seen.get(o);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(const e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:nh(t,"input",e.processors),output:nh(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function rh(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return rh(n.element,r);if("set"===n.type)return rh(n.valueType,r);if("lazy"===n.type)return rh(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return rh(n.innerType,r);if("intersection"===n.type)return rh(n.left,r)||rh(n.right,r);if("record"===n.type||"map"===n.type)return rh(n.keyType,r)||rh(n.valueType,r);if("pipe"===n.type)return rh(n.in,r)||rh(n.out,r);if("object"===n.type){for(const e in n.shape)if(rh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(rh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(rh(e,r))return!0;return!(!n.rest||!rh(n.rest,r))}return!1}const nh=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=Xm({...a??{},target:s,io:t,processors:r});return Qm(e,i),eh(i,e),th(i,e)},ah={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sh=(e,t,r,n)=>{const a=e._zod.def;Qm(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function ih(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function oh(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=xu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function ch(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=xu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function lh(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,s){try{return Promise.resolve(ih(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&nd({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:ad(oh(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,s){try{return Promise.resolve(ih(function(){return Promise.resolve(("sync"===r.mode?Bd:Vd)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&nd({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Od}(e))return{values:{},errors:ad(ch(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const uh=od("ZodISODateTime",(e,t)=>{Xp.init(e,t),Uh.init(e,t)});function dh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Td(t)})}(uh,e)}const ph=od("ZodISODate",(e,t)=>{Qp.init(e,t),Uh.init(e,t)});function mh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Td(t)})}(ph,e)}const hh=od("ZodISOTime",(e,t)=>{em.init(e,t),Uh.init(e,t)});function fh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Td(t)})}(hh,e)}const gh=od("ZodISODuration",(e,t)=>{tm.init(e,t),Uh.init(e,t)});function bh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Td(t)})}(gh,e)}const vh=od("ZodError",(e,t)=>{Od.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e}));else if("invalid_key"===a.code)n({issues:a.issues});else if("invalid_element"===a.code)n({issues:a.issues});else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,md,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,md,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),yh=Fd(vh),xh=Wd(vh),wh=Hd(vh),Sh=$d(vh),kh=qd(vh),Eh=Zd(vh),Ch=Jd(vh),Nh=Yd(vh),Ah=Xd(vh),jh=Qd(vh),Ph=ep(vh),Th=tp(vh),_h=od("ZodType",(e,t)=>(Op.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nh(e,"input"),output:nh(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=Xm({...r,processors:t});return Qm(e,n),eh(n,e),th(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(xd(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>Pd(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>yh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>wh(e,t,r),e.parseAsync=async(t,r)=>xh(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Sh(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>kh(e,t,r),e.decode=(t,r)=>Eh(e,t,r),e.encodeAsync=async(t,r)=>Ch(e,t,r),e.decodeAsync=async(t,r)=>Nh(e,t,r),e.safeEncode=(t,r)=>Ah(e,t,r),e.safeDecode=(t,r)=>jh(e,t,r),e.safeEncodeAsync=async(t,r)=>Ph(e,t,r),e.safeDecodeAsync=async(t,r)=>Th(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Td(r)})}(Cf,e,t)}(t,r)),e.superRefine=t=>e.check(Ym(t)),e.overwrite=t=>e.check(Jm(t)),e.optional=()=>hf(e),e.exactOptional=()=>new ff({type:"optional",innerType:e}),e.nullable=()=>bf(e),e.nullish=()=>hf(bf(e)),e.nonoptional=t=>function(e,t){return new xf({type:"nonoptional",innerType:e,...Td(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Td(r)})}(sf,e,t);var t},e.or=t=>function(e,t){return new lf({type:"union",options:e,...Td(t)})}([e,t]),e.and=t=>new uf({type:"intersection",left:e,right:t}),e.transform=t=>kf(e,new pf({type:"transform",transform:t})),e.default=t=>{return r=t,new vf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Nd(r)}});var r},e.prefault=t=>{return r=t,new yf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Nd(r)}});var r},e.catch=t=>{return new wf({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>kf(e,t),e.readonly=()=>new Ef({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Gm.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Gm.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Gm.get(e);const r=e.clone();return Gm.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Rh=od("_ZodString",(e,t)=>{zp.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=ah[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Pp({check:"string_format",format:"regex",...Td(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Rp({check:"string_format",format:"includes",...Td(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Dp({check:"string_format",format:"starts_with",...Td(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ip({check:"string_format",format:"ends_with",...Td(t),suffix:e})}(...t)),e.min=(...t)=>e.check(qm(...t)),e.max=(...t)=>e.check(Km(...t)),e.length=(...t)=>e.check(Zm(...t)),e.nonempty=(...t)=>e.check(qm(1,...t)),e.lowercase=t=>e.check(function(e){return new Tp({check:"string_format",format:"lowercase",...Td(e)})}(t)),e.uppercase=t=>e.check(function(e){return new _p({check:"string_format",format:"uppercase",...Td(e)})}(t)),e.trim=()=>e.check(Jm(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Jm(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Jm(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Jm(e=>e.toUpperCase())),e.slugify=()=>e.check(Jm(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Dh=od("ZodString",(e,t)=>{zp.init(e,t),Rh.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Td(t)})}(Mh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Td(t)})}(zh,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Td(t)})}(ef,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Td(t)})}(Fh,t)),e.guid=t=>e.check($m(Lh,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Td(t)})}(Oh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Td(t)})}(Oh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Td(t)})}(Oh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Td(t)})}(Oh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Td(t)})}(Bh,t)),e.guid=t=>e.check($m(Lh,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Td(t)})}(Wh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Td(t)})}(Vh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Td(t)})}(Hh,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Td(t)})}(Yh,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Td(t)})}(Xh,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Td(t)})}(Gh,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Td(t)})}($h,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Td(t)})}(Kh,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Td(t)})}(qh,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Td(t)})}(Zh,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Td(t)})}(Jh,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Td(t)})}(Qh,t)),e.datetime=t=>e.check(dh(t)),e.date=t=>e.check(mh(t)),e.time=t=>e.check(fh(t)),e.duration=t=>e.check(bh(t))});function Ih(e){return function(e,t){return new e({type:"string",...Td(t)})}(Dh,e)}const Uh=od("ZodStringFormat",(e,t)=>{Fp.init(e,t),Rh.init(e,t)}),Mh=od("ZodEmail",(e,t)=>{Vp.init(e,t),Uh.init(e,t)}),Lh=od("ZodGUID",(e,t)=>{Bp.init(e,t),Uh.init(e,t)}),Oh=od("ZodUUID",(e,t)=>{Wp.init(e,t),Uh.init(e,t)}),zh=od("ZodURL",(e,t)=>{Hp.init(e,t),Uh.init(e,t)}),Fh=od("ZodEmoji",(e,t)=>{Gp.init(e,t),Uh.init(e,t)}),Bh=od("ZodNanoID",(e,t)=>{$p.init(e,t),Uh.init(e,t)}),Wh=od("ZodCUID",(e,t)=>{Kp.init(e,t),Uh.init(e,t)}),Vh=od("ZodCUID2",(e,t)=>{qp.init(e,t),Uh.init(e,t)}),Hh=od("ZodULID",(e,t)=>{Zp.init(e,t),Uh.init(e,t)}),Gh=od("ZodXID",(e,t)=>{Jp.init(e,t),Uh.init(e,t)}),$h=od("ZodKSUID",(e,t)=>{Yp.init(e,t),Uh.init(e,t)}),Kh=od("ZodIPv4",(e,t)=>{rm.init(e,t),Uh.init(e,t)}),qh=od("ZodIPv6",(e,t)=>{nm.init(e,t),Uh.init(e,t)}),Zh=od("ZodCIDRv4",(e,t)=>{am.init(e,t),Uh.init(e,t)}),Jh=od("ZodCIDRv6",(e,t)=>{sm.init(e,t),Uh.init(e,t)}),Yh=od("ZodBase64",(e,t)=>{om.init(e,t),Uh.init(e,t)}),Xh=od("ZodBase64URL",(e,t)=>{cm.init(e,t),Uh.init(e,t)}),Qh=od("ZodE164",(e,t)=>{lm.init(e,t),Uh.init(e,t)}),ef=od("ZodJWT",(e,t)=>{um.init(e,t),Uh.init(e,t)}),tf=od("ZodUnknown",(e,t)=>{dm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function rf(){return new tf({type:"unknown"})}const nf=od("ZodNever",(e,t)=>{pm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function af(e){return function(e,t){return new e({type:"never",...Td(t)})}(nf,e)}const sf=od("ZodArray",(e,t)=>{hm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(a.minItems=i),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=Qm(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(qm(t,r)),e.nonempty=t=>e.check(qm(1,t)),e.max=(t,r)=>e.check(Km(t,r)),e.length=(t,r)=>e.check(Zm(t,r)),e.unwrap=()=>e.element});const of=od("ZodObject",(e,t)=>{ym.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def;a.type="object",a.properties={};const i=s.shape;for(const e in i)a.properties[e]=Qm(i[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const r=s.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===s.catchall?._zod.def.type?a.additionalProperties=!1:s.catchall?s.catchall&&(a.additionalProperties=Qm(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),vd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new df({type:"enum",entries:r,...Td(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:rf()}),e.loose=()=>e.clone({...e._zod.def,catchall:rf()}),e.strict=()=>e.clone({...e._zod.def,catchall:af()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Cd(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const r=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=xd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yd(this,"shape",r),r}});return Pd(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Cd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=xd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yd(this,"shape",r),r}});return Pd(e,r)}(e,t),e.merge=t=>function(e,t){const r=xd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yd(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Pd(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Pd(e,xd(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return yd(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=xd(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return yd(this,"shape",n),n},checks:[]});return Pd(e,a)}(e,t),e.partial=(...t)=>function(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=xd(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return yd(this,"shape",a),a},checks:[]});return Pd(t,a)}(mf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=xd(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return yd(this,"shape",a),a}});return Pd(t,n)}(xf,e,t[0])});function cf(e,t){const r={type:"object",shape:e??{},...Td(t)};return new of(r)}const lf=od("ZodUnion",(e,t)=>{wm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=!1===a.inclusive,i=a.options.map((e,r)=>Qm(e,t,{...n,path:[...n.path,s?"oneOf":"anyOf",r]}));s?r.oneOf=i:r.anyOf=i})(e,t,r,n),e.options=t.options});const uf=od("ZodIntersection",(e,t)=>{Sm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=Qm(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=Qm(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];r.allOf=c})(e,t,r,n)});const df=od("ZodEnum",(e,t)=>{Cm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=pd(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n})(e,0,r),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new df({...t,checks:[],...Td(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new df({...t,checks:[],...Td(n),entries:a})}});const pf=od("ZodTransform",(e,t)=>{Nm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ld(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Md(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(Md(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const mf=od("ZodOptional",(e,t)=>{jm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>sh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function hf(e){return new mf({type:"optional",innerType:e})}const ff=od("ZodExactOptional",(e,t)=>{Pm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>sh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const gf=od("ZodNullable",(e,t)=>{Tm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=Qm(a.innerType,t,n),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=a.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function bf(e){return new gf({type:"nullable",innerType:e})}const vf=od("ZodDefault",(e,t)=>{_m.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Qm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const yf=od("ZodPrefault",(e,t)=>{Dm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Qm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const xf=od("ZodNonOptional",(e,t)=>{Im.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Qm(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const wf=od("ZodCatch",(e,t)=>{Mm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;Qm(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Sf=od("ZodPipe",(e,t)=>{Lm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;Qm(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function kf(e,t){return new Sf({type:"pipe",in:e,out:t})}const Ef=od("ZodReadonly",(e,t)=>{zm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Qm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.readOnly=!0})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Cf=od("ZodCustom",(e,t)=>{Bm.init(e,t),_h.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const Nf={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},Af={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function jf(e){return e&&e.trim()?Af[e.trim().toLowerCase()]??"":""}function Pf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Nf[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${Pf(e)})`}));var Tf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ws(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),_f=a.forwardRef((t,r)=>e.jsx(Tf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));_f.displayName="Label";var Rf=_f;const Df=js("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),If=a.forwardRef(({className:t,...r},n)=>e.jsx(Rf,{ref:n,className:Se(Df(),t),...r}));If.displayName=Rf.displayName;const Uf=yu,Mf=a.createContext({}),Lf=({...t})=>e.jsx(Mf.Provider,{value:{name:t.name},children:e.jsx(bu,{...t})}),Of=()=>{const e=a.useContext(Mf),r=a.useContext(zf),{getFieldState:n,formState:s}=t.useContext(vu),i=n(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},zf=a.createContext({}),Ff=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(zf.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Ff.displayName="FormItem";const Bf=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Of();return e.jsx(If,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});Bf.displayName="FormLabel";const Wf=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Of();return e.jsx(Ss,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Wf.displayName="FormControl";const Vf=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Of();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Vf.displayName="FormDescription";const Hf=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Of(),o=s?String(s?.message):r;return o?e.jsx("p",{ref:a,id:i,className:Se("text-sm font-medium text-destructive",t),...n,children:o}):null});Hf.displayName="FormMessage";const Gf=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Se("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n}));function $f(t){const r=Kf(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Zf);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}function Kf(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Gf.displayName="Input";var qf=Symbol("radix.slottable");function Zf(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===qf}function Jf(r){const n=r+"CollectionProvider",[a,s]=Rs(n),[i,o]=a(n,{collectionRef:{current:null},itemMap:new Map}),c=r=>{const{scope:n,children:a}=r,s=t.useRef(null),o=t.useRef(new Map).current;return e.jsx(i,{scope:n,itemMap:o,collectionRef:s,children:a})};c.displayName=n;const l=r+"CollectionSlot",u=$f(l),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=bs(r,o(l,n).collectionRef);return e.jsx(u,{ref:s,children:a})});d.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=$f(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=bs(n,c),u=o(p,a);return t.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:d,ItemSlot:f},function(e){const n=o(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},s]}var Yf=a.createContext(void 0);function Xf(e){const t=a.useContext(Yf);return e||t||"ltr"}var Qf="rovingFocusGroup.onEntryFocus",eg={bubbles:!1,cancelable:!0},tg="RovingFocusGroup",[rg,ng,ag]=Jf(tg),[sg,ig]=Rs(tg,[ag]),[og,cg]=sg(tg),lg=a.forwardRef((t,r)=>e.jsx(rg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(rg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(ug,{...t,ref:r})})}));lg.displayName=tg;var ug=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=bs(r,h),g=Xf(o),[b,v]=zs({prop:c,defaultProp:l??null,onChange:u,caller:tg}),[y,x]=a.useState(!1),w=Hs(d),S=ng(n),k=a.useRef(!1),[E,C]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Qf,w),()=>e.removeEventListener(Qf,w)},[w]),e.jsx(og,{scope:n,orientation:s,dir:g,loop:i,currentTabStopId:b,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>C(e=>e-1),[]),children:e.jsx(Vs.div,{tabIndex:y||0===E?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:_s(t.onMouseDown,()=>{k.current=!0}),onFocus:_s(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(Qf,eg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);hg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:_s(t.onBlur,()=>x(!1))})})}),dg="RovingFocusGroupItem",pg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=Ls(),d=o||u,p=cg(dg,n),m=p.currentTabStopId===d,h=ng(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(rg.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:e.jsx(Vs.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:_s(t.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:_s(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:_s(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:mg[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>hg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});pg.displayName=dg;var mg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var fg=lg,gg=pg,bg="Radio",[vg,yg]=Rs(bg),[xg,wg]=vg(bg),Sg=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:u,form:d,...p}=t,[m,h]=a.useState(null),f=bs(r,e=>h(e)),g=a.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(xg,{scope:n,checked:i,disabled:c,children:[e.jsx(Vs.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ng(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:_s(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Cg,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});Sg.displayName=bg;var kg="RadioIndicator",Eg=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=wg(kg,n);return e.jsx(ui,{present:a||i.checked,children:e.jsx(Vs.span,{"data-state":Ng(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Eg.displayName=kg;var Cg=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=bs(c,o),u=fl(n),d=gl(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx(Vs.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ng(e){return e?"checked":"unchecked"}Cg.displayName="RadioBubbleInput";var Ag=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jg="RadioGroup",[Pg]=Rs(jg,[ig,yg]),Tg=ig(),_g=yg(),[Rg,Dg]=Pg(jg),Ig=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...m}=t,h=Tg(n),f=Xf(u),[g,b]=zs({prop:i,defaultProp:s??null,onChange:p,caller:jg});return e.jsx(Rg,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(fg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Vs.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Ig.displayName=jg;var Ug="RadioGroupItem",Mg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Dg(Ug,n),c=o.disabled||s,l=Tg(n),u=_g(n),d=a.useRef(null),p=bs(r,d),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Ag.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(gg,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Sg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:_s(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:_s(i.onFocus,()=>{h.current&&d.current?.click()})})})});Mg.displayName=Ug;var Lg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=_g(n);return e.jsx(Eg,{...s,...a,ref:r})});Lg.displayName="RadioGroupIndicator";var Og=Ig,zg=Mg,Fg=Lg;const Bg=a.forwardRef(({className:t,...r},n)=>e.jsx(Og,{className:Se("grid gap-2",t),...r,ref:n}));Bg.displayName=Og.displayName;const Wg=a.forwardRef(({className:t,...r},n)=>e.jsx(zg,{ref:n,className:Se("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Fg,{className:"flex items-center justify-center",children:e.jsx(ac,{className:"h-3.5 w-3.5 fill-primary"})})}));function Vg(e,[t,r]){return Math.min(r,Math.max(t,e))}Wg.displayName=zg.displayName;var Hg="ScrollArea",[Gg]=Rs(Hg),[$g,Kg]=Gg(Hg),qg=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,u]=a.useState(null),[d,p]=a.useState(null),[m,h]=a.useState(null),[f,g]=a.useState(null),[b,v]=a.useState(null),[y,x]=a.useState(0),[w,S]=a.useState(0),[k,E]=a.useState(!1),[C,N]=a.useState(!1),A=bs(r,e=>u(e)),j=Xf(i);return e.jsx($g,{scope:n,type:s,dir:j,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Vs.div,{dir:j,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});qg.displayName=Hg;var Zg="ScrollAreaViewport",Jg=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=Kg(Zg,n),l=bs(r,a.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(Vs.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Jg.displayName=Zg;var Yg="ScrollAreaScrollbar",Xg=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Kg(Yg,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return a.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===i.type?e.jsx(Qg,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(eb,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(tb,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(rb,{...s,ref:r}):null});Xg.displayName=Yg;var Qg=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Kg(Yg,t.__scopeScrollArea),[o,c]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(ui,{present:n||o,children:e.jsx(tb,{"data-state":o?"visible":"hidden",...s,ref:r})})}),eb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Kg(Yg,t.__scopeScrollArea),o="horizontal"===t.orientation,c=wb(()=>u("SCROLL_END"),100),[l,u]=(d="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},a.useReducer((e,t)=>p[e][t]??e,d));var d,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,u]),a.useEffect(()=>{const e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,u,c]),e.jsx(ui,{present:n||"hidden"!==l,children:e.jsx(rb,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:_s(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:_s(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),tb=a.forwardRef((t,r)=>{const n=Kg(Yg,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,u=wb(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return Sb(n.viewport,u),Sb(n.content,u),e.jsx(ui,{present:s||o,children:e.jsx(rb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),rb=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=Kg(Yg,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=fb(l.viewport,l.content),p={...s,sizes:l,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=gb(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return vb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(nb,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=bb(i.viewport.scrollLeft,l,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===n?e.jsx(ab,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=bb(i.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),nb=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Kg(Yg,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=bs(r,u,o.onScrollbarXChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(ob,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":gb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),yb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:hb(c.paddingLeft),paddingEnd:hb(c.paddingRight)}})}})}),ab=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Kg(Yg,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=bs(r,u,o.onScrollbarYChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(ob,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":gb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),yb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:hb(c.paddingTop),paddingEnd:hb(c.paddingBottom)}})}})}),[sb,ib]=Gg(Yg),ob=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:m,...h}=t,f=Kg(Yg,n),[g,b]=a.useState(null),v=bs(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Hs(p),E=Hs(u),C=wb(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,g,S,k]),a.useEffect(E,[s,E]),Sb(g,C),Sb(f.content,C),e.jsx(sb,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Hs(o),onThumbPointerUp:Hs(c),onThumbPositionChange:E,onThumbPointerDown:Hs(l),children:e.jsx(Vs.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:_s(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),N(e)}}),onPointerMove:_s(t.onPointerMove,N),onPointerUp:_s(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),cb="ScrollAreaThumb",lb=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=ib(cb,t.__scopeScrollArea);return e.jsx(ui,{present:n||s.hasThumb,children:e.jsx(ub,{ref:r,...a})})}),ub=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=Kg(cb,n),c=ib(cb,n),{onThumbPositionChange:l}=c,u=bs(r,e=>c.onThumbChange(e)),d=a.useRef(void 0),p=wb(()=>{d.current&&(d.current(),d.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!d.current){const t=xb(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Vs.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:_s(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:_s(t.onPointerUp,c.onThumbPointerUp)})});lb.displayName=cb;var db="ScrollAreaCorner",pb=a.forwardRef((t,r)=>{const n=Kg(db,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(mb,{...t,ref:r}):null});pb.displayName=db;var mb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=Kg(db,n),[o,c]=a.useState(0),[l,u]=a.useState(0),d=Boolean(o&&l);return Sb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),Sb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Vs.div,{...s,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function hb(e){return e?parseInt(e,10):0}function fb(e,t){const r=e/t;return isNaN(r)?0:r}function gb(e){const t=fb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function bb(e,t,r="ltr"){const n=gb(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Vg(e,"ltr"===r?[0,i]:[-1*i,0]);return vb([0,i],[0,o])(c)}function vb(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function yb(e,t){return e>0&&e<t}var xb=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,o=r.top!==s.top;(i||o)&&t(),r=s,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function wb(e,t){const r=Hs(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Sb(e,t){const r=Hs(t);Is(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var kb=qg,Eb=Jg,Cb=pb;const Nb=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(kb,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Eb,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Ab,{}),e.jsx(Cb,{})]}));Nb.displayName=kb.displayName;const Ab=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Xg,{ref:a,orientation:r,className:Se("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(lb,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function jb(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</text></svg>`}Ab.displayName=Xg.displayName;const Pb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],Tb=({workspace:r})=>{const{t:n}=an(),{updateWorkspace:a}=Pa(),{can:s}=dl(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState(),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=td({resolver:lh(cf({name:Ih().min(2,{message:n("general.nameMinLength")}),image:Ih().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(ml,{});const g=s(il.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),!g&&e.jsx("div",{className:"text-red-500",children:n("general.ownerOnly")}),e.jsx(Uf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a(r,e),m(n("general.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(Lf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Ff,{children:[e.jsx(Bf,{children:n("general.name")}),e.jsx(Wf,{children:e.jsx(Gf,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(Hf,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(If,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[jf(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:jf(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(If,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Vf,{children:n("general.iconDescription")})]}),e.jsxs(Bg,{value:c,disabled:!g,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Wg,{value:"emoji",id:"emoji"}),e.jsxs(If,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(cs,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Wg,{value:"url",id:"url"}),e.jsxs(If,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[u&&e.jsx("span",{className:"text-2xl",children:u}),!u&&f.watch("image")?.trim()&&e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview"})]})]}),g&&e.jsx(Nb,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Pb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",jb(e))})(t),disabled:!g,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Lf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Ff,{children:[e.jsx(Bf,{children:n("general.imageUrl")}),e.jsx(Wf,{children:e.jsx(Gf,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Vf,{children:n("general.imageUrlDescription")}),e.jsx(Hf,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:g&&e.jsx(Ts,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};var _b=.999,Rb=/[\\\/_+.#"@\[\(\{&]/,Db=/[\\\/_+.#"@\[\(\{&]/g,Ib=/[\s-]/,Ub=/[\s-]/g;function Mb(e,t,r,n,a,s,i){if(s===t.length)return a===e.length?1:.99;var o=`${a},${s}`;if(void 0!==i[o])return i[o];for(var c,l,u,d,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Mb(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Rb.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(Db))&&a>0&&(c*=Math.pow(_b,u.length))):Ib.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(Ub))&&a>0&&(c*=Math.pow(_b,d.length))):(c*=.17,a>0&&(c*=Math.pow(_b,m-a))),e.charAt(m)!==t.charAt(s)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(m-1)!==n.charAt(s))&&(.1*(l=Mb(e,t,r,n,m+1,s+2,i))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return i[o]=h,h}function Lb(e){return e.toLowerCase().replace(Ub," ")}function Ob(e,t,r){return Mb(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Lb(e),Lb(t),0,0,{})}var zb='[cmdk-group=""]',Fb='[cmdk-group-items=""]',Bb='[cmdk-item=""]',Wb=`${Bb}:not([aria-disabled="true"])`,Vb="cmdk-item-select",Hb="data-value",Gb=(e,t,r)=>Ob(e,t,r),$b=a.createContext(void 0),Kb=()=>a.useContext($b),qb=a.createContext(void 0),Zb=()=>a.useContext(qb),Jb=a.createContext(void 0),Yb=a.forwardRef((e,t)=>{let r=dv(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=dv(()=>new Set),s=dv(()=>new Map),i=dv(()=>new Map),o=dv(()=>new Set),c=lv(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ls(),x=Ls(),w=Ls(),S=a.useRef(null),k=hv();uv(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),uv(()=>{k(6,T)},[]);let E=a.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),A(),k(1,j);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=_())?void 0:e.id,E.emit()}),n||k(5,T),void 0!==(null==(s=c.current)?void 0:s.value)){let e=null!=t?t:"";return void(null==(o=(i=c.current).onValueChange)||o.call(i,e))}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),k(2,()=>{A(),E.emit()}))},item:(e,t)=>(n.current.add(e),t&&(s.current.has(t)?s.current.get(t).add(e):s.current.set(t,new Set([e]))),k(3,()=>{P(),A(),r.current.value||j(),E.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=_();k(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&j(),E.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{i.current.delete(e),s.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:S}),[]);function N(e,t){var n,a;let s=null!=(a=null==(n=c.current)?void 0:n.filter)?a:Gb;return e?s(e,r.current.search,t):0}function A(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;R().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(Fb);t?t.appendChild(e.parentElement===t?e:e.closest(`${Fb} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Fb} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${zb}[${Hb}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function j(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Hb);E.setState("value",t||void 0)}function P(){var e,t,a,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let l=0;for(let s of n.current){let n=N(null!=(t=null==(e=i.current.get(s))?void 0:e.value)?t:"",null!=(o=null==(a=i.current.get(s))?void 0:a.keywords)?o:[]);r.current.filtered.items.set(s,n),n>0&&l++}for(let[e,t]of s.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=l}function T(){var e,t,r;let n=_();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(zb))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function _(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Bb}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Wb))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute(Hb))}function I(e){var t;let r=_(),n=R(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=c.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&E.setState("value",s.getAttribute(Hb))}function U(e){let t,r=_(),n=null==r?void 0:r.closest(zb);for(;n&&!t;)n=e>0?ov(n,zb):cv(n,zb),t=null==n?void 0:n.querySelector(Wb);t?E.setState("value",t.getAttribute(Hb)):I(e)}let M=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return a.createElement(Vs.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":b&&e.ctrlKey&&O(e);break;case"ArrowUp":O(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=_();if(t){let e=new Event(Vb);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:gv},l),fv(e,e=>a.createElement(qb.Provider,{value:E},a.createElement($b.Provider,{value:C},e))))}),Xb=a.forwardRef((e,t)=>{var r,n;let s=Ls(),i=a.useRef(null),o=a.useContext(Jb),c=Kb(),l=lv(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;uv(()=>{if(!u)return c.item(s,null==o?void 0:o.id)},[u]);let d=mv(s,i,[e.value,e.children,i],e.keywords),p=Zb(),m=pv(e=>e.value&&e.value===d.current),h=pv(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(s)>0));function f(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Vb,f),()=>t.removeEventListener(Vb,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:x,keywords:w,...S}=e;return a.createElement(Vs.div,{ref:gs(i,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||c.getDisablePointerSelection()?void 0:g,onClick:b?void 0:f},e.children)}),Qb=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ls(),c=a.useRef(null),l=a.useRef(null),u=Ls(),d=Kb(),p=pv(e=>!(!s&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));uv(()=>d.group(o),[]),mv(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Vs.div,{ref:gs(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),fv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(Jb.Provider,{value:m},e))))}),ev=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=pv(e=>!e.search);return r||i?a.createElement(Vs.div,{ref:gs(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),tv=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=Zb(),o=pv(e=>e.search),c=pv(e=>e.selectedItemId),l=Kb();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Vs.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:s?e.value:o,onChange:e=>{s||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),rv=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=pv(e=>e.selectedItemId),l=Kb();return a.useEffect(()=>{if(o.current&&i.current){let e,t=o.current,r=i.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(Vs.div,{ref:gs(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},fv(e,e=>a.createElement("div",{ref:gs(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),nv=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement($o,{open:r,onOpenChange:n},a.createElement(qo,{container:o},a.createElement(Zo,{"cmdk-overlay":"",className:s}),a.createElement(Jo,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(Yb,{ref:t,...c}))))}),av=a.forwardRef((e,t)=>pv(e=>0===e.filtered.count)?a.createElement(Vs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),sv=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Vs.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},fv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),iv=Object.assign(Yb,{List:rv,Item:Xb,Input:tv,Group:Qb,Separator:ev,Dialog:nv,Empty:av,Loading:sv});function ov(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function cv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function lv(e){let t=a.useRef(e);return uv(()=>{t.current=e}),t}var uv="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function dv(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function pv(e){let t=Zb(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function mv(e,t,r,n=[]){let s=a.useRef(),i=Kb();return uv(()=>{var a;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());i.value(e,o,c),null==(a=t.current)||a.setAttribute(Hb,o),s.current=o}),s}var hv=()=>{let[e,t]=a.useState(),r=dv(()=>new Map);return uv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function fv({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var gv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const bv=a.forwardRef(({className:t,...r},n)=>e.jsx(iv,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));bv.displayName=iv.displayName;const vv=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(cc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(iv.Input,{ref:n,className:Se("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...r})]}));vv.displayName=iv.Input.displayName;const yv=a.forwardRef(({className:t,...r},n)=>e.jsx(iv.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));yv.displayName=iv.List.displayName;a.forwardRef((t,r)=>e.jsx(iv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=iv.Empty.displayName;const xv=a.forwardRef(({className:t,...r},n)=>e.jsx(iv.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r}));xv.displayName=iv.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(iv.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=iv.Separator.displayName;const wv=a.forwardRef(({className:t,...r},n)=>e.jsx(iv.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r}));wv.displayName=iv.Item.displayName;const Sv=["top","right","bottom","left"],kv=Math.min,Ev=Math.max,Cv=Math.round,Nv=Math.floor,Av=e=>({x:e,y:e}),jv={left:"right",right:"left",bottom:"top",top:"bottom"},Pv={start:"end",end:"start"};function Tv(e,t,r){return Ev(e,kv(t,r))}function _v(e,t){return"function"==typeof e?e(t):e}function Rv(e){return e.split("-")[0]}function Dv(e){return e.split("-")[1]}function Iv(e){return"x"===e?"y":"x"}function Uv(e){return"y"===e?"height":"width"}const Mv=new Set(["top","bottom"]);function Lv(e){return Mv.has(Rv(e))?"y":"x"}function Ov(e){return Iv(Lv(e))}function zv(e){return e.replace(/start|end/g,e=>Pv[e])}const Fv=["left","right"],Bv=["right","left"],Wv=["top","bottom"],Vv=["bottom","top"];function Hv(e,t,r,n){const a=Dv(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Bv:Fv:t?Fv:Bv;case"left":case"right":return t?Wv:Vv;default:return[]}}(Rv(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(zv)))),s}function Gv(e){return e.replace(/left|right|bottom|top/g,e=>jv[e])}function $v(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kv(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}}function qv(e,t,r){let{reference:n,floating:a}=e;const s=Lv(t),i=Ov(t),o=Uv(i),c=Rv(t),l="y"===s,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:u,y:n.y-a.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-a.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Dv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function Zv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:s,rects:i,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=_v(t,e),h=$v(m),f=o[p?"floating"===d?"reference":"floating":d],g=Kv(await s.getClippingRect({element:null==(r=await(null==s.isElement?void 0:s.isElement(f)))||r?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},x=Kv(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}function Jv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yv(e){return Sv.some(t=>e[t]>=0)}const Xv=new Set(["left","top"]);function Qv(){return"undefined"!=typeof window}function ey(e){return ny(e)?(e.nodeName||"").toLowerCase():"#document"}function ty(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ry(e){var t;return null==(t=(ny(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ny(e){return!!Qv()&&(e instanceof Node||e instanceof ty(e).Node)}function ay(e){return!!Qv()&&(e instanceof Element||e instanceof ty(e).Element)}function sy(e){return!!Qv()&&(e instanceof HTMLElement||e instanceof ty(e).HTMLElement)}function iy(e){return!(!Qv()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ty(e).ShadowRoot)}const oy=new Set(["inline","contents"]);function cy(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=xy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!oy.has(a)}const ly=new Set(["table","td","th"]);function uy(e){return ly.has(ey(e))}const dy=[":popover-open",":modal"];function py(e){return dy.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const my=["transform","translate","scale","rotate","perspective"],hy=["transform","translate","scale","rotate","perspective","filter"],fy=["paint","layout","strict","content"];function gy(e){const t=by(),r=ay(e)?xy(e):e;return my.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||hy.some(e=>(r.willChange||"").includes(e))||fy.some(e=>(r.contain||"").includes(e))}function by(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const vy=new Set(["html","body","#document"]);function yy(e){return vy.has(ey(e))}function xy(e){return ty(e).getComputedStyle(e)}function wy(e){return ay(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sy(e){if("html"===ey(e))return e;const t=e.assignedSlot||e.parentNode||iy(e)&&e.host||ry(e);return iy(t)?t.host:t}function ky(e){const t=Sy(e);return yy(t)?e.ownerDocument?e.ownerDocument.body:e.body:sy(t)&&cy(t)?t:ky(t)}function Ey(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=ky(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=ty(a);if(s){const e=Cy(i);return t.concat(i,i.visualViewport||[],cy(a)?a:[],e&&r?Ey(e):[])}return t.concat(a,Ey(a,[],r))}function Cy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ny(e){const t=xy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=sy(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Cv(r)!==s||Cv(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Ay(e){return ay(e)?e:e.contextElement}function jy(e){const t=Ay(e);if(!sy(t))return Av(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Ny(t);let i=(s?Cv(r.width):r.width)/n,o=(s?Cv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Py=Av(0);function Ty(e){const t=ty(e);return by()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Py}function _y(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Ay(e);let i=Av(1);t&&(n?ay(n)&&(i=jy(n)):i=jy(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ty(e))&&t}(s,r,n)?Ty(s):Av(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(s){const e=ty(s),t=n&&ay(n)?ty(n):n;let r=e,a=Cy(r);for(;a&&n&&t!==r;){const e=jy(a),t=a.getBoundingClientRect(),n=xy(a),s=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=s,l+=i,r=ty(a),a=Cy(r)}}return Kv({width:u,height:d,x:c,y:l})}function Ry(e,t){const r=wy(e).scrollLeft;return t?t.left+r:_y(ry(e)).left+r}function Dy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ry(e,r),y:r.top+t.scrollTop}}const Iy=new Set(["absolute","fixed"]);function Uy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ty(e),n=ry(e),a=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,o=0,c=0;if(a){s=a.width,i=a.height;const e=by();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Ry(n);if(l<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(s-=i)}else l<=25&&(s+=l);return{width:s,height:i,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=ry(e),r=wy(e),n=e.ownerDocument.body,a=Ev(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Ev(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Ry(e);const o=-r.scrollTop;return"rtl"===xy(n).direction&&(i+=Ev(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(ry(e));else if(ay(t))n=function(e,t){const r=_y(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=sy(e)?jy(e):Av(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:a*s.x,y:n*s.y}}(t,r);else{const r=Ty(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Kv(n)}function My(e,t){const r=Sy(e);return!(r===t||!ay(r)||yy(r))&&("fixed"===xy(r).position||My(r,t))}function Ly(e,t,r){const n=sy(t),a=ry(t),s="fixed"===r,i=_y(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Av(0);function l(){c.x=Ry(a)}if(n||!n&&!s)if(("body"!==ey(t)||cy(a))&&(o=wy(t)),n){const e=_y(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const u=!a||n||s?Av(0):Dy(a,o);return{x:i.left+o.scrollLeft-c.x-u.x,y:i.top+o.scrollTop-c.y-u.y,width:i.width,height:i.height}}function Oy(e){return"static"===xy(e).position}function zy(e,t){if(!sy(e)||"fixed"===xy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ry(e)===r&&(r=r.ownerDocument.body),r}function Fy(e,t){const r=ty(e);if(py(e))return r;if(!sy(e)){let t=Sy(e);for(;t&&!yy(t);){if(ay(t)&&!Oy(t))return t;t=Sy(t)}return r}let n=zy(e,t);for(;n&&uy(n)&&Oy(n);)n=zy(n,t);return n&&yy(n)&&Oy(n)&&!gy(n)?r:n||function(e){let t=Sy(e);for(;sy(t)&&!yy(t);){if(gy(t))return t;if(py(t))return null;t=Sy(t)}return null}(e)||r}const By={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=ry(n),o=!!t&&py(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Av(1);const u=Av(0),d=sy(n);if((d||!d&&!s)&&(("body"!==ey(n)||cy(i))&&(c=wy(n)),sy(n))){const e=_y(n);l=jy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||s?Av(0):Dy(i,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:ry,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?py(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Ey(e,[],!1).filter(e=>ay(e)&&"body"!==ey(e)),a=null;const s="fixed"===xy(e).position;let i=s?Sy(e):e;for(;ay(i)&&!yy(i);){const t=xy(i),r=gy(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Iy.has(a.position)||cy(i)&&!r&&My(e,i))?n=n.filter(e=>e!==i):a=t,i=Sy(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Uy(t,r,a);return e.top=Ev(n.top,e.top),e.right=kv(n.right,e.right),e.bottom=kv(n.bottom,e.bottom),e.left=Ev(n.left,e.left),e},Uy(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Fy,getElementRects:async function(e){const t=this.getOffsetParent||Fy,r=this.getDimensions,n=await r(e.floating);return{reference:Ly(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ny(e);return{width:t,height:r}},getScale:jy,isElement:ay,isRTL:function(e){return"rtl"===xy(e).direction}};function Wy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vy(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=Ay(e),u=a||s?[...l?Ey(l):[],...Ey(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const d=l&&o?function(e,t){let r,n=null;const a=ry(e);function s(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-Nv(d)+"px "+-Nv(a.clientWidth-(u+p))+"px "+-Nv(a.clientHeight-(d+m))+"px "+-Nv(u)+"px",threshold:Ev(0,kv(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Wy(l,e.getBoundingClientRect())||i(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),s}(l,r):null;let p,m=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),l&&!c&&h.observe(l),h.observe(t));let f=c?_y(e):null;return c&&function t(){const n=_y(e);f&&!Wy(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Hy=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:i,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,s=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Rv(r),o=Dv(r),c="y"===Lv(r),l=Xv.has(i)?-1:1,u=s&&c?-1:1,d=_v(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}(t,e);return i===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Gy=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=_v(e,t),u={x:r,y:n},d=await s.detectOverflow(t,l),p=Lv(Rv(a)),m=Iv(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=Tv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=Tv(f+d["y"===p?"top":"left"],f,f-d[e])}const g=c.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:i,[p]:o}}}}}},$y=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:i,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=_v(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Rv(a),v=Lv(o),y=Rv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[Gv(o)]:function(e){const t=Gv(e);return[zv(e),t,zv(t)]}(o)),S="none"!==h;!p&&S&&w.push(...Hv(o,f,h,x));const k=[o,...w],E=await c.detectOverflow(t,g),C=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(u&&C.push(E[b]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Dv(e),a=Ov(e),s=Uv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Gv(i)),[i,Gv(i)]}(a,i,x);C.push(E[e[0]],E[e[1]])}if(N=[...N,{placement:a,overflows:C}],!C.every(e=>e<=0)){var A,j;const e=((null==(A=s.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Lv(t))||N.every(e=>Lv(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let r=null==(j=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!r)switch(m){case"bestFit":{var P;const e=null==(P=N.filter(e=>{if(S){const t=Lv(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},Ky=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:c=()=>{},...l}=_v(e,t),u=await i.detectOverflow(t,l),d=Rv(a),p=Dv(a),m="y"===Lv(a),{width:h,height:f}=s.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,g="end"===p?"top":"bottom");const v=f-u.top-u.bottom,y=h-u.left-u.right,x=kv(f-u[g],v),w=kv(h-u[b],y),S=!t.middlewareData.shift;let k=x,E=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=Ev(u.left,0),t=Ev(u.right,0),r=Ev(u.top,0),n=Ev(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:Ev(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:Ev(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const C=await i.getDimensions(o.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},qy=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=_v(e,t);switch(a){case"referenceHidden":{const e=Jv(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yv(e)}}}case"escaped":{const e=Jv(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Yv(e)}}}default:return{}}}}},Zy=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:i,elements:o,middlewareData:c}=t,{element:l,padding:u=0}=_v(e,t)||{};if(null==l)return{};const d=$v(u),p={x:r,y:n},m=Ov(a),h=Uv(m),f=await i.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[m]-p[m]-s.floating[h],w=p[m]-s.reference[m],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=o.floating[y]||s.floating[h]);const E=x/2-w/2,C=k/2-f[h]/2-1,N=kv(d[b],C),A=kv(d[v],C),j=N,P=k-f[h]-A,T=k/2-f[h]/2+E,_=Tv(j,T,P),R=!c.arrow&&null!=Dv(a)&&T!==_&&s.reference[h]/2-(T<j?N:A)-f[h]/2<0,D=R?T<j?T-j:T-P:0;return{[m]:p[m]+D,data:{[m]:_,centerOffset:T-_-D,...R&&{alignmentOffset:D}},reset:R}}}),Jy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=_v(e,t),u={x:r,y:n},d=Lv(a),p=Iv(d);let m=u[p],h=u[d];const f=_v(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=s.reference[p]-s.floating[e]+g.mainAxis,r=s.reference[p]+s.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=Xv.has(Rv(a)),r=s.reference[d]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=s.reference[d]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[d]:h}}}},Yy=(e,t,r)=>{const n=new Map,a={platform:By,...r},s={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:i}=r,o=s.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=qv(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:s,fn:g}=o[r],{x:b,y:v,data:y,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:Zv},elements:{reference:e,floating:t}});u=null!=b?b:u,d=null!=v?v:d,m={...m,[s]:{...m[s],...y}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:u,y:d}=qv(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var Xy="undefined"!=typeof document?t.useLayoutEffect:function(){};function Qy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Qy(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;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Qy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function ex(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tx(e,t){const r=ex(e);return Math.round(t*r)/r}function rx(e){const t=a.useRef(e);return Xy(()=>{t.current=e}),t}const nx=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?Zy({element:r.current,padding:n}).fn(t):{}:r?Zy({element:r,padding:n}).fn(t):{};var a}}),ax=(e,t)=>({...Hy(e),options:[e,t]}),sx=(e,t)=>({...Gy(e),options:[e,t]}),ix=(e,t)=>({...Jy(e),options:[e,t]}),ox=(e,t)=>({...$y(e),options:[e,t]}),cx=(e,t)=>({...Ky(e),options:[e,t]}),lx=(e,t)=>({...qy(e),options:[e,t]}),ux=(e,t)=>({...nx(e),options:[e,t]});var dx=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Vs.svg,{...i,ref:r,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});dx.displayName="Arrow";var px=dx,mx="Popper",[hx,fx]=Rs(mx),[gx,bx]=hx(mx),vx=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(gx,{scope:r,anchor:s,onAnchorChange:i,children:n})};vx.displayName=mx;var yx="PopperAnchor",xx=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=bx(yx,n),c=a.useRef(null),l=bs(r,c),u=a.useRef(null);return a.useEffect(()=>{const e=u.current;u.current=s?.current||c.current,e!==u.current&&o.onAnchorChange(u.current)}),s?null:e.jsx(Vs.div,{...i,ref:l})});xx.displayName=yx;var wx="PopperContent",[Sx,kx]=hx(wx),Ex=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=bx(wx,n),[x,w]=a.useState(null),S=bs(r,e=>w(e)),[k,E]=a.useState(null),C=gl(k),N=C?.width??0,A=C?.height??0,j=i+("center"!==c?"-"+c:""),P="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},T=Array.isArray(p)?p:[p],_=T.length>0,R={padding:P,boundary:T.filter(jx),altBoundary:_},{refs:D,floatingStyles:I,placement:U,isPositioned:M,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);Qy(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==E.current&&(E.current=e,b(e))},[]),w=a.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),S=o||g,k=c||v,E=a.useRef(null),C=a.useRef(null),N=a.useRef(p),A=null!=u,j=rx(u),P=rx(i),T=rx(d),_=a.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};P.current&&(e.platform=P.current),Yy(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};R.current&&!Qy(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,P,T]);Xy(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=a.useRef(!1);Xy(()=>(R.current=!0,()=>{R.current=!1}),[]),Xy(()=>{if(S&&(E.current=S),k&&(C.current=k),S&&k){if(j.current)return j.current(S,k,_);_()}},[S,k,_,j,A]);const D=a.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),U=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=tx(I.floating,p.x),n=tx(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...ex(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:_,refs:D,elements:I,floatingStyles:U}),[p,_,D,I,U])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Vy(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[ax({mainAxis:o+A,alignmentAxis:l}),d&&sx({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?ix():void 0,...R}),d&&ox({...R}),cx({...R,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:s}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${s}px`)}}),k&&ux({element:k,padding:u}),Px({arrowWidth:N,arrowHeight:A}),f&&lx({strategy:"referenceHidden",...R})]}),[O,z]=Tx(U),F=Hs(b);Is(()=>{M&&F?.()},[M,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[H,G]=a.useState();return Is(()=>{x&&G(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:M?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Sx,{scope:n,placedSide:O,onArrowChange:E,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Vs.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});Ex.displayName=wx;var Cx="PopperArrow",Nx={top:"bottom",right:"left",bottom:"top",left:"right"},Ax=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=kx(Cx,n),i=Nx[s.placedSide];return e.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:e.jsx(px,{...a,ref:r,style:{...a.style,display:"block"}})})});function jx(e){return null!==e}Ax.displayName=Cx;var Px=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,s=0!==a.arrow?.centerOffset,i=s?0:e.arrowWidth,o=s?0:e.arrowHeight,[c,l]=Tx(r),u={start:"0%",center:"50%",end:"100%"}[l],d=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?u:`${d}px`,h=-o+"px"):"top"===c?(m=s?u:`${d}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?u:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?u:`${p}px`),{data:{x:m,y:h}}}});function Tx(e){const[t,r="center"]=e.split("-");return[t,r]}var _x=vx,Rx=xx,Dx=Ex,Ix=Ax;function Ux(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mx=Symbol("radix.slottable");function Lx(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Mx}var Ox="Popover",[zx]=Rs(Ox,[fx]),Fx=fx(),[Bx,Wx]=zx(Ox),Vx=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=Fx(r),u=a.useRef(null),[d,p]=a.useState(!1),[m,h]=zs({prop:s,defaultProp:i??!1,onChange:o,caller:Ox});return e.jsx(_x,{...l,children:e.jsx(Bx,{scope:r,contentId:Ls(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};Vx.displayName=Ox;var Hx="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=Wx(Hx,n),o=Fx(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Rx,{...o,...s,ref:r})}).displayName=Hx;var Gx="PopoverTrigger",$x=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Wx(Gx,n),i=Fx(n),o=bs(r,s.triggerRef),c=e.jsx(Vs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":aw(s.open),...a,ref:o,onClick:_s(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Rx,{asChild:!0,...i,children:c})});$x.displayName=Gx;var Kx="PopoverPortal",[qx,Zx]=zx(Kx,{forceMount:void 0}),Jx=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=Wx(Kx,r);return e.jsx(qx,{scope:r,forceMount:n,children:e.jsx(ui,{present:n||i.open,children:e.jsx(li,{asChild:!0,container:s,children:a})})})};Jx.displayName=Kx;var Yx="PopoverContent",Xx=a.forwardRef((t,r)=>{const n=Zx(Yx,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=Wx(Yx,t.__scopePopover);return e.jsx(ui,{present:a||i.open,children:i.modal?e.jsx(ew,{...s,ref:r}):e.jsx(tw,{...s,ref:r})})});Xx.displayName=Yx;var Qx=function(t){const r=Ux(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Lx);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("PopoverContent.RemoveScroll"),ew=a.forwardRef((t,r)=>{const n=Wx(Yx,t.__scopePopover),s=a.useRef(null),i=bs(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return co(e)},[]),e.jsx(to,{as:Qx,allowPinchZoom:!0,children:e.jsx(rw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_s(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:_s(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:_s(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),tw=a.forwardRef((t,r)=>{const n=Wx(Yx,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(rw,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),rw=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=t,m=Wx(Yx,n),h=Fx(n);return mi(),e.jsx(ri,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Js,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Dx,{"data-state":aw(m.open),role:"dialog",id:m.contentId,...h,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),nw="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Wx(nw,n);return e.jsx(Vs.button,{type:"button",...a,ref:r,onClick:_s(t.onClick,()=>s.onOpenChange(!1))})}).displayName=nw;function aw(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Fx(n);return e.jsx(Ix,{...s,...a,ref:r})}).displayName="PopoverArrow";var sw=Jx,iw=Xx;const ow=Vx,cw=$x,lw=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(lc);return e.jsx(sw,{container:o,children:e.jsx(iw,{ref:i,align:r,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})})});function uw({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,u]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const d=r.find(e=>e.value===o);return e.jsxs(ow,{open:l,onOpenChange:u,children:[e.jsx(cw,{asChild:!0,children:e.jsxs(Ts,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[d?e.jsxs("div",{children:[String(d.label).trim(),d.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:d.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(qa,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(lw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(bv,{children:[e.jsx(vv,{placeholder:s}),e.jsx(yv,{children:e.jsx(xv,{children:r.map(t=>e.jsxs(wv,{className:Se("whitespace-nowrap text-start",{"text-green-500":o===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,c(e),a?.(e),void u(!1);var e},children:[o===t.value&&e.jsx(Ka,{className:Se("me-2 h-4 w-4 text-green-400",o===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}lw.displayName=iw.displayName;const dw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},pw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},mw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=pw[e.code]||"USD",r=dw[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function hw({value:t,onChange:r}){const{t:n}=an(),a=mw.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(uw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const fw=mw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),gw=Array.from(new Set(fw.map(e=>e.value))).map(e=>fw.find(t=>t.value===e)).filter(e=>void 0!==e);function bw({value:t,onChange:r}){const{t:n}=an(),a=gw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(uw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let vw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];vw=vw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),vw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const yw=vw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function xw({value:t,onChange:r}){const{t:n}=an(),a=yw.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(uw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const ww=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],s=t.text;let i=s.substring(s.indexOf("(")+1,s.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Sw({value:t,onChange:r}){const{t:n}=an(),a=ww.map(e=>({value:e.value,label:e.text}));return e.jsx(uw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const kw=({workspace:r})=>{const{t:n}=an(),{updateUserProfile:a,getProfile:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState(),[u,d]=t.useState(0),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=td({resolver:lh(cf({name:Ih().min(2,{message:n("profile.nameMinLength")}),country:Ih().optional(),timezone:Ih().optional(),language:Ih().optional(),currency:Ih().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return t.useEffect(()=>{s().then(e=>{l(e),f.setValue("name",e.name),f.setValue("country",e.country),f.setValue("timezone",e.timezone),f.setValue("language",e.language),f.setValue("currency",e.currency)})},[u]),c?e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Uf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),m(n("profile.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),e.jsx(Gf,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Lf,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Ff,{children:[e.jsx(Bf,{children:n("profile.name")}),e.jsx(Wf,{children:e.jsx(Gf,{...t})}),e.jsx(Hf,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.language")}),e.jsx(xw,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.country")}),e.jsx(hw,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.currency")}),e.jsx(bw,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.timezone")}),e.jsx(Sw,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ts,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ts,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:i,children:n("profile.reset")})]})]})})}),c?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(ml,{})},Ew="bb";function Cw(e,t){let r;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");r=new URL(e),r.search=""}catch{r=new URL("https://localhost")}return r.searchParams.set(Ew,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Nw(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Ew);if(!e)return null;const t=function(e){const t={};if(!e)return t;const r=e.split(",");for(const e of r){const r=e.indexOf(":");if(-1===r)continue;const n=decodeURIComponent(e.slice(0,r)),a=decodeURIComponent(e.slice(r+1));n&&(t[n]=a)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function Aw(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Ew)&&(e.searchParams.delete(Ew),window.history.replaceState({},"",e.toString()))}catch{}}function jw(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize}}:null}function Pw(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(null==o)return{included:i,hasOverage:!1,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let u;if(l&&"number"==typeof c&&Number.isFinite(c))try{u=new Intl.NumberFormat(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${r.currencySymbol??Pf(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??Pf(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const Tw="personal",_w=(e,t,r="en-US")=>{const n=(t??"").trim();return n?new Intl.NumberFormat(r,{style:"currency",currency:n.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},Rw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",Dw=e=>{switch(e){case qn:return"bg-green-100 text-green-800";case Kn:return"bg-yellow-100 text-yellow-800";case $n:return"bg-gray-100 text-gray-800";case Zn:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Iw=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=an(),{invoices:o,loading:c,error:l,refetch:u}=Rn(t,a),d=o.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:s("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("invoices.description")})]}),e.jsx(Ts,{variant:"ghost",size:"sm",progress:c,onClick:u,disabled:c,children:s("settings.common.refreshAction",{loading:String(c)})})]}),l&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:l})]}),e.jsx(Ts,{variant:"outline",size:"sm",onClick:u,disabled:c,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(c)})})]}),c&&!d?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(ml,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case $n:case Kn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case qn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Zn:case Jn:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${Dw(t.status)}`,children:s(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:_w(t.amount_due,t.currency,i)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:Rw(t.created,i)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:s("invoices.paidAmount",{amount:_w(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ts,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:r.color,children:[s(r.textKey),e.jsx(Ya,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ts,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Ja,{className:"h-3 w-3 me-1.5"}),s("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(Xa,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:s(r?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!r&&n&&e.jsx(Ts,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},Uw=t.lazy(()=>Promise.resolve().then(function(){return oC}).then(e=>({default:e.default}))),Mw=(e,t)=>{if(!t)return"";try{const r=new Date(t);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(r)}catch{return""}},Lw=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=an(),{can:c}=dl(),{settings:l}=Sn(),u=c(il.WORKSPACE_BILLING_VIEW),d=c(il.WORKSPACE_BILLING_MANAGE),p=l?.workspace?.mode===Tw,{subscription:m,loading:h,error:f,updateSubscription:g,refetch:b}=_n(n),{createCheckoutSession:v}=Pn(n),{cancelSubscription:y,loading:x}=In(n),{resumeSubscription:w,loading:S}=Un(n),{openBillingPortal:k,loading:E}=Dn(n),{versions:C,loading:N,error:A,refetch:j}=jn(n),P=h||N,T=f||A,{currentVersion:_,latestVersion:R,isDeprecated:D,plansToShow:I}=t.useMemo(()=>{const e=C?.currentVersion,t=C?.availableVersions||[],r=null!=m?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const a=!!(r&&n&&e)&&n.version>e.version;return{currentVersion:e,latestVersion:n,hasNewerVersion:a,isDeprecated:a&&r,plansToShow:n?.plans&&n.plans.length>0?n.plans:[]}},[C,m?.subscription]),[U,M]=t.useState(!1),[L,O]=t.useState(null),[z,F]=t.useState(null),B=t.useRef(null),[W,V]=t.useState(!1),[H,G]=t.useState(!1);t.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const[$,K]=t.useState(!1),[q,Z]=t.useState("subscription"),J=async()=>{await Promise.all([b(),j()])},Y=t.useMemo(()=>oa(m?.subscription?.stripePriceId,I??[]),[m?.subscription?.stripePriceId,I]);if(P&&!m&&!C)return e.jsx(ml,{});if(!u)return null;const X=m?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[T&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:T}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(Ts,{variant:"outline",size:"sm",onClick:J,disabled:P,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(P)})})]}),L&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:L})]}),e.jsx(Ts,{variant:"outline",size:"sm",onClick:()=>O(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),z&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:z})]}),e.jsx(Ts,{variant:"outline",size:"sm",onClick:()=>F(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>Z("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===q?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>Z("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===q?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===q&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(es,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),D&&m?.subscription&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ps,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:a("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",_?.version||"?"," → v",R?.version||"?"]})]})]}),e.jsx(Ts,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>V(!0),children:a("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:a("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=m?.subscription?.subscriptionStatus===Vn,r=m?.subscription?.cancelAtPeriodEnd;return r||x?null:t&&I&&I.length>0?e.jsx(Ts,{size:"sm",onClick:()=>V(!0),children:a("subscription.viewPricingPlans")}):m?.subscription&&!t&&d?e.jsx(Ts,{variant:"outline",size:"sm",onClick:()=>V(!0),children:a("subscription.changePlanButton")}):!m?.subscription&&I&&I.length>0?e.jsx(Ts,{size:"sm",onClick:()=>V(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ts,{variant:"ghost",size:"sm",progress:P,onClick:J,disabled:P||U,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),m?.subscription?(()=>{const t=oa(m.subscription.stripePriceId,I??[]),n=t?.interval??null,c=t?.currency??m.plan?.currency??r?.billingCurrency??"",l=n&&m.planVersion?aa(m.planVersion,c,n):null,u=c,h=m.planVersion?ca(m.planVersion,c):null,f=h&&n?la(m.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=h?.includedSeats??0,v=Math.max(0,g-b),y=null!=l?0===l?a("subscription.free"):o(l,u):null,w=n===Fn.Monthly?a("subscription.billingInterval.perMonth"):n===Fn.Quarterly?a("subscription.billingInterval.perQuarter"):n===Fn.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(D?"border-amber-300":"border-gray-200"),children:[m.subscription.subscriptionStatus===Wn&&(()=>{const t=m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd,r=t?new Date(t):null,n=r&&!isNaN(r.getTime())?r:null,s=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):null,i=null!==s&&s<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==s&&s<=0?a("subscription.trialEnded"):null!==s?a("subscription.trialEndsIn",{days:s}):a("subscription.onTrial")," ",a("subscription.upgradeToKeepAccess")]}),e.jsx(Ts,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>V(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(D?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:m.plan?.name||a("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(m.subscription.subscriptionStatus===Bn?m.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":m.subscription.subscriptionStatus===Wn?"bg-blue-100 text-blue-800":m.subscription.subscriptionStatus===Vn?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[m.subscription.subscriptionStatus===Bn&&(m.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),m.subscription.subscriptionStatus===Wn&&a("subscription.status.trial"),m.subscription.subscriptionStatus===Vn&&a("subscription.status.canceled"),m.subscription.subscriptionStatus===Hn&&a("subscription.status.pastDue")]}),m.subscription.subscriptionStatus===Wn&&Mw(s,m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Mw(s,m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd),")"]}),D&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[e.jsx(ps,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),m.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:m.plan.description}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:y||a("invoices.na")}),y&&y!==a("subscription.free")&&w&&e.jsx("span",{className:"text-sm text-gray-500",children:w})]}),h&&f&&f>0&&!p&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(f,u),interval:w})}),!p&&h&&f&&f>0&&v>0&&y&&y!==a("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(l+f*v,u),interval:w,count:v})})]}),(m.subscription.subscriptionStatus===Bn||m.subscription.subscriptionStatus===Wn)&&!m.subscription.cancelAtPeriodEnd&&Mw(s,m.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ga,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:Mw(s,m.subscription.stripeCurrentPeriodEnd)??""})})]})]}),D&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",_?.version||a("invoices.na")]}),(m.subscription.subscriptionStatus===Bn||m.subscription.subscriptionStatus===Wn||m.subscription.subscriptionStatus===Hn)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[m.subscription&&d&&e.jsx(Ts,{variant:"outline",size:"sm",onClick:()=>k(),disabled:E,progress:E,children:a(E?"subscription.openingPortal":"subscription.managePayment")}),d&&(m.subscription.subscriptionStatus===Bn||m.subscription.subscriptionStatus===Wn)&&e.jsx(e.Fragment,{children:m.subscription.subscriptionStatus===Bn&&m.subscription.cancelAtPeriodEnd?e.jsx(Ts,{variant:"outline",size:"sm",onClick:()=>K(!0),disabled:U||x||S,progress:S,children:a("subscription.resumeTitle")}):e.jsx(Ts,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>G(!0),disabled:U||x||S,progress:x||U,children:x||U?a("subscription.canceling"):m.subscription.subscriptionStatus===Wn?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),m.subscription.subscriptionStatus===Hn&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ps,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:a("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:a("subscription.paymentPastDueDescription")}),e.jsx(Ts,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>Z("invoices"),children:a("subscription.viewInvoices")})]})]})}),m.subscription.subscriptionStatus===Hn&&m.subscription.dunningState&&m.subscription.dunningState!==ea&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ps,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:m.subscription.dunningState===ta?a("subscription.dunningFinal"):m.subscription.dunningState===ra?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:m.subscription.dunningState===ra?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),m.subscription.subscriptionStatus===Gn&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ga,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:a("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:a("subscription.subscriptionPausedDescription")})]})]})}),m.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ga,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Mw(s,m.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Mw(s,m.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),m.planVersion&&(()=>{const t=((e,t,r=Fn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===Yn){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===Xn){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===Qn){const n=t&&e.pricingVariants?.length?ia(e,t,o,r):jw(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(m.planVersion,c,n??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:r})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(r?"text-green-500":"text-gray-300"),children:r?"✓":"✕"}),e.jsx("span",{className:r?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:r})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:r})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:r})=>{const n=Pw(r,t.name.toLowerCase(),{currency:c,locale:s}),i=n?n.hasOverage?a("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):a("quota.includedOnly",{count:n.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:i})]})},t._id)})})]}),h&&!p&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:i(g)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:i(b)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[i(v)," ",a("subscription.seats.extra")]})]}),f&&f>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[o(f,c),w]})]}),h.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:i(h.maxSeats)})]})]})]})]})}):null})()]})})():r.pendingOnboarding?e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Za,{className:"h-12 w-12 mx-auto mb-3 text-blue-400"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.startFreeTrial")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.startTrialDescription")})]}),e.jsx(Ts,{size:"sm",progress:U,onClick:async()=>{try{M(!0);const e=await v({planVersionId:r.pendingOnboarding?.planVersionId??""});e&&"checkoutUrl"in e&&e.checkoutUrl&&Ia(e.checkoutUrl)}catch(e){}finally{M(!1)}},children:a("subscription.startFreeTrial")}),I&&I.length>0&&e.jsx(Ts,{variant:"ghost",size:"sm",className:"ms-2",onClick:()=>V(!0),children:a("subscription.viewAllPlans")})]}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Za,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.noSubscriptionDescription")})]}),I&&I.length>0&&e.jsx(Ts,{size:"sm",onClick:()=>V(!0),children:a("subscription.viewPricingPlans")})]})]}),!C&&!P&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),T&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",T]}),!T&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(Ts,{variant:"outline",size:"sm",progress:P,onClick:J,disabled:P,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),"invoices"===q&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(es,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(Iw,{workspaceId:n,hasActiveSubscription:null!==m?.subscription,onViewPricingPlans:()=>Z("subscription"),limit:20})]}),I&&I.length>0&&e.jsx(t.Suspense,{fallback:W?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(es,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(Uw,{open:W,onOpenChange:V,planVersions:I,currentPlanVersionId:X||null,currentStripePriceId:m?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Fn.Monthly,s)=>{if(!n)return;const i=I?.find(t=>t._id===e),o=s??Y?.currency??m?.plan?.currency??r?.billingCurrency??"",c=i?function(e,t,r){const n=na(e,t);if(!n?.stripePrices)return null;const a=r===Fn.Monthly?"monthlyPriceId":r===Fn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Fn.Monthly?"monthly":r===Fn.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,l=m?.subscription?.stripePriceId;if(!c||!l||c!==l){M(!0),O(null),F(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Cw({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:Cw({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(n);let i;const c=m?.subscription?.subscriptionStatus===Vn;if(i=m?.subscription&&!c?await g(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await v({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),i&&"checkoutUrl"in i&&i.checkoutUrl)return void Ia(i.checkoutUrl);F(a("subscription.updateSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");O(t)}finally{M(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{O(null),F(null)},5e3)}}},loading:U||P})}),e.jsx($c,{open:$,onOpenChange:K,children:e.jsxs(Jc,{children:[e.jsxs(Yc,{children:[e.jsx(Qc,{children:a("subscription.resumeTitle")}),e.jsx(el,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ps,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",m?.subscription?.stripeCurrentPeriodEnd&&Mw(s,m.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Mw(s,m.subscription.stripeCurrentPeriodEnd)}):a("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:a("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs(Xc,{children:[e.jsx(rl,{disabled:S,children:a("subscription.resumeKeep")}),e.jsx(tl,{onClick:async()=>{if(n){K(!1),M(!0),O(null),F(null);try{await w(),F(a("subscription.resumeSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");O(t)}finally{M(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{O(null),F(null)},5e3)}}},disabled:S,children:a(S?"subscription.resuming":"subscription.resumeButton")})]})]})}),e.jsx($c,{open:H,onOpenChange:G,children:e.jsxs(Jc,{children:[e.jsxs(Yc,{children:[e.jsx(Qc,{children:a("subscription.cancelTitle")}),e.jsx(el,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[a("subscription.retainAccess")," ",m?.subscription?.stripeCurrentPeriodEnd&&Mw(s,m.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Mw(s,m.subscription.stripeCurrentPeriodEnd)}):a("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:a("subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(Xc,{children:[e.jsx(rl,{disabled:x,children:a("subscription.cancelKeep")}),e.jsx(tl,{onClick:async()=>{if(n){G(!1),M(!0),O(null),F(null);try{await y(),F(a("subscription.cancelSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");O(t)}finally{M(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{O(null),F(null)},5e3)}}},disabled:x,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(x?"subscription.canceling":"subscription.cancelButton")})]})]})})]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})})};function Ow(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function zw(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function Fw(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const Bw=()=>{const{quotas:r,loading:n,error:a,refetch:s}=Ra(),{t:i,formattingLocale:o,fmtNum:c}=an(),{can:l}=dl(),u=(e,t)=>zw(e,t,o),{response:d}=zn(),[p,m]=t.useState(!1),h=t.useMemo(()=>{const e={};if(!d?.planVersion||!d?.subscription)return e;const t=d.planVersion,n=d.subscription,a=n.billingInterval??"monthly",s=n.plan?.currency??"usd",i=Pf(s);if(!r)return e;for(const n of Object.keys(r)){const o=sa(t,s,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],u=l?.unitSize??1,d=r[n].overage,p=(u>1?Math.ceil(d/u):d)*o/100;e[n]={overageCents:o,unitSize:u,currency:s,currencySymbol:i,estimatedCost:p}}return e},[d,r]),f=t.useMemo(()=>{const e=d?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e,t="en-US"){try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric"}).format(r)}catch{return""}}(e,o);return t?{endDate:t,daysRemaining:Fw(e)}:null},[d,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(ml,{});if(!l(il.WORKSPACE_USAGE_VIEW))return null;if(a)return e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:a})]}),e.jsx(Ts,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx($a,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i("usage.noDataHint")})]});const v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=Object.values(h).reduce((e,t)=>e+t.estimatedCost,0),w=Object.values(h)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.description")}),e.jsxs(Ts,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(ns,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(Ga,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" (",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",i("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(b.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.inOverage")}),e.jsx("p",{className:Se("text-lg sm:text-xl font-semibold mt-1",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:u(x,w)})]})]}),v>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ps,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:i("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:i("usage.overageWarning",{count:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:u(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.map(([t,r])=>{const n=(a=r.consumed,(s=r.included)<=0?a>0?100:0:Math.min(a/s*100,100));var a,s;const i=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),o=h[t];return e.jsx(Ww,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function Ww({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=an(),c=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,o),l=(e,t)=>zw(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:Ow(t)}),r.hasOverage&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.overage")}),!r.hasOverage&&n>=90&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(r.consumed)," / ",c(r.included)]})]}),e.jsx("div",{className:Se("h-2 rounded-full w-full",a.bg),children:e.jsx("div",{className:Se("h-2 rounded-full transition-all duration-500",a.bar),style:{width:`${n}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(n)})}),e.jsx("span",{children:r.available>0?i("usage.availableRemaining",{count:c(r.available)}):r.hasOverage?i("usage.overLimitCount",{count:c(r.overage)}):i("usage.fullyUsed")})]}),r.hasOverage&&s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(r.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:Math.ceil(r.overage/s.unitSize).toLocaleString(o)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(s.estimatedCost,s.currencySymbol)})]})]}),!r.hasOverage&&s&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function Vw(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?gs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hw=Symbol("radix.slottable");function Gw(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Hw}var $w=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});a.forwardRef((t,r)=>e.jsx(Vs.span,{...t,ref:r,style:{...$w,...t.style}})).displayName="VisuallyHidden";var Kw=[" ","Enter","ArrowUp","ArrowDown"],qw=[" ","Enter"],Zw="Select",[Jw,Yw,Xw]=Jf(Zw),[Qw]=Rs(Zw,[Xw,fx]),eS=fx(),[tS,rS]=Qw(Zw),[nS,aS]=Qw(Zw),sS=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=eS(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),E=Xf(d),[C,N]=zs({prop:s,defaultProp:i??!1,onChange:o,caller:Zw}),[A,j]=zs({prop:c,defaultProp:l,onChange:u,caller:Zw}),P=a.useRef(null),T=!v||(g||!!v.closest("form")),[_,R]=a.useState(new Set),D=Array.from(_).map(e=>e.props.value).join(";");return e.jsx(_x,{...b,children:e.jsxs(tS,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:Ls(),value:A,onValueChange:j,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:P,disabled:h,children:[e.jsx(Jw.Provider,{scope:r,children:e.jsx(nS,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),T?e.jsxs(VS,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:A,onChange:e=>j(e.target.value),disabled:h,form:g,children:[void 0===A?e.jsx("option",{value:""}):null,Array.from(_)]},D):null]})})};sS.displayName=Zw;var iS="SelectTrigger",oS=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=eS(n),c=rS(iS,n),l=c.disabled||s,u=bs(r,c.onTriggerChange),d=Yw(n),p=a.useRef("touch"),[m,h,f]=GS(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=$S(t,e,r);void 0!==n&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),f()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Rx,{asChild:!0,...o,children:e.jsx(Vs.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":HS(c.value)?"":void 0,...i,ref:u,onClick:_s(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:_s(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:_s(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Kw.includes(e.key)&&(g(),e.preventDefault())})})})});oS.displayName=iS;var cS="SelectValue",lS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=rS(cS,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=bs(r,l.onValueNodeChange);return Is(()=>{u(d)},[u,d]),e.jsx(Vs.span,{...c,ref:p,style:{pointerEvents:"none"},children:HS(l.value)?e.jsx(e.Fragment,{children:o}):i})});lS.displayName=cS;var uS=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Vs.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});uS.displayName="SelectIcon";var dS=t=>e.jsx(li,{asChild:!0,...t});dS.displayName="SelectPortal";var pS="SelectContent",mS=a.forwardRef((t,r)=>{const n=rS(pS,t.__scopeSelect),[i,o]=a.useState();if(Is(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(fS,{scope:t.__scopeSelect,children:e.jsx(Jw.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(vS,{...t,ref:r})});mS.displayName=pS;var hS=10,[fS,gS]=Qw(pS),bS=function(t){const r=Vw(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Gw);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("SelectContent.RemoveScroll"),vS=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=t,x=rS(pS,n),[w,S]=a.useState(null),[k,E]=a.useState(null),C=bs(r,e=>S(e)),[N,A]=a.useState(null),[j,P]=a.useState(null),T=Yw(n),[_,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return co(w)},[w]),mi();const I=a.useCallback(e=>{const[t,...r]=T().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[T,k]),U=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{_&&U()},[_,U]);const{onOpenChange:M,triggerPointerDownPosRef:L}=x;a.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,M,L]),a.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[O,z]=GS(e=>{const t=T().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=$S(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&(A(e),n&&(D.current=!0))},[x.value]),B=a.useCallback(()=>w?.focus(),[w]),W=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&P(e)},[x.value]),V="popper"===s?xS:yS,H=V===xS?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(fS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:j,position:s,isPositioned:_,searchRef:O,children:e.jsx(to,{as:bS,allowPinchZoom:!0,children:e.jsx(ri,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:_s(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Js,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:e.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_s(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});vS.displayName="SelectContentImpl";var yS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=rS(pS,n),c=gS(pS,n),[l,u]=a.useState(null),[d,p]=a.useState(null),m=bs(r,e=>p(e)),h=Yw(n),f=a.useRef(!1),g=a.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=c,w=a.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==o.dir){const a=n.left-t.left,s=r.left-a,i=e.left-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-hS,d=Vg(s,[hS,Math.max(hS,u-c)]);l.style.minWidth=o+"px",l.style.left=d+"px"}else{const a=t.right-n.right,s=window.innerWidth-r.right-a,i=window.innerWidth-e.right-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-hS,d=Vg(s,[hS,Math.max(hS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),i=window.innerHeight-2*hS,c=b.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+m+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),C=e.top+e.height/2-hS,N=i-C,A=v.offsetHeight/2,j=p+m+(v.offsetTop+A),P=x-j;if(j<=C){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-b.offsetTop-b.offsetHeight,r=j+Math.max(N,A+(e?E:0)+t+g);l.style.height=r+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(C,p+b.offsetTop+(e?k:0)+A)+P;l.style.height=t+"px",b.scrollTop=j-C+b.offsetTop}l.style.margin=`${hS}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,d,b,v,y,o.dir,s]);Is(()=>w(),[w]);const[S,k]=a.useState();Is(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const E=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(wS,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Vs.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});yS.displayName="SelectItemAlignedPosition";var xS=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=hS,...i}=t,o=eS(n);return e.jsx(Dx,{...o,...i,ref:r,align:a,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xS.displayName="SelectPopperPosition";var[wS,SS]=Qw(pS,{}),kS="SelectViewport",ES=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=gS(kS,n),c=SS(kS,n),l=bs(r,o.onViewportChange),u=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(Jw.Slot,{scope:n,children:e.jsx(Vs.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:_s(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*hS,a=parseFloat(r.style.minHeight),s=parseFloat(r.style.height),i=Math.max(a,s);if(i<n){const a=i+e,s=Math.min(n,a),o=a-s;r.style.height=s+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});ES.displayName=kS;var CS="SelectGroup",[NS,AS]=Qw(CS);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ls();return e.jsx(NS,{scope:n,id:s,children:e.jsx(Vs.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=CS;var jS="SelectLabel",PS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=AS(jS,n);return e.jsx(Vs.div,{id:s.id,...a,ref:r})});PS.displayName=jS;var TS="SelectItem",[_S,RS]=Qw(TS),DS=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=rS(TS,n),u=gS(TS,n),d=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=bs(r,e=>u.itemRefCallback?.(e,s,i)),b=Ls(),v=a.useRef("touch"),y=()=>{i||(l.onValueChange(s),l.onOpenChange(!1))};if(""===s)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(_S,{scope:n,value:s,disabled:i,textId:b,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Jw.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Vs.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:_s(c.onFocus,()=>f(!0)),onBlur:_s(c.onBlur,()=>f(!1)),onClick:_s(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:_s(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:_s(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:_s(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_s(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:_s(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(qw.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});DS.displayName=TS;var IS="SelectItemText",US=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=rS(IS,n),u=gS(IS,n),d=RS(IS,n),p=aS(IS,n),[m,h]=a.useState(null),f=bs(r,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return Is(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Vs.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});US.displayName=IS;var MS="SelectItemIndicator",LS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return RS(MS,n).isSelected?e.jsx(Vs.span,{"aria-hidden":!0,...a,ref:r}):null});LS.displayName=MS;var OS="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=gS(OS,t.__scopeSelect),s=SS(OS,t.__scopeSelect),[i,o]=a.useState(!1),c=bs(r,s.onScrollButtonChange);return Is(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(FS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=OS;var zS="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=gS(zS,t.__scopeSelect),s=SS(zS,t.__scopeSelect),[i,o]=a.useState(!1),c=bs(r,s.onScrollButtonChange);return Is(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(FS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=zS;var FS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=gS("SelectScrollButton",n),c=a.useRef(null),l=Yw(n),u=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Is(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Vs.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:_s(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:_s(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:_s(i.onPointerLeave,()=>{u()})})}),BS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Vs.div,{"aria-hidden":!0,...a,ref:r})});BS.displayName="SelectSeparator";var WS="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=eS(n),i=rS(WS,n),o=gS(WS,n);return i.open&&"popper"===o.position?e.jsx(Ix,{...s,...a,ref:r}):null}).displayName=WS;var VS=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=bs(s,i),c=fl(r);return a.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),e.jsx(Vs.select,{...n,style:{...$w,...n.style},ref:o,defaultValue:r})});function HS(e){return""===e||void 0===e}function GS(e){const t=Hs(e),r=a.useRef(""),n=a.useRef(0),s=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function $S(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let s=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(s=s.filter(e=>e!==r));const i=s.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}VS.displayName="SelectBubbleInput";var KS=oS,qS=uS,ZS=dS,JS=mS,YS=ES,XS=PS,QS=DS,ek=US,tk=LS,rk=BS;const nk=sS,ak=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(KS,{ref:a,className:Se("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[r,e.jsx(qS,{asChild:!0,children:e.jsx(rc,{className:"h-4 w-4 opacity-50"})})]}));ak.displayName=KS.displayName;const sk=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(lc);return e.jsx(ZS,{container:o,children:e.jsx(JS,{ref:i,className:Se("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:e.jsx(YS,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});sk.displayName=JS.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(XS,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=XS.displayName;const ik=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(QS,{ref:a,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(tk,{children:e.jsx(ac,{className:"h-4 w-4"})})}),e.jsx(ek,{children:r})]}));ik.displayName=QS.displayName;function ok(e,r){const{response:n}=zn();return t.useMemo(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const t=e.users?.length??0,a=n?.planVersion,s=n?.subscription,i=e.billingCurrency||"usd",o=ua({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,t-u):0,p=c>0?Math.max(0,c-t):1/0,m=c>0&&t>=c,h=c>0&&t>=.8*c&&!m,f=l&&a?la(a,i,s?.billingInterval??"monthly"):null,g=da({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:i,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[n,e,r?.settingsMaxUsers])}a.forwardRef(({className:t,...r},n)=>e.jsx(rk,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=rk.displayName;const ck=({workspace:r})=>{const{user:n}=Ck(),{t:a,fmtNum:s,fmtCents:i}=an(),[o,c]=t.useState(0),[l,u]=t.useState(!1),[d,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=Pa(),{settings:v}=Sn(),{can:y}=dl(),{response:x}=zn(),w=ok(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(u(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{u(!1)}))},[r,o]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===Tw;if(l||!r)return e.jsx(ml,{});if(k)return null;const E=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},C=d.map(e=>({...e,...E(e.user)})),N=y(il.WORKSPACE_MEMBERS_INVITE),A=y(il.WORKSPACE_MEMBERS_REMOVE),j=y(il.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:P,includedSeats:T,maxUsers:_,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:U,perSeatPriceCents:M,currency:L}=w,O=d.length,z=x?.subscription?.billingInterval??"monthly",F=P&&O>=T;return e.jsxs("div",{children:[!N&&!A&&!j&&e.jsx("div",{className:"text-red-500",children:a("users.adminOnly")}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(lk,{onInvite:S,workspaceId:r._id}),F&&M&&M>0&&e.jsx("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:e.jsx("span",{children:a("users.extraSeatCost",{price:i(M,L),interval:z})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:a("users.limitReached",{reason:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?a(I,U??void 0):""})]})})}),(P||_>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:a("users.seatHeading",{hasSeatPricing:String(P)})}),_>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(O>=_?"bg-red-100 text-red-700":O>=.8*_?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(O)," / ",s(_)]})]}),_>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(O>=_?"bg-red-500":O>=.8*_?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,O/_*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:P?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(T)})," ",a("users.included"),M&&M>0&&e.jsxs("span",{className:"text-gray-400",children:[" · ",i(M,L),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(_)})," ",a("users.maxMembers")]})}),_>0?e.jsxs("span",{children:[s(Math.max(0,_-O))," ",a("users.available")]}):e.jsx("span",{className:"text-gray-400",children:a("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:a("users.memberCount",{count:O})})}),e.jsx("div",{children:e.jsx(Ts,{variant:"ghost",size:"sm",onClick:S,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:C.map((t,s)=>{const i=t.id===n?.id,o=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:a("users.you")}),o&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:a("users.owner")})]})]}),j&&e.jsxs("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(nk,{disabled:i||!j||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(Aa(r,a)?Re(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}}):(h(a),b(n,a,{role:s}).then(()=>{S()}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(ak,{children:e.jsx(lS,{placeholder:a("users.selectRole")})}),e.jsx(sk,{children:r?.roles.map(t=>e.jsx(ik,{value:t,children:t},t))})]}),m===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx(es,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Ts,{variant:"destructive",size:"sm",startIcon:e.jsx(ds,{}),onClick:()=>{return e=t.id,void(Aa(r,e)?Re(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Re(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function lk({onInvite:r,workspaceId:n}){const{t:a}=an(),{addUser:s,getWorkspace:i}=Pa(),{settings:o}=Sn(),[c,l]=t.useState(""),[u,d]=t.useState("admin"),[p,m]=t.useState(!1),[h,f]=t.useState(null),[g,b]=t.useState(null),[v,y]=t.useState(null),x=t.useRef(null),w=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),t.useEffect(()=>{n&&i(n).then(y)},[n]);const S=()=>{f(null),b(null),l(""),d("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[h&&e.jsx("div",{className:"text-red-500",children:h}),g&&e.jsx("div",{className:"text-green-500",children:g}),e.jsxs("div",{children:[e.jsx(If,{children:a("users.inviteByEmail")}),e.jsx(Gf,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(If,{children:a("users.role")}),e.jsxs(nk,{value:u,onValueChange:d,children:[e.jsx(ak,{children:e.jsx(lS,{placeholder:a("users.selectRole")})}),e.jsx(sk,{children:w.map(t=>e.jsx(ik,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ts,{progress:p,onClick:async()=>{const e=c.trim();if(!e)return void f(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(m(!0),await s(n,e,u).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Re(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:u}}),f(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{m(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S()},6e3)})):f(a("users.invalidEmail"))},disabled:p||!c||!u,children:p?a("users.inviting"):a("users.inviteAs",{role:u})})})]})}const uk={firefox:4,safari:4,edge:4,chrome:4},dk=()=>{const{isSupported:r,permission:n,isSubscribed:a,loading:s,error:i,subscribe:o,unsubscribe:c}=Tk(),{t:l}=an(),u=t.useMemo(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),d=uk[u];return r?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:l("notifications.manageDescription")}),i&&"denied"!==n&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:i}),"denied"===n&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(is,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:l("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:l("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:d},(t,r)=>e.jsx("li",{children:l(`notifications.unblock.${u}.step${r+1}`)},r))})]})]})}),"denied"!==n&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(a?"bg-green-100":"bg-gray-100"),children:a?e.jsx(Va,{className:"h-4 w-4 text-green-600"}):e.jsx(Wa,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:l("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:l("notifications.pushDescription",{subscribed:String(a)})})]})]}),e.jsx(Ts,{variant:a?"outline":"default",size:"sm",className:"shrink-0",onClick:a?c:o,disabled:s,progress:s,children:l("notifications.toggleAction",{loading:String(s),subscribed:String(a)})})]}),a&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:l("notifications.deviceNote")})]})]}):e.jsx("div",{className:"text-sm text-gray-500",children:l("notifications.notSupported")})},pk=({workspace:r})=>{const{t:n}=an(),{isOwner:a}=dl(),{settings:s}=Sn(),{appPermissions:i}=sl(),{updateWorkspacePermissions:o}=Pa(),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useRef(null);t.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const m=t.useMemo(()=>s?.workspace?.roles??r.roles??[],[s?.workspace?.roles,r.roles]),h=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[f,g]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of m)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];g(t)},[r.permissions,i,m]),!r)return e.jsx(ml,{});if(!i||0===h.length)return null;return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),!a&&e.jsx("div",{className:"text-red-500 mb-4",children:n("permissions.ownerOnly")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),m.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:h.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),m.map(r=>{const n="admin"===r,s=n||(f[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(jl,{checked:s,disabled:!a||n,onCheckedChange:()=>((e,t)=>{g(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),a&&e.jsx("div",{className:"mt-6",children:e.jsx(Ts,{onClick:async()=>{l(!0),d(null);try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(f)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=f[r]??[];t[r]=[...n,...a]}await o(r._id,t),d(n("permissions.saveSuccess")),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(null),5e3)}catch(e){Re(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})},mk=({workspace:t,section:r,setSection:n})=>{const{t:a}=an(),{settings:s}=Sn(),{can:i}=dl(),{appPermissions:o}=sl(),c=s?.workspace?.mode===Tw,l=i(il.WORKSPACE_DELETE),u=o&&Object.keys(o).length>0;return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:Se("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(hk,{title:a("settings.sidebar.account"),children:e.jsx(fk,{activeSection:r,icon:e.jsx(ms,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:gk.Profile,onClick:()=>n(gk.Profile)})}),e.jsxs(hk,{title:a("settings.sidebar.workspace"),children:[i(il.WORKSPACE_SETTINGS_VIEW)&&e.jsx(fk,{activeSection:r,icon:e.jsx(ss,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:gk.General,onClick:()=>n(gk.General)}),!c&&i(il.WORKSPACE_MEMBERS_VIEW)&&e.jsx(fk,{activeSection:r,icon:e.jsx(hs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:gk.Users,onClick:()=>n(gk.Users)}),i(il.WORKSPACE_BILLING_VIEW)&&e.jsx(fk,{activeSection:r,icon:e.jsx(Za,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:gk.Subscription,onClick:()=>n(gk.Subscription)}),i(il.WORKSPACE_USAGE_VIEW)&&e.jsx(fk,{activeSection:r,icon:e.jsx($a,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:gk.Usage,onClick:()=>n(gk.Usage)}),i(il.WORKSPACE_FEATURES_VIEW)&&e.jsx(fk,{activeSection:r,icon:e.jsx(ls,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:gk.Features,onClick:()=>n(gk.Features)}),e.jsx(fk,{activeSection:r,icon:e.jsx(Va,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:gk.Notifications,onClick:()=>n(gk.Notifications)}),u&&!c&&e.jsx(fk,{activeSection:r,icon:e.jsx(os,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:gk.Permissions,onClick:()=>n(gk.Permissions)}),l&&!c&&e.jsx(fk,{activeSection:r,icon:e.jsx(ps,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:gk.Danger,onClick:()=>n(gk.Danger)})]})]})};function hk({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function fk({icon:t,label:r,section:n,onClick:a,activeSection:s}){return e.jsxs("button",{className:Se("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===s?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const gk={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},bk=new Set(Object.values(gk)),vk={[gk.Profile]:"settings.titles.profile",[gk.General]:"settings.titles.general",[gk.Users]:"settings.titles.users",[gk.Subscription]:"settings.titles.subscription",[gk.Usage]:"settings.titles.usage",[gk.Features]:"settings.titles.features",[gk.Notifications]:"settings.titles.notifications",[gk.Permissions]:"settings.titles.permissions",[gk.Danger]:"settings.titles.danger"},yk=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=gk.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=an(),[m,h]=t.useState(!1),[f,g]=t.useState(i),b=void 0!==a?a:m,v=s||h,y=void 0!==o?o:f,x=c||g;if(!r)return null;const w=e.jsx(Ts,{variant:"outline",size:"icon",children:e.jsx(ss,{className:"h-4 w-4"})});return e.jsxs(dc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(pc,{asChild:!0,children:u||w}),e.jsxs(fc,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(vc,{className:"sr-only",children:d(vk[y])}),e.jsx(mk,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(bc,{className:"text-xl font-bold mb-4",children:d(vk[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===gk.Profile&&e.jsx(kw,{workspace:r}),y===gk.General&&e.jsx(Tb,{workspace:r}),y===gk.Users&&e.jsx(ck,{workspace:r}),y===gk.Subscription&&e.jsx(Lw,{workspace:r}),y===gk.Usage&&e.jsx(Bw,{}),y===gk.Features&&e.jsx(Pl,{workspaceId:r._id?.toString()}),y===gk.Notifications&&e.jsx(dk,{}),y===gk.Permissions&&e.jsx(pk,{workspace:r}),y===gk.Danger&&e.jsx(hl,{workspace:r})]})]})]})]})};var xk=Object.freeze({__proto__:null,SETTINGS_SCREENS:bk,SettingsScreen:gk,WorkspaceSettingsDialog:yk,default:yk});const wk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:gk.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e){this.currentState={open:!0,section:e||gk.Profile},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState.open,this.currentState.section)})}};function Sk(e,t,r){const n=e._id||e.id;if(!n||"string"!=typeof n)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:n,name:e.name||"",org:t,email:e.email,emailVerified:!0,clientId:r,role:e.role||"",image:e.image}}function kk(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function Ek(){return Pt(e=>e.auth)}function Ck(){const{t:e}=an(),r=bn(),n=Ek(),a=xn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=Pa(),u=t.useMemo(()=>new Da({serverUrl:s,version:a.version}),[s,a.version]),d=t.useCallback(async()=>{r.auth(Ue());try{const t=await u.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw r.auth(Le()),new Error(t.message||e("errors.generic"));Ia(t.data.redirectUrl)}catch(e){throw r.auth(Le()),Re(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Re(e,{component:"useSaaSAuth",action:"signOut"})}finally{cn(ln),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?wk.openWorkspaceSettings(e):Re(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...h,signIn:d,signOut:p,openWorkspaceSettings:m}),[n.session,n.status,h,d,p,m])}class Nk extends fn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const Ak=t.createContext(null);function jk(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}const Pk=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=an(),i=xn(),{isAuthenticated:o}=Ck(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Nk({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,d]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(n);if(e)return;if(!t)return void d(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;d(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||d(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return d(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){d(e=>({...e,loading:!0,error:null}));try{if(!await p())return void d(e=>({...e,loading:!1,error:s("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(n);await navigator.serviceWorker.ready;const r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:jk(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),d(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){d(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(n);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}d(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...u,requestPermission:p,subscribe:m,unsubscribe:h}),[u,p,m,h]);return e.jsx(Ak.Provider,{value:f,children:r})});function Tk(){const e=t.useContext(Ak);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}let _k=!1,Rk=null;const Dk=t.memo(({children:r,callbacks:n})=>{const a=bn(),s=Ek(),i=xn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(_k=!1,Rk=null)},[]);const u=t.useCallback(async e=>{try{if(n?.handleAuthentication){const{sessionId:t}=await n.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=i;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:s,version:o,orgId:c}=r,l=new Da({serverUrl:s,version:o}),u=await l.getProfile(t),d=kk(Sk(u,c,r.auth?.clientId||""),t);dn(d.sessionId),a.auth(Oe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(un),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:un}})}}()}}catch(t){throw Re(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),a.auth(Le()),t}},[a,n,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(_k)return;if(Rk)return;if(!rt(i))return;if(mn())return;if(!n?.getSession)return _k=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";Rk=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return _k=!0,a.auth(Le()),void n?.onSessionExpired?.("missing");try{const e=new Da({serverUrl:t,version:r}),n=await e.getProfile(i),o=kk(Sk(n,s,c),i);dn(o.sessionId),_k=!0,a.auth(Oe(o))}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),_k=!0,a.auth(Le()),n?.onSessionExpired?.("expired")}finally{Rk=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=mn();if(!e)return;if(c.current||l.current===e)return;if(!rt(i))return;c.current=!0,l.current=e;let t=!1;return a.auth(Me()),u(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Re(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[u,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});Dk.displayName="AuthProviderWrapper";const Ik=t.memo(({config:r,auth:n,children:a})=>{const s=bn(),i=xn(),o=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{s.os(Qe({...r,auth:o}))},[r,o,s]);const c=t.useMemo(()=>rt(i)?new yn(i):null,[i.serverUrl,i.version,i.orgId]);return vn(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);s.os(et(t))},[c,i.settings,s],{onError:e=>Re(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:a})});Ik.displayName="ContextConfigProvider";class Uk extends fn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user attributes"));const r=await t.json();return r&&"object"==typeof r&&!Array.isArray(r)?r:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const Mk=t.createContext(void 0),Lk=t.memo(({children:r})=>{const{t:n}=an(),a=xn(),s=function(){const e=xn();return t.useMemo(()=>new Uk(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=Ck(),{serverUrl:o,version:c}=a,[l,u]=t.useState({}),[d,p]=t.useState({}),[m,h]=t.useState(!1),[f,g]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getAttributes(e);u(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[s,o,c,i]),v=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),y=t.useCallback(async e=>{h(!0),g(null);try{const t=await s.updateAttributes(e);return await b(),t}catch(t){const r=t instanceof Error?t:new Error(n("errors.generic"));throw g(r),Re(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[s,b]),x=t.useCallback(async(e,t)=>{h(!0),g(null);try{const r=await s.updateAttribute(e,t);return await b(),r}catch(r){const a=r instanceof Error?r:new Error(n("errors.generic"));throw g(a),Re(r,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),r}finally{h(!1)}},[s,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getFeatures(e);p(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchFeatures"})}else p({})},[s,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);vn(async e=>{if(!i||!o||!c)return u({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Re(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:d,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,d,m,f,y,x,v,S]);return e.jsx(Mk.Provider,{value:k,children:r})});Lk.displayName="UserProvider";const Ok=t.lazy(()=>Promise.resolve().then(function(){return xk}).then(e=>({default:e.default})));const zk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState(gk.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=wk.getState();o(e.open),l(e.section);return wk.subscribe((e,t)=>{o(e),l(t)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=Nw();if(!e)return;const t=function(e){if(e.screen&&bk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":return gk.Subscription;default:return null}}(e);if(!t)return u.current=!0,void Aw();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(()=>{u.current=!0,Aw()}):(u.current=!0,void Aw())}u.current=!0,wk.openWorkspaceSettings(t),Aw()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(Ok,{workspace:n,open:i,onOpenChange:e=>{e||wk.closeSettings()},section:c,onSectionChange:e=>{wk.setSection(e)},showTrigger:!1})})]})},Fk=(e,t,r)=>{if(t!==tt.V1)throw new Error(`Invalid version: "${t}". Only "${tt.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},Bk=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,children:c})=>{Fk(r,n,a);const l=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),u=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),d=s?.callbacks?.handleEvent;return t.useEffect(()=>(wa.setCallbacks(d?{handleEvent:d}:null),()=>{wa.setCallbacks(null)}),[d]),e.jsx(Yr,{locale:i,children:e.jsx(jt,{children:e.jsx(Dk,{callbacks:u,children:e.jsx(uc,{children:e.jsx(Ik,{config:l,auth:s,children:e.jsx(al,{appPermissions:o,children:e.jsx(Lk,{children:e.jsx(On,{children:e.jsx(_a,{children:e.jsx(Pk,{children:e.jsx(zk,{children:c})})})})})})})})})})})});Bk.displayName="SaaSOSProviderInner";const Wk=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Bk,{...r,children:t})});Wk.displayName="SaaSOSProvider";const Vk=e=>{const{children:t}=e,{status:r}=Ck();return r!==We.authenticated?null:t},Hk=e=>{const{children:t}=e,{status:r}=Ck();return r!==We.unauthenticated?null:t};Vk.displayName="WhenAuthenticated",Hk.displayName="WhenUnauthenticated";const Gk=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Ck();return n.includes(a?.role??"")?t:r||null},$k=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Ck(),{currentWorkspace:s}=Pa(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};Gk.displayName="WhenRoles",$k.displayName="WhenWorkspaceRoles";const Kk=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=dl();return a(n)?t:r??null};function qk(){const e=t.useContext(Mk);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}Kk.displayName="WhenPermission";const Zk=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Pa(),a=n?.features?.[r];return a?t:null},Jk=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Pa(),a=n?.features?.[r];return a?null:t},Yk=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=qk();return n(r)?t:null},Xk=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=qk();return n(r)?null:t};Zk.displayName="WhenWorkspaceFeatureEnabled",Jk.displayName="WhenWorkspaceFeatureDisabled",Yk.displayName="WhenUserFeatureEnabled",Xk.displayName="WhenUserFeatureDisabled";const Qk=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?t:n??null},eE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?n??null:t},tE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=zn();if(i)return n??null;if(!s?.subscription)return a??null;const o=s.plan??s.subscription?.plan;if(!o)return a??null;const c=r.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:a??null},rE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},nE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?.subscriptionStatus===Wn?n??null:t},aE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=zn();if(i)return r??null;const o=s?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return n??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return n??null;const l=new Date(c);if(isNaN(l.getTime()))return n??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>a?n??null:t};Qk.displayName="WhenSubscription",eE.displayName="WhenNoSubscription",tE.displayName="WhenSubscriptionToPlans",rE.displayName="WhenTrialing",nE.displayName="WhenNotTrialing",aE.displayName="WhenTrialEnding";const sE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},iE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},oE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage?r:a??null},cE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=Ra();if(o)return a??null;const c=i?.[t];if(!c)return s??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?s??null:n};function lE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function uE(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}sE.displayName="WhenQuotaAvailable",iE.displayName="WhenQuotaExhausted",oE.displayName="WhenQuotaOverage",cE.displayName="WhenQuotaThreshold";var dE,pE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ws(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),mE={exports:{}},hE={};function fE(){if(dE)return hE;dE=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),c=n({inst:{value:r,getSnapshot:t}}),l=c[0].inst,u=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&u({inst:l})},[e,r,t]),a(function(){return o(l)&&u({inst:l}),e(function(){o(l)&&u({inst:l})})},[e]),i(r),r};return hE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,hE}var gE,bE,vE={};
|
|
27
|
+
*/function ba(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function va(...e){return t=>{let r=!1;const n=e.map(e=>{const n=ba(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():ba(e[t],null)}}}}function ya(...e){return s.useCallback(va(...e),e)}var xa=Symbol.for("react.lazy"),wa=s[" use ".trim().toString()];function Sa(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===xa&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function ka(t){const r=Ca(t),n=s.forwardRef((t,n)=>{let{children:a,...i}=t;Sa(a)&&"function"==typeof wa&&(a=wa(a._payload));const o=s.Children.toArray(a),c=o.find(Aa);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}var Ea=ka("Slot");function Ca(e){const t=s.forwardRef((e,t)=>{let{children:r,...n}=e;if(Sa(r)&&"function"==typeof wa&&(r=wa(r._payload)),s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Na=Symbol("radix.slottable");function Aa(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Na}const _a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ja=o,Pa=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ja(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=_a(t)||_a(n);return s[e][i]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...o}[t]):{...a,...o}[t]===r})?[...e,r,n]:e},[]);return ja(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},Ta=Pa("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Ra=s.forwardRef(({className:t,variant:r,progress:n,size:a,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?Ea:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(a);return e.jsxs(d,{disabled:n||l.disabled,className:Se(Ta({variant:r,size:a,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx(ea,{size:p,className:"animate-spin"}),i&&s.cloneElement(i,{size:p}),l.children,o&&s.cloneElement(o,{size:p})]})});function Da(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Ia(t,r=[]){let n=[];const a=()=>{const e=n.map(e=>s.createContext(e));return function(r){const n=r?.[t]||e;return s.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return a.scopeName=t,[function(r,a){const i=s.createContext(a),o=n.length;n=[...n,a];const c=r=>{const{scope:n,children:a,...c}=r,l=n?.[t]?.[o]||i,u=s.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:a})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=s.useContext(c);if(l)return l;if(void 0!==a)return a;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Ua(a,...r)]}function Ua(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Ra.displayName="Button";var Ma=globalThis?.document?s.useLayoutEffect:()=>{},La=s[" useId ".trim().toString()]||(()=>{}),Oa=0;function za(e){const[t,r]=s.useState(La());return Ma(()=>{r(e=>e??String(Oa++))},[e]),e||(t?`radix-${t}`:"")}var Fa=s[" useInsertionEffect ".trim().toString()]||Ma;function Wa({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=function({defaultProp:e,onChange:t}){const[r,n]=s.useState(e),a=s.useRef(r),i=s.useRef(t);return Fa(()=>{i.current=t},[t]),s.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:a;{const t=s.useRef(void 0!==e);s.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,n])}const u=s.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[c,e,i,o]);return[l,u]}function Ba(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Va=Symbol("radix.slottable");function Ha(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Va}var Ga=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=function(t){const r=Ba(t),n=s.forwardRef((t,n)=>{const{children:a,...i}=t,o=s.Children.toArray(a),c=o.find(Ha);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}(`Primitive.${r}`),a=s.forwardRef((t,s)=>{const{asChild:a,...i}=t,o=a?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:s})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function $a(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}var Ka,qa="dismissableLayer.update",Za="dismissableLayer.pointerDownOutside",Ja="dismissableLayer.focusOutside",Ya=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xa=s.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=s.useContext(Ya),[p,m]=s.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=s.useState({}),g=ya(r,e=>m(e)),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=$a(e),n=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){ei(Za,r,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),E=function(e,t=globalThis?.document){const r=$a(e),n=s.useRef(!1);return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){ei(Ja,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=$a(e);s.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{x===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),s.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Ka=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Qa(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ka)}},[p,h,n,d]),s.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Qa())},[p,d]),s.useEffect(()=>{const e=()=>f({});return document.addEventListener(qa,e),()=>document.removeEventListener(qa,e)},[]),e.jsx(Ga.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Da(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Da(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Da(t.onPointerDownCapture,k.onPointerDownCapture)})});Xa.displayName="DismissableLayer";function Qa(){const e=new CustomEvent(qa);document.dispatchEvent(e)}function ei(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(s,i):s.dispatchEvent(i)}s.forwardRef((t,r)=>{const n=s.useContext(Ya),a=s.useRef(null),i=ya(r,a);return s.useEffect(()=>{const e=a.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Ga.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var ti="focusScope.autoFocusOnMount",ri="focusScope.autoFocusOnUnmount",ni={bubbles:!1,cancelable:!0},si=s.forwardRef((t,r)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=s.useState(null),d=$a(i),p=$a(o),m=s.useRef(null),h=ya(r,e=>u(e)),f=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:ci(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ci(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ci(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[a,l,f.paused]),s.useEffect(()=>{if(l){li.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(ti,ni);l.addEventListener(ti,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ci(n,{select:t}),document.activeElement!==r)return}((e=ai(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ci(l))}return()=>{l.removeEventListener(ti,d),setTimeout(()=>{const e=new CustomEvent(ri,ni);l.addEventListener(ri,p),l.dispatchEvent(e),e.defaultPrevented||ci(t??document.body,{select:!0}),l.removeEventListener(ri,p),li.remove(f)},0)}}var e},[l,d,p,f]);const g=s.useCallback(e=>{if(!n&&!a)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[s,a]=function(e){const t=ai(e),r=ii(t,e),n=ii(t.reverse(),e);return[r,n]}(t);s&&a?e.shiftKey||r!==a?e.shiftKey&&r===s&&(e.preventDefault(),n&&ci(a,{select:!0})):(e.preventDefault(),n&&ci(s,{select:!0})):r===t&&e.preventDefault()}},[n,a,f.paused]);return e.jsx(Ga.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function ai(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ii(e,t){for(const r of e)if(!oi(r,{upTo:t}))return r}function oi(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ci(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}si.displayName="FocusScope";var li=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ui(e,t),e.unshift(t)},remove(t){e=ui(e,t),e[0]?.resume()}}}();function ui(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var di=s.forwardRef((t,n)=>{const{container:a,...i}=t,[o,c]=s.useState(!1);Ma(()=>c(!0),[]);const l=a||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Ga.div,{...i,ref:n}),l):null});di.displayName="Portal";var pi=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef(null),a=s.useRef(e),i=s.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const e=mi(n.current);i.current="mounted"===c?e:"none"},[c]),Ma(()=>{const t=n.current,r=a.current;if(r!==e){const n=i.current,s=mi(t);if(e)l("MOUNT");else if("none"===s||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==s?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,l]),Ma(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,s=s=>{const i=mi(n.current).includes(CSS.escape(s.animationName));if(s.target===t&&i&&(l("ANIMATION_END"),!a.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(i.current=mi(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),a="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),i=ya(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||n.isPresent?s.cloneElement(a,{ref:i}):null};function mi(e){return e?.animationName||"none"}pi.displayName="Presence";var hi=0;function fi(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gi()),document.body.insertAdjacentElement("beforeend",e[1]??gi()),hi++,()=>{1===hi&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),hi--}},[])}function gi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bi=function(){return bi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},bi.apply(this,arguments)};function vi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}"function"==typeof SuppressedError&&SuppressedError;var yi="right-scroll-bar-position",xi="width-before-scroll-bar";function wi(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Si="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,ki=new WeakMap;function Ei(e,r){var n,s,a,i=(n=null,s=function(t){return e.forEach(function(e){return wi(e,t)})},(a=t.useState(function(){return{value:n,callback:s,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=s,a.facade);return Si(function(){var t=ki.get(i);if(t){var r=new Set(t),n=new Set(e),s=i.current;r.forEach(function(e){n.has(e)||wi(e,null)}),n.forEach(function(e){r.has(e)||wi(e,s)})}ki.set(i,e)},[e]),i}function Ci(e){return e}var Ni=function(e){var t=e.sideCar,r=vi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return s.createElement(n,bi({},r))};Ni.isSideCarExport=!0;var Ai=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Ci);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var s=t(e,n);return r.push(s),function(){r=r.filter(function(e){return e!==s})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var s=r;r=[],s.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=bi({async:!0,ssr:!1},e),t}(),_i=function(){},ji=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:_i,onWheelCapture:_i,onTouchMoveCapture:_i}),a=n[0],i=n[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,f=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,x=e.gapMode,w=vi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Ei([r,t]),E=bi(bi({},w),a);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ai,removeScrollBar:u,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?s.cloneElement(s.Children.only(c),bi(bi({},E),{ref:k})):s.createElement(y,bi({},E,{className:l,ref:k}),c))});ji.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ji.classNames={fullWidth:xi,zeroRight:yi};function Pi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Ti=function(){var e=0,t=null;return{add:function(r){var n,s;0==e&&(t=Pi())&&(s=r,(n=t).styleSheet?n.styleSheet.cssText=s:n.appendChild(document.createTextNode(s)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ri=function(){var e,t=(e=Ti(),function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Di={left:0,top:0,right:0,gap:0},Ii=function(e){return parseInt(e||"",10)||0},Ui=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Di;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],s=t["padding"===e?"paddingRight":"marginRight"];return[Ii(r),Ii(n),Ii(s)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Mi=Ri(),Li="data-scroll-locked",Oi=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(Li,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(s,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(yi," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(xi," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(yi," .").concat(yi," {\n right: 0 ").concat(n,";\n }\n \n .").concat(xi," .").concat(xi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Li,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},zi=function(){var e=parseInt(document.body.getAttribute(Li)||"0",10);return isFinite(e)?e:0},Fi=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;s.useEffect(function(){return document.body.setAttribute(Li,(zi()+1).toString()),function(){var e=zi()-1;e<=0?document.body.removeAttribute(Li):document.body.setAttribute(Li,e.toString())}},[]);var i=s.useMemo(function(){return Ui(a)},[a]);return s.createElement(Mi,{styles:Oi(i,!t,a,r?"":"!important")})},Wi=!1;if("undefined"!=typeof window)try{var Bi=Object.defineProperty({},"passive",{get:function(){return Wi=!0,!0}});window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch(e){Wi=!1}var Vi=!!Wi&&{passive:!1},Hi=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Gi=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),$i(e,n)){var s=Ki(e,n);if(s[1]>s[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},$i=function(e,t){return"v"===e?function(e){return Hi(e,"overflowY")}(t):function(e){return Hi(e,"overflowX")}(t)},Ki=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},qi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zi=function(e){return[e.deltaX,e.deltaY]},Ji=function(e){return e&&"current"in e?e.current:e},Yi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Xi=0,Qi=[];function eo(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var to,ro=(to=function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),a=s.useState(Xi++)[0],i=s.useState(Ri)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,r){if(r||2===arguments.length)for(var n,s=0,a=t.length;s<a;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Ji),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var s,a=qi(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-a[0],l="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===u||m.contains(u)))return!1;var h=Gi(d,u);if(!h)return!0;if(h?s=d:(s="v"===d?"h":"v",h=Gi(d,u)),!h)return!1;if(!n.current&&"changedTouches"in e&&(c||l)&&(n.current=s),!s)return!0;var f=n.current||s;return function(e,t,r,n){var s=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=s*n,i=r.target,o=t.contains(i),c=!1,l=a>0,u=0,d=0;do{if(!i)break;var p=Ki(e,i),m=p[0],h=p[1]-p[2]-s*m;(m||h)&&$i(e,i)&&(u+=h,d+=m);var f=i.parentNode;i=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&i!==document.body||o&&(t.contains(i)||t===i));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=s.useCallback(function(e){var r=e;if(Qi.length&&Qi[Qi.length-1]===i){var n="deltaY"in r?Zi(r):qi(r),s=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,s=n,t[0]===s[0]&&t[1]===s[1]);var t,s})[0];if(s&&s.should)r.cancelable&&r.preventDefault();else if(!s){var a=(o.current.shards||[]).map(Ji).filter(Boolean).filter(function(e){return e.contains(r.target)});(a.length>0?c(r,a[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,s){var a={name:e,delta:r,target:n,should:s,shadowParent:eo(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=qi(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,Zi(t),t.target,c(t,e.lockRef.current))},[]),m=s.useCallback(function(t){u(t.type,qi(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return Qi.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Vi),document.addEventListener("touchmove",l,Vi),document.addEventListener("touchstart",d,Vi),function(){Qi=Qi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Vi),document.removeEventListener("touchmove",l,Vi),document.removeEventListener("touchstart",d,Vi)}},[]);var h=e.removeScrollBar,f=e.inert;return s.createElement(s.Fragment,null,f?s.createElement(i,{styles:Yi(a)}):null,h?s.createElement(Fi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Ai.useMedium(to),Ni),no=s.forwardRef(function(e,t){return s.createElement(ji,bi({},e,{ref:t,sideCar:ro}))});no.classNames=ji.classNames;var so=new WeakMap,ao=new WeakMap,io={},oo=0,co=function(e){return e&&(e.host||co(e.parentNode))},lo=function(e,t,r,n){var s=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=co(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);io[r]||(io[r]=new WeakMap);var a=io[r],i=[],o=new Set,c=new Set(s),l=function(e){e&&!o.has(e)&&(o.add(e),l(e.parentNode))};s.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))u(e);else try{var t=e.getAttribute(n),s=null!==t&&"false"!==t,c=(so.get(e)||0)+1,l=(a.get(e)||0)+1;so.set(e,c),a.set(e,l),i.push(e),1===c&&s&&ao.set(e,!0),1===l&&e.setAttribute(r,"true"),s||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),o.clear(),oo++,function(){i.forEach(function(e){var t=so.get(e)-1,s=a.get(e)-1;so.set(e,t),a.set(e,s),t||(ao.has(e)||e.removeAttribute(n),ao.delete(e)),s||e.removeAttribute(r)}),--oo||(so=new WeakMap,so=new WeakMap,ao=new WeakMap,io={})}},uo=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lo(n,s,r,"aria-hidden")):function(){return null}};function po(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mo=Symbol("radix.slottable");function ho(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===mo}var fo="Dialog",[go,bo]=Ia(fo),[vo,yo]=go(fo),xo=t=>{const{__scopeDialog:r,children:n,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=s.useRef(null),u=s.useRef(null),[d,p]=Wa({prop:a,defaultProp:i??!1,onChange:o,caller:fo});return e.jsx(vo,{scope:r,triggerRef:l,contentRef:u,contentId:za(),titleId:za(),descriptionId:za(),open:d,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};xo.displayName=fo;var wo="DialogTrigger",So=s.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,a=yo(wo,n),i=ya(r,a.triggerRef);return e.jsx(Ga.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Bo(a.open),...s,ref:i,onClick:Da(t.onClick,a.onOpenToggle)})});So.displayName=wo;var ko="DialogPortal",[Eo,Co]=go(ko,{forceMount:void 0}),No=t=>{const{__scopeDialog:r,forceMount:n,children:a,container:i}=t,o=yo(ko,r);return e.jsx(Eo,{scope:r,forceMount:n,children:s.Children.map(a,t=>e.jsx(pi,{present:n||o.open,children:e.jsx(di,{asChild:!0,container:i,children:t})}))})};No.displayName=ko;var Ao="DialogOverlay",_o=s.forwardRef((t,r)=>{const n=Co(Ao,t.__scopeDialog),{forceMount:s=n.forceMount,...a}=t,i=yo(Ao,t.__scopeDialog);return i.modal?e.jsx(pi,{present:s||i.open,children:e.jsx(Po,{...a,ref:r})}):null});_o.displayName=Ao;var jo=function(t){const r=po(t),n=s.forwardRef((t,n)=>{const{children:a,...i}=t,o=s.Children.toArray(a),c=o.find(ho);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}("DialogOverlay.RemoveScroll"),Po=s.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,a=yo(Ao,n);return e.jsx(no,{as:jo,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(Ga.div,{"data-state":Bo(a.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),To="DialogContent",Ro=s.forwardRef((t,r)=>{const n=Co(To,t.__scopeDialog),{forceMount:s=n.forceMount,...a}=t,i=yo(To,t.__scopeDialog);return e.jsx(pi,{present:s||i.open,children:i.modal?e.jsx(Do,{...a,ref:r}):e.jsx(Io,{...a,ref:r})})});Ro.displayName=To;var Do=s.forwardRef((t,r)=>{const n=yo(To,t.__scopeDialog),a=s.useRef(null),i=ya(r,n.contentRef,a);return s.useEffect(()=>{const e=a.current;if(e)return uo(e)},[]),e.jsx(Uo,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Da(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Da(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Da(t.onFocusOutside,e=>e.preventDefault())})}),Io=s.forwardRef((t,r)=>{const n=yo(To,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return e.jsx(Uo,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||n.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,s=n.triggerRef.current?.contains(r);s&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Uo=s.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=yo(To,n),u=s.useRef(null),d=ya(r,u);return fi(),e.jsxs(e.Fragment,{children:[e.jsx(si,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Xa,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Bo(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx($o,{titleId:l.titleId}),e.jsx(Ko,{contentRef:u,descriptionId:l.descriptionId})]})]})}),Mo="DialogTitle",Lo=s.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,a=yo(Mo,n);return e.jsx(Ga.h2,{id:a.titleId,...s,ref:r})});Lo.displayName=Mo;var Oo="DialogDescription",zo=s.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,a=yo(Oo,n);return e.jsx(Ga.p,{id:a.descriptionId,...s,ref:r})});zo.displayName=Oo;var Fo="DialogClose",Wo=s.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,a=yo(Fo,n);return e.jsx(Ga.button,{type:"button",...s,ref:r,onClick:Da(t.onClick,()=>a.onOpenChange(!1))})});function Bo(e){return e?"open":"closed"}Wo.displayName=Fo;var Vo="DialogTitleWarning",[Ho,Go]=function(t,r){const n=s.createContext(r),a=t=>{const{children:r,...a}=t,i=s.useMemo(()=>a,Object.values(a));return e.jsx(n.Provider,{value:i,children:r})};return a.displayName=t+"Provider",[a,function(e){const a=s.useContext(n);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(Vo,{contentName:To,titleName:Mo,docsSlug:"dialog"}),$o=({titleId:e})=>{const t=Go(Vo),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},Ko=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Go("DialogDescriptionWarning").contentName}}.`;return s.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},qo=xo,Zo=So,Jo=No,Yo=_o,Xo=Ro,Qo=Lo,ec=zo,tc=Wo;function rc(e,t){if(null==e)return{};var r,n,s={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}var nc=["color"],sc=t.forwardRef(function(e,r){var n=e.color,s=void 0===n?"currentColor":n,a=rc(e,nc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))}),ac=["color"],ic=t.forwardRef(function(e,r){var n=e.color,s=void 0===n?"currentColor":n,a=rc(e,ac);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))}),oc=["color"],cc=t.forwardRef(function(e,r){var n=e.color,s=void 0===n?"currentColor":n,a=rc(e,oc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))}),lc=["color"],uc=t.forwardRef(function(e,r){var n=e.color,s=void 0===n?"currentColor":n,a=rc(e,lc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))});const dc=t.createContext({container:null,setContainer:()=>{}}),pc=t.memo(({children:r})=>{const[n,s]=t.useState(null),a=t.useMemo(()=>({container:n,setContainer:s}),[n]),i=t.useMemo(()=>r,[r]);return e.jsxs(dc.Provider,{value:a,children:[i,e.jsx("div",{ref:s,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});pc.displayName="PortalProvider";const mc=qo,hc=Zo,fc=Jo,gc=s.forwardRef(({className:t,...r},n)=>e.jsx(Yo,{ref:n,className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));gc.displayName=Yo.displayName;const bc=s.forwardRef(({className:t,children:r,...n},a)=>{const{container:i}=s.useContext(dc);return e.jsxs(fc,{container:i,children:[e.jsx(gc,{}),e.jsxs(Xo,{ref:a,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[r,e.jsxs(tc,{className:"absolute right-4 rtl:right-auto rtl:left-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(cc,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});bc.displayName=Xo.displayName;const vc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});vc.displayName="DialogHeader";const yc=s.forwardRef(({className:t,...r},n)=>e.jsx(Qo,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));yc.displayName=Qo.displayName;const xc=s.forwardRef(({className:t,...r},n)=>e.jsx(ec,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));xc.displayName=ec.displayName;var wc=Symbol("radix.slottable");var Sc="AlertDialog",[kc]=Ia(Sc,[bo]),Ec=bo(),Cc=t=>{const{__scopeAlertDialog:r,...n}=t,s=Ec(r);return e.jsx(qo,{...s,...n,modal:!0})};Cc.displayName=Sc;var Nc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,a=Ec(n);return e.jsx(Zo,{...a,...s,ref:r})});Nc.displayName="AlertDialogTrigger";var Ac=t=>{const{__scopeAlertDialog:r,...n}=t,s=Ec(r);return e.jsx(Jo,{...s,...n})};Ac.displayName="AlertDialogPortal";var _c=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,a=Ec(n);return e.jsx(Yo,{...a,...s,ref:r})});_c.displayName="AlertDialogOverlay";var jc="AlertDialogContent",[Pc,Tc]=kc(jc),Rc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=wc,r}("AlertDialogContent"),Dc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:a,...i}=t,o=Ec(n),c=s.useRef(null),l=ya(r,c),u=s.useRef(null);return e.jsx(Ho,{contentName:jc,titleName:Ic,docsSlug:"alert-dialog",children:e.jsx(Pc,{scope:n,cancelRef:u,children:e.jsxs(Xo,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:Da(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Rc,{children:a}),e.jsx(Wc,{contentRef:c})]})})})});Dc.displayName=jc;var Ic="AlertDialogTitle",Uc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,a=Ec(n);return e.jsx(Qo,{...a,...s,ref:r})});Uc.displayName=Ic;var Mc="AlertDialogDescription",Lc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,a=Ec(n);return e.jsx(ec,{...a,...s,ref:r})});Lc.displayName=Mc;var Oc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,a=Ec(n);return e.jsx(tc,{...a,...s,ref:r})});Oc.displayName="AlertDialogAction";var zc="AlertDialogCancel",Fc=s.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...s}=t,{cancelRef:a}=Tc(zc,n),i=Ec(n),o=ya(r,a);return e.jsx(tc,{...i,...s,ref:o})});Fc.displayName=zc;var Wc=({contentRef:e})=>{const t=`\`${jc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${jc}\` by passing a \`${Mc}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${jc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Bc=_c,Vc=Dc,Hc=Oc,Gc=Fc,$c=Uc,Kc=Lc;const qc=Cc,Zc=Nc,Jc=Ac,Yc=s.forwardRef(({className:t,...r},n)=>e.jsx(Bc,{className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r,ref:n}));Yc.displayName=Bc.displayName;const Xc=s.forwardRef(({className:t,...r},n)=>{const{container:a}=s.useContext(dc);return e.jsxs(Jc,{container:a,children:[e.jsx(Yc,{}),e.jsx(Vc,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r})]})});Xc.displayName=Vc.displayName;const Qc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Qc.displayName="AlertDialogHeader";const el=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});el.displayName="AlertDialogFooter";const tl=s.forwardRef(({className:t,...r},n)=>e.jsx($c,{ref:n,className:Se("text-lg font-semibold",t),...r}));tl.displayName=$c.displayName;const rl=s.forwardRef(({className:t,...r},n)=>e.jsx(Kc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));rl.displayName=Kc.displayName;const nl=s.forwardRef(({className:t,...r},n)=>e.jsx(Hc,{ref:n,className:Se(Ta(),t),...r}));nl.displayName=Hc.displayName;const sl=s.forwardRef(({className:t,...r},n)=>e.jsx(Gc,{ref:n,className:Se(Ta({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));sl.displayName=Gc.displayName;const al=t.createContext({appPermissions:void 0});function il({appPermissions:r,children:n}){const s=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(al.Provider,{value:s,children:n})}function ol(){return t.useContext(al)}const cl={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},ll=Object.values(cl),ul={admin:ll.filter(e=>e!==cl.WORKSPACE_DELETE),member:[cl.WORKSPACE_SETTINGS_VIEW,cl.WORKSPACE_MEMBERS_VIEW,cl.WORKSPACE_FEATURES_VIEW,cl.WORKSPACE_BILLING_VIEW,cl.WORKSPACE_USAGE_VIEW],viewer:[cl.WORKSPACE_SETTINGS_VIEW,cl.WORKSPACE_MEMBERS_VIEW]};function dl(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function pl(e){const{userId:t,workspace:r,settings:n,appPermissions:s}=e;if(!r||!t)return new Set;if(As(r,t)){const e=new Set(ll);if(s)for(const t of dl(s))e.add(t);if(r.permissions)for(const t of dl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of dl(n.workspace.permissions))e.add(t);return e}const a=e.workspaceRole??_s(r,t);if(!a)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),u=i?.[a]?c(i[a]):[],d=o?.[a]?c(o[a]):[],p=ul[a]??[];let m;if(u.length>0)m=u;else if(d.length>0)m=d;else if(p.length>0)m=p;else{m=ul[n?.workspace?.defaultRole??"member"]??ul.member??[]}const h=new Set(m),f=i?.[a]?l(i[a]):[],g=s?.[a]?l(s[a]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(cl.WORKSPACE_MEMBERS_INVITE)}(h,a,n),h}function ml(e){const{user:r}=Ak(),{currentWorkspace:n}=js(),{settings:s}=Sn(),{appPermissions:a}=ol(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?_s(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&As(i,o),[i,o]),u=t.useMemo(()=>pl({userId:o,workspaceRole:c,workspace:i,settings:s,appPermissions:a}),[o,c,i,s,a]),d=t.useCallback(e=>Array.isArray(e)?e.every(e=>u.has(e)):u.has(e),[u]);return{can:d,permissions:u,isOwner:l,role:c}}function hl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function fl(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(hl,{className:"h-10 w-full"}),e.jsx(hl,{className:"h-10 w-full"}),e.jsx(hl,{className:"h-10 w-full"})]})}const gl=({workspace:r})=>{const[n,s]=t.useState(!1),{deleteWorkspace:a}=js(),{can:i}=ml(),{settings:o}=Sn(),{t:c}=sn();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(fl,{});return i(cl.WORKSPACE_DELETE)?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:c("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c("danger.deleteDescription")})]}),e.jsxs(qc,{children:[e.jsx(Zc,{asChild:!0,children:e.jsxs(Ra,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(pa,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Xc,{children:[e.jsxs(Qc,{children:[e.jsx(tl,{children:c("danger.deleteConfirm")}),e.jsx(rl,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(el,{children:[e.jsx(sl,{disabled:n,children:c("settings.common.cancel")}),e.jsx(nl,{onClick:async()=>{s(!0);try{await a(r._id)}catch(e){Re(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:r._id}}),alert(e instanceof Error?e.message:c("danger.failedToDelete"))}finally{s(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?e.jsxs(e.Fragment,{children:[e.jsx(ea,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:c("danger.adminOnly")})})};function bl(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function vl(e){const[t,r]=s.useState(void 0);return Ma(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let s,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;s=t.inlineSize,a=t.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var yl="Switch",[xl]=Ia(yl),[wl,Sl]=xl(yl),kl=s.forwardRef((t,r)=>{const{__scopeSwitch:n,name:a,checked:i,defaultChecked:o,required:c,disabled:l,value:u="on",onCheckedChange:d,form:p,...m}=t,[h,f]=s.useState(null),g=ya(r,e=>f(e)),b=s.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Wa({prop:i,defaultProp:o??!1,onChange:d,caller:yl});return e.jsxs(wl,{scope:n,checked:y,disabled:l,children:[e.jsx(Ga.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Al(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:Da(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Nl,{control:h,bubbles:!b.current,name:a,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});kl.displayName=yl;var El="SwitchThumb",Cl=s.forwardRef((t,r)=>{const{__scopeSwitch:n,...s}=t,a=Sl(El,n);return e.jsx(Ga.span,{"data-state":Al(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:r})});Cl.displayName=El;var Nl=s.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:a=!0,...i},o)=>{const c=s.useRef(null),l=ya(c,o),u=bl(n),d=vl(r);return s.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:a});r.call(e,n),e.dispatchEvent(t)}},[u,n,a]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Al(e){return e?"checked":"unchecked"}Nl.displayName="SwitchBubbleInput";var _l=kl,jl=Cl;const Pl=s.forwardRef(({className:t,...r},n)=>e.jsx(_l,{className:Se("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...r,ref:n,children:e.jsx(jl,{className:Se("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Pl.displayName=_l.displayName;const Tl=({workspaceId:r})=>{const{t:n}=sn(),{allFeatures:s,updateFeature:a,getWorkspace:i}=js(),{can:o}=ml(),[c,l]=t.useState({}),[u,d]=t.useState(null),[p,m]=t.useState(null),h=t.useRef(null);if(t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),t.useEffect(()=>{i(r).then(m)},[r]),!p)return e.jsx(fl,{});const f=o(cl.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:n("features.ownerOnly")}),!s.length&&e.jsx("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),s.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:s.map(t=>{const r=p?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],u=n("features.actionStatus",{action:!0===o?"enabling":!1===o?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),i?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx(ea,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(Pl,{disabled:!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),d(null);try{const r=await a(p._id,e,t);m(r);const i=s.find(t=>t.slug===e);d(n("features.updateSuccess",{feature:i?.name||"Feature",enabled:String(t)})),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(null)},5e3)}catch(t){Re(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var Rl=e=>"checkbox"===e.type,Dl=e=>e instanceof Date,Il=e=>null==e;const Ul=e=>"object"==typeof e;var Ml=e=>!Il(e)&&!Array.isArray(e)&&Ul(e)&&!Dl(e),Ll=e=>Ml(e)&&e.target?Rl(e.target)?e.target.checked:e.target.value:e,Ol=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),zl="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Fl(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(zl&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Ml(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Ml(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Fl(e[t]));return n}var Wl=e=>/^\w*$/.test(e),Bl=e=>void 0===e,Vl=e=>Array.isArray(e)?e.filter(Boolean):[],Hl=e=>Vl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Gl=(e,t,r)=>{if(!t||!Ml(e))return r;const n=(Wl(t)?[t]:Hl(t)).reduce((e,t)=>Il(e)?e:e[t],e);return Bl(n)||n===e?Bl(e[t])?r:e[t]:n},$l=e=>"boolean"==typeof e,Kl=e=>"function"==typeof e,ql=(e,t,r)=>{let n=-1;const s=Wl(t)?[t]:Hl(t),a=s.length,i=a-1;for(;++n<a;){const t=s[n];let a=r;if(n!==i){const r=e[t];a=Ml(r)||Array.isArray(r)?r:isNaN(+s[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const Zl="blur",Jl="focusout",Yl="change",Xl="onBlur",Ql="onChange",eu="onSubmit",tu="onTouched",ru="all",nu="max",su="min",au="maxLength",iu="minLength",ou="pattern",cu="required",lu="validate",uu=t.createContext(null);uu.displayName="HookFormControlContext";const du=()=>t.useContext(uu);var pu=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(s,a,{get:()=>{const s=a;return t._proxyFormState[s]!==ru&&(t._proxyFormState[s]=!n||ru),r&&(r[s]=!0),e[s]}});return s};const mu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var hu=e=>"string"==typeof e,fu=(e,t,r,n,s)=>hu(e)?(n&&t.watch.add(e),Gl(r,e,s)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Gl(r,e))):(n&&(t.watchAll=!0),r),gu=e=>Il(e)||!Ul(e);function bu(e,t,r=new WeakSet){if(gu(e)||gu(t))return Object.is(e,t);if(Dl(e)&&Dl(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!s.includes(a))return!1;if("ref"!==a){const e=t[a];if(Dl(n)&&Dl(e)||Ml(n)&&Ml(e)||Array.isArray(n)&&Array.isArray(e)?!bu(n,e,r):!Object.is(n,e))return!1}}return!0}function vu(e){const r=du(),{name:n,disabled:s,control:a=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Ol(a._names.array,n),u=t.useMemo(()=>Gl(a._formValues,n,Gl(a._defaultValues,n,o)),[a,n,o]),d=function(e){const r=du(),{control:n=r,name:s,defaultValue:a,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(a),u=t.useRef(c),d=t.useRef(void 0),p=t.useRef(n),m=t.useRef(s);u.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(s,l.current);return u.current?u.current(e):e}),g=t.useCallback(e=>{const t=fu(s,n._names,e||n._formValues,!1,l.current);return u.current?u.current(t):t},[n._formValues,n._names,s]),b=t.useCallback(e=>{if(!i){const t=fu(s,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);bu(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,s]);mu(()=>(p.current===n&&bu(m.current,s)||(p.current=n,m.current=s,b()),n._subscribe({name:s,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[n,o,s,b]),t.useEffect(()=>n._removeUnmounted());const v=p.current!==n,y=m.current,x=t.useMemo(()=>{if(i)return null;const e=!v&&!bu(y,s);return v||e?g():null},[i,v,s,y,g]);return null!==x?x:h}({control:a,name:n,defaultValue:u,exact:c}),p=function(e){const r=du(),{control:n=r,disabled:s,name:a,exact:i}=e||{},[o,c]=t.useState(n._formState),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return mu(()=>n._subscribe({name:a,formState:l.current,exact:i,callback:e=>{!s&&c({...n._formState,...e})}}),[a,s,i]),t.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>pu(o,n,l.current,!1),[o,n])}({control:a,name:n,exact:c}),m=t.useRef(e),h=t.useRef(void 0),f=t.useRef(a.register(n,{...e.rules,value:d,...$l(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Gl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Gl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Gl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Gl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Gl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Ll(e),name:n},type:Yl}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Gl(a._formValues,n),name:n},type:Zl}),[n,a._formValues]),y=t.useCallback(e=>{const t=Gl(a._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Kl(e.focus)&&e.focus(),select:()=>Kl(e.select)&&e.select(),setCustomValidity:t=>Kl(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Kl(e.reportValidity)&&e.reportValidity()})},[a._fields,n]),x=t.useMemo(()=>({name:n,value:d,...$l(s)||p.disabled?{disabled:p.disabled||s}:{},onChange:b,onBlur:v,ref:y}),[n,s,p.disabled,b,v,y,d]);return t.useEffect(()=>{const e=a._options.shouldUnregister||i,t=h.current;t&&t!==n&&!l&&a.unregister(t),a.register(n,{...m.current.rules,...$l(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Gl(a._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Fl(Gl(a._options.defaultValues,n,m.current.defaultValue));ql(a._defaultValues,n,e),Bl(Gl(a._formValues,n))&&ql(a._formValues,n,e)}return!l&&a.register(n),h.current=n,()=>{(l?e&&!a._state.action:e)?a.unregister(n):r(n,!1)}},[n,a,l,i]),t.useEffect(()=>{a._setDisabledField({disabled:s,name:n})},[s,n,a]),t.useMemo(()=>({field:x,formState:p,fieldState:g}),[x,p,g])}const yu=e=>e.render(vu(e)),xu=t.createContext(null);xu.displayName="HookFormContext";const wu=e=>{const{children:r,watch:n,getValues:s,getFieldState:a,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return t.createElement(xu.Provider,{value:t.useMemo(()=>({watch:n,getValues:s,getFieldState:a,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,u,a,s,m,g,p,d,i,b,c,v,l,h,n])},t.createElement(uu.Provider,{value:f},r))};var Su=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},ku=e=>Array.isArray(e)?e:[e],Eu=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Cu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],a=t[n];if(s&&Ml(s)&&a){const e=Cu(s,a);Ml(e)&&(r[n]=e)}else e[n]&&(r[n]=a)}return r}var Nu=e=>Ml(e)&&!Object.keys(e).length,Au=e=>"file"===e.type,_u=e=>{if(!zl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ju=e=>"select-multiple"===e.type,Pu=e=>"radio"===e.type,Tu=e=>_u(e)&&e.isConnected;function Ru(e,t){const r=Array.isArray(t)?t:Wl(t)?[t]:Hl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Bl(e)?n++:e[t[n++]];return e}(e,r),s=r.length-1,a=r[s];return n&&delete n[a],0!==s&&(Ml(n)&&Nu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Bl(e[t]))return!1;return!0}(n))&&Ru(e,r.slice(0,-1)),e}function Du(e){return Array.isArray(e)||Ml(e)&&!(e=>{for(const t in e)if(Kl(e[t]))return!0;return!1})(e)}function Iu(e,t={}){for(const r in e){const n=e[r];Du(n)?(t[r]=Array.isArray(n)?[]:{},Iu(n,t[r])):Bl(n)||(t[r]=!0)}return t}function Uu(e,t,r){r||(r=Iu(t));for(const n in e){const s=e[n];if(Du(s))Bl(t)||gu(r[n])?r[n]=Iu(s,Array.isArray(s)?[]:{}):Uu(s,Il(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!bu(s,e)}}return r}const Mu={value:!1,isValid:!1},Lu={value:!0,isValid:!0};var Ou=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Bl(e[0].attributes.value)?Bl(e[0].value)||""===e[0].value?Lu:{value:e[0].value,isValid:!0}:Lu:Mu}return Mu},zu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Bl(e)?e:t?""===e?NaN:e?+e:e:r&&hu(e)?new Date(e):n?n(e):e;const Fu={isValid:!1,value:null};var Wu=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Fu):Fu;function Bu(e){const t=e.ref;return Au(t)?t.files:Pu(t)?Wu(e.refs).value:ju(t)?[...t.selectedOptions].map(({value:e})=>e):Rl(t)?Ou(e.refs).value:zu(Bl(t.value)?e.ref.value:t.value,e)}var Vu=e=>e instanceof RegExp,Hu=e=>Bl(e)?e:Vu(e)?e.source:Ml(e)?Vu(e.value)?e.value.source:e.value:e,Gu=e=>({isOnSubmit:!e||e===eu,isOnBlur:e===Xl,isOnChange:e===Ql,isOnAll:e===ru,isOnTouch:e===tu});const $u="AsyncFunction";var Ku=e=>!!e&&!!e.validate&&!!(Kl(e.validate)&&e.validate.constructor.name===$u||Ml(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===$u)),qu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Zu=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const r=Gl(e,s);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],s)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Zu(a,t))break}else if(Ml(a)&&Zu(a,t))break}}};function Ju(e,t,r){const n=Gl(e,r);if(n||Wl(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const n=s.join("."),a=Gl(t,n),i=Gl(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};s.pop()}return{name:r}}var Yu=(e,t,r)=>{const n=ku(Gl(e,r));return ql(n,"root",t[r]),ql(e,r,n),e};function Xu(e,t,r="validate"){if(hu(e)||Array.isArray(e)&&e.every(hu)||$l(e)&&!e)return{type:r,message:hu(e)?e:"",ref:t}}var Qu=e=>Ml(e)&&!Vu(e)?e:{value:e,message:""},ed=async(e,t,r,n,s,a)=>{const{ref:i,refs:o,required:c,maxLength:l,minLength:u,min:d,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=Gl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{s&&y.reportValidity&&(y.setCustomValidity($l(e)?"":e||""),y.reportValidity())},w={},S=Pu(i),k=Rl(i),E=S||k,C=(g||Au(i))&&Bl(i.value)&&Bl(v)||_u(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=Su.bind(null,f,n,w),A=(e,t,r,n=au,s=iu)=>{const a=e?t:r;w[f]={type:e?n:s,message:a,ref:i,...N(e?n:s,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!E&&(C||Il(v))||$l(v)&&!v||k&&!Ou(o).isValid||S&&!Wu(o).isValid)){const{value:e,message:t}=hu(c)?{value:!!c,message:c}:Qu(c);if(e&&(w[f]={type:cu,message:t,ref:y,...N(cu,t)},!n))return x(t),w}if(!(C||Il(d)&&Il(p))){let e,t;const r=Qu(p),s=Qu(d);if(Il(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),a=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,c="week"==i.type;hu(r.value)&&v&&(e=o?a(v)>a(r.value):c?v>r.value:n>new Date(r.value)),hu(s.value)&&v&&(t=o?a(v)<a(s.value):c?v<s.value:n<new Date(s.value))}else{const n=i.valueAsNumber||(v?+v:v);Il(r.value)||(e=n>r.value),Il(s.value)||(t=n<s.value)}if((e||t)&&(A(!!e,r.message,s.message,nu,su),!n))return x(w[f].message),w}if((l||u)&&!C&&(hu(v)||a&&Array.isArray(v))){const e=Qu(l),t=Qu(u),r=!Il(e.value)&&v.length>+e.value,s=!Il(t.value)&&v.length<+t.value;if((r||s)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!C&&hu(v)){const{value:e,message:t}=Qu(m);if(Vu(e)&&!v.match(e)&&(w[f]={type:ou,message:t,ref:i,...N(ou,t)},!n))return x(t),w}if(h)if(Kl(h)){const e=Xu(await h(v,r),y);if(e&&(w[f]={...e,...N(lu,e.message)},!n))return x(e.message),w}else if(Ml(h)){let e={};for(const t in h){if(!Nu(e)&&!n)break;const s=Xu(await h[t](v,r),y,t);s&&(e={...s,...N(t,s.message)},x(s.message),n&&(w[f]=e))}if(!Nu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const td={mode:eu,reValidateMode:Ql,shouldFocusError:!0};function rd(e={}){let t,r={...td,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Kl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},s={},a=(Ml(r.defaultValues)||Ml(r.values))&&Fl(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Fl(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let p={...d};const m={array:Eu(),state:Eu()},h=r.criteriaMode===ru,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Nu((await x()).errors),g()):e=await w(s,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?ql(n.validatingFields,e,t):Ru(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Nu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Gl(s,e);if(c){const s=Gl(i,e,Bl(r)?Gl(a,e):r);Bl(s)||n&&n.defaultChecked||t?ql(i,e,t?s:Bu(c._f)):E(e,s),o.mount&&!o.action&&f()}},v=(e,t,s,i,o)=>{let c=!1,l=!1;const u={name:e};if(!r.disabled){if(!s||i){(d.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=S(),c=l!==u.isDirty);const r=bu(Gl(a,e),t);l=!!Gl(n.dirtyFields,e),r?Ru(n.dirtyFields,e):ql(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(s){const t=Gl(n.touchedFields,e);t||(ql(n.touchedFields,e,s),u.touchedFields=n.touchedFields,c=c||(d.touchedFields||p.touchedFields)&&t!==s)}c&&o&&m.state.next(u)}return c?u:{}},y=(e,s,a,i)=>{const o=Gl(n.errors,e),c=(d.isValid||p.isValid)&&$l(s)&&n.isValid!==s;var u;if(r.delayError&&a?(u=()=>((e,t)=>{ql(n.errors,e,t),m.state.next({errors:n.errors})})(e,a),t=e=>{clearTimeout(l),l=setTimeout(u,e)},t(r.delayError)):(clearTimeout(l),t=null,a?ql(n.errors,e,a):Ru(n.errors,e)),(a?!bu(o,a):o)||!Nu(i)||c){const t={...i,...c&&$l(s)?{isValid:s}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},x=async e=>{g(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const s={};for(const r of e){const e=Gl(t,r);e&&ql(s,r,e._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}})(e||c.mount,s,r.criteriaMode,r.shouldUseNativeValidation));return t},w=async(t,s,a={valid:!0})=>{for(const o in t){const l=t[o];if(l){const{_f:t,...o}=l;if(t){const o=c.array.has(t.name),u=l._f&&Ku(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await ed(l,c.disabled,i,h,r.shouldUseNativeValidation&&!s,o);if(u&&d.validatingFields&&g([t.name]),p[t.name]&&(a.valid=!1,s||e.shouldUseNativeValidation))break;!s&&(Gl(p,t.name)?o?Yu(n.errors,p,t.name):ql(n.errors,t.name,p[t.name]):Ru(n.errors,t.name))}!Nu(o)&&await w(o,s,a)}}return a.valid},S=(e,t)=>!r.disabled&&(e&&t&&ql(i,e,t),!bu(P(),a)),k=(e,t,r)=>fu(e,c,{...o.mount?i:Bl(t)?a:hu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Gl(s,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&ql(i,e,zu(t,r)),a=_u(r.ref)&&Il(t)?"":t,ju(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?Rl(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):Au(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||m.state.next({name:e,values:Fl(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&j(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,o=Gl(s,i);(c.array.has(e)||Ml(a)||o&&!o._f)&&!Dl(a)?C(i,a,r):E(i,a,r)}},N=(e,t,r={})=>{const l=Gl(s,e),u=c.array.has(e),h=Fl(t);ql(i,e,h),u?(m.array.next({name:e,values:Fl(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Uu(a,i),isDirty:S(e,h)})):!l||l._f||Il(h)?E(e,h,r):C(e,h,r),qu(e,c)?m.state.next({...n,name:e,values:Fl(i)}):m.state.next({name:o.mount?e:void 0,values:Fl(i)})},A=async e=>{o.mount=!0;const a=e.target;let l=a.name,u=!0;const b=Gl(s,l),S=e=>{u=Number.isNaN(e)||Dl(e)&&isNaN(e.getTime())||bu(e,Gl(i,l,e))},k=Gu(r.mode),E=Gu(r.reValidateMode);if(b){let o,C;const N=a.type?Bu(b._f):Ll(e),A=e.type===Zl||e.type===Jl,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Gl(n.errors,l)&&!b._f.deps||((e,t,r,n,s)=>!s.isOnAll&&(!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:!(r?n.isOnChange:s.isOnChange)||e))(A,Gl(n.touchedFields,l),n.isSubmitted,E,k),P=qu(l,c,A);ql(i,l,N),A?a&&a.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const T=v(l,N,A),R=!Nu(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Fl(i)}),_)return(d.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...P?{}:T});if(!A&&P&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),u){const t=Ju(n.errors,s,l),r=Ju(e,s,t.name||l);o=r.error,l=r.name,C=Nu(e)}}else g([l],!0),o=(await ed(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),u&&(o?C=!1:(d.isValid||p.isValid)&&(C=await w(s,!0)));u&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&j(b._f.deps),y(l,C,o,T))}},_=(e,t)=>{if(Gl(n.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let a,i;const o=ku(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(g(e),e)for(const r of e){const e=Gl(t,r);e?ql(n.errors,r,e):Ru(n.errors,r)}else n.errors=t;return t})(Bl(e)?e:o);a=Nu(t),i=e?!o.some(e=>Gl(t,e)):a}else e?(i=(await Promise.all(o.map(async e=>{const t=Gl(s,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await w(s);return m.state.next({...!hu(e)||(d.isValid||p.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Zu(s,_,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:a};return t&&(r=Cu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Bl(e)?r:hu(e)?Gl(r,e):e.map(e=>Gl(r,e))},T=(e,t)=>({invalid:!!Gl((t||n).errors,e),isDirty:!!Gl((t||n).dirtyFields,e),error:Gl((t||n).errors,e),isValidating:!!Gl(n.validatingFields,e),isTouched:!!Gl((t||n).touchedFields,e)}),R=(e,t,r)=>{const a=(Gl(s,e,{_f:{}})._f||{}).ref,i=Gl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;ql(n.errors,e,{...u,...t,ref:a}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},D=e=>m.state.subscribe({next:t=>{var r,s,o;r=e.name,s=t.name,o=e.exact,r&&s&&r!==s&&!ku(r).some(e=>e&&(o?e===s:e.startsWith(s)||s.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:s,...a}=e;return Nu(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||ru))})(t,e.formState||d,W,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:a})}}).unsubscribe,I=(e,t={})=>{for(const o of e?ku(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(Ru(s,o),Ru(i,o)),!t.keepError&&Ru(n.errors,o),!t.keepDirty&&Ru(n.dirtyFields,o),!t.keepTouched&&Ru(n.touchedFields,o),!t.keepIsValidating&&Ru(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Ru(a,o);m.state.next({values:Fl(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if($l(e)&&o.mount||e||c.disabled.has(t)){const r=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),r&&o.mount&&!o.action&&f()}},M=(e,t={})=>{let n=Gl(s,e);const i=$l(t.disabled)||$l(r.disabled);return ql(s,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:$l(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Hu(t.min),max:Hu(t.max),minLength:Hu(t.minLength),maxLength:Hu(t.maxLength),pattern:Hu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Gl(s,e);const r=Bl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Pu(e)||Rl(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;ql(s,e,{_f:{...n._f,...o?{refs:[...c.filter(Tu),r,...Array.isArray(Gl(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Gl(s,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Ol(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&Zu(s,_,c.mount),O=(e,t)=>async a=>{let o;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let l=Fl(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Fl(t)}else await w(s);if(c.disabled.size)for(const e of c.disabled)Ru(l,e);if(Ru(n.errors,"root"),Nu(n.errors)){m.state.next({errors:{}});try{await e(l,a)}catch(e){o=e}}else t&&await t({...n.errors},a),L(),setTimeout(L);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Fl(e):a,u=Fl(l),p=Nu(e),h=p?a:u;if(t.keepDefaultValues||(a=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Uu(a,i))]);for(const t of Array.from(e)){const e=Gl(n.dirtyFields,t),r=Gl(i,t),s=Gl(h,t);e&&!Bl(r)?ql(h,t,r):e||Bl(s)||N(t,s)}}else{if(zl&&Bl(e))for(const e of c.mount){const t=Gl(s,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(_u(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Gl(h,e));else s={}}i=r.shouldUnregister?t.keepDefaultValues?Fl(a):{}:Fl(h),m.array.next({values:{...h}}),m.state.next({values:{...h}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Nu(h),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),m.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||bu(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Uu(a,i):n.dirtyFields:t.keepDefaultValues&&e?Uu(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:a})},F=(e,t)=>z(Kl(e)?e(i):e,{...r.resetOptions,...t}),W=e=>{n={...n,...e}},B={control:{register:M,unregister:I,getFieldState:T,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Gl(s,e))){const t=c(Gl(s,e),l.argA,l.argB);u&&ql(s,e,t)}if(h&&Array.isArray(Gl(n.errors,e))){const t=c(Gl(n.errors,e),l.argA,l.argB);u&&ql(n.errors,e,t),((e,t)=>{!Vl(Gl(e,t)).length&&Ru(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Gl(n.touchedFields,e))){const t=c(Gl(n.touchedFields,e),l.argA,l.argB);u&&ql(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Uu(a,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ql(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Vl(Gl(o.mount?i:a,e,r.shouldUnregister?Gl(a,e,[]):[])),_reset:z,_resetDefaultValues:()=>Kl(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Gl(s,e);t&&(t._f.refs?t._f.refs.every(e=>!Tu(e)):!Tu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{$l(e)&&(m.state.next({disabled:e}),Zu(s,(t,r)=>{const n=Gl(s,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:m,_proxyFormState:d,get _fields(){return s},get _formValues(){return i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return a},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(o.mount=!0,p={...p,...e.formState},D({...e,formState:{...u,...e.formState}})),trigger:j,register:M,handleSubmit:O,watch:(e,t)=>Kl(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:P,reset:F,resetField:(e,t={})=>{Gl(s,e)&&(Bl(t.defaultValue)?N(e,Fl(Gl(a,e))):(N(e,t.defaultValue),ql(a,e,Fl(t.defaultValue))),t.keepTouched||Ru(n.touchedFields,e),t.keepDirty||(Ru(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Fl(Gl(a,e))):S()),t.keepError||(Ru(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&ku(e).forEach(e=>Ru(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Gl(s,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Kl(e.select)&&e.select()})}},getFieldState:T};return{...B,formControl:B}}function nd(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[s,a]=t.useState({isDirty:!1,isValidating:!1,isLoading:Kl(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Kl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:s},e.defaultValues&&!Kl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=rd(e);r.current={...n,formState:s}}const i=r.current.control;return i._options=e,mu(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),t.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==s.isDirty&&i._subjects.state.next({isDirty:e})}},[i,s.isDirty]),t.useEffect(()=>{var t;e.values&&!bu(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),n.current=e.values,a(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),t.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=t.useMemo(()=>pu(s,i),[i,s]),r.current}const sd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Gl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ad=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?sd(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>sd(t,r,e))}},id=(e,t)=>{t.shouldUseNativeValidation&&ad(e,t);const r={};for(const n in e){const s=Gl(t.fields,n),a=Object.assign(e[n]||{},{ref:s&&s.ref});if(od(t.names||Object.keys(e),n)){const e=Object.assign({},Gl(r,n));ql(e,"root",a),ql(r,n,e)}else ql(r,n,a)}return r},od=(e,t)=>{const r=cd(t);return e.some(e=>cd(e).match(`^${r}\\.\\d+`))};function cd(e){return e.replace(/\]|\[/g,"")}function ld(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const s=i.prototype,a=Object.keys(s);for(let e=0;e<a.length;e++){const t=a[e];t in r||(r[t]=s[t].bind(r))}}const s=r?.Parent??Object;class a extends s{}function i(e){var t;const s=r?.Parent?new a:this;n(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ud extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const pd={};function md(e){return pd}function hd(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}function fd(e,t){return"bigint"==typeof t?t.toString():t}function gd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bd(e){return null==e}function vd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const yd=Symbol("evaluating");function xd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==yd)return void 0===n&&(n=yd,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function wd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Sd(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function kd(e){return JSON.stringify(e)}const Ed="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Nd=gd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ad(e){if(!1===Cd(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const r=t.prototype;return!1!==Cd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function _d(e){return Ad(e)?{...e}:Array.isArray(e)?[...e]:e}const jd=new Set(["string","number","symbol"]);function Pd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Td(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Rd(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Dd(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function Id(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Ud(e){return"string"==typeof e?e:e?.message}function Md(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Ud(e.inst?._zod.def?.error?.(e))??Ud(t?.error?.(e))??Ud(r.customError?.(e))??Ud(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ld(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Od(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const zd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Fd=ld("$ZodError",zd),Wd=ld("$ZodError",zd,{Parent:Error});const Bd=e=>(t,r,n,s)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new ud;if(i.issues.length){const t=new(s?.Err??e)(i.issues.map(e=>Md(e,a,md())));throw Ed(t,s?.callee),t}return i.value},Vd=Bd(Wd),Hd=e=>async(t,r,n,s)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(s?.Err??e)(i.issues.map(e=>Md(e,a,md())));throw Ed(t,s?.callee),t}return i.value},Gd=Hd(Wd),$d=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ud;return a.issues.length?{success:!1,error:new(e??Fd)(a.issues.map(e=>Md(e,s,md())))}:{success:!0,data:a.value}},Kd=$d(Wd),qd=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Md(e,s,md())))}:{success:!0,data:a.value}},Zd=qd(Wd),Jd=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bd(e)(t,r,s)},Yd=e=>(t,r,n)=>Bd(e)(t,r,n),Xd=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Hd(e)(t,r,s)},Qd=e=>async(t,r,n)=>Hd(e)(t,r,n),ep=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return $d(e)(t,r,s)},tp=e=>(t,r,n)=>$d(e)(t,r,n),rp=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return qd(e)(t,r,s)},np=e=>async(t,r,n)=>qd(e)(t,r,n),sp=/^[cC][^\s-]{8,}$/,ap=/^[0-9a-z]+$/,ip=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,op=/^[0-9a-vA-V]{20}$/,cp=/^[A-Za-z0-9]{27}$/,lp=/^[a-zA-Z0-9_-]{21}$/,up=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,mp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const hp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yp=/^[A-Za-z0-9_-]*$/,xp=/^\+[1-9]\d{6,14}$/,wp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Sp=new RegExp(`^${wp}$`);function kp(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Ep=/^[^A-Z]*$/,Cp=/^[^a-z]*$/,Np=ld("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ap=ld("$ZodCheckMaxLength",(e,t)=>{var r;Np.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!bd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const s=Ld(n);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),_p=ld("$ZodCheckMinLength",(e,t)=>{var r;Np.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!bd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const s=Ld(n);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jp=ld("$ZodCheckLengthEquals",(e,t)=>{var r;Np.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!bd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,s=n.length;if(s===t.length)return;const a=Ld(n),i=s>t.length;r.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Pp=ld("$ZodCheckStringFormat",(e,t)=>{var r,n;Np.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Tp=ld("$ZodCheckRegex",(e,t)=>{Pp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rp=ld("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Pp.init(e,t)}),Dp=ld("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Cp),Pp.init(e,t)}),Ip=ld("$ZodCheckIncludes",(e,t)=>{Np.init(e,t);const r=Pd(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Up=ld("$ZodCheckStartsWith",(e,t)=>{Np.init(e,t);const r=new RegExp(`^${Pd(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Mp=ld("$ZodCheckEndsWith",(e,t)=>{Np.init(e,t);const r=new RegExp(`.*${Pd(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Lp=ld("$ZodCheckOverwrite",(e,t)=>{Np.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Op{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const zp={major:4,minor:3,patch:6},Fp=ld("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zp;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,s=Dd(e);for(const a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,i=a._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new ud;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(s||(s=Dd(e,t)))});else{if(e.issues.length===t)continue;s||(s=Dd(e,t))}}return n?n.then(()=>e):e},r=(r,s,a)=>{if(Dd(r))return r.aborted=!0,r;const i=t(s,n,a);if(i instanceof Promise){if(!1===a.async)throw new ud;return i.then(t=>e._zod.parse(t,a))}return e._zod.parse(i,a)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if("backward"===a.direction){const t=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,s,a)):r(t,s,a)}const i=e._zod.parse(s,a);if(i instanceof Promise){if(!1===a.async)throw new ud;return i.then(e=>t(e,n,a))}return t(i,n,a)}}xd(e,"~standard",()=>({validate:t=>{try{const r=Kd(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Zd(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Wp=ld("$ZodString",(e,t)=>{var r;Fp.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Bp=ld("$ZodStringFormat",(e,t)=>{Pp.init(e,t),Wp.init(e,t)}),Vp=ld("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dp),Bp.init(e,t)}),Hp=ld("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=pp(e))}else t.pattern??(t.pattern=pp());Bp.init(e,t)}),Gp=ld("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=mp),Bp.init(e,t)}),$p=ld("$ZodURL",(e,t)=>{Bp.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),s=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=s.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Kp=ld("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Bp.init(e,t)}),qp=ld("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lp),Bp.init(e,t)}),Zp=ld("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=sp),Bp.init(e,t)}),Jp=ld("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ap),Bp.init(e,t)}),Yp=ld("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ip),Bp.init(e,t)}),Xp=ld("$ZodXID",(e,t)=>{t.pattern??(t.pattern=op),Bp.init(e,t)}),Qp=ld("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=cp),Bp.init(e,t)}),em=ld("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=kp({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${wp}T(?:${n})$`)}(t)),Bp.init(e,t)}),tm=ld("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Sp),Bp.init(e,t)}),rm=ld("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${kp(t)}$`)),Bp.init(e,t)}),nm=ld("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=up),Bp.init(e,t)}),sm=ld("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hp),Bp.init(e,t),e._zod.bag.format="ipv4"}),am=ld("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=fp),Bp.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),im=ld("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=gp),Bp.init(e,t)}),om=ld("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bp),Bp.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function cm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const lm=ld("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=vp),Bp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{cm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const um=ld("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yp),Bp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!yp.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return cm(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),dm=ld("$ZodE164",(e,t)=>{t.pattern??(t.pattern=xp),Bp.init(e,t)});const pm=ld("$ZodJWT",(e,t)=>{Bp.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),mm=ld("$ZodUnknown",(e,t)=>{Fp.init(e,t),e._zod.parse=e=>e}),hm=ld("$ZodNever",(e,t)=>{Fp.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function fm(e,t,r){e.issues.length&&t.issues.push(...Id(r,e.issues)),t.value[r]=e.value}const gm=ld("$ZodArray",(e,t)=>{Fp.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const a=[];for(let e=0;e<s.length;e++){const i=s[e],o=t.element._zod.run({value:i,issues:[]},n);o instanceof Promise?a.push(o.then(t=>fm(t,r,e))):fm(o,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function bm(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...Id(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function vm(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ym(e,t,r,n,s,a){const i=[],o=s.keySet,c=s.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const s in t){if(o.has(s))continue;if("never"===l){i.push(s);continue}const a=c.run({value:t[s],issues:[]},n);a instanceof Promise?e.push(a.then(e=>bm(e,r,s,t,u))):bm(a,r,s,t,u)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}const xm=ld("$ZodObject",(e,t)=>{Fp.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}const n=gd(()=>vm(t));xd(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const s=Cd,a=t.catchall;let i;e._zod.parse=(t,r)=>{i??(i=n.value);const o=t.value;if(!s(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=i.shape;for(const e of i.keys){const n=l[e],s="optional"===n._zod.optout,a=n._zod.run({value:o[e],issues:[]},r);a instanceof Promise?c.push(a.then(r=>bm(r,t,e,o,s))):bm(a,t,e,o,s)}return a?ym(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),wm=ld("$ZodObjectJIT",(e,t)=>{xm.init(e,t);const r=e._zod.parse,n=gd(()=>vm(t));let s;const a=Cd,i=!pd.jitless,o=i&&Nd.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=n.value);const p=u.value;return a(p)?i&&o&&!1===d?.async&&!0!==d.jitless?(s||(s=(e=>{const t=new Op(["shape","payload","ctx"]),r=n.value,s=e=>{const t=kd(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const a=Object.create(null);let i=0;for(const e of r.keys)a[e]="key_"+i++;t.write("const newResult = {};");for(const n of r.keys){const r=a[n],i=kd(n),o=e[n],c="optional"===o?._zod?.optout;t.write(`const ${r} = ${s(n)};`),c?t.write(`\n if (${r}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `):t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=s(u,d),c?ym([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function Sm(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const s=e.filter(e=>!Dd(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>Md(e,n,md())))}),t)}const km=ld("$ZodUnion",(e,t)=>{Fp.init(e,t),xd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),xd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),xd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),xd(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>vd(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(s,a)=>{if(r)return n(s,a);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},a);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>Sm(t,s,e,a)):Sm(o,s,e,a)}}),Em=ld("$ZodIntersection",(e,t)=>{Fp.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,s=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([t,r])=>Nm(e,t,r)):Nm(e,s,a)}});function Cm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ad(e)&&Ad(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),s={...e,...t};for(const r of n){const n=Cm(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};s[r]=n.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=Cm(e[n],t[n]);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Nm(e,t,r){const n=new Map;let s;for(const r of t.issues)if("unrecognized_keys"===r.code){s??(s=r);for(const e of r.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(r);for(const t of r.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const a=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&s&&e.issues.push({...s,keys:a}),Dd(e))return e;const i=Cm(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Am=ld("$ZodEnum",(e,t)=>{Fp.init(e,t);const r=hd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>jd.has(typeof e)).map(e=>"string"==typeof e?Pd(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),_m=ld("$ZodTransform",(e,t)=>{Fp.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new dd(e.constructor.name);const s=t.transform(r.value,r);if(n.async){return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(r.value=e,r))}if(s instanceof Promise)throw new ud;return r.value=s,r}});function jm(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Pm=ld("$ZodOptional",(e,t)=>{Fp.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${vd(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>jm(t,e.value)):jm(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Tm=ld("$ZodExactOptional",(e,t)=>{Pm.init(e,t),xd(e._zod,"values",()=>t.innerType._zod.values),xd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Rm=ld("$ZodNullable",(e,t)=>{Fp.init(e,t),xd(e._zod,"optin",()=>t.innerType._zod.optin),xd(e._zod,"optout",()=>t.innerType._zod.optout),xd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${vd(e.source)}|null)$`):void 0}),xd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),Dm=ld("$ZodDefault",(e,t)=>{Fp.init(e,t),e._zod.optin="optional",xd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>Im(e,t)):Im(n,t)}});function Im(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Um=ld("$ZodPrefault",(e,t)=>{Fp.init(e,t),e._zod.optin="optional",xd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),Mm=ld("$ZodNonOptional",(e,t)=>{Fp.init(e,t),xd(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(t=>Lm(t,e)):Lm(s,e)}});function Lm(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Om=ld("$ZodCatch",(e,t)=>{Fp.init(e,t),xd(e._zod,"optin",()=>t.innerType._zod.optin),xd(e._zod,"optout",()=>t.innerType._zod.optout),xd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Md(e,r,md()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Md(e,r,md()))},input:e.value}),e.issues=[]),e)}}),zm=ld("$ZodPipe",(e,t)=>{Fp.init(e,t),xd(e._zod,"values",()=>t.in._zod.values),xd(e._zod,"optin",()=>t.in._zod.optin),xd(e._zod,"optout",()=>t.out._zod.optout),xd(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>Fm(e,t.in,r)):Fm(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Fm(e,t.out,r)):Fm(n,t.out,r)}});function Fm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Wm=ld("$ZodReadonly",(e,t)=>{Fp.init(e,t),xd(e._zod,"propValues",()=>t.innerType._zod.propValues),xd(e._zod,"values",()=>t.innerType._zod.values),xd(e._zod,"optin",()=>t.innerType?._zod?.optin),xd(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(Bm):Bm(n)}});function Bm(e){return e.value=Object.freeze(e.value),e}const Vm=ld("$ZodCustom",(e,t)=>{Np.init(e,t),Fp.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(t=>Hm(t,r,n,e));Hm(s,r,n,e)}});function Hm(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(Od(e))}}var Gm;class $m{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(Gm=globalThis).__zod_globalRegistry??(Gm.__zod_globalRegistry=new $m);const Km=globalThis.__zod_globalRegistry;function qm(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Rd(t)})}function Zm(e,t){return new Ap({check:"max_length",...Rd(t),maximum:e})}function Jm(e,t){return new _p({check:"min_length",...Rd(t),minimum:e})}function Ym(e,t){return new jp({check:"length_equals",...Rd(t),length:e})}function Xm(e){return new Lp({check:"overwrite",tx:e})}function Qm(e){const t=function(e,t){const r=new Np({check:"custom",...Rd(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Od(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Od(n))}},e(r.value,r)));return t}function eh(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Km,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function th(e,t,r={path:[],schemaPath:[]}){var n;const s=e._zod.def,a=t.seen.get(e);if(a){a.count++;return r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema}const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{const r=i.schema,a=t.processors[s.type];if(!a)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);a(e,t,r,n)}const a=e._zod.parent;a&&(i.ref||(i.ref=a),th(a,t,n),t.seen.get(a).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&sh(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function rh(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const r=e.metadataRegistry.get(t[0])?.id;if(r){const e=n.get(r);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:s,defId:a}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const r=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(r)return{ref:s(r)};const a=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=a,{defId:a,ref:`${s("__shared")}#/${n}/${a}`}}if(t[1]===r)return{ref:"#"};const s=`#/${n}/`,a=t[1].schema.id??"__schema"+e.counter++;return{defId:a,ref:s+a}})(t);n.def={...n.schema},a&&(n.defId=a);const i=n.schema;for(const e in i)delete i[e];i.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const n=r[1];if(t===r[0]){s(r);continue}if(e.external){const n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){s(r);continue}}const a=e.metadataRegistry.get(r[0])?.id;a?s(r):(n.cycle||n.count>1&&"ref"===e.reused)&&s(r)}}function nh(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const r=e.seen.get(t);if(null===r.ref)return;const s=r.def??r.schema,a={...s},i=r.ref;if(r.ref=null,i){n(i);const r=e.seen.get(i),o=r.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,o):(s.allOf=s.allOf??[],s.allOf.push(o)),Object.assign(s,a);if(t._zod.parent===i)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in a||delete s[e]);if(o.$ref&&r.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(s[e])===JSON.stringify(r.def[e])&&delete s[e]}const o=t._zod.parent;if(o&&o!==i){n(o);const t=e.seen.get(o);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:r.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(r)}Object.assign(s,r.def??r.schema);const a=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?s.$defs=a:s.definitions=a);try{const r=JSON.parse(JSON.stringify(s));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:ah(t,"input",e.processors),output:ah(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function sh(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return sh(n.element,r);if("set"===n.type)return sh(n.valueType,r);if("lazy"===n.type)return sh(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return sh(n.innerType,r);if("intersection"===n.type)return sh(n.left,r)||sh(n.right,r);if("record"===n.type||"map"===n.type)return sh(n.keyType,r)||sh(n.valueType,r);if("pipe"===n.type)return sh(n.in,r)||sh(n.out,r);if("object"===n.type){for(const e in n.shape)if(sh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(sh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(sh(e,r))return!0;return!(!n.rest||!sh(n.rest,r))}return!1}const ah=(e,t,r={})=>n=>{const{libraryOptions:s,target:a}=n??{},i=eh({...s??{},target:a,io:t,processors:r});return th(e,i),rh(i,e),nh(i,e)},ih={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oh=(e,t,r,n)=>{const s=e._zod.def;th(s.innerType,t,n);t.seen.get(e).ref=s.innerType};function ch(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function lh(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:a,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Su(i,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function uh(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[i]={message:o.message,type:o.code}}else r[i]={message:a,type:s};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=Su(i,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function dh(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,s,a){try{return Promise.resolve(ch(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&ad({},a),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:id(lh(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,s,a){try{return Promise.resolve(ch(function(){return Promise.resolve(("sync"===r.mode?Vd:Gd)(e,n,t)).then(function(e){return a.shouldUseNativeValidation&&ad({},a),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Fd}(e))return{values:{},errors:id(uh(e.issues,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const ph=ld("ZodISODateTime",(e,t)=>{em.init(e,t),Lh.init(e,t)});function mh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Rd(t)})}(ph,e)}const hh=ld("ZodISODate",(e,t)=>{tm.init(e,t),Lh.init(e,t)});function fh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Rd(t)})}(hh,e)}const gh=ld("ZodISOTime",(e,t)=>{rm.init(e,t),Lh.init(e,t)});function bh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Rd(t)})}(gh,e)}const vh=ld("ZodISODuration",(e,t)=>{nm.init(e,t),Lh.init(e,t)});function yh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Rd(t)})}(vh,e)}const xh=ld("ZodError",(e,t)=>{Fd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const r={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>n({issues:e}));else if("invalid_key"===s.code)n({issues:s.issues});else if("invalid_element"===s.code)n({issues:s.issues});else if(0===s.path.length)r._errors.push(t(s));else{let e=r,n=0;for(;n<s.path.length;){const r=s.path[n];n===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,fd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,fd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),wh=Bd(xh),Sh=Hd(xh),kh=$d(xh),Eh=qd(xh),Ch=Jd(xh),Nh=Yd(xh),Ah=Xd(xh),_h=Qd(xh),jh=ep(xh),Ph=tp(xh),Th=rp(xh),Rh=np(xh),Dh=ld("ZodType",(e,t)=>(Fp.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ah(e,"input"),output:ah(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=eh({...r,processors:t});return th(e,n),rh(n,e),nh(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Sd(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>Td(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>wh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>kh(e,t,r),e.parseAsync=async(t,r)=>Sh(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Eh(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Ch(e,t,r),e.decode=(t,r)=>Nh(e,t,r),e.encodeAsync=async(t,r)=>Ah(e,t,r),e.decodeAsync=async(t,r)=>_h(e,t,r),e.safeEncode=(t,r)=>jh(e,t,r),e.safeDecode=(t,r)=>Ph(e,t,r),e.safeEncodeAsync=async(t,r)=>Th(e,t,r),e.safeDecodeAsync=async(t,r)=>Rh(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Rd(r)})}(Af,e,t)}(t,r)),e.superRefine=t=>e.check(Qm(t)),e.overwrite=t=>e.check(Xm(t)),e.optional=()=>gf(e),e.exactOptional=()=>new bf({type:"optional",innerType:e}),e.nullable=()=>yf(e),e.nullish=()=>gf(yf(e)),e.nonoptional=t=>function(e,t){return new Sf({type:"nonoptional",innerType:e,...Rd(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Rd(r)})}(cf,e,t);var t},e.or=t=>function(e,t){return new df({type:"union",options:e,...Rd(t)})}([e,t]),e.and=t=>new pf({type:"intersection",left:e,right:t}),e.transform=t=>Cf(e,new hf({type:"transform",transform:t})),e.default=t=>{return r=t,new xf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():_d(r)}});var r},e.prefault=t=>{return r=t,new wf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():_d(r)}});var r},e.catch=t=>{return new kf({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Cf(e,t),e.readonly=()=>new Nf({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Km.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Km.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Km.get(e);const r=e.clone();return Km.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Ih=ld("_ZodString",(e,t)=>{Wp.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:s,maximum:a,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof s&&(n.minLength=s),"number"==typeof a&&(n.maxLength=a),i&&(n.format=ih[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Tp({check:"string_format",format:"regex",...Rd(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ip({check:"string_format",format:"includes",...Rd(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Up({check:"string_format",format:"starts_with",...Rd(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Mp({check:"string_format",format:"ends_with",...Rd(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Jm(...t)),e.max=(...t)=>e.check(Zm(...t)),e.length=(...t)=>e.check(Ym(...t)),e.nonempty=(...t)=>e.check(Jm(1,...t)),e.lowercase=t=>e.check(function(e){return new Rp({check:"string_format",format:"lowercase",...Rd(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Dp({check:"string_format",format:"uppercase",...Rd(e)})}(t)),e.trim=()=>e.check(Xm(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Xm(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Xm(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Xm(e=>e.toUpperCase())),e.slugify=()=>e.check(Xm(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Uh=ld("ZodString",(e,t)=>{Wp.init(e,t),Ih.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Rd(t)})}(Oh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Rd(t)})}(Wh,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Rd(t)})}(rf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Rd(t)})}(Bh,t)),e.guid=t=>e.check(qm(zh,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Rd(t)})}(Fh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Rd(t)})}(Fh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Rd(t)})}(Fh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Rd(t)})}(Fh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Rd(t)})}(Vh,t)),e.guid=t=>e.check(qm(zh,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Rd(t)})}(Hh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Rd(t)})}(Gh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Rd(t)})}($h,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Rd(t)})}(Qh,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Rd(t)})}(ef,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Rd(t)})}(Kh,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Rd(t)})}(qh,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Rd(t)})}(Zh,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Rd(t)})}(Jh,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Rd(t)})}(Yh,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Rd(t)})}(Xh,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Rd(t)})}(tf,t)),e.datetime=t=>e.check(mh(t)),e.date=t=>e.check(fh(t)),e.time=t=>e.check(bh(t)),e.duration=t=>e.check(yh(t))});function Mh(e){return function(e,t){return new e({type:"string",...Rd(t)})}(Uh,e)}const Lh=ld("ZodStringFormat",(e,t)=>{Bp.init(e,t),Ih.init(e,t)}),Oh=ld("ZodEmail",(e,t)=>{Gp.init(e,t),Lh.init(e,t)}),zh=ld("ZodGUID",(e,t)=>{Vp.init(e,t),Lh.init(e,t)}),Fh=ld("ZodUUID",(e,t)=>{Hp.init(e,t),Lh.init(e,t)}),Wh=ld("ZodURL",(e,t)=>{$p.init(e,t),Lh.init(e,t)}),Bh=ld("ZodEmoji",(e,t)=>{Kp.init(e,t),Lh.init(e,t)}),Vh=ld("ZodNanoID",(e,t)=>{qp.init(e,t),Lh.init(e,t)}),Hh=ld("ZodCUID",(e,t)=>{Zp.init(e,t),Lh.init(e,t)}),Gh=ld("ZodCUID2",(e,t)=>{Jp.init(e,t),Lh.init(e,t)}),$h=ld("ZodULID",(e,t)=>{Yp.init(e,t),Lh.init(e,t)}),Kh=ld("ZodXID",(e,t)=>{Xp.init(e,t),Lh.init(e,t)}),qh=ld("ZodKSUID",(e,t)=>{Qp.init(e,t),Lh.init(e,t)}),Zh=ld("ZodIPv4",(e,t)=>{sm.init(e,t),Lh.init(e,t)}),Jh=ld("ZodIPv6",(e,t)=>{am.init(e,t),Lh.init(e,t)}),Yh=ld("ZodCIDRv4",(e,t)=>{im.init(e,t),Lh.init(e,t)}),Xh=ld("ZodCIDRv6",(e,t)=>{om.init(e,t),Lh.init(e,t)}),Qh=ld("ZodBase64",(e,t)=>{lm.init(e,t),Lh.init(e,t)}),ef=ld("ZodBase64URL",(e,t)=>{um.init(e,t),Lh.init(e,t)}),tf=ld("ZodE164",(e,t)=>{dm.init(e,t),Lh.init(e,t)}),rf=ld("ZodJWT",(e,t)=>{pm.init(e,t),Lh.init(e,t)}),nf=ld("ZodUnknown",(e,t)=>{mm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function sf(){return new nf({type:"unknown"})}const af=ld("ZodNever",(e,t)=>{hm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function of(e){return function(e,t){return new e({type:"never",...Rd(t)})}(af,e)}const cf=ld("ZodArray",(e,t)=>{gm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=r,a=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(s.minItems=i),"number"==typeof o&&(s.maxItems=o),s.type="array",s.items=th(a.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(Jm(t,r)),e.nonempty=t=>e.check(Jm(1,t)),e.max=(t,r)=>e.check(Zm(t,r)),e.length=(t,r)=>e.check(Ym(t,r)),e.unwrap=()=>e.element});const lf=ld("ZodObject",(e,t)=>{wm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=r,a=e._zod.def;s.type="object",s.properties={};const i=a.shape;for(const e in i)s.properties[e]=th(i[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const r=a.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(s.required=Array.from(c)),"never"===a.catchall?._zod.def.type?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=th(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)})(e,t,r,n),xd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new mf({type:"enum",entries:r,...Rd(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sf()}),e.loose=()=>e.clone({...e._zod.def,catchall:sf()}),e.strict=()=>e.clone({...e._zod.def,catchall:of()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ad(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const r=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Sd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return wd(this,"shape",r),r}});return Td(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Ad(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Sd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return wd(this,"shape",r),r}});return Td(e,r)}(e,t),e.merge=t=>function(e,t){const r=Sd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return wd(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Td(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Td(e,Sd(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return wd(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Sd(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return wd(this,"shape",n),n},checks:[]});return Td(e,s)}(e,t),e.partial=(...t)=>function(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Sd(t._zod.def,{get shape(){const n=t._zod.def.shape,s={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)s[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return wd(this,"shape",s),s},checks:[]});return Td(t,s)}(ff,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Sd(t._zod.def,{get shape(){const n=t._zod.def.shape,s={...n};if(r)for(const t in r){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)s[t]=new e({type:"nonoptional",innerType:n[t]});return wd(this,"shape",s),s}});return Td(t,n)}(Sf,e,t[0])});function uf(e,t){const r={type:"object",shape:e??{},...Rd(t)};return new lf(r)}const df=ld("ZodUnion",(e,t)=>{km.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def,a=!1===s.inclusive,i=s.options.map((e,r)=>th(e,t,{...n,path:[...n.path,a?"oneOf":"anyOf",r]}));a?r.oneOf=i:r.anyOf=i})(e,t,r,n),e.options=t.options});const pf=ld("ZodIntersection",(e,t)=>{Em.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def,a=th(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=th(s.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(a)?a.allOf:[a],...o(i)?i.allOf:[i]];r.allOf=c})(e,t,r,n)});const mf=ld("ZodEnum",(e,t)=>{Am.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=hd(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n})(e,0,r),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const s={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);s[n]=t.entries[n]}return new mf({...t,checks:[],...Rd(n),entries:s})},e.exclude=(e,n)=>{const s={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new mf({...t,checks:[],...Rd(n),entries:s})}});const hf=ld("ZodTransform",(e,t)=>{_m.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new dd(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Od(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(Od(t))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(e=>(r.value=e,r)):(r.value=s,r)}});const ff=ld("ZodOptional",(e,t)=>{Pm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>oh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function gf(e){return new ff({type:"optional",innerType:e})}const bf=ld("ZodExactOptional",(e,t)=>{Tm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>oh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const vf=ld("ZodNullable",(e,t)=>{Rm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def,a=th(s.innerType,t,n),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function yf(e){return new vf({type:"nullable",innerType:e})}const xf=ld("ZodDefault",(e,t)=>{Dm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def;th(s.innerType,t,n),t.seen.get(e).ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const wf=ld("ZodPrefault",(e,t)=>{Um.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def;th(s.innerType,t,n),t.seen.get(e).ref=s.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Sf=ld("ZodNonOptional",(e,t)=>{Mm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def;th(s.innerType,t,n),t.seen.get(e).ref=s.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const kf=ld("ZodCatch",(e,t)=>{Om.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def;let a;th(s.innerType,t,n),t.seen.get(e).ref=s.innerType;try{a=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Ef=ld("ZodPipe",(e,t)=>{zm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def,a="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;th(a,t,n),t.seen.get(e).ref=a})(e,t,0,n),e.in=t.in,e.out=t.out});function Cf(e,t){return new Ef({type:"pipe",in:e,out:t})}const Nf=ld("ZodReadonly",(e,t)=>{Wm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const s=e._zod.def;th(s.innerType,t,n),t.seen.get(e).ref=s.innerType,r.readOnly=!0})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Af=ld("ZodCustom",(e,t)=>{Vm.init(e,t),Dh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const _f={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},jf={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Pf(e){return e&&e.trim()?jf[e.trim().toLowerCase()]??"":""}function Tf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return _f[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${Tf(e)})`}));var Rf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ka(`Primitive.${r}`),a=s.forwardRef((t,s)=>{const{asChild:a,...i}=t,o=a?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:s})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{}),Df=s.forwardRef((t,r)=>e.jsx(Rf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Df.displayName="Label";var If=Df;const Uf=Pa("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Mf=s.forwardRef(({className:t,...r},n)=>e.jsx(If,{ref:n,className:Se(Uf(),t),...r}));Mf.displayName=If.displayName;const Lf=wu,Of=s.createContext({}),zf=({...t})=>e.jsx(Of.Provider,{value:{name:t.name},children:e.jsx(yu,{...t})}),Ff=()=>{const e=s.useContext(Of),r=s.useContext(Wf),{getFieldState:n,formState:a}=t.useContext(xu),i=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Wf=s.createContext({}),Bf=s.forwardRef(({className:t,...r},n)=>{const a=s.useId();return e.jsx(Wf.Provider,{value:{id:a},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Bf.displayName="FormItem";const Vf=s.forwardRef(({className:t,...r},n)=>{const{error:s,formItemId:a}=Ff();return e.jsx(Mf,{ref:n,className:Se(s&&"text-destructive",t),htmlFor:a,...r})});Vf.displayName="FormLabel";const Hf=s.forwardRef(({...t},r)=>{const{error:n,formItemId:s,formDescriptionId:a,formMessageId:i}=Ff();return e.jsx(Ea,{ref:r,id:s,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...t})});Hf.displayName="FormControl";const Gf=s.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:s}=Ff();return e.jsx("p",{ref:n,id:s,className:Se("text-sm text-muted-foreground",t),...r})});Gf.displayName="FormDescription";const $f=s.forwardRef(({className:t,children:r,...n},s)=>{const{error:a,formMessageId:i}=Ff(),o=a?String(a?.message):r;return o?e.jsx("p",{ref:s,id:i,className:Se("text-sm font-medium text-destructive",t),...n,children:o}):null});$f.displayName="FormMessage";const Kf=s.forwardRef(({className:t,type:r,...n},s)=>e.jsx("input",{type:r,className:Se("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...n}));function qf(t){const r=Zf(t),n=s.forwardRef((t,n)=>{const{children:a,...i}=t,o=s.Children.toArray(a),c=o.find(Yf);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}function Zf(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Kf.displayName="Input";var Jf=Symbol("radix.slottable");function Yf(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Jf}function Xf(r){const n=r+"CollectionProvider",[s,a]=Ia(n),[i,o]=s(n,{collectionRef:{current:null},itemMap:new Map}),c=r=>{const{scope:n,children:s}=r,a=t.useRef(null),o=t.useRef(new Map).current;return e.jsx(i,{scope:n,itemMap:o,collectionRef:a,children:s})};c.displayName=n;const l=r+"CollectionSlot",u=qf(l),d=t.forwardRef((t,r)=>{const{scope:n,children:s}=t,a=ya(r,o(l,n).collectionRef);return e.jsx(u,{ref:a,children:s})});d.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=qf(p),f=t.forwardRef((r,n)=>{const{scope:s,children:a,...i}=r,c=t.useRef(null),l=ya(n,c),u=o(p,s);return t.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:a})});return f.displayName=p,[{Provider:c,Slot:d,ItemSlot:f},function(e){const n=o(r+"CollectionConsumer",e),s=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return s},a]}var Qf=s.createContext(void 0);function eg(e){const t=s.useContext(Qf);return e||t||"ltr"}var tg="rovingFocusGroup.onEntryFocus",rg={bubbles:!1,cancelable:!0},ng="RovingFocusGroup",[sg,ag,ig]=Xf(ng),[og,cg]=Ia(ng,[ig]),[lg,ug]=og(ng),dg=s.forwardRef((t,r)=>e.jsx(sg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(sg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(pg,{...t,ref:r})})}));dg.displayName=ng;var pg=s.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=t,h=s.useRef(null),f=ya(r,h),g=eg(o),[b,v]=Wa({prop:c,defaultProp:l??null,onChange:u,caller:ng}),[y,x]=s.useState(!1),w=$a(d),S=ag(n),k=s.useRef(!1),[E,C]=s.useState(0);return s.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(tg,w),()=>e.removeEventListener(tg,w)},[w]),e.jsx(lg,{scope:n,orientation:a,dir:g,loop:i,currentTabStopId:b,onItemFocus:s.useCallback(e=>v(e),[v]),onItemShiftTab:s.useCallback(()=>x(!0),[]),onFocusableItemAdd:s.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>C(e=>e-1),[]),children:e.jsx(Ga.div,{tabIndex:y||0===E?-1:0,"data-orientation":a,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:Da(t.onMouseDown,()=>{k.current=!0}),onFocus:Da(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(tg,rg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);gg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:Da(t.onBlur,()=>x(!1))})})}),mg="RovingFocusGroupItem",hg=s.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=za(),d=o||u,p=ug(mg,n),m=p.currentTabStopId===d,h=ag(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return s.useEffect(()=>{if(a)return f(),()=>g()},[a,f,g]),e.jsx(sg.ItemSlot,{scope:n,id:d,focusable:a,active:i,children:e.jsx(Ga.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Da(t.onMouseDown,e=>{a?p.onItemFocus(d):e.preventDefault()}),onFocus:Da(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:Da(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:fg[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>gg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});hg.displayName=mg;var fg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var bg=dg,vg=hg,yg="Radio",[xg,wg]=Ia(yg),[Sg,kg]=xg(yg),Eg=s.forwardRef((t,r)=>{const{__scopeRadio:n,name:a,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:u,form:d,...p}=t,[m,h]=s.useState(null),f=ya(r,e=>h(e)),g=s.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(Sg,{scope:n,checked:i,disabled:c,children:[e.jsx(Ga.button,{type:"button",role:"radio","aria-checked":i,"data-state":_g(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Da(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Ag,{control:m,bubbles:!g.current,name:a,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});Eg.displayName=yg;var Cg="RadioIndicator",Ng=s.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:s,...a}=t,i=kg(Cg,n);return e.jsx(pi,{present:s||i.checked,children:e.jsx(Ga.span,{"data-state":_g(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});Ng.displayName=Cg;var Ag=s.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:a=!0,...i},o)=>{const c=s.useRef(null),l=ya(c,o),u=bl(n),d=vl(r);return s.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:a});r.call(e,n),e.dispatchEvent(t)}},[u,n,a]),e.jsx(Ga.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function _g(e){return e?"checked":"unchecked"}Ag.displayName="RadioBubbleInput";var jg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pg="RadioGroup",[Tg]=Ia(Pg,[cg,wg]),Rg=cg(),Dg=wg(),[Ig,Ug]=Tg(Pg),Mg=s.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:s,defaultValue:a,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...m}=t,h=Rg(n),f=eg(u),[g,b]=Wa({prop:i,defaultProp:a??null,onChange:p,caller:Pg});return e.jsx(Ig,{scope:n,name:s,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(bg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Ga.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Mg.displayName=Pg;var Lg="RadioGroupItem",Og=s.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:a,...i}=t,o=Ug(Lg,n),c=o.disabled||a,l=Rg(n),u=Dg(n),d=s.useRef(null),p=ya(r,d),m=o.value===i.value,h=s.useRef(!1);return s.useEffect(()=>{const e=e=>{jg.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(vg,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Eg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:Da(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Da(i.onFocus,()=>{h.current&&d.current?.click()})})})});Og.displayName=Lg;var zg=s.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...s}=t,a=Dg(n);return e.jsx(Ng,{...a,...s,ref:r})});zg.displayName="RadioGroupIndicator";var Fg=Mg,Wg=Og,Bg=zg;const Vg=s.forwardRef(({className:t,...r},n)=>e.jsx(Fg,{className:Se("grid gap-2",t),...r,ref:n}));Vg.displayName=Fg.displayName;const Hg=s.forwardRef(({className:t,...r},n)=>e.jsx(Wg,{ref:n,className:Se("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Bg,{className:"flex items-center justify-center",children:e.jsx(ic,{className:"h-3.5 w-3.5 fill-primary"})})}));function Gg(e,[t,r]){return Math.min(r,Math.max(t,e))}Hg.displayName=Wg.displayName;var $g="ScrollArea",[Kg]=Ia($g),[qg,Zg]=Kg($g),Jg=s.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:a="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,u]=s.useState(null),[d,p]=s.useState(null),[m,h]=s.useState(null),[f,g]=s.useState(null),[b,v]=s.useState(null),[y,x]=s.useState(0),[w,S]=s.useState(0),[k,E]=s.useState(!1),[C,N]=s.useState(!1),A=ya(r,e=>u(e)),_=eg(i);return e.jsx(qg,{scope:n,type:a,dir:_,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Ga.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});Jg.displayName=$g;var Yg="ScrollAreaViewport",Xg=s.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:a,nonce:i,...o}=t,c=Zg(Yg,n),l=ya(r,s.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(Ga.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Xg.displayName=Yg;var Qg="ScrollAreaScrollbar",eb=s.forwardRef((t,r)=>{const{forceMount:n,...a}=t,i=Zg(Qg,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return s.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===i.type?e.jsx(tb,{...a,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(rb,{...a,ref:r,forceMount:n}):"auto"===i.type?e.jsx(nb,{...a,ref:r,forceMount:n}):"always"===i.type?e.jsx(sb,{...a,ref:r}):null});eb.displayName=Qg;var tb=s.forwardRef((t,r)=>{const{forceMount:n,...a}=t,i=Zg(Qg,t.__scopeScrollArea),[o,c]=s.useState(!1);return s.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(pi,{present:n||o,children:e.jsx(nb,{"data-state":o?"visible":"hidden",...a,ref:r})})}),rb=s.forwardRef((t,r)=>{const{forceMount:n,...a}=t,i=Zg(Qg,t.__scopeScrollArea),o="horizontal"===t.orientation,c=kb(()=>u("SCROLL_END"),100),[l,u]=(d="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},s.useReducer((e,t)=>p[e][t]??e,d));var d,p;return s.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,u]),s.useEffect(()=>{const e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,u,c]),e.jsx(pi,{present:n||"hidden"!==l,children:e.jsx(sb,{"data-state":"hidden"===l?"hidden":"visible",...a,ref:r,onPointerEnter:Da(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Da(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),nb=s.forwardRef((t,r)=>{const n=Zg(Qg,t.__scopeScrollArea),{forceMount:a,...i}=t,[o,c]=s.useState(!1),l="horizontal"===t.orientation,u=kb(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return Eb(n.viewport,u),Eb(n.content,u),e.jsx(pi,{present:a||o,children:e.jsx(sb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),sb=s.forwardRef((t,r)=>{const{orientation:n="vertical",...a}=t,i=Zg(Qg,t.__scopeScrollArea),o=s.useRef(null),c=s.useRef(0),[l,u]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=bb(l.viewport,l.content),p={...a,sizes:l,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,r,n="ltr"){const s=vb(r),a=s/2,i=t||a,o=s-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return xb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(ab,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=yb(i.viewport.scrollLeft,l,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===n?e.jsx(ib,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=yb(i.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),ab=s.forwardRef((t,r)=>{const{sizes:n,onSizesChange:a,...i}=t,o=Zg(Qg,t.__scopeScrollArea),[c,l]=s.useState(),u=s.useRef(null),d=ya(r,u,o.onScrollbarXChange);return s.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(lb,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":vb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),wb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:gb(c.paddingLeft),paddingEnd:gb(c.paddingRight)}})}})}),ib=s.forwardRef((t,r)=>{const{sizes:n,onSizesChange:a,...i}=t,o=Zg(Qg,t.__scopeScrollArea),[c,l]=s.useState(),u=s.useRef(null),d=ya(r,u,o.onScrollbarYChange);return s.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(lb,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":vb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),wb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:gb(c.paddingTop),paddingEnd:gb(c.paddingBottom)}})}})}),[ob,cb]=Kg(Qg),lb=s.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:m,...h}=t,f=Zg(Qg,n),[g,b]=s.useState(null),v=ya(r,e=>b(e)),y=s.useRef(null),x=s.useRef(""),w=f.viewport,S=a.content-a.viewport,k=$a(p),E=$a(u),C=kb(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return s.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,g,S,k]),s.useEffect(E,[a,E]),Eb(g,C),Eb(f.content,C),e.jsx(ob,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:$a(o),onThumbPointerUp:$a(c),onThumbPositionChange:E,onThumbPointerDown:$a(l),children:e.jsx(Ga.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Da(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),N(e)}}),onPointerMove:Da(t.onPointerMove,N),onPointerUp:Da(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),ub="ScrollAreaThumb",db=s.forwardRef((t,r)=>{const{forceMount:n,...s}=t,a=cb(ub,t.__scopeScrollArea);return e.jsx(pi,{present:n||a.hasThumb,children:e.jsx(pb,{ref:r,...s})})}),pb=s.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:a,...i}=t,o=Zg(ub,n),c=cb(ub,n),{onThumbPositionChange:l}=c,u=ya(r,e=>c.onThumbChange(e)),d=s.useRef(void 0),p=kb(()=>{d.current&&(d.current(),d.current=void 0)},100);return s.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!d.current){const t=Sb(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Ga.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Da(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:Da(t.onPointerUp,c.onThumbPointerUp)})});db.displayName=ub;var mb="ScrollAreaCorner",hb=s.forwardRef((t,r)=>{const n=Zg(mb,t.__scopeScrollArea),s=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&s?e.jsx(fb,{...t,ref:r}):null});hb.displayName=mb;var fb=s.forwardRef((t,r)=>{const{__scopeScrollArea:n,...a}=t,i=Zg(mb,n),[o,c]=s.useState(0),[l,u]=s.useState(0),d=Boolean(o&&l);return Eb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),Eb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Ga.div,{...a,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function gb(e){return e?parseInt(e,10):0}function bb(e,t){const r=e/t;return isNaN(r)?0:r}function vb(e){const t=bb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function yb(e,t,r="ltr"){const n=vb(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,i=t.content-t.viewport,o=a-n,c=Gg(e,"ltr"===r?[0,i]:[-1*i,0]);return xb([0,i],[0,o])(c)}function xb(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function wb(e,t){return e>0&&e<t}var Sb=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,o=r.top!==a.top;(i||o)&&t(),r=a,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function kb(e,t){const r=$a(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Eb(e,t){const r=$a(t);Ma(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var Cb=Jg,Nb=Xg,Ab=hb;const _b=s.forwardRef(({className:t,children:r,...n},s)=>e.jsxs(Cb,{ref:s,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Nb,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(jb,{}),e.jsx(Ab,{})]}));_b.displayName=Cb.displayName;const jb=s.forwardRef(({className:t,orientation:r="vertical",...n},s)=>e.jsx(eb,{ref:s,orientation:r,className:Se("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(db,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Pb(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</text></svg>`}jb.displayName=eb.displayName;const Tb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],Rb=({workspace:r})=>{const{t:n}=sn(),{updateWorkspace:s}=js(),{can:a}=ml(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState(),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=nd({resolver:dh(uf({name:Mh().min(2,{message:n("general.nameMinLength")}),image:Mh().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(fl,{});const g=a(cl.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),!g&&e.jsx("div",{className:"text-red-500",children:n("general.ownerOnly")}),e.jsx(Lf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await s(r,e),m(n("general.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(zf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Bf,{children:[e.jsx(Vf,{children:n("general.name")}),e.jsx(Hf,{children:e.jsx(Kf,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx($f,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Mf,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[Pf(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:Pf(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Mf,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Gf,{children:n("general.iconDescription")})]}),e.jsxs(Vg,{value:c,disabled:!g,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Hg,{value:"emoji",id:"emoji"}),e.jsxs(Mf,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ua,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Hg,{value:"url",id:"url"}),e.jsxs(Mf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qs,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[u&&e.jsx("span",{className:"text-2xl",children:u}),!u&&f.watch("image")?.trim()&&e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview"})]})]}),g&&e.jsx(_b,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Tb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Pb(e))})(t),disabled:!g,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(zf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Bf,{children:[e.jsx(Vf,{children:n("general.imageUrl")}),e.jsx(Hf,{children:e.jsx(Kf,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Gf,{children:n("general.imageUrlDescription")}),e.jsx($f,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:g&&e.jsx(Ra,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};var Db=.999,Ib=/[\\\/_+.#"@\[\(\{&]/,Ub=/[\\\/_+.#"@\[\(\{&]/g,Mb=/[\s-]/,Lb=/[\s-]/g;function Ob(e,t,r,n,s,a,i){if(a===t.length)return s===e.length?1:.99;var o=`${s},${a}`;if(void 0!==i[o])return i[o];for(var c,l,u,d,p=n.charAt(a),m=r.indexOf(p,s),h=0;m>=0;)(c=Ob(e,t,r,n,m+1,a+1,i))>h&&(m===s?c*=1:Ib.test(e.charAt(m-1))?(c*=.8,(u=e.slice(s,m-1).match(Ub))&&s>0&&(c*=Math.pow(Db,u.length))):Mb.test(e.charAt(m-1))?(c*=.9,(d=e.slice(s,m-1).match(Lb))&&s>0&&(c*=Math.pow(Db,d.length))):(c*=.17,s>0&&(c*=Math.pow(Db,m-s))),e.charAt(m)!==t.charAt(a)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(m-1)!==n.charAt(a))&&(.1*(l=Ob(e,t,r,n,m+1,a+2,i))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return i[o]=h,h}function zb(e){return e.toLowerCase().replace(Lb," ")}function Fb(e,t,r){return Ob(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,zb(e),zb(t),0,0,{})}var Wb='[cmdk-group=""]',Bb='[cmdk-group-items=""]',Vb='[cmdk-item=""]',Hb=`${Vb}:not([aria-disabled="true"])`,Gb="cmdk-item-select",$b="data-value",Kb=(e,t,r)=>Fb(e,t,r),qb=s.createContext(void 0),Zb=()=>s.useContext(qb),Jb=s.createContext(void 0),Yb=()=>s.useContext(Jb),Xb=s.createContext(void 0),Qb=s.forwardRef((e,t)=>{let r=mv(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=mv(()=>new Set),a=mv(()=>new Map),i=mv(()=>new Map),o=mv(()=>new Set),c=dv(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=za(),x=za(),w=za(),S=s.useRef(null),k=gv();pv(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),pv(()=>{k(6,P)},[]);let E=s.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var s,a,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)j(),A(),k(1,_);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(y))||s.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=T())?void 0:e.id,E.emit()}),n||k(5,P),void 0!==(null==(a=c.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(o=(i=c.current).onValueChange)||o.call(i,e))}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=s.useMemo(()=>({value:(e,t,n)=>{var s;t!==(null==(s=i.current.get(e))?void 0:s.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),k(2,()=>{A(),E.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),k(3,()=>{j(),A(),r.current.value||_(),E.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();k(4,()=>{j(),(null==t?void 0:t.getAttribute("id"))===e&&_(),E.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:S}),[]);function N(e,t){var n,s;let a=null!=(s=null==(n=c.current)?void 0:n.filter)?s:Kb;return e?a(e,r.current.search,t):0}function A(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),s=0;n.forEach(t=>{let r=e.get(t);s=Math.max(r,s)}),t.push([r,s])});let n=S.current;R().sort((t,r)=>{var n,s;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(s=e.get(a))?s:0)}).forEach(e=>{let t=e.closest(Bb);t?t.appendChild(e.parentElement===t?e:e.closest(`${Bb} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Bb} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Wb}[${$b}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function _(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute($b);E.setState("value",t||void 0)}function j(){var e,t,s,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let l=0;for(let a of n.current){let n=N(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(o=null==(s=i.current.get(a))?void 0:s.keywords)?o:[]);r.current.filtered.items.set(a,n),n>0&&l++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=l}function P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Wb))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Vb}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Hb))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute($b))}function I(e){var t;let r=T(),n=R(),s=n.findIndex(e=>e===r),a=n[s+e];null!=(t=c.current)&&t.loop&&(a=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),a&&E.setState("value",a.getAttribute($b))}function U(e){let t,r=T(),n=null==r?void 0:r.closest(Wb);for(;n&&!t;)n=e>0?lv(n,Wb):uv(n,Wb),t=null==n?void 0:n.querySelector(Hb);t?E.setState("value",t.getAttribute($b)):I(e)}let M=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return s.createElement(Ga.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":b&&e.ctrlKey&&O(e);break;case"ArrowUp":O(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(Gb);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:vv},l),bv(e,e=>s.createElement(Jb.Provider,{value:E},s.createElement(qb.Provider,{value:C},e))))}),ev=s.forwardRef((e,t)=>{var r,n;let a=za(),i=s.useRef(null),o=s.useContext(Xb),c=Zb(),l=dv(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;pv(()=>{if(!u)return c.item(a,null==o?void 0:o.id)},[u]);let d=fv(a,i,[e.value,e.children,i],e.keywords),p=Yb(),m=hv(e=>e.value&&e.value===d.current),h=hv(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(a)>0));function f(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(s.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Gb,f),()=>t.removeEventListener(Gb,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:x,keywords:w,...S}=e;return s.createElement(Ga.div,{ref:va(i,t),...S,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||c.getDisablePointerSelection()?void 0:g,onClick:b?void 0:f},e.children)}),tv=s.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...i}=e,o=za(),c=s.useRef(null),l=s.useRef(null),u=za(),d=Zb(),p=hv(e=>!(!a&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));pv(()=>d.group(o),[]),fv(o,c,[e.value,e.heading,l]);let m=s.useMemo(()=>({id:o,forceMount:a}),[a]);return s.createElement(Ga.div,{ref:va(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&s.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),bv(e,e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(Xb.Provider,{value:m},e))))}),rv=s.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=s.useRef(null),i=hv(e=>!e.search);return r||i?s.createElement(Ga.div,{ref:va(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),nv=s.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,i=Yb(),o=hv(e=>e.search),c=hv(e=>e.selectedItemId),l=Zb();return s.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),s.createElement(Ga.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:a?e.value:o,onChange:e=>{a||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),sv=s.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,i=s.useRef(null),o=s.useRef(null),c=hv(e=>e.selectedItemId),l=Zb();return s.useEffect(()=>{if(o.current&&i.current){let e,t=o.current,r=i.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),s.createElement(Ga.div,{ref:va(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},bv(e,e=>s.createElement("div",{ref:va(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),av=s.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:i,container:o,...c}=e;return s.createElement(qo,{open:r,onOpenChange:n},s.createElement(Jo,{container:o},s.createElement(Yo,{"cmdk-overlay":"",className:a}),s.createElement(Xo,{"aria-label":e.label,"cmdk-dialog":"",className:i},s.createElement(Qb,{ref:t,...c}))))}),iv=s.forwardRef((e,t)=>hv(e=>0===e.filtered.count)?s.createElement(Ga.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ov=s.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...i}=e;return s.createElement(Ga.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},bv(e,e=>s.createElement("div",{"aria-hidden":!0},e)))}),cv=Object.assign(Qb,{List:sv,Item:ev,Input:nv,Group:tv,Separator:rv,Dialog:av,Empty:iv,Loading:ov});function lv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function uv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function dv(e){let t=s.useRef(e);return pv(()=>{t.current=e}),t}var pv="undefined"==typeof window?s.useEffect:s.useLayoutEffect;function mv(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function hv(e){let t=Yb(),r=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,r,r)}function fv(e,t,r,n=[]){let a=s.useRef(),i=Zb();return pv(()=>{var s;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),c=n.map(e=>e.trim());i.value(e,o,c),null==(s=t.current)||s.setAttribute($b,o),a.current=o}),a}var gv=()=>{let[e,t]=s.useState(),r=mv(()=>new Map);return pv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function bv({asChild:e,children:t},r){return e&&s.isValidElement(t)?s.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var vv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const yv=s.forwardRef(({className:t,...r},n)=>e.jsx(cv,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));yv.displayName=cv.displayName;const xv=s.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(uc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(cv.Input,{ref:n,className:Se("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...r})]}));xv.displayName=cv.Input.displayName;const wv=s.forwardRef(({className:t,...r},n)=>e.jsx(cv.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));wv.displayName=cv.List.displayName;s.forwardRef((t,r)=>e.jsx(cv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=cv.Empty.displayName;const Sv=s.forwardRef(({className:t,...r},n)=>e.jsx(cv.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r}));Sv.displayName=cv.Group.displayName;s.forwardRef(({className:t,...r},n)=>e.jsx(cv.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=cv.Separator.displayName;const kv=s.forwardRef(({className:t,...r},n)=>e.jsx(cv.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r}));kv.displayName=cv.Item.displayName;const Ev=["top","right","bottom","left"],Cv=Math.min,Nv=Math.max,Av=Math.round,_v=Math.floor,jv=e=>({x:e,y:e}),Pv={left:"right",right:"left",bottom:"top",top:"bottom"},Tv={start:"end",end:"start"};function Rv(e,t,r){return Nv(e,Cv(t,r))}function Dv(e,t){return"function"==typeof e?e(t):e}function Iv(e){return e.split("-")[0]}function Uv(e){return e.split("-")[1]}function Mv(e){return"x"===e?"y":"x"}function Lv(e){return"y"===e?"height":"width"}const Ov=new Set(["top","bottom"]);function zv(e){return Ov.has(Iv(e))?"y":"x"}function Fv(e){return Mv(zv(e))}function Wv(e){return e.replace(/start|end/g,e=>Tv[e])}const Bv=["left","right"],Vv=["right","left"],Hv=["top","bottom"],Gv=["bottom","top"];function $v(e,t,r,n){const s=Uv(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Vv:Bv:t?Bv:Vv;case"left":case"right":return t?Hv:Gv;default:return[]}}(Iv(e),"start"===r,n);return s&&(a=a.map(e=>e+"-"+s),t&&(a=a.concat(a.map(Wv)))),a}function Kv(e){return e.replace(/left|right|bottom|top/g,e=>Pv[e])}function qv(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Zv(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Jv(e,t,r){let{reference:n,floating:s}=e;const a=zv(t),i=Fv(t),o=Lv(i),c=Iv(t),l="y"===a,u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,p=n[o]/2-s[o]/2;let m;switch(c){case"top":m={x:u,y:n.y-s.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-s.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Uv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function Yv(e,t){var r;void 0===t&&(t={});const{x:n,y:s,platform:a,rects:i,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=Dv(t,e),h=qv(m),f=o[p?"floating"===d?"reference":"floating":d],g=Zv(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(f)))||r?f:f.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(o.floating)),y=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},x=Zv(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}function Xv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qv(e){return Ev.some(t=>e[t]>=0)}const ey=new Set(["left","top"]);function ty(){return"undefined"!=typeof window}function ry(e){return ay(e)?(e.nodeName||"").toLowerCase():"#document"}function ny(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sy(e){var t;return null==(t=(ay(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ay(e){return!!ty()&&(e instanceof Node||e instanceof ny(e).Node)}function iy(e){return!!ty()&&(e instanceof Element||e instanceof ny(e).Element)}function oy(e){return!!ty()&&(e instanceof HTMLElement||e instanceof ny(e).HTMLElement)}function cy(e){return!(!ty()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ny(e).ShadowRoot)}const ly=new Set(["inline","contents"]);function uy(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Sy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ly.has(s)}const dy=new Set(["table","td","th"]);function py(e){return dy.has(ry(e))}const my=[":popover-open",":modal"];function hy(e){return my.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const fy=["transform","translate","scale","rotate","perspective"],gy=["transform","translate","scale","rotate","perspective","filter"],by=["paint","layout","strict","content"];function vy(e){const t=yy(),r=iy(e)?Sy(e):e;return fy.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||gy.some(e=>(r.willChange||"").includes(e))||by.some(e=>(r.contain||"").includes(e))}function yy(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const xy=new Set(["html","body","#document"]);function wy(e){return xy.has(ry(e))}function Sy(e){return ny(e).getComputedStyle(e)}function ky(e){return iy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ey(e){if("html"===ry(e))return e;const t=e.assignedSlot||e.parentNode||cy(e)&&e.host||sy(e);return cy(t)?t.host:t}function Cy(e){const t=Ey(e);return wy(t)?e.ownerDocument?e.ownerDocument.body:e.body:oy(t)&&uy(t)?t:Cy(t)}function Ny(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const s=Cy(e),a=s===(null==(n=e.ownerDocument)?void 0:n.body),i=ny(s);if(a){const e=Ay(i);return t.concat(i,i.visualViewport||[],uy(s)?s:[],e&&r?Ny(e):[])}return t.concat(s,Ny(s,[],r))}function Ay(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _y(e){const t=Sy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=oy(e),a=s?e.offsetWidth:r,i=s?e.offsetHeight:n,o=Av(r)!==a||Av(n)!==i;return o&&(r=a,n=i),{width:r,height:n,$:o}}function jy(e){return iy(e)?e:e.contextElement}function Py(e){const t=jy(e);if(!oy(t))return jv(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:a}=_y(t);let i=(a?Av(r.width):r.width)/n,o=(a?Av(r.height):r.height)/s;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Ty=jv(0);function Ry(e){const t=ny(e);return yy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ty}function Dy(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const s=e.getBoundingClientRect(),a=jy(e);let i=jv(1);t&&(n?iy(n)&&(i=Py(n)):i=Py(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ny(e))&&t}(a,r,n)?Ry(a):jv(0);let c=(s.left+o.x)/i.x,l=(s.top+o.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(a){const e=ny(a),t=n&&iy(n)?ny(n):n;let r=e,s=Ay(r);for(;s&&n&&t!==r;){const e=Py(s),t=s.getBoundingClientRect(),n=Sy(s),a=t.left+(s.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(s.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=i,r=ny(s),s=Ay(r)}}return Zv({width:u,height:d,x:c,y:l})}function Iy(e,t){const r=ky(e).scrollLeft;return t?t.left+r:Dy(sy(e)).left+r}function Uy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Iy(e,r),y:r.top+t.scrollTop}}const My=new Set(["absolute","fixed"]);function Ly(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ny(e),n=sy(e),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,o=0,c=0;if(s){a=s.width,i=s.height;const e=yy();(!e||e&&"fixed"===t)&&(o=s.offsetLeft,c=s.offsetTop)}const l=Iy(n);if(l<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),s="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(n.clientWidth-t.clientWidth-s);i<=25&&(a-=i)}else l<=25&&(a+=l);return{width:a,height:i,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=sy(e),r=ky(e),n=e.ownerDocument.body,s=Nv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Nv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Iy(e);const o=-r.scrollTop;return"rtl"===Sy(n).direction&&(i+=Nv(t.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:o}}(sy(e));else if(iy(t))n=function(e,t){const r=Dy(e,!0,"fixed"===t),n=r.top+e.clientTop,s=r.left+e.clientLeft,a=oy(e)?Py(e):jv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:s*a.x,y:n*a.y}}(t,r);else{const r=Ry(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Zv(n)}function Oy(e,t){const r=Ey(e);return!(r===t||!iy(r)||wy(r))&&("fixed"===Sy(r).position||Oy(r,t))}function zy(e,t,r){const n=oy(t),s=sy(t),a="fixed"===r,i=Dy(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const c=jv(0);function l(){c.x=Iy(s)}if(n||!n&&!a)if(("body"!==ry(t)||uy(s))&&(o=ky(t)),n){const e=Dy(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else s&&l();a&&!n&&s&&l();const u=!s||n||a?jv(0):Uy(s,o);return{x:i.left+o.scrollLeft-c.x-u.x,y:i.top+o.scrollTop-c.y-u.y,width:i.width,height:i.height}}function Fy(e){return"static"===Sy(e).position}function Wy(e,t){if(!oy(e)||"fixed"===Sy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sy(e)===r&&(r=r.ownerDocument.body),r}function By(e,t){const r=ny(e);if(hy(e))return r;if(!oy(e)){let t=Ey(e);for(;t&&!wy(t);){if(iy(t)&&!Fy(t))return t;t=Ey(t)}return r}let n=Wy(e,t);for(;n&&py(n)&&Fy(n);)n=Wy(n,t);return n&&wy(n)&&Fy(n)&&!vy(n)?r:n||function(e){let t=Ey(e);for(;oy(t)&&!wy(t);){if(vy(t))return t;if(hy(t))return null;t=Ey(t)}return null}(e)||r}const Vy={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const a="fixed"===s,i=sy(n),o=!!t&&hy(t.floating);if(n===i||o&&a)return r;let c={scrollLeft:0,scrollTop:0},l=jv(1);const u=jv(0),d=oy(n);if((d||!d&&!a)&&(("body"!==ry(n)||uy(i))&&(c=ky(n)),oy(n))){const e=Dy(n);l=Py(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||a?jv(0):Uy(i,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:sy,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[..."clippingAncestors"===r?hy(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Ny(e,[],!1).filter(e=>iy(e)&&"body"!==ry(e)),s=null;const a="fixed"===Sy(e).position;let i=a?Ey(e):e;for(;iy(i)&&!wy(i);){const t=Sy(i),r=vy(i);r||"fixed"!==t.position||(s=null),(a?!r&&!s:!r&&"static"===t.position&&s&&My.has(s.position)||uy(i)&&!r&&Oy(e,i))?n=n.filter(e=>e!==i):s=t,i=Ey(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=a[0],o=a.reduce((e,r)=>{const n=Ly(t,r,s);return e.top=Nv(n.top,e.top),e.right=Cv(n.right,e.right),e.bottom=Cv(n.bottom,e.bottom),e.left=Nv(n.left,e.left),e},Ly(t,i,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:By,getElementRects:async function(e){const t=this.getOffsetParent||By,r=this.getDimensions,n=await r(e.floating);return{reference:zy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=_y(e);return{width:t,height:r}},getScale:Py,isElement:iy,isRTL:function(e){return"rtl"===Sy(e).direction}};function Hy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gy(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=jy(e),u=s||a?[...l?Ny(l):[],...Ny(t)]:[];u.forEach(e=>{s&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=l&&o?function(e,t){let r,n=null;const s=sy(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),a();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-_v(d)+"px "+-_v(s.clientWidth-(u+p))+"px "+-_v(s.clientHeight-(d+m))+"px "+-_v(u)+"px",threshold:Nv(0,Cv(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Hy(l,e.getBoundingClientRect())||i(),f=!1}try{n=new IntersectionObserver(g,{...h,root:s.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),a}(l,r):null;let p,m=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),l&&!c&&h.observe(l),h.observe(t));let f=c?Dy(e):null;return c&&function t(){const n=Dy(e);f&&!Hy(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{s&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const $y=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:a,placement:i,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:s}=e,a=await(null==n.isRTL?void 0:n.isRTL(s.floating)),i=Iv(r),o=Uv(r),c="y"===zv(r),l=ey.has(i)?-1:1,u=a&&c?-1:1,d=Dv(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}(t,e);return i===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Ky=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Dv(e,t),u={x:r,y:n},d=await a.detectOverflow(t,l),p=zv(Iv(s)),m=Mv(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=Rv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=Rv(f+d["y"===p?"top":"left"],f,f-d[e])}const g=c.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:i,[p]:o}}}}}},qy=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=Dv(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const b=Iv(s),v=zv(o),y=Iv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[Kv(o)]:function(e){const t=Kv(e);return[Wv(e),t,Wv(t)]}(o)),S="none"!==h;!p&&S&&w.push(...$v(o,f,h,x));const k=[o,...w],E=await c.detectOverflow(t,g),C=[];let N=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&C.push(E[b]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Uv(e),s=Fv(e),a=Lv(s);let i="x"===s?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Kv(i)),[i,Kv(i)]}(s,i,x);C.push(E[e[0]],E[e[1]])}if(N=[...N,{placement:s,overflows:C}],!C.every(e=>e<=0)){var A,_;const e=((null==(A=a.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==zv(t))||N.every(e=>zv(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let r=null==(_=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:_.placement;if(!r)switch(m){case"bestFit":{var j;const e=null==(j=N.filter(e=>{if(S){const t=zv(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(r=e);break}case"initialPlacement":r=o}if(s!==r)return{reset:{placement:r}}}return{}}}},Zy=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:a,platform:i,elements:o}=t,{apply:c=()=>{},...l}=Dv(e,t),u=await i.detectOverflow(t,l),d=Iv(s),p=Uv(s),m="y"===zv(s),{width:h,height:f}=a.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,g="end"===p?"top":"bottom");const v=f-u.top-u.bottom,y=h-u.left-u.right,x=Cv(f-u[g],v),w=Cv(h-u[b],y),S=!t.middlewareData.shift;let k=x,E=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=Nv(u.left,0),t=Nv(u.right,0),r=Nv(u.top,0),n=Nv(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:Nv(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:Nv(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const C=await i.getDimensions(o.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},Jy=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...a}=Dv(e,t);switch(s){case"referenceHidden":{const e=Xv(await n.detectOverflow(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Qv(e)}}}case"escaped":{const e=Xv(await n.detectOverflow(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Qv(e)}}}default:return{}}}}},Yy=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:a,platform:i,elements:o,middlewareData:c}=t,{element:l,padding:u=0}=Dv(e,t)||{};if(null==l)return{};const d=qv(u),p={x:r,y:n},m=Fv(s),h=Lv(m),f=await i.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],w=p[m]-a.reference[m],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=o.floating[y]||a.floating[h]);const E=x/2-w/2,C=k/2-f[h]/2-1,N=Cv(d[b],C),A=Cv(d[v],C),_=N,j=k-f[h]-A,P=k/2-f[h]/2+E,T=Rv(_,P,j),R=!c.arrow&&null!=Uv(s)&&P!==T&&a.reference[h]/2-(P<_?N:A)-f[h]/2<0,D=R?P<_?P-_:P-j:0;return{[m]:p[m]+D,data:{[m]:T,centerOffset:P-T-D,...R&&{alignmentOffset:D}},reset:R}}}),Xy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=Dv(e,t),u={x:r,y:n},d=zv(s),p=Mv(d);let m=u[p],h=u[d];const f=Dv(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+g.mainAxis,r=a.reference[p]+a.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=ey.has(Iv(s)),r=a.reference[d]-a.floating[e]+(t&&(null==(b=i.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[d]:h}}}},Qy=(e,t,r)=>{const n=new Map,s={platform:Vy,...r},a={...s.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,o=a.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Jv(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:a,fn:g}=o[r],{x:b,y:v,data:y,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:Yv},elements:{reference:e,floating:t}});u=null!=b?b:u,d=null!=v?v:d,m={...m,[a]:{...m[a],...y}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:s}):x.rects),({x:u,y:d}=Jv(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:s,middlewareData:m}})(e,t,{...s,platform:a})};var ex="undefined"!=typeof document?t.useLayoutEffect:function(){};function tx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!tx(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;0!==n--;){const r=s[n];if(("_owner"!==r||!e.$$typeof)&&!tx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function rx(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nx(e,t){const r=rx(e);return Math.round(t*r)/r}function sx(e){const t=s.useRef(e);return ex(()=>{t.current=e}),t}const ax=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(s=r,{}.hasOwnProperty.call(s,"current"))?null!=r.current?Yy({element:r.current,padding:n}).fn(t):{}:r?Yy({element:r,padding:n}).fn(t):{};var s}}),ix=(e,t)=>({...$y(e),options:[e,t]}),ox=(e,t)=>({...Ky(e),options:[e,t]}),cx=(e,t)=>({...Xy(e),options:[e,t]}),lx=(e,t)=>({...qy(e),options:[e,t]}),ux=(e,t)=>({...Zy(e),options:[e,t]}),dx=(e,t)=>({...Jy(e),options:[e,t]}),px=(e,t)=>({...ax(e),options:[e,t]});var mx=s.forwardRef((t,r)=>{const{children:n,width:s=10,height:a=5,...i}=t;return e.jsx(Ga.svg,{...i,ref:r,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});mx.displayName="Arrow";var hx=mx,fx="Popper",[gx,bx]=Ia(fx),[vx,yx]=gx(fx),xx=t=>{const{__scopePopper:r,children:n}=t,[a,i]=s.useState(null);return e.jsx(vx,{scope:r,anchor:a,onAnchorChange:i,children:n})};xx.displayName=fx;var wx="PopperAnchor",Sx=s.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:a,...i}=t,o=yx(wx,n),c=s.useRef(null),l=ya(r,c),u=s.useRef(null);return s.useEffect(()=>{const e=u.current;u.current=a?.current||c.current,e!==u.current&&o.onAnchorChange(u.current)}),a?null:e.jsx(Ga.div,{...i,ref:l})});Sx.displayName=wx;var kx="PopperContent",[Ex,Cx]=gx(kx),Nx=s.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=yx(kx,n),[x,w]=s.useState(null),S=ya(r,e=>w(e)),[k,E]=s.useState(null),C=vl(k),N=C?.width??0,A=C?.height??0,_=i+("center"!==c?"-"+c:""),j="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(p)?p:[p],T=P.length>0,R={padding:j,boundary:P.filter(Px),altBoundary:T},{refs:D,floatingStyles:I,placement:U,isPositioned:M,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,m]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=s.useState(n);tx(h,n)||f(n);const[g,b]=s.useState(null),[v,y]=s.useState(null),x=s.useCallback(e=>{e!==E.current&&(E.current=e,b(e))},[]),w=s.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),S=o||g,k=c||v,E=s.useRef(null),C=s.useRef(null),N=s.useRef(p),A=null!=u,_=sx(u),j=sx(i),P=sx(d),T=s.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};j.current&&(e.platform=j.current),Qy(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!tx(N.current,t)&&(N.current=t,a.flushSync(()=>{m(t)}))})},[h,t,r,j,P]);ex(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=s.useRef(!1);ex(()=>(R.current=!0,()=>{R.current=!1}),[]),ex(()=>{if(S&&(E.current=S),k&&(C.current=k),S&&k){if(_.current)return _.current(S,k,T);T()}},[S,k,T,_,A]);const D=s.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:w}),[x,w]),I=s.useMemo(()=>({reference:S,floating:k}),[S,k]),U=s.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=nx(I.floating,p.x),n=nx(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...rx(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:T,refs:D,elements:I,floatingStyles:U}),[p,T,D,I,U])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>Gy(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[ix({mainAxis:o+A,alignmentAxis:l}),d&&ox({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?cx():void 0,...R}),d&&lx({...R}),ux({...R,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:s,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${s}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),k&&px({element:k,padding:u}),Tx({arrowWidth:N,arrowHeight:A}),f&&dx({strategy:"referenceHidden",...R})]}),[O,z]=Rx(U),F=$a(b);Ma(()=>{M&&F?.()},[M,F]);const W=L.arrow?.x,B=L.arrow?.y,V=0!==L.arrow?.centerOffset,[H,G]=s.useState();return Ma(()=>{x&&G(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:M?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Ex,{scope:n,placedSide:O,onArrowChange:E,arrowX:W,arrowY:B,shouldHideArrow:V,children:e.jsx(Ga.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});Nx.displayName=kx;var Ax="PopperArrow",_x={top:"bottom",right:"left",bottom:"top",left:"right"},jx=s.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,a=Cx(Ax,n),i=_x[a.placedSide];return e.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:e.jsx(hx,{...s,ref:r,style:{...s.style,display:"block"}})})});function Px(e){return null!==e}jx.displayName=Ax;var Tx=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:s}=t,a=0!==s.arrow?.centerOffset,i=a?0:e.arrowWidth,o=a?0:e.arrowHeight,[c,l]=Rx(r),u={start:"0%",center:"50%",end:"100%"}[l],d=(s.arrow?.x??0)+i/2,p=(s.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=a?u:`${d}px`,h=-o+"px"):"top"===c?(m=a?u:`${d}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=a?u:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=a?u:`${p}px`),{data:{x:m,y:h}}}});function Rx(e){const[t,r="center"]=e.split("-");return[t,r]}var Dx=xx,Ix=Sx,Ux=Nx,Mx=jx;function Lx(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ox=Symbol("radix.slottable");function zx(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ox}var Fx="Popover",[Wx]=Ia(Fx,[bx]),Bx=bx(),[Vx,Hx]=Wx(Fx),Gx=t=>{const{__scopePopover:r,children:n,open:a,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=Bx(r),u=s.useRef(null),[d,p]=s.useState(!1),[m,h]=Wa({prop:a,defaultProp:i??!1,onChange:o,caller:Fx});return e.jsx(Dx,{...l,children:e.jsx(Vx,{scope:r,contentId:za(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:c,children:n})})};Gx.displayName=Fx;var $x="PopoverAnchor";s.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,i=Hx($x,n),o=Bx(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return s.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Ix,{...o,...a,ref:r})}).displayName=$x;var Kx="PopoverTrigger",qx=s.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,a=Hx(Kx,n),i=Bx(n),o=ya(r,a.triggerRef),c=e.jsx(Ga.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":iw(a.open),...s,ref:o,onClick:Da(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:e.jsx(Ix,{asChild:!0,...i,children:c})});qx.displayName=Kx;var Zx="PopoverPortal",[Jx,Yx]=Wx(Zx,{forceMount:void 0}),Xx=t=>{const{__scopePopover:r,forceMount:n,children:s,container:a}=t,i=Hx(Zx,r);return e.jsx(Jx,{scope:r,forceMount:n,children:e.jsx(pi,{present:n||i.open,children:e.jsx(di,{asChild:!0,container:a,children:s})})})};Xx.displayName=Zx;var Qx="PopoverContent",ew=s.forwardRef((t,r)=>{const n=Yx(Qx,t.__scopePopover),{forceMount:s=n.forceMount,...a}=t,i=Hx(Qx,t.__scopePopover);return e.jsx(pi,{present:s||i.open,children:i.modal?e.jsx(rw,{...a,ref:r}):e.jsx(nw,{...a,ref:r})})});ew.displayName=Qx;var tw=function(t){const r=Lx(t),n=s.forwardRef((t,n)=>{const{children:a,...i}=t,o=s.Children.toArray(a),c=o.find(zx);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}("PopoverContent.RemoveScroll"),rw=s.forwardRef((t,r)=>{const n=Hx(Qx,t.__scopePopover),a=s.useRef(null),i=ya(r,a),o=s.useRef(!1);return s.useEffect(()=>{const e=a.current;if(e)return uo(e)},[]),e.jsx(no,{as:tw,allowPinchZoom:!0,children:e.jsx(sw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Da(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Da(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Da(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),nw=s.forwardRef((t,r)=>{const n=Hx(Qx,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return e.jsx(sw,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||n.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,s=n.triggerRef.current?.contains(r);s&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),sw=s.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=t,m=Hx(Qx,n),h=Bx(n);return fi(),e.jsx(si,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:e.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Ux,{"data-state":iw(m.open),role:"dialog",id:m.contentId,...h,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),aw="PopoverClose";s.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,a=Hx(aw,n);return e.jsx(Ga.button,{type:"button",...s,ref:r,onClick:Da(t.onClick,()=>a.onOpenChange(!1))})}).displayName=aw;function iw(e){return e?"open":"closed"}s.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,a=Bx(n);return e.jsx(Mx,{...a,...s,ref:r})}).displayName="PopoverArrow";var ow=Xx,cw=ew;const lw=Gx,uw=qx,dw=s.forwardRef(({className:t,align:r="center",sideOffset:n=4,...a},i)=>{const{container:o}=s.useContext(dc);return e.jsx(ow,{container:o,children:e.jsx(cw,{ref:i,align:r,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})})});function pw({options:r,value:n,onChange:s,placeholder:a="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,u]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const d=r.find(e=>e.value===o);return e.jsxs(lw,{open:l,onOpenChange:u,children:[e.jsx(uw,{asChild:!0,children:e.jsxs(Ra,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[d?e.jsxs("div",{children:[String(d.label).trim(),d.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:d.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(qs,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(yv,{children:[e.jsx(xv,{placeholder:a}),e.jsx(wv,{children:e.jsx(Sv,{children:r.map(t=>e.jsxs(kv,{className:Se("whitespace-nowrap text-start",{"text-green-500":o===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,c(e),s?.(e),void u(!1);var e},children:[o===t.value&&e.jsx(Ks,{className:Se("me-2 h-4 w-4 text-green-400",o===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}dw.displayName=cw.displayName;const mw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},hw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},fw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=hw[e.code]||"USD",r=mw[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function gw({value:t,onChange:r}){const{t:n}=sn(),s=fw.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(pw,{options:s,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const bw=fw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),vw=Array.from(new Set(bw.map(e=>e.value))).map(e=>bw.find(t=>t.value===e)).filter(e=>void 0!==e);function yw({value:t,onChange:r}){const{t:n}=sn(),s=vw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(pw,{options:s,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let xw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];xw=xw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),xw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const ww=xw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Sw({value:t,onChange:r}){const{t:n}=sn(),s=ww.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(pw,{options:s,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const kw=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const s=r[n],a=t.text;let i=a.substring(a.indexOf("(")+1,a.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:s,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${s}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Ew({value:t,onChange:r}){const{t:n}=sn(),s=kw.map(e=>({value:e.value,label:e.text}));return e.jsx(pw,{options:s,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const Cw=({workspace:r})=>{const{t:n}=sn(),{updateUserProfile:s,getProfile:a}=js(),[i,o]=t.useState(!1),[c,l]=t.useState(),[u,d]=t.useState(0),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=nd({resolver:dh(uf({name:Mh().min(2,{message:n("profile.nameMinLength")}),country:Mh().optional(),timezone:Mh().optional(),language:Mh().optional(),currency:Mh().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return t.useEffect(()=>{a().then(e=>{l(e),f.setValue("name",e.name),f.setValue("country",e.country),f.setValue("timezone",e.timezone),f.setValue("language",e.language),f.setValue("currency",e.currency)})},[u]),c?e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Lf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await s({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),m(n("profile.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),e.jsx(Kf,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(zf,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Bf,{children:[e.jsx(Vf,{children:n("profile.name")}),e.jsx(Hf,{children:e.jsx(Kf,{...t})}),e.jsx($f,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.language")}),e.jsx(Sw,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.country")}),e.jsx(gw,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.currency")}),e.jsx(yw,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.timezone")}),e.jsx(Ew,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ra,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ra,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:i,children:n("profile.reset")})]})]})})}),c?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(fl,{})},Nw="bb";function Aw(e,t){let r;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");r=new URL(e),r.search=""}catch{r=new URL("https://localhost")}return r.searchParams.set(Nw,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function _w(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Nw);if(!e)return null;const t=function(e){const t={};if(!e)return t;const r=e.split(",");for(const e of r){const r=e.indexOf(":");if(-1===r)continue;const n=decodeURIComponent(e.slice(0,r)),s=decodeURIComponent(e.slice(r+1));n&&(t[n]=s)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function jw(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Nw)&&(e.searchParams.delete(Nw),window.history.replaceState({},"",e.toString()))}catch{}}function Pw(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize}}:null}function Tw(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:s,locale:a="en"}=r,{included:i,overage:o}=e;if(null==o)return{included:i,hasOverage:!1,price:"",unit:""};const c=n?o/100:o,l=(s??"").trim().toUpperCase();let u;if(l&&"number"==typeof c&&Number.isFinite(c))try{u=new Intl.NumberFormat(a,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${r.currencySymbol??Tf(s??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??Tf(s??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(a)} ${t}`:t||""}}const Rw="personal",Dw=(e,t,r="en-US")=>{const n=(t??"").trim();return n?new Intl.NumberFormat(r,{style:"currency",currency:n.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},Iw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",Uw=e=>{switch(e){case qn:return"bg-green-100 text-green-800";case Kn:return"bg-yellow-100 text-yellow-800";case $n:return"bg-gray-100 text-gray-800";case Zn:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Mw=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:s=20})=>{const{t:a,formattingLocale:i}=sn(),{invoices:o,loading:c,error:l,refetch:u}=Rn(t,s),d=o.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:a("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:a("invoices.description")})]}),e.jsx(Ra,{variant:"ghost",size:"sm",progress:c,onClick:u,disabled:c,children:a("settings.common.refreshAction",{loading:String(c)})})]}),l&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:l})]}),e.jsx(Ra,{variant:"outline",size:"sm",onClick:u,disabled:c,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(c)})})]}),c&&!d?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(fl,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case $n:case Kn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case qn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Zn:case Jn:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${Uw(t.status)}`,children:a(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:Dw(t.amount_due,t.currency,i)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:Iw(t.created,i)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:a("invoices.paidAmount",{amount:Dw(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ra,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:r.color,children:[a(r.textKey),e.jsx(Ys,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ra,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Js,{className:"h-3 w-3 me-1.5"}),a("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(Xs,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:a(r?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!r&&n&&e.jsx(Ra,{size:"sm",className:"mt-4",onClick:n,children:a("subscription.viewPricingPlans")})]})]})},Lw=t.lazy(()=>Promise.resolve().then(function(){return lC}).then(e=>({default:e.default}))),Ow=(e,t)=>{if(!t)return"";try{const r=new Date(t);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(r)}catch{return""}},zw=({workspace:r})=>{const n=r._id?.toString(),{t:s,formattingLocale:a,fmtNum:i,fmtCents:o}=sn(),{can:c}=ml(),{settings:l}=Sn(),u=c(cl.WORKSPACE_BILLING_VIEW),d=c(cl.WORKSPACE_BILLING_MANAGE),p=l?.workspace?.mode===Rw,{subscription:m,loading:h,error:f,updateSubscription:g,refetch:b}=Tn(n),{createCheckoutSession:v}=jn(n),{cancelSubscription:y,loading:x}=In(n),{resumeSubscription:w,loading:S}=Un(n),{openBillingPortal:k,loading:E}=Dn(n),{versions:C,loading:N,error:A,refetch:_}=_n(n),j=h||N,P=f||A,{currentVersion:T,latestVersion:R,isDeprecated:D,plansToShow:I}=t.useMemo(()=>{const e=C?.currentVersion,t=C?.availableVersions||[],r=null!=m?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const s=!!(r&&n&&e)&&n.version>e.version;return{currentVersion:e,latestVersion:n,hasNewerVersion:s,isDeprecated:s&&r,plansToShow:n?.plans&&n.plans.length>0?n.plans:[]}},[C,m?.subscription]),[U,M]=t.useState(!1),[L,O]=t.useState(null),[z,F]=t.useState(null),W=t.useRef(null),[B,V]=t.useState(!1),[H,G]=t.useState(!1);t.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]);const[$,K]=t.useState(!1),[q,Z]=t.useState("subscription"),J=async()=>{await Promise.all([b(),_()])},Y=t.useMemo(()=>os(m?.subscription?.stripePriceId,I??[]),[m?.subscription?.stripePriceId,I]);if(j&&!m&&!C)return e.jsx(fl,{});if(!u)return null;const X=m?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[P&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:P}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:s("subscription.errorLoadingDescription")})]}),e.jsx(Ra,{variant:"outline",size:"sm",onClick:J,disabled:j,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(j)})})]}),L&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:L})]}),e.jsx(Ra,{variant:"outline",size:"sm",onClick:()=>O(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.dismiss")})]}),z&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:z})]}),e.jsx(Ra,{variant:"outline",size:"sm",onClick:()=>F(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:s("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>Z("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===q?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:s("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>Z("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===q?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:s("subscription.invoicesTab")})]})}),"subscription"===q&&e.jsxs(e.Fragment,{children:[j&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(ea,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:s("settings.common.loading")})]}),D&&m?.subscription&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ha,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:s("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",T?.version||"?"," → v",R?.version||"?"]})]})]}),e.jsx(Ra,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>V(!0),children:s("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:s("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=m?.subscription?.subscriptionStatus===Vn,r=m?.subscription?.cancelAtPeriodEnd;return r||x?null:t&&I&&I.length>0?e.jsx(Ra,{size:"sm",onClick:()=>V(!0),children:s("subscription.viewPricingPlans")}):m?.subscription&&!t&&d?e.jsx(Ra,{variant:"outline",size:"sm",onClick:()=>V(!0),children:s("subscription.changePlanButton")}):!m?.subscription&&I&&I.length>0?e.jsx(Ra,{size:"sm",onClick:()=>V(!0),children:s("subscription.viewPricingPlans")}):null})(),e.jsx(Ra,{variant:"ghost",size:"sm",progress:j,onClick:J,disabled:j||U,children:s("settings.common.refreshAction",{loading:String(j)})})]})]}),m?.subscription?(()=>{const t=os(m.subscription.stripePriceId,I??[]),n=t?.interval??null,c=t?.currency??m.plan?.currency??r?.billingCurrency??"",l=n&&m.planVersion?ss(m.planVersion,c,n):null,u=c,h=m.planVersion?cs(m.planVersion,c):null,f=h&&n?ls(m.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=h?.includedSeats??0,v=Math.max(0,g-b),y=null!=l?0===l?s("subscription.free"):o(l,u):null,w=n===Fn.Monthly?s("subscription.billingInterval.perMonth"):n===Fn.Quarterly?s("subscription.billingInterval.perQuarter"):n===Fn.Yearly?s("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(D?"border-amber-300":"border-gray-200"),children:[m.subscription.subscriptionStatus===Bn&&(()=>{const t=m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd,r=t?new Date(t):null,n=r&&!isNaN(r.getTime())?r:null,a=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):null,i=null!==a&&a<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==a&&a<=0?s("subscription.trialEnded"):null!==a?s("subscription.trialEndsIn",{days:a}):s("subscription.onTrial")," ",s("subscription.upgradeToKeepAccess")]}),e.jsx(Ra,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>V(!0),children:s("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(D?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:m.plan?.name||s("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(m.subscription.subscriptionStatus===Wn?m.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":m.subscription.subscriptionStatus===Bn?"bg-blue-100 text-blue-800":m.subscription.subscriptionStatus===Vn?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[m.subscription.subscriptionStatus===Wn&&(m.subscription.cancelAtPeriodEnd?s("subscription.status.canceling"):s("subscription.status.active")),m.subscription.subscriptionStatus===Bn&&s("subscription.status.trial"),m.subscription.subscriptionStatus===Vn&&s("subscription.status.canceled"),m.subscription.subscriptionStatus===Hn&&s("subscription.status.pastDue")]}),m.subscription.subscriptionStatus===Bn&&Ow(a,m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Ow(a,m.subscription.trialEnd||m.subscription.stripeCurrentPeriodEnd),")"]}),D&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[e.jsx(ha,{className:"h-3 w-3"}),s("subscription.status.deprecated")]})]}),m.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:m.plan.description}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:y||s("invoices.na")}),y&&y!==s("subscription.free")&&w&&e.jsx("span",{className:"text-sm text-gray-500",children:w})]}),h&&f&&f>0&&!p&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:s("subscription.perSeatDisplay",{price:o(f,u),interval:w})}),!p&&h&&f&&f>0&&v>0&&y&&y!==s("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:s("subscription.estTotalDisplay",{total:o(l+f*v,u),interval:w,count:v})})]}),(m.subscription.subscriptionStatus===Wn||m.subscription.subscriptionStatus===Bn)&&!m.subscription.cancelAtPeriodEnd&&Ow(a,m.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Gs,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:s("subscription.nextBillingDisplay",{date:Ow(a,m.subscription.stripeCurrentPeriodEnd)??""})})]})]}),D&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",T?.version||s("invoices.na")]}),(m.subscription.subscriptionStatus===Wn||m.subscription.subscriptionStatus===Bn||m.subscription.subscriptionStatus===Hn)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[m.subscription&&d&&e.jsx(Ra,{variant:"outline",size:"sm",onClick:()=>k(),disabled:E,progress:E,children:s(E?"subscription.openingPortal":"subscription.managePayment")}),d&&(m.subscription.subscriptionStatus===Wn||m.subscription.subscriptionStatus===Bn)&&e.jsx(e.Fragment,{children:m.subscription.subscriptionStatus===Wn&&m.subscription.cancelAtPeriodEnd?e.jsx(Ra,{variant:"outline",size:"sm",onClick:()=>K(!0),disabled:U||x||S,progress:S,children:s("subscription.resumeTitle")}):e.jsx(Ra,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>G(!0),disabled:U||x||S,progress:x||U,children:x||U?s("subscription.canceling"):m.subscription.subscriptionStatus===Bn?s("subscription.cancelTrial"):s("subscription.cancelTitle")})})]})]}),m.subscription.subscriptionStatus===Hn&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ha,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:s("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:s("subscription.paymentPastDueDescription")}),e.jsx(Ra,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>Z("invoices"),children:s("subscription.viewInvoices")})]})]})}),m.subscription.subscriptionStatus===Hn&&m.subscription.dunningState&&m.subscription.dunningState!==es&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ha,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:m.subscription.dunningState===ts?s("subscription.dunningFinal"):m.subscription.dunningState===rs?s("subscription.dunningSuspended"):s("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:m.subscription.dunningState===rs?s("subscription.dunningSuspendedDescription"):s("subscription.dunningRecoveryDescription")})]})]})}),m.subscription.subscriptionStatus===Gn&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Gs,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:s("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:s("subscription.subscriptionPausedDescription")})]})]})}),m.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Gs,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:s("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Ow(a,m.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[s("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Ow(a,m.subscription.stripeCurrentPeriodEnd)}),"."]}):s("subscription.cancelEndFallback")})]})]})}),m.planVersion&&(()=>{const t=((e,t,r=Fn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],s=[],a=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===Yn){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===Xn){const t=e.limits?.[o]??0;s.push({item:i,value:t})}else if(i.type===Qn){const n=t&&e.pricingVariants?.length?is(e,t,o,r):Pw(e.quotas?.[o],r);null!=n&&a.push({item:i,value:n})}}),{features:n,limits:s,quotas:a}})(m.planVersion,c,n??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:r})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(r?"text-green-500":"text-gray-300"),children:r?"✓":"✕"}),e.jsx("span",{className:r?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:r})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:r})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:r})=>{const n=Tw(r,t.name.toLowerCase(),{currency:c,locale:a}),i=n?n.hasOverage?s("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):s("quota.includedOnly",{count:n.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:i})]})},t._id)})})]}),h&&!p&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:i(g)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:i(b)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[i(v)," ",s("subscription.seats.extra")]})]}),f&&f>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[o(f,c),w]})]}),h.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:i(h.maxSeats)})]})]})]})]})}):null})()]})})():r.pendingOnboarding?e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Zs,{className:"h-12 w-12 mx-auto mb-3 text-blue-400"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:s("subscription.startFreeTrial")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s("subscription.startTrialDescription")})]}),e.jsx(Ra,{size:"sm",progress:U,onClick:async()=>{try{M(!0);const e=await v({planVersionId:r.pendingOnboarding?.planVersionId??""});e&&"checkoutUrl"in e&&e.checkoutUrl&&Is(e.checkoutUrl)}catch(e){}finally{M(!1)}},children:s("subscription.startFreeTrial")}),I&&I.length>0&&e.jsx(Ra,{variant:"ghost",size:"sm",className:"ms-2",onClick:()=>V(!0),children:s("subscription.viewAllPlans")})]}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Zs,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:s("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s("subscription.noSubscriptionDescription")})]}),I&&I.length>0&&e.jsx(Ra,{size:"sm",onClick:()=>V(!0),children:s("subscription.viewPricingPlans")})]})]}),!C&&!j&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:s("subscription.errorLoading")}),P&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",P]}),!P&&e.jsx("p",{className:"text-sm mt-2",children:s("subscription.noPlansAvailable")})]}),e.jsx(Ra,{variant:"outline",size:"sm",progress:j,onClick:J,disabled:j,className:"mt-4",children:s("settings.common.refreshAction",{loading:String(j)})})]})]}),"invoices"===q&&e.jsxs(e.Fragment,{children:[j&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(ea,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:s("settings.common.loading")})]}),e.jsx(Mw,{workspaceId:n,hasActiveSubscription:null!==m?.subscription,onViewPricingPlans:()=>Z("subscription"),limit:20})]}),I&&I.length>0&&e.jsx(t.Suspense,{fallback:B?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ea,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s("settings.common.loading")})]})}):null,children:e.jsx(Lw,{open:B,onOpenChange:V,planVersions:I,currentPlanVersionId:X||null,currentStripePriceId:m?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Fn.Monthly,a)=>{if(!n)return;const i=I?.find(t=>t._id===e),o=a??Y?.currency??m?.plan?.currency??r?.billingCurrency??"",c=i?function(e,t,r){const n=ns(e,t);if(!n?.stripePrices)return null;const s=r===Fn.Monthly?"monthlyPriceId":r===Fn.Yearly?"yearlyPriceId":"quarterlyPriceId",a=r===Fn.Monthly?"monthly":r===Fn.Yearly?"yearly":void 0;return n.stripePrices[s]??(a?n.stripePrices[a]:void 0)??null}(i,o,t):null,l=m?.subscription?.stripePriceId;if(!c||!l||c!==l){M(!0),O(null),F(null);try{const{successUrl:r,cancelUrl:a}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Aw({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:Aw({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(n);let i;const c=m?.subscription?.subscriptionStatus===Vn;if(i=m?.subscription&&!c?await g(e,{billingInterval:t,successUrl:r,cancelUrl:a}):await v({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:a}),i&&"checkoutUrl"in i&&i.checkoutUrl)return void Is(i.checkoutUrl);F(s("subscription.updateSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorProcessing");O(t)}finally{M(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{O(null),F(null)},5e3)}}},loading:U||j})}),e.jsx(qc,{open:$,onOpenChange:K,children:e.jsxs(Xc,{children:[e.jsxs(Qc,{children:[e.jsx(tl,{children:s("subscription.resumeTitle")}),e.jsx(rl,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:s("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ha,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[s("subscription.resumeChargeDate")," ",m?.subscription?.stripeCurrentPeriodEnd&&Ow(a,m.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Ow(a,m.subscription.stripeCurrentPeriodEnd)}):s("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:s("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:s("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs(el,{children:[e.jsx(sl,{disabled:S,children:s("subscription.resumeKeep")}),e.jsx(nl,{onClick:async()=>{if(n){K(!1),M(!0),O(null),F(null);try{await w(),F(s("subscription.resumeSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorResuming");O(t)}finally{M(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{O(null),F(null)},5e3)}}},disabled:S,children:s(S?"subscription.resuming":"subscription.resumeButton")})]})]})}),e.jsx(qc,{open:H,onOpenChange:G,children:e.jsxs(Xc,{children:[e.jsxs(Qc,{children:[e.jsx(tl,{children:s("subscription.cancelTitle")}),e.jsx(rl,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:s("subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[s("subscription.retainAccess")," ",m?.subscription?.stripeCurrentPeriodEnd&&Ow(a,m.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Ow(a,m.subscription.stripeCurrentPeriodEnd)}):s("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:s("subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:s("subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(el,{children:[e.jsx(sl,{disabled:x,children:s("subscription.cancelKeep")}),e.jsx(nl,{onClick:async()=>{if(n){G(!1),M(!0),O(null),F(null);try{await y(),F(s("subscription.cancelSuccess")),await J()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorCanceling");O(t)}finally{M(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{O(null),F(null)},5e3)}}},disabled:x,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:s(x?"subscription.canceling":"subscription.cancelButton")})]})]})})]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:s("subscription.invalidWorkspace")})})};function Fw(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Ww(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function Bw(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const Vw=()=>{const{quotas:r,loading:n,error:s,refetch:a}=Rs(),{t:i,formattingLocale:o,fmtNum:c}=sn(),{can:l}=ml(),u=(e,t)=>Ww(e,t,o),{response:d}=zn(),[p,m]=t.useState(!1),h=t.useMemo(()=>{const e={};if(!d?.planVersion||!d?.subscription)return e;const t=d.planVersion,n=d.subscription,s=n.billingInterval??"monthly",a=n.plan?.currency??"usd",i=Tf(a);if(!r)return e;for(const n of Object.keys(r)){const o=as(t,a,n,s);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[s],u=l?.unitSize??1,d=r[n].overage,p=(u>1?Math.ceil(d/u):d)*o/100;e[n]={overageCents:o,unitSize:u,currency:a,currencySymbol:i,estimatedCost:p}}return e},[d,r]),f=t.useMemo(()=>{const e=d?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e,t="en-US"){try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric"}).format(r)}catch{return""}}(e,o);return t?{endDate:t,daysRemaining:Bw(e)}:null},[d,o]),g=async()=>{m(!0);try{await a()}finally{m(!1)}};if(n&&!r)return e.jsx(fl,{});if(!l(cl.WORKSPACE_USAGE_VIEW))return null;if(s)return e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:s})]}),e.jsx(Ra,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx($s,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i("usage.noDataHint")})]});const v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=Object.values(h).reduce((e,t)=>e+t.estimatedCost,0),w=Object.values(h)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.description")}),e.jsxs(Ra,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(sa,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(Gs,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" (",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",i("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(b.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.inOverage")}),e.jsx("p",{className:Se("text-lg sm:text-xl font-semibold mt-1",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:u(x,w)})]})]}),v>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ha,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:i("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:i("usage.overageWarning",{count:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:u(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.map(([t,r])=>{const n=(s=r.consumed,(a=r.included)<=0?s>0?100:0:Math.min(s/a*100,100));var s,a;const i=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),o=h[t];return e.jsx(Hw,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function Hw({slug:t,quota:r,percent:n,colors:s,pricing:a}){const{t:i,formattingLocale:o}=sn(),c=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,o),l=(e,t)=>Ww(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:Fw(t)}),r.hasOverage&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",s.badge,s.badgeText),children:i("usage.overage")}),!r.hasOverage&&n>=90&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",s.badge,s.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(r.consumed)," / ",c(r.included)]})]}),e.jsx("div",{className:Se("h-2 rounded-full w-full",s.bg),children:e.jsx("div",{className:Se("h-2 rounded-full transition-all duration-500",s.bar),style:{width:`${n}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(n)})}),e.jsx("span",{children:r.available>0?i("usage.availableRemaining",{count:c(r.available)}):r.hasOverage?i("usage.overLimitCount",{count:c(r.overage)}):i("usage.fullyUsed")})]}),r.hasOverage&&a&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(r.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(a.overageCents/100,a.currencySymbol),unitSize:a.unitSize})})]}),a.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:Math.ceil(r.overage/a.unitSize).toLocaleString(o)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(a.estimatedCost,a.currencySymbol)})]})]}),!r.hasOverage&&a&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(a.overageCents/100,a.currencySymbol),unitSize:a.unitSize})})})]})}function Gw(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{const t=a(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(a.ref=t?va(t,e):e),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $w=Symbol("radix.slottable");function Kw(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$w}var qw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});s.forwardRef((t,r)=>e.jsx(Ga.span,{...t,ref:r,style:{...qw,...t.style}})).displayName="VisuallyHidden";var Zw=[" ","Enter","ArrowUp","ArrowDown"],Jw=[" ","Enter"],Yw="Select",[Xw,Qw,eS]=Xf(Yw),[tS]=Ia(Yw,[eS,bx]),rS=bx(),[nS,sS]=tS(Yw),[aS,iS]=tS(Yw),oS=t=>{const{__scopeSelect:r,children:n,open:a,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=rS(r),[v,y]=s.useState(null),[x,w]=s.useState(null),[S,k]=s.useState(!1),E=eg(d),[C,N]=Wa({prop:a,defaultProp:i??!1,onChange:o,caller:Yw}),[A,_]=Wa({prop:c,defaultProp:l,onChange:u,caller:Yw}),j=s.useRef(null),P=!v||(g||!!v.closest("form")),[T,R]=s.useState(new Set),D=Array.from(T).map(e=>e.props.value).join(";");return e.jsx(Dx,{...b,children:e.jsxs(nS,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:za(),value:A,onValueChange:_,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[e.jsx(Xw.Provider,{scope:r,children:e.jsx(aS,{scope:t.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?e.jsxs(GS,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:A,onChange:e=>_(e.target.value),disabled:h,form:g,children:[void 0===A?e.jsx("option",{value:""}):null,Array.from(T)]},D):null]})})};oS.displayName=Yw;var cS="SelectTrigger",lS=s.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:a=!1,...i}=t,o=rS(n),c=sS(cS,n),l=c.disabled||a,u=ya(r,c.onTriggerChange),d=Qw(n),p=s.useRef("touch"),[m,h,f]=KS(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=qS(t,e,r);void 0!==n&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),f()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Ix,{asChild:!0,...o,children:e.jsx(Ga.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":$S(c.value)?"":void 0,...i,ref:u,onClick:Da(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Da(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Da(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Zw.includes(e.key)&&(g(),e.preventDefault())})})})});lS.displayName=cS;var uS="SelectValue",dS=s.forwardRef((t,r)=>{const{__scopeSelect:n,className:s,style:a,children:i,placeholder:o="",...c}=t,l=sS(uS,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=ya(r,l.onValueNodeChange);return Ma(()=>{u(d)},[u,d]),e.jsx(Ga.span,{...c,ref:p,style:{pointerEvents:"none"},children:$S(l.value)?e.jsx(e.Fragment,{children:o}):i})});dS.displayName=uS;var pS=s.forwardRef((t,r)=>{const{__scopeSelect:n,children:s,...a}=t;return e.jsx(Ga.span,{"aria-hidden":!0,...a,ref:r,children:s||"▼"})});pS.displayName="SelectIcon";var mS=t=>e.jsx(di,{asChild:!0,...t});mS.displayName="SelectPortal";var hS="SelectContent",fS=s.forwardRef((t,r)=>{const n=sS(hS,t.__scopeSelect),[i,o]=s.useState();if(Ma(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?a.createPortal(e.jsx(bS,{scope:t.__scopeSelect,children:e.jsx(Xw.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(xS,{...t,ref:r})});fS.displayName=hS;var gS=10,[bS,vS]=tS(hS),yS=function(t){const r=Gw(t),n=s.forwardRef((t,n)=>{const{children:a,...i}=t,o=s.Children.toArray(a),c=o.find(Kw);if(c){const t=c.props.children,a=o.map(e=>e===c?s.Children.count(t)>1?s.Children.only(null):s.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:s.isValidElement(t)?s.cloneElement(t,void 0,a):null})}return e.jsx(r,{...i,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}("SelectContent.RemoveScroll"),xS=s.forwardRef((t,r)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=t,x=sS(hS,n),[w,S]=s.useState(null),[k,E]=s.useState(null),C=ya(r,e=>S(e)),[N,A]=s.useState(null),[_,j]=s.useState(null),P=Qw(n),[T,R]=s.useState(!1),D=s.useRef(!1);s.useEffect(()=>{if(w)return uo(w)},[w]),fi();const I=s.useCallback(e=>{const[t,...r]=P().map(e=>e.ref.current),[n]=r.slice(-1),s=document.activeElement;for(const r of e){if(r===s)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==s)return}},[P,k]),U=s.useCallback(()=>I([N,w]),[I,N,w]);s.useEffect(()=>{T&&U()},[T,U]);const{onOpenChange:M,triggerPointerDownPosRef:L}=x;s.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,M,L]),s.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[O,z]=KS(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=qS(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=s.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&(A(e),n&&(D.current=!0))},[x.value]),W=s.useCallback(()=>w?.focus(),[w]),B=s.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&j(e)},[x.value]),V="popper"===a?SS:wS,H=V===SS?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(bS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:W,itemTextRefCallback:B,focusSelectedItem:U,selectedItemText:_,position:a,isPositioned:T,searchRef:O,children:e.jsx(no,{as:yS,allowPinchZoom:!0,children:e.jsx(si,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Da(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:e.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Da(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});xS.displayName="SelectContentImpl";var wS=s.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:a,...i}=t,o=sS(hS,n),c=vS(hS,n),[l,u]=s.useState(null),[d,p]=s.useState(null),m=ya(r,e=>p(e)),h=Qw(n),f=s.useRef(!1),g=s.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=c,w=s.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==o.dir){const s=n.left-t.left,a=r.left-s,i=e.left-a,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-gS,d=Gg(a,[gS,Math.max(gS,u-c)]);l.style.minWidth=o+"px",l.style.left=d+"px"}else{const s=t.right-n.right,a=window.innerWidth-r.right-s,i=window.innerWidth-e.right-a,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-gS,d=Gg(a,[gS,Math.max(gS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const s=h(),i=window.innerHeight-2*gS,c=b.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+m+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),C=e.top+e.height/2-gS,N=i-C,A=v.offsetHeight/2,_=p+m+(v.offsetTop+A),j=x-_;if(_<=C){const e=s.length>0&&v===s[s.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-b.offsetTop-b.offsetHeight,r=_+Math.max(N,A+(e?E:0)+t+g);l.style.height=r+"px"}else{const e=s.length>0&&v===s[0].ref.current;l.style.top="0px";const t=Math.max(C,p+b.offsetTop+(e?k:0)+A)+j;l.style.height=t+"px",b.scrollTop=_-C+b.offsetTop}l.style.margin=`${gS}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,d,b,v,y,o.dir,a]);Ma(()=>w(),[w]);const[S,k]=s.useState();Ma(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const E=s.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(kS,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Ga.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});wS.displayName="SelectItemAlignedPosition";var SS=s.forwardRef((t,r)=>{const{__scopeSelect:n,align:s="start",collisionPadding:a=gS,...i}=t,o=rS(n);return e.jsx(Ux,{...o,...i,ref:r,align:s,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SS.displayName="SelectPopperPosition";var[kS,ES]=tS(hS,{}),CS="SelectViewport",NS=s.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:a,...i}=t,o=vS(CS,n),c=ES(CS,n),l=ya(r,o.onViewportChange),u=s.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),e.jsx(Xw.Slot,{scope:n,children:e.jsx(Ga.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Da(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*gS,s=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(s,a);if(i<n){const s=i+e,a=Math.min(n,s),o=s-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});NS.displayName=CS;var AS="SelectGroup",[_S,jS]=tS(AS);s.forwardRef((t,r)=>{const{__scopeSelect:n,...s}=t,a=za();return e.jsx(_S,{scope:n,id:a,children:e.jsx(Ga.div,{role:"group","aria-labelledby":a,...s,ref:r})})}).displayName=AS;var PS="SelectLabel",TS=s.forwardRef((t,r)=>{const{__scopeSelect:n,...s}=t,a=jS(PS,n);return e.jsx(Ga.div,{id:a.id,...s,ref:r})});TS.displayName=PS;var RS="SelectItem",[DS,IS]=tS(RS),US=s.forwardRef((t,r)=>{const{__scopeSelect:n,value:a,disabled:i=!1,textValue:o,...c}=t,l=sS(RS,n),u=vS(RS,n),d=l.value===a,[p,m]=s.useState(o??""),[h,f]=s.useState(!1),g=ya(r,e=>u.itemRefCallback?.(e,a,i)),b=za(),v=s.useRef("touch"),y=()=>{i||(l.onValueChange(a),l.onOpenChange(!1))};if(""===a)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(DS,{scope:n,value:a,disabled:i,textId:b,isSelected:d,onItemTextChange:s.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Xw.ItemSlot,{scope:n,value:a,disabled:i,textValue:p,children:e.jsx(Ga.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:Da(c.onFocus,()=>f(!0)),onBlur:Da(c.onBlur,()=>f(!1)),onClick:Da(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Da(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Da(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Da(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Da(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Da(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Jw.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});US.displayName=RS;var MS="SelectItemText",LS=s.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=sS(MS,n),u=vS(MS,n),d=IS(MS,n),p=iS(MS,n),[m,h]=s.useState(null),f=ya(r,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,b=s.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return Ma(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Ga.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?a.createPortal(c.children,l.valueNode):null]})});LS.displayName=MS;var OS="SelectItemIndicator",zS=s.forwardRef((t,r)=>{const{__scopeSelect:n,...s}=t;return IS(OS,n).isSelected?e.jsx(Ga.span,{"aria-hidden":!0,...s,ref:r}):null});zS.displayName=OS;var FS="SelectScrollUpButton";s.forwardRef((t,r)=>{const n=vS(FS,t.__scopeSelect),a=ES(FS,t.__scopeSelect),[i,o]=s.useState(!1),c=ya(r,a.onScrollButtonChange);return Ma(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(BS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=FS;var WS="SelectScrollDownButton";s.forwardRef((t,r)=>{const n=vS(WS,t.__scopeSelect),a=ES(WS,t.__scopeSelect),[i,o]=s.useState(!1),c=ya(r,a.onScrollButtonChange);return Ma(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(BS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=WS;var BS=s.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:a,...i}=t,o=vS("SelectScrollButton",n),c=s.useRef(null),l=Qw(n),u=s.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),Ma(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Ga.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Da(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(a,50))}),onPointerMove:Da(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(a,50))}),onPointerLeave:Da(i.onPointerLeave,()=>{u()})})}),VS=s.forwardRef((t,r)=>{const{__scopeSelect:n,...s}=t;return e.jsx(Ga.div,{"aria-hidden":!0,...s,ref:r})});VS.displayName="SelectSeparator";var HS="SelectArrow";s.forwardRef((t,r)=>{const{__scopeSelect:n,...s}=t,a=rS(n),i=sS(HS,n),o=vS(HS,n);return i.open&&"popper"===o.position?e.jsx(Mx,{...a,...s,ref:r}):null}).displayName=HS;var GS=s.forwardRef(({__scopeSelect:t,value:r,...n},a)=>{const i=s.useRef(null),o=ya(a,i),c=bl(r);return s.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),e.jsx(Ga.select,{...n,style:{...qw,...n.style},ref:o,defaultValue:r})});function $S(e){return""===e||void 0===e}function KS(e){const t=$a(e),r=s.useRef(""),n=s.useRef(0),a=s.useCallback(e=>{const s=r.current+e;t(s),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(s)},[t]),i=s.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function qS(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(s,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}GS.displayName="SelectBubbleInput";var ZS=lS,JS=pS,YS=mS,XS=fS,QS=NS,ek=TS,tk=US,rk=LS,nk=zS,sk=VS;const ak=oS,ik=s.forwardRef(({className:t,children:r,...n},s)=>e.jsxs(ZS,{ref:s,className:Se("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[r,e.jsx(JS,{asChild:!0,children:e.jsx(sc,{className:"h-4 w-4 opacity-50"})})]}));ik.displayName=ZS.displayName;const ok=s.forwardRef(({className:t,children:r,position:n="popper",...a},i)=>{const{container:o}=s.useContext(dc);return e.jsx(YS,{container:o,children:e.jsx(XS,{ref:i,className:Se("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...a,children:e.jsx(QS,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});ok.displayName=XS.displayName;s.forwardRef(({className:t,...r},n)=>e.jsx(ek,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=ek.displayName;const ck=s.forwardRef(({className:t,children:r,...n},s)=>e.jsxs(tk,{ref:s,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(nk,{children:e.jsx(ic,{className:"h-4 w-4"})})}),e.jsx(rk,{children:r})]}));ck.displayName=tk.displayName;function lk(e,r){const{response:n}=zn();return t.useMemo(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const t=e.users?.length??0,s=n?.planVersion,a=n?.subscription,i=e.billingCurrency||"usd",o=us({planVersion:s,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,t-u):0,p=c>0?Math.max(0,c-t):1/0,m=c>0&&t>=c,h=c>0&&t>=.8*c&&!m,f=l&&s?ls(s,i,a?.billingInterval??"monthly"):null,g=ds({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:i,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[n,e,r?.settingsMaxUsers])}s.forwardRef(({className:t,...r},n)=>e.jsx(sk,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=sk.displayName;const uk=({workspace:r})=>{const{user:n}=Ak(),{t:s,fmtNum:a,fmtCents:i}=sn(),[o,c]=t.useState(0),[l,u]=t.useState(!1),[d,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=js(),{settings:v}=Sn(),{can:y}=ml(),{response:x}=zn(),w=lk(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(u(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{u(!1)}))},[r,o]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===Rw;if(l||!r)return e.jsx(fl,{});if(k)return null;const E=e=>"string"==typeof e?{name:s("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},C=d.map(e=>({...e,...E(e.user)})),N=y(cl.WORKSPACE_MEMBERS_INVITE),A=y(cl.WORKSPACE_MEMBERS_REMOVE),_=y(cl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:j,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:U,perSeatPriceCents:M,currency:L}=w,O=d.length,z=x?.subscription?.billingInterval??"monthly",F=j&&O>=P;return e.jsxs("div",{children:[!N&&!A&&!_&&e.jsx("div",{className:"text-red-500",children:s("users.adminOnly")}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(dk,{onInvite:S,workspaceId:r._id}),F&&M&&M>0&&e.jsx("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:e.jsx("span",{children:s("users.extraSeatCost",{price:i(M,L),interval:z})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:s("users.limitReached",{reason:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?s(I,U??void 0):""})]})})}),(j||T>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:s("users.seatHeading",{hasSeatPricing:String(j)})}),T>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(O>=T?"bg-red-100 text-red-700":O>=.8*T?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[a(O)," / ",a(T)]})]}),T>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(O>=T?"bg-red-500":O>=.8*T?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,O/T*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:j?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:a(P)})," ",s("users.included"),M&&M>0&&e.jsxs("span",{className:"text-gray-400",children:[" · ",i(M,L),s("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:a(T)})," ",s("users.maxMembers")]})}),T>0?e.jsxs("span",{children:[a(Math.max(0,T-O))," ",s("users.available")]}):e.jsx("span",{className:"text-gray-400",children:s("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:s("users.memberCount",{count:O})})}),e.jsx("div",{children:e.jsx(Ra,{variant:"ghost",size:"sm",onClick:S,progress:l,children:s("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:C.map((t,a)=>{const i=t.id===n?.id,o=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:s("users.you")}),o&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:s("users.owner")})]})]}),_&&e.jsxs("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(ak,{disabled:i||!_||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,s=t.id,a=e,void(As(r,s)?Re(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:s,role:a}}):(h(s),b(n,s,{role:a}).then(()=>{S()}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:s,role:a}})}).finally(()=>{h(null)})));var n,s,a},children:[e.jsx(ik,{children:e.jsx(dS,{placeholder:s("users.selectRole")})}),e.jsx(ok,{children:r?.roles.map(t=>e.jsx(ck,{value:t,children:t},t))})]}),m===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx(ea,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Ra,{variant:"destructive",size:"sm",startIcon:e.jsx(ma,{}),onClick:()=>{return e=t.id,void(As(r,e)?Re(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Re(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},a)})}),0===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:s("users.noMembers")})]})};function dk({onInvite:r,workspaceId:n}){const{t:s}=sn(),{addUser:a,getWorkspace:i}=js(),{settings:o}=Sn(),[c,l]=t.useState(""),[u,d]=t.useState("admin"),[p,m]=t.useState(!1),[h,f]=t.useState(null),[g,b]=t.useState(null),[v,y]=t.useState(null),x=t.useRef(null),w=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),t.useEffect(()=>{n&&i(n).then(y)},[n]);const S=()=>{f(null),b(null),l(""),d("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[h&&e.jsx("div",{className:"text-red-500",children:h}),g&&e.jsx("div",{className:"text-green-500",children:g}),e.jsxs("div",{children:[e.jsx(Mf,{children:s("users.inviteByEmail")}),e.jsx(Kf,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Mf,{children:s("users.role")}),e.jsxs(ak,{value:u,onValueChange:d,children:[e.jsx(ik,{children:e.jsx(dS,{placeholder:s("users.selectRole")})}),e.jsx(ok,{children:w.map(t=>e.jsx(ck,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ra,{progress:p,onClick:async()=>{const e=c.trim();if(!e)return void f(s("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(m(!0),await a(n,e,u).then(()=>{b(s("users.inviteSuccess")),r?.()}).catch(t=>{Re(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:u}}),f(t instanceof Error?t.message:s("users.inviteFailed"))}).finally(()=>{m(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S()},6e3)})):f(s("users.invalidEmail"))},disabled:p||!c||!u,children:p?s("users.inviting"):s("users.inviteAs",{role:u})})})]})}const pk={firefox:4,safari:4,edge:4,chrome:4},mk=({workspace:r})=>{const{isSupported:n,permission:s,isSubscribed:a,loading:i,error:o,subscribe:c,unsubscribe:l}=Rk(),{t:u}=sn(),{api:d}=kn(),{can:p}=ml(),m=p(cl.WORKSPACE_SETTINGS_EDIT),h=t.useMemo(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),f=pk[h],[g,b]=t.useState([]),[v,y]=t.useState(!0),[x,w]=t.useState({}),[S,k]=t.useState(!0),[E,C]=t.useState(null),[N,A]=t.useState(null),_=t.useRef(null);t.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]),t.useEffect(()=>{if(!r?._id)return;const e=r._id.toString();y(!0),k(!0),Promise.all([d.getNotificationEvents(e).catch(()=>[]),d.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{b(e),w(t)}).finally(()=>{y(!1),k(!1)})},[r?._id]);const j=t.useCallback(async(e,t,n)=>{if(!r?._id||!m)return;const s=!n;C(`${e}.${t}`),A(null),w(r=>({...r,[e]:{...r[e],[t]:s}}));try{const n=await d.updateNotificationPreferences(r._id.toString(),{[e]:{[t]:s}});w(n),A(u("notifications.prefsSaved")),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>A(null),3e3)}catch(r){w(r=>({...r,[e]:{...r[e],[t]:n}})),Re(r,{component:"SettingsNotifications",action:"toggleChannel"})}finally{C(null)}},[r?._id,m,d,u]),P=(e,t)=>!1!==x[e]?.[t],T=t.useMemo(()=>{const e=new Map;for(const t of g){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[g]),R=v||S,D=g.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:u("notifications.manageDescription")}),n&&e.jsxs(e.Fragment,{children:[o&&"denied"!==s&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:o}),"denied"===s&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(oa,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:u("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:u("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:f},(t,r)=>e.jsx("li",{children:u(`notifications.unblock.${h}.step${r+1}`)},r))})]})]})}),"denied"!==s&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(a?"bg-green-100":"bg-gray-100"),children:a?e.jsx(Vs,{className:"h-4 w-4 text-green-600"}):e.jsx(Bs,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:u("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u("notifications.pushDescription",{subscribed:String(a)})})]})]}),e.jsx(Ra,{variant:a?"outline":"default",size:"sm",className:"shrink-0",onClick:a?l:c,disabled:i,progress:i,children:u("notifications.toggleAction",{loading:String(i),subscribed:String(a)})})]}),a&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:u("notifications.deviceNote")})]})]}),R&&e.jsx("div",{className:"text-center text-sm text-gray-400 py-4",children:u("notifications.loadingPrefs")}),!R&&D&&m&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),T.map(([t,r])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:e.jsx("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:t})}),e.jsxs("div",{className:"divide-y",children:[e.jsxs("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(ta,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(la,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),r.map(t=>{const r=P(t.slug,"email"),n=P(t.slug,"push"),s=E===`${t.slug}.email`,a=E===`${t.slug}.push`;return e.jsxs("div",{className:"flex items-center px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-6 shrink-0",children:[e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.email?e.jsx(Pl,{checked:r,onCheckedChange:()=>j(t.slug,"email",r),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})}),e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.push?e.jsx(Pl,{checked:n,onCheckedChange:()=>j(t.slug,"push",n),disabled:a}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},hk=({workspace:r})=>{const{t:n}=sn(),{isOwner:s}=ml(),{settings:a}=Sn(),{appPermissions:i}=ol(),{updateWorkspacePermissions:o}=js(),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useRef(null);t.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const m=t.useMemo(()=>a?.workspace?.roles??r.roles??[],[a?.workspace?.roles,r.roles]),h=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[f,g]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of m)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];g(t)},[r.permissions,i,m]),!r)return e.jsx(fl,{});if(!i||0===h.length)return null;return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),!s&&e.jsx("div",{className:"text-red-500 mb-4",children:n("permissions.ownerOnly")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),m.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:h.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),m.map(r=>{const n="admin"===r,a=n||(f[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(Pl,{checked:a,disabled:!s||n,onCheckedChange:()=>((e,t)=>{g(r=>{const n=r[e]??[],s=n.includes(t);return{...r,[e]:s?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Ra,{onClick:async()=>{l(!0),d(null);try{const e=r.permissions??{},t={},s=new Set([...Object.keys(e),...Object.keys(f)]);for(const r of s){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),s=f[r]??[];t[r]=[...n,...s]}await o(r._id,t),d(n("permissions.saveSuccess")),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(null),5e3)}catch(e){Re(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})},fk=({workspace:t,section:r,setSection:n})=>{const{t:s}=sn(),{settings:a}=Sn(),{can:i}=ml(),{appPermissions:o}=ol(),c=a?.workspace?.mode===Rw,l=i(cl.WORKSPACE_DELETE),u=o&&Object.keys(o).length>0;return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:Se("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(gk,{title:s("settings.sidebar.account"),children:e.jsx(bk,{activeSection:r,icon:e.jsx(fa,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.profile"),section:vk.Profile,onClick:()=>n(vk.Profile)})}),e.jsxs(gk,{title:s("settings.sidebar.workspace"),children:[i(cl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(bk,{activeSection:r,icon:e.jsx(ia,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.general"),section:vk.General,onClick:()=>n(vk.General)}),!c&&i(cl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(bk,{activeSection:r,icon:e.jsx(ga,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.users"),section:vk.Users,onClick:()=>n(vk.Users)}),i(cl.WORKSPACE_BILLING_VIEW)&&e.jsx(bk,{activeSection:r,icon:e.jsx(Zs,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.subscription"),section:vk.Subscription,onClick:()=>n(vk.Subscription)}),i(cl.WORKSPACE_USAGE_VIEW)&&e.jsx(bk,{activeSection:r,icon:e.jsx($s,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.usage"),section:vk.Usage,onClick:()=>n(vk.Usage)}),i(cl.WORKSPACE_FEATURES_VIEW)&&e.jsx(bk,{activeSection:r,icon:e.jsx(da,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.features"),section:vk.Features,onClick:()=>n(vk.Features)}),e.jsx(bk,{activeSection:r,icon:e.jsx(Vs,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.notifications"),section:vk.Notifications,onClick:()=>n(vk.Notifications)}),u&&!c&&e.jsx(bk,{activeSection:r,icon:e.jsx(ca,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.permissions"),section:vk.Permissions,onClick:()=>n(vk.Permissions)}),l&&!c&&e.jsx(bk,{activeSection:r,icon:e.jsx(ha,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.danger"),section:vk.Danger,onClick:()=>n(vk.Danger)})]})]})};function gk({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function bk({icon:t,label:r,section:n,onClick:s,activeSection:a}){return e.jsxs("button",{className:Se("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===a?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>s(n),children:[t,r]})}const vk={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},yk=new Set(Object.values(vk)),xk={[vk.Profile]:"settings.titles.profile",[vk.General]:"settings.titles.general",[vk.Users]:"settings.titles.users",[vk.Subscription]:"settings.titles.subscription",[vk.Usage]:"settings.titles.usage",[vk.Features]:"settings.titles.features",[vk.Notifications]:"settings.titles.notifications",[vk.Permissions]:"settings.titles.permissions",[vk.Danger]:"settings.titles.danger"},wk=({workspace:r,onClose:n,open:s,onOpenChange:a,defaultSection:i=vk.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=sn(),[m,h]=t.useState(!1),[f,g]=t.useState(i),b=void 0!==s?s:m,v=a||h,y=void 0!==o?o:f,x=c||g;if(!r)return null;const w=e.jsx(Ra,{variant:"outline",size:"icon",children:e.jsx(ia,{className:"h-4 w-4"})});return e.jsxs(mc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(hc,{asChild:!0,children:u||w}),e.jsxs(bc,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(xc,{className:"sr-only",children:d(xk[y])}),e.jsx(fk,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(yc,{className:"text-xl font-bold mb-4",children:d(xk[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===vk.Profile&&e.jsx(Cw,{workspace:r}),y===vk.General&&e.jsx(Rb,{workspace:r}),y===vk.Users&&e.jsx(uk,{workspace:r}),y===vk.Subscription&&e.jsx(zw,{workspace:r}),y===vk.Usage&&e.jsx(Vw,{}),y===vk.Features&&e.jsx(Tl,{workspaceId:r._id?.toString()}),y===vk.Notifications&&e.jsx(mk,{workspace:r}),y===vk.Permissions&&e.jsx(hk,{workspace:r}),y===vk.Danger&&e.jsx(gl,{workspace:r})]})]})]})]})};var Sk=Object.freeze({__proto__:null,SETTINGS_SCREENS:yk,SettingsScreen:vk,WorkspaceSettingsDialog:wk,default:wk});const kk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:vk.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e){this.currentState={open:!0,section:e||vk.Profile},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState.open,this.currentState.section)})}};function Ek(e,t,r){const n=e._id||e.id;if(!n||"string"!=typeof n)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:n,name:e.name||"",org:t,email:e.email,emailVerified:!0,clientId:r,role:e.role||"",image:e.image}}function Ck(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function Nk(){return jt(e=>e.auth)}function Ak(){const{t:e}=sn(),r=bn(),n=Nk(),s=xn(),{serverUrl:a,orgId:i,auth:o}=s,{resetCurrentWorkspace:c,currentWorkspace:l}=js(),u=t.useMemo(()=>new Ds({serverUrl:a,version:s.version}),[a,s.version]),d=t.useCallback(async()=>{r.auth(Ue());try{const t=await u.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw r.auth(Le()),new Error(t.message||e("errors.generic"));Is(t.data.redirectUrl)}catch(e){throw r.auth(Le()),Re(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Re(e,{component:"useSaaSAuth",action:"signOut"})}finally{cn(ln),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?kk.openWorkspaceSettings(e):Re(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...h,signIn:d,signOut:p,openWorkspaceSettings:m}),[n.session,n.status,h,d,p,m])}class _k extends fn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const jk=t.createContext(null);function Pk(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}const Tk=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:s=!1}){const{t:a}=sn(),i=xn(),{isAuthenticated:o}=Ak(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new _k({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,d]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(n);if(e)return;if(!t)return void d(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;d(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||d(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return d(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){d(e=>({...e,loading:!0,error:null}));try{if(!await p())return void d(e=>({...e,loading:!1,error:a("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(n);await navigator.serviceWorker.ready;const r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Pk(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),d(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToSubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){d(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(n);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}d(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToUnsubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...u,requestPermission:p,subscribe:m,unsubscribe:h}),[u,p,m,h]);return e.jsx(jk.Provider,{value:f,children:r})});function Rk(){const e=t.useContext(jk);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}let Dk=!1,Ik=null;const Uk=t.memo(({children:r,callbacks:n})=>{const s=bn(),a=Nk(),i=xn(),o=Ve(a.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(Dk=!1,Ik=null)},[]);const u=t.useCallback(async e=>{try{if(n?.handleAuthentication){const{sessionId:t}=await n.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=i;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:a,version:o,orgId:c}=r,l=new Ds({serverUrl:a,version:o}),u=await l.getProfile(t),d=Ck(Ek(u,c,r.auth?.clientId||""),t);dn(d.sessionId),s.auth(Oe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(un),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:un}})}}()}}catch(t){throw Re(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),s.auth(Le()),t}},[s,n,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(Dk)return;if(Ik)return;if(!rt(i))return;if(mn())return;if(!n?.getSession)return Dk=!0,void s.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:a}=i,c=i.auth?.clientId||"";Ik=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return Dk=!0,s.auth(Le()),void n?.onSessionExpired?.("missing");try{const e=new Ds({serverUrl:t,version:r}),n=await e.getProfile(i),o=Ck(Ek(n,a,c),i);dn(o.sessionId),Dk=!0,s.auth(Oe(o))}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),Dk=!0,s.auth(Le()),n?.onSessionExpired?.("expired")}finally{Ik=null}})()},[o,s,i,n]),t.useEffect(()=>{const e=mn();if(!e)return;if(c.current||l.current===e)return;if(!rt(i))return;c.current=!0,l.current=e;let t=!1;return s.auth(Me()),u(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Re(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[u,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});Uk.displayName="AuthProviderWrapper";const Mk=t.memo(({config:r,auth:n,children:s})=>{const a=bn(),i=xn(),o=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{a.os(Qe({...r,auth:o}))},[r,o,a]);const c=t.useMemo(()=>rt(i)?new yn(i):null,[i.serverUrl,i.version,i.orgId]);return vn(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);a.os(et(t))},[c,i.settings,a],{onError:e=>Re(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:s})});Mk.displayName="ContextConfigProvider";class Lk extends fn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user attributes"));const r=await t.json();return r&&"object"==typeof r&&!Array.isArray(r)?r:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const Ok=t.createContext(void 0),zk=t.memo(({children:r})=>{const{t:n}=sn(),s=xn(),a=function(){const e=xn();return t.useMemo(()=>new Lk(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=Ak(),{serverUrl:o,version:c}=s,[l,u]=t.useState({}),[d,p]=t.useState({}),[m,h]=t.useState(!1),[f,g]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await a.getAttributes(e);u(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[a,o,c,i]),v=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),y=t.useCallback(async e=>{h(!0),g(null);try{const t=await a.updateAttributes(e);return await b(),t}catch(t){const r=t instanceof Error?t:new Error(n("errors.generic"));throw g(r),Re(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[a,b]),x=t.useCallback(async(e,t)=>{h(!0),g(null);try{const r=await a.updateAttribute(e,t);return await b(),r}catch(r){const s=r instanceof Error?r:new Error(n("errors.generic"));throw g(s),Re(r,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),r}finally{h(!1)}},[a,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await a.getFeatures(e);p(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchFeatures"})}else p({})},[a,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);vn(async e=>{if(!i||!o||!c)return u({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Re(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:d,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,d,m,f,y,x,v,S]);return e.jsx(Ok.Provider,{value:k,children:r})});zk.displayName="UserProvider";const Fk=t.lazy(()=>Promise.resolve().then(function(){return Sk}).then(e=>({default:e.default})));const Wk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:s,workspaces:a}=js(),[i,o]=t.useState(!1),[c,l]=t.useState(vk.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=kk.getState();o(e.open),l(e.section);return kk.subscribe((e,t)=>{o(e),l(t)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=_w();if(!e)return;const t=function(e){if(e.screen&&yk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":return vk.Subscription;default:return null}}(e);if(!t)return u.current=!0,void jw();const r=e.ws;if(r&&r!==n._id){const e=a.find(e=>e._id===r);return e?void s(e).catch(()=>{u.current=!0,jw()}):(u.current=!0,void jw())}u.current=!0,kk.openWorkspaceSettings(t),jw()},[n,a,s]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(Fk,{workspace:n,open:i,onOpenChange:e=>{e||kk.closeSettings()},section:c,onSectionChange:e=>{kk.setSection(e)},showTrigger:!1})})]})},Bk=(e,t,r)=>{if(t!==tt.V1)throw new Error(`Invalid version: "${t}". Only "${tt.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},Vk=t.memo(({serverUrl:r,version:n,orgId:s,auth:a,locale:i,defaultPermissions:o,children:c})=>{Bk(r,n,s);const l=t.useMemo(()=>({serverUrl:r,version:n,orgId:s}),[r,n,s]),u=t.useMemo(()=>a?.callbacks,[a?.callbacks?.handleAuthentication,a?.callbacks?.onSignOut,a?.callbacks?.handleEvent,a?.callbacks?.onWorkspaceChange]),d=a?.callbacks?.handleEvent;return t.useEffect(()=>(ws.setCallbacks(d?{handleEvent:d}:null),()=>{ws.setCallbacks(null)}),[d]),e.jsx(Yr,{locale:i,children:e.jsx(_t,{children:e.jsx(Uk,{callbacks:u,children:e.jsx(pc,{children:e.jsx(Mk,{config:l,auth:a,children:e.jsx(il,{appPermissions:o,children:e.jsx(zk,{children:e.jsx(On,{children:e.jsx(Ts,{children:e.jsx(Tk,{children:e.jsx(Wk,{children:c})})})})})})})})})})})});Vk.displayName="SaaSOSProviderInner";const Hk=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Vk,{...r,children:t})});Hk.displayName="SaaSOSProvider";const Gk=e=>{const{children:t}=e,{status:r}=Ak();return r!==Be.authenticated?null:t},$k=e=>{const{children:t}=e,{status:r}=Ak();return r!==Be.unauthenticated?null:t};Gk.displayName="WhenAuthenticated",$k.displayName="WhenUnauthenticated";const Kk=e=>{const{children:t,fallback:r,roles:n}=e,{user:s}=Ak();return n.includes(s?.role??"")?t:r||null},qk=e=>{const{children:t,fallback:r,roles:n}=e,{user:s}=Ak(),{currentWorkspace:a}=js(),i=a?.users.find(e=>e._id===s?.id);return i&&n.includes(i?.role??"")?t:r||null};Kk.displayName="WhenRoles",qk.displayName="WhenWorkspaceRoles";const Zk=e=>{const{children:t,fallback:r,permission:n}=e,{can:s}=ml();return s(n)?t:r??null};function Jk(){const e=t.useContext(Ok);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}Zk.displayName="WhenPermission";const Yk=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=js(),s=n?.features?.[r];return s?t:null},Xk=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=js(),s=n?.features?.[r];return s?null:t},Qk=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=Jk();return n(r)?t:null},eE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=Jk();return n(r)?null:t};Yk.displayName="WhenWorkspaceFeatureEnabled",Xk.displayName="WhenWorkspaceFeatureDisabled",Qk.displayName="WhenUserFeatureEnabled",eE.displayName="WhenUserFeatureDisabled";const tE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:s,loading:a}=zn();return a?r??null:s?.subscription?t:n??null},rE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:s,loading:a}=zn();return a?r??null:s?.subscription?n??null:t},nE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:s}=e,{response:a,loading:i}=zn();if(i)return n??null;if(!a?.subscription)return s??null;const o=a.plan??a.subscription?.plan;if(!o)return s??null;const c=r.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:s??null},sE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:s,loading:a}=zn();return a?r??null:"trialing"!==s?.subscription?.subscriptionStatus?n??null:t},aE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:s,loading:a}=zn();return a?r??null:s?.subscription?.subscriptionStatus===Bn?n??null:t},iE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:s=3}=e,{response:a,loading:i}=zn();if(i)return r??null;const o=a?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return n??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return n??null;const l=new Date(c);if(isNaN(l.getTime()))return n??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>s?n??null:t};tE.displayName="WhenSubscription",rE.displayName="WhenNoSubscription",nE.displayName="WhenSubscriptionToPlans",sE.displayName="WhenTrialing",aE.displayName="WhenNotTrialing",iE.displayName="WhenTrialEnding";const oE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:s}=e,{quotas:a,loading:i}=Rs();if(i)return n??null;const o=a?.[t];return o?o.available<=0?s??null:r:s??null},cE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:s}=e,{quotas:a,loading:i}=Rs();if(i)return n??null;const o=a?.[t];return o?o.available>0?s??null:r:s??null},lE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:s}=e,{quotas:a,loading:i}=Rs();if(i)return n??null;const o=a?.[t];return o&&o.hasOverage?r:s??null},uE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:s,fallbackComponent:a}=e,{quotas:i,loading:o}=Rs();if(o)return s??null;const c=i?.[t];if(!c)return a??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?a??null:n};function dE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function pE(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}oE.displayName="WhenQuotaAvailable",cE.displayName="WhenQuotaExhausted",lE.displayName="WhenQuotaOverage",uE.displayName="WhenQuotaThreshold";var mE,hE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ka(`Primitive.${r}`),a=s.forwardRef((t,s)=>{const{asChild:a,...i}=t,o=a?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:s})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{}),fE={exports:{}},gE={};function bE(){if(mE)return gE;mE=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,s=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),c=n({inst:{value:r,getSnapshot:t}}),l=c[0].inst,u=c[1];return a(function(){l.value=r,l.getSnapshot=t,o(l)&&u({inst:l})},[e,r,t]),s(function(){return o(l)&&u({inst:l}),e(function(){o(l)&&u({inst:l})})},[e]),i(r),r};return gE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,gE}var vE,yE,xE={};
|
|
28
28
|
/**
|
|
29
29
|
* @license React
|
|
30
30
|
* use-sync-external-store-shim.development.js
|
|
@@ -33,4 +33,4 @@ var za={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/function yE(){return gE||(gE=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,i=r.useLayoutEffect,o=r.useDebugValue,c=!1,l=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){c||void 0===r.startTransition||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!l){var p=u();n(d,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[t,d,u]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(d),d};vE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),vE}function xE(){return bE||(bE=1,"production"===process.env.NODE_ENV?mE.exports=fE():mE.exports=yE()),mE.exports}var wE=xE();function SE(){return()=>{}}var kE="Avatar",[EE]=function(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s);i.displayName=r+"Context";const o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},uE(s,...r)]}(kE),[CE,NE]=EE(kE),AE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(CE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(pE.span,{...s,ref:r})})});AE.displayName=kE;var jE="AvatarImage",PE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=NE(jE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=wE.useSyncExternalStore(SE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>RE(i,e));return Is(()=>{c(RE(i,e))},[i,e]),Is(()=>{const e=e=>()=>{c(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),o}(s,o),u=Hs(e=>{i(e),c.onImageLoadingStatusChange(e)});return Is(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(pE.img,{...o,ref:r,src:s}):null});PE.displayName=jE;var TE="AvatarFallback",_E=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=NE(TE,n),[c,l]=a.useState(void 0===s);return a.useEffect(()=>{if(void 0!==s){const e=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(e)}},[s]),c&&"loaded"!==o.imageLoadingStatus?e.jsx(pE.span,{...i,ref:r}):null});function RE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}_E.displayName=TE;var DE=AE,IE=PE,UE=_E;const ME=a.forwardRef(({className:t,...r},n)=>e.jsx(DE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));ME.displayName=DE.displayName;const LE=a.forwardRef(({className:t,...r},n)=>e.jsx(IE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));LE.displayName=IE.displayName;const OE=a.forwardRef(({className:t,...r},n)=>e.jsx(UE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));OE.displayName=UE.displayName;var zE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ws(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),FE="horizontal",BE=["horizontal","vertical"],WE=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=FE,...s}=t,i=function(e){return BE.includes(e)}(a)?a:FE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(zE.div,{"data-orientation":i,...o,...s,ref:r})});WE.displayName="Separator";var VE=WE;const HE=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(VE,{ref:s,decorative:n,orientation:r,className:Se("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function GE(t){const{t:r}=an(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,u=n.subscription??null,d=null!=u&&"object"==typeof u?u.plan??null:null,p=d?.name??"";return e.jsxs("div",{className:Se("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":c}),children:[e.jsxs(ME,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(LE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(OE,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(hs,{className:"h-3 w-3"}),e.jsx("span",{children:r("workspace.membersCount",{count:n.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c?null:e.jsx(Ts,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Re(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(yk,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function $E(r){const{t:n,dir:a}=an(),{switching:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=Pa(),f=td({resolver:lh(cf({name:Ih().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Ih().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(dc,{open:i,onOpenChange:o,children:[e.jsx(pc,{asChild:!0,children:e.jsxs(Ts,{className:"w-full rounded-none",disabled:s,children:[e.jsx(ts,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(fc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(gc,{children:[e.jsx(bc,{children:n("workspace.createTitle")}),e.jsx(vc,{children:n("workspace.createDescription")})]}),e.jsx(Uf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=jb(u);else if("url"===c&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:n("workspace.invalidUrl")})}m(!0);try{await h(e.name,t),o(!1),f.reset(),d("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Re(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(Lf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Ff,{children:[e.jsx(Bf,{children:n("workspace.workspaceName")}),e.jsx(Wf,{children:e.jsx(Gf,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Hf,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(If,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Vf,{children:n("workspace.iconDescription")})]}),e.jsxs(Bg,{value:c,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Wg,{value:"emoji",id:"emoji"}),e.jsxs(If,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(cs,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Wg,{value:"url",id:"url"}),e.jsxs(If,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"h-4 w-4"}),n("workspace.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:u})]}),e.jsx(Nb,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Pb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",jb(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Lf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Ff,{children:[e.jsx(Bf,{children:n("workspace.imageUrl")}),e.jsx(Wf,{children:e.jsx(Gf,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Vf,{children:n("workspace.imageUrlDescription")}),e.jsx(Hf,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Ts,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ts,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}HE.displayName=VE.displayName;class KE extends fn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let qE=class{constructor(e){this.api=new KE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),s=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:s}})}};const ZE=cf({name:Ih().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:Ih().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")});function JE({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function YE({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}var XE=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}"}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso"}}});var QE=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}"}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation"}}});var eC=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}"}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden"}}});var tC=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました"}}});var rC=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败"}}});var nC=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल"}}});var aC=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}"}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام"}}});const sC={[Fn.Monthly]:"subscription.billingInterval.perMonth",[Fn.Quarterly]:"subscription.billingInterval.perQuarter",[Fn.Yearly]:"subscription.billingInterval.perYear"},iC=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Fn.Yearly:n=t/12;break;case Fn.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var oC=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,onSelectPlan:l,loading:u=!1})=>{const[d,p]=t.useState(!1),{t:m,formattingLocale:h,dir:f,fmtNum:g,fmtCents:b}=an(),{settings:v}=Sn(),y=v?.workspace?.mode===Tw,x=(e,t)=>null==e||0===e?"":b(e,t),w=e=>m(sC[e]??sC[Fn.Monthly]),[S,k]=t.useState(null),E=t.useRef(!1),C=t.useMemo(()=>oa(i,a),[i,a]),N=C?.interval??null,A=C?.currency??null,j=t.useMemo(()=>function(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(a),[a]),P=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?j.includes(e)?[e]:[]:j},[o,j]),[T,_]=t.useState(N||Fn.Monthly),[R,D]=t.useState(()=>A&&P.includes(A)?A:P.length>0?P[0]:""),I=o?.trim()||R;t.useEffect(()=>{r&&(_(N||Fn.Monthly),A&&P.includes(A)?D(A):P.length>0&&!P.includes(R)&&D(P[0]))},[r,N,A,P]);const U=t.useMemo(()=>[...a].sort((e,t)=>e.version-t.version),[a]),M=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(U),L=M.filter(e=>e.type===Yn),O=M.filter(e=>e.type===Xn),z=M.filter(e=>e.type===Qn),F=async e=>{if(!(e===s&&N===T||u||d||E.current)){E.current=!0,p(!0),k(e);try{await l(e,T,I),n(!1)}catch(e){}finally{E.current=!1,p(!1),k(null)}}},B=e=>aa(e,I,T),W=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===I.toLowerCase()),V=u||d,H=e=>{switch(e){case Fn.Monthly:return m("subscription.billingInterval.monthly");case Fn.Quarterly:return m("subscription.billingInterval.quarterly");case Fn.Yearly:return m("subscription.billingInterval.yearly");default:return m("subscription.billingInterval.monthly")}},G=e=>{const t=e._id===s,r=N===T;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return{labelKey:"_dynamic",dynamicLabel:m("subscription.switchToInterval",{interval:H(T)}),variant:"default",disabled:!1};if(!s)return{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const n=U.findIndex(e=>e._id===s),a=U.findIndex(t=>t._id===e._id);return-1===n||-1===a?{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:a<n?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:a>n?{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},$=(e,t,r=Fn.Monthly)=>{if(t.type===Yn)return e.features?.[t.slug]??!1;if(t.type===Xn)return e.limits?.[t.slug]??null;if(t.type===Qn){const n=ia(e,I,t.slug,r);return n||jw(e.quotas?.[t.slug],r)}return null},K=(e,t,r)=>{if(t.type===Yn)return!0===e?"✓":"—";if(t.type===Xn)return null!=e?String(e):"—";if(t.type===Qn){const n=Pw("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:h});return n?n.hasOverage?m("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):m("quota.includedOnly",{count:n.included}):"—"}return"—"};return e.jsx(dc,{open:r,onOpenChange:n,children:e.jsxs(fc,{dir:f,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx(bc,{className:"text-xl sm:text-2xl font-bold",children:m("pricing.title")}),e.jsx(vc,{className:"mt-1 text-sm",children:m("subscription.choosePlanDescription")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&P.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:m("pricing.currency")}),e.jsx("select",{"aria-label":m("pricing.selectCurrency"),value:R,onChange:e=>D(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:P.map(t=>{const r=jf(t);return e.jsx("option",{value:t,children:r?`${r} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:m("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":m("pricing.billingInterval"),children:[Fn.Monthly,Fn.Quarterly,Fn.Yearly].map(t=>{const r=N===t;return e.jsx("button",{onClick:()=>_(t),"aria-pressed":T===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(T===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===Fn.Monthly&&m("subscription.billingInterval.monthly"),t===Fn.Quarterly&&m("subscription.billingInterval.quarterly"),t===Fn.Yearly&&m("subscription.billingInterval.yearly"),t===Fn.Yearly&&e.jsx("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:m("pricing.save")}),r&&s&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:m("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===P.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:m("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:m("pricing.noPlansCurrencyHint")})]}):0===U.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:m("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:U.map(t=>{const r=t._id===s,n=G(t),a=V&&t._id===S,i=B(t),o=W(t),l=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"",u=aa(t,I,Fn.Monthly)??0,d=T!==Fn.Monthly&&null!==i?iC(u,i,T):null,p=ca(t,I),h=p?la(t,I,T):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(r?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==i||o?x(i,l)||m("pricing.free"):"—"}),null!==i&&i>0&&o&&e.jsx("span",{className:"text-sm text-slate-500",children:w(T)})]}),null!==d&&d>0&&o&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:m("subscription.savingsPercent",{percent:d})}),p?.enabled&&h&&h>0&&!y&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:m("subscription.seatPriceDisplay",{price:b(h,l),interval:w(T),included:g(p.includedSeats),includedLabel:m("pricing.included")})})]}),L.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:L.map(r=>{const n=$(t,r,T),a=r.type===Yn&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===Yn?a?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:a?"text-slate-700":"text-slate-400",children:r.name})]},r._id)})})]}),O.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:O.map(r=>{const n=$(t,r,T);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof n?g(n):"—"})]},r._id)})})]}),p?.enabled&&!y&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:m("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:g(p.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:p.maxSeats>0?g(p.maxSeats):m("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(p.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?m("subscription.seats.allIncluded"):`${g(t)} ${m("subscription.seats.extra")}`})]})})()]})]}),e.jsx(Ts,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||V||!o,progress:a,onClick:()=>F(t._id),children:a?m("pricing.processing"):o?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:280+200*U.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:280,minWidth:280}}),U.map(t=>e.jsx("col",{style:{width:200,minWidth:200}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),U.map(t=>{const r=t._id===s,n=G(t),a=V&&t._id===S,i=B(t),o=aa(t,I,Fn.Monthly)??0,c=T!==Fn.Monthly&&null!==i?iC(o,i,T):null,l=W(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"";return e.jsx("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(t._id===s?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 truncate",children:t.plan.name}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:l&&null!==i||l?x(i,u)||m("pricing.free"):"—"}),null!==i&&i>0&&l&&e.jsx("span",{className:"text-sm text-slate-500",children:w(T)})]}),null!==c&&c>0&&l&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium mt-0.5",children:m("subscription.savingsPercent",{percent:c})}),(()=>{if(y)return null;const r=ca(t,I);if(!r)return null;const n=la(t,I,T);return!n||n<=0?null:e.jsx("div",{className:"text-xs text-slate-500 mt-1 border-t border-slate-100 pt-1",children:e.jsx("span",{children:m("subscription.seatPriceDisplay",{price:b(n,u),interval:w(T),included:g(r.includedSeats),includedLabel:m("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Ts,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||V||!l,progress:a,onClick:()=>F(t._id),children:a?m("pricing.processing"):l?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[L.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.features")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),L.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a),o=t.type===Yn&&!0===n;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),O.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.limits")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),O.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),z.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.quotas")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),z.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),!y&&U.some(e=>{const t=ca(e,I);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.seats.title")}),e.jsx("td",{colSpan:U.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.seats.freeWithBase")})]}),U.map(t=>{const r=ca(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?g(r.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.maxSeats")})}),U.map(t=>{const r=ca(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?g(r.maxSeats):m("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.perExtraSeat")})}),U.map(t=>{const r=la(t,I,T),n=t.pricingVariants?.length?I:t.plan?.currency??I??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${b(r,n)}${w(T)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.membersInWorkspace",{count:c})})]}),U.map(t=>{const r=ca(t,I);if(!r?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const n=r.includedSeats||0,a=Math.max(0,c-n);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:0===a?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:m("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[g(a)," ",m("subscription.seats.extra")]})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:i=!0,showSuccessMessage:o=!0,hideLogo:c=!1,hideTitles:l=!1})=>{const{t:u}=an(),[d,p]=t.useState(!1),[m,h]=t.useState(!1),{submitBetaForm:f,isLoading:g,isSubmitting:b,error:v,config:y,success:x,message:w}=(()=>{const{t:e}=an(),r=xn(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,u]=t.useState(null),[d,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),u(null);try{const e=new qE(r),n=await e.fetchConfig();t||a(n)}catch(r){t||u(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:d,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return u(t),{success:!1,message:t}}try{c(!0),u(null),p(!1),h(null);const e=new qE(r),n=await e.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return p(a),h(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return u(r),p(!1),h(r),{success:!1,message:r}}finally{c(!1)}},[r])}})();t.useEffect(()=>{x&&o&&(p(!0),h(!0)),v&&h(!0)},[x,o,v]);const S=td({resolver:lh(ZE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{i&&S.setFocus("name")},[i,S]);const k=S.formState.isValid&&!b;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:g?e.jsxs("div",{className:Se("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",a),children:[e.jsx(pl,{className:"h-24 w-24 rounded-lg"}),e.jsx(pl,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(pl,{className:"h-4 w-16"}),e.jsx(pl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(pl,{className:"h-4 w-16"}),e.jsx(pl,{className:"h-10 w-full"})]}),e.jsx(pl,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!c&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(YE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(yu,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(async e=>{try{const t=await f(e);t.success?(r?.(),S.reset(),o&&p(!0),h(!0)):(n?.(t.message),h(!0))}catch(e){n?.(e instanceof Error?e.message:u("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(JE,{screen:y?.screen?.register}),e.jsx(Lf,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Ff,{className:s,children:[e.jsx(Bf,{children:u("beta.nameLabel")}),e.jsx(Wf,{children:e.jsx(Gf,{...t})}),e.jsx(Vf,{}),e.jsx(Hf,{})]})}),e.jsx(Lf,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Ff,{className:s,children:[e.jsx(Bf,{children:u("beta.emailLabel")}),e.jsx(Wf,{children:e.jsx(Gf,{...t})}),e.jsx(Vf,{}),e.jsx(Hf,{})]})}),e.jsx(Ts,{type:"submit",disabled:!k,className:s,children:u(b?"beta.submittingText":"beta.submitText")})]}),m&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":u("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Ts,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:u("beta.tryAgain")})})]}),m&&d&&w&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(JE,{screen:y?.screen?.thankYou})})]})}),!m&&e.jsx("div",{children:e.jsxs("div",{children:[u("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.privacyPolicy")})," ",u("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.termsOfService")}),"."]})})]})})},exports.PricingPage=function({slug:t,children:r,loadingFallback:n,errorFallback:a}){const{items:s,plans:i,notes:o,loading:c,error:l,refetch:u}=Cn(t);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(pl,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(pl,{className:"h-64 rounded-lg"},t))})]}):l?a?e.jsx(e.Fragment,{children:a(l)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:l}):e.jsx(e.Fragment,{children:r({loading:c,error:l,items:s,plans:i,notes:o,refetch:u})})},exports.PushNotificationProvider=Pk,exports.QuotaUsageContextProvider=_a,exports.SETTINGS_SCREENS=bk,exports.SUPPORTED_LOCALES=qr,exports.SaaSOSProvider=Wk,exports.SettingsScreen=gk,exports.SubscriptionContextProvider=On,exports.WhenAuthenticated=Vk,exports.WhenNoSubscription=eE,exports.WhenNotTrialing=nE,exports.WhenPermission=Kk,exports.WhenQuotaAvailable=sE,exports.WhenQuotaExhausted=iE,exports.WhenQuotaOverage=oE,exports.WhenQuotaThreshold=cE,exports.WhenRoles=Gk,exports.WhenSubscription=Qk,exports.WhenSubscriptionToPlans=tE,exports.WhenTrialEnding=aE,exports.WhenTrialing=rE,exports.WhenUnauthenticated=Hk,exports.WhenUserFeatureDisabled=Xk,exports.WhenUserFeatureEnabled=Yk,exports.WhenWorkspaceFeatureDisabled=Jk,exports.WhenWorkspaceFeatureEnabled=Zk,exports.WhenWorkspaceRoles=$k,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=an(),{isAuthenticated:s,user:i}=Ck(),o=rt(xn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=Pa(),{settings:v}=Sn(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,E]=t.useState(""),C=u||d;t.useEffect(()=>{s&&o&&(0===c.length?(m(),h()):h())},[s,o]),t.useEffect(()=>{s&&o&&w>0&&f()},[w,s,o]);const N=c,A=N.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(k.toLowerCase())),j=v?.workspace?.canCreateWorkspace??!0,P=v?.workspace?.showSwitcher??!0,T=v?.workspace?.maxWorkspacesPerUser??0,_=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==j&&(0===T||_<T);return t.useEffect(()=>{!P&&c.length>0&&!l&&b(c[0]).catch(()=>{})},[P,c,l]),!P&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(C,l)}),e.jsx(yk,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(dc,{open:y,onOpenChange:x,children:[e.jsx(pc,{children:r.trigger?.(C,l)}),e.jsxs(fc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(gc,{dir:a,children:[e.jsxs(bc,{className:"flex items-center gap-2",children:[e.jsx(Ha,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(vc,{children:n("workspace.switchDescription")})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.notLoggedIn")})}),i&&e.jsxs("div",{dir:a,className:"flex flex-col gap-4",children:[l&&e.jsx(GE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(HE,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.availableWorkspaces",{count:A.length})}),e.jsx("div",{children:e.jsx(Ts,{progress:d,disabled:d,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(rs,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(as,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Gf,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>E(e.target.value),className:"ps-10"})]}),u?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(es,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:n("workspace.loadingWorkspaces")})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ha,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(k?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(Nb,{className:"h-64",dir:a,children:e.jsx("div",{dir:a,className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t._id===l?._id;return e.jsx(GE,{workspace:t,isCurrentWorkspace:r,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N},t._id)})})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx(HE,{}),e.jsx($E,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Mn,exports.useBillingPortal=Dn,exports.useCancelSubscription=In,exports.useCreateCheckoutSession=Pn,exports.useInvoice=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=En(t,"errors.fetchInvoice",n);u(a),Re(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{invoice:s,loading:o,error:l,refetch:d}},exports.useInvoices=Rn,exports.usePermissions=dl,exports.usePlanGroup=An,exports.usePlanGroupVersions=jn,exports.usePublicPlanGroupVersion=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersion",r);l(n),Re(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{planGroupVersion:a,loading:i,error:c,refetch:u}},exports.usePublicPlans=Cn,exports.usePushNotifications=Tk,exports.useQuotaUsageContext=Ra,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=En(t,"errors.fetchQuotaUsage",n);u(a),Re(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{status:s,loading:o,error:l,refetch:d}},exports.useRecordUsage=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.recordUsage(e,t);return _t(),r}catch(n){const a=En(n,"errors.recordUsage",r);throw o(a),Re(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=Un,exports.useSaaSAuth=Ck,exports.useSaaSOs=xn,exports.useSaaSSettings=Sn,exports.useSaaSWorkspaces=Pa,exports.useSeatStatus=ok,exports.useSubscription=Nn,exports.useSubscriptionContext=zn,exports.useSubscriptionManagement=_n,exports.useTranslation=an,exports.useTrialStatus=function(){const{response:e}=zn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=lE(t.trialEnd)??lE(t.stripeCurrentPeriodEnd),n=lE(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])},exports.useUpdateSubscription=Tn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=an(),{api:s}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[u,d]=t.useState(0),[p,m]=t.useState(1),[h,f]=t.useState(!1),[g,b]=t.useState(!1),[v,y]=t.useState(!1),[x,w]=t.useState(null),S=n?.from,k=n?.to,E=n?.source,C=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),d(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...E&&{source:E},...C&&{page:C},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),d(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=En(t,"errors.fetchUsageLogs",a);w(n),Re(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,E,C,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:u,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext(Mk);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=qk;
|
|
36
|
+
*/function wE(){return vE||(vE=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,a=r.useEffect,i=r.useLayoutEffect,o=r.useDebugValue,c=!1,l=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){c||void 0===r.startTransition||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!l){var p=u();n(d,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=s({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[t,d,u]),a(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(d),d};xE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),xE}function SE(){return yE||(yE=1,"production"===process.env.NODE_ENV?fE.exports=bE():fE.exports=wE()),fE.exports}var kE=SE();function EE(){return()=>{}}var CE="Avatar",[NE]=function(t,r=[]){let n=[];const a=()=>{const e=n.map(e=>s.createContext(e));return function(r){const n=r?.[t]||e;return s.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return a.scopeName=t,[function(r,a){const i=s.createContext(a);i.displayName=r+"Context";const o=n.length;n=[...n,a];const c=r=>{const{scope:n,children:a,...c}=r,l=n?.[t]?.[o]||i,u=s.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:a})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=s.useContext(c);if(l)return l;if(void 0!==a)return a;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},pE(a,...r)]}(CE),[AE,_E]=NE(CE),jE=s.forwardRef((t,r)=>{const{__scopeAvatar:n,...a}=t,[i,o]=s.useState("idle");return e.jsx(AE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(hE.span,{...a,ref:r})})});jE.displayName=CE;var PE="AvatarImage",TE=s.forwardRef((t,r)=>{const{__scopeAvatar:n,src:a,onLoadingStatusChange:i=()=>{},...o}=t,c=_E(PE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=kE.useSyncExternalStore(EE,()=>!0,()=>!1),a=s.useRef(null),i=n?(a.current||(a.current=new window.Image),a.current):null,[o,c]=s.useState(()=>IE(i,e));return Ma(()=>{c(IE(i,e))},[i,e]),Ma(()=>{const e=e=>()=>{c(e)};if(!i)return;const n=e("loaded"),s=e("error");return i.addEventListener("load",n),i.addEventListener("error",s),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",s)}},[i,r,t]),o}(a,o),u=$a(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ma(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(hE.img,{...o,ref:r,src:a}):null});TE.displayName=PE;var RE="AvatarFallback",DE=s.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:a,...i}=t,o=_E(RE,n),[c,l]=s.useState(void 0===a);return s.useEffect(()=>{if(void 0!==a){const e=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(e)}},[a]),c&&"loaded"!==o.imageLoadingStatus?e.jsx(hE.span,{...i,ref:r}):null});function IE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}DE.displayName=RE;var UE=jE,ME=TE,LE=DE;const OE=s.forwardRef(({className:t,...r},n)=>e.jsx(UE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));OE.displayName=UE.displayName;const zE=s.forwardRef(({className:t,...r},n)=>e.jsx(ME,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));zE.displayName=ME.displayName;const FE=s.forwardRef(({className:t,...r},n)=>e.jsx(LE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));FE.displayName=LE.displayName;var WE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ka(`Primitive.${r}`),a=s.forwardRef((t,s)=>{const{asChild:a,...i}=t,o=a?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:s})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{}),BE="horizontal",VE=["horizontal","vertical"],HE=s.forwardRef((t,r)=>{const{decorative:n,orientation:s=BE,...a}=t,i=function(e){return VE.includes(e)}(s)?s:BE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(WE.div,{"data-orientation":i,...o,...a,ref:r})});HE.displayName="Separator";var GE=HE;const $E=s.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...s},a)=>e.jsx(GE,{ref:a,decorative:n,orientation:r,className:Se("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...s}));function KE(t){const{t:r}=sn(),{workspace:n,setCurrentWorkspace:s,setOpen:a,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,u=n.subscription??null,d=null!=u&&"object"==typeof u?u.plan??null:null,p=d?.name??"";return e.jsxs("div",{className:Se("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":c}),children:[e.jsxs(OE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(zE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(FE,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ga,{className:"h-3 w-3"}),e.jsx("span",{children:r("workspace.membersCount",{count:n.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c?null:e.jsx(Ra,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>a(!1)).catch(e=>{Re(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(wk,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&s(i[e])}}})]})]});var m}function qE(r){const{t:n,dir:s}=sn(),{switching:a}=js(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=js(),f=nd({resolver:dh(uf({name:Mh().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Mh().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(mc,{open:i,onOpenChange:o,children:[e.jsx(hc,{asChild:!0,children:e.jsxs(Ra,{className:"w-full rounded-none",disabled:a,children:[e.jsx(ra,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(bc,{dir:s,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(vc,{children:[e.jsx(yc,{children:n("workspace.createTitle")}),e.jsx(xc,{children:n("workspace.createDescription")})]}),e.jsx(Lf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Pb(u);else if("url"===c&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:n("workspace.invalidUrl")})}m(!0);try{await h(e.name,t),o(!1),f.reset(),d("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Re(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(zf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Bf,{children:[e.jsx(Vf,{children:n("workspace.workspaceName")}),e.jsx(Hf,{children:e.jsx(Kf,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx($f,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Mf,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Gf,{children:n("workspace.iconDescription")})]}),e.jsxs(Vg,{value:c,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Hg,{value:"emoji",id:"emoji"}),e.jsxs(Mf,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ua,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Hg,{value:"url",id:"url"}),e.jsxs(Mf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qs,{className:"h-4 w-4"}),n("workspace.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:u})]}),e.jsx(_b,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Tb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Pb(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(zf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Bf,{children:[e.jsx(Vf,{children:n("workspace.imageUrl")}),e.jsx(Hf,{children:e.jsx(Kf,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Gf,{children:n("workspace.imageUrlDescription")}),e.jsx($f,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Ra,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ra,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(ea,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}$E.displayName=GE.displayName;class ZE extends fn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let JE=class{constructor(e){this.api=new ZE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),s=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),a=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:s,currency:a}})}};const YE=uf({name:Mh().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:Mh().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")});function XE({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function QE({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}var eC=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}"}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso"}}});var tC=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}"}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation"}}});var rC=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}"}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden"}}});var nC=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました"}}});var sC=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败"}}});var aC=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल"}}});var iC=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}"}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام"}}});const oC={[Fn.Monthly]:"subscription.billingInterval.perMonth",[Fn.Quarterly]:"subscription.billingInterval.perQuarter",[Fn.Yearly]:"subscription.billingInterval.perYear"},cC=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Fn.Yearly:n=t/12;break;case Fn.Quarterly:n=t/3;break;default:return null}const s=(e-n)/e*100;return s>0?Math.round(s):null};var lC=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:s,currentPlanVersionId:a,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,onSelectPlan:l,loading:u=!1})=>{const[d,p]=t.useState(!1),{t:m,formattingLocale:h,dir:f,fmtNum:g,fmtCents:b}=sn(),{settings:v}=Sn(),y=v?.workspace?.mode===Rw,x=(e,t)=>null==e||0===e?"":b(e,t),w=e=>m(oC[e]??oC[Fn.Monthly]),[S,k]=t.useState(null),E=t.useRef(!1),C=t.useMemo(()=>os(i,s),[i,s]),N=C?.interval??null,A=C?.currency??null,_=t.useMemo(()=>function(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(s),[s]),j=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?_.includes(e)?[e]:[]:_},[o,_]),[P,T]=t.useState(N||Fn.Monthly),[R,D]=t.useState(()=>A&&j.includes(A)?A:j.length>0?j[0]:""),I=o?.trim()||R;t.useEffect(()=>{r&&(T(N||Fn.Monthly),A&&j.includes(A)?D(A):j.length>0&&!j.includes(R)&&D(j[0]))},[r,N,A,j]);const U=t.useMemo(()=>[...s].sort((e,t)=>e.version-t.version),[s]),M=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(U),L=M.filter(e=>e.type===Yn),O=M.filter(e=>e.type===Xn),z=M.filter(e=>e.type===Qn),F=async e=>{if(!(e===a&&N===P||u||d||E.current)){E.current=!0,p(!0),k(e);try{await l(e,P,I),n(!1)}catch(e){}finally{E.current=!1,p(!1),k(null)}}},W=e=>ss(e,I,P),B=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===I.toLowerCase()),V=u||d,H=e=>{switch(e){case Fn.Monthly:return m("subscription.billingInterval.monthly");case Fn.Quarterly:return m("subscription.billingInterval.quarterly");case Fn.Yearly:return m("subscription.billingInterval.yearly");default:return m("subscription.billingInterval.monthly")}},G=e=>{const t=e._id===a,r=N===P;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return{labelKey:"_dynamic",dynamicLabel:m("subscription.switchToInterval",{interval:H(P)}),variant:"default",disabled:!1};if(!a)return{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const n=U.findIndex(e=>e._id===a),s=U.findIndex(t=>t._id===e._id);return-1===n||-1===s?{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:s<n?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:s>n?{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},$=(e,t,r=Fn.Monthly)=>{if(t.type===Yn)return e.features?.[t.slug]??!1;if(t.type===Xn)return e.limits?.[t.slug]??null;if(t.type===Qn){const n=is(e,I,t.slug,r);return n||Pw(e.quotas?.[t.slug],r)}return null},K=(e,t,r)=>{if(t.type===Yn)return!0===e?"✓":"—";if(t.type===Xn)return null!=e?String(e):"—";if(t.type===Qn){const n=Tw("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:h});return n?n.hasOverage?m("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):m("quota.includedOnly",{count:n.included}):"—"}return"—"};return e.jsx(mc,{open:r,onOpenChange:n,children:e.jsxs(bc,{dir:f,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx(yc,{className:"text-xl sm:text-2xl font-bold",children:m("pricing.title")}),e.jsx(xc,{className:"mt-1 text-sm",children:m("subscription.choosePlanDescription")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&j.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:m("pricing.currency")}),e.jsx("select",{"aria-label":m("pricing.selectCurrency"),value:R,onChange:e=>D(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:j.map(t=>{const r=Pf(t);return e.jsx("option",{value:t,children:r?`${r} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:m("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":m("pricing.billingInterval"),children:[Fn.Monthly,Fn.Quarterly,Fn.Yearly].map(t=>{const r=N===t;return e.jsx("button",{onClick:()=>T(t),"aria-pressed":P===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(P===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===Fn.Monthly&&m("subscription.billingInterval.monthly"),t===Fn.Quarterly&&m("subscription.billingInterval.quarterly"),t===Fn.Yearly&&m("subscription.billingInterval.yearly"),t===Fn.Yearly&&e.jsx("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:m("pricing.save")}),r&&a&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:m("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===j.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:m("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:m("pricing.noPlansCurrencyHint")})]}):0===U.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:m("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:U.map(t=>{const r=t._id===a,n=G(t),s=V&&t._id===S,i=W(t),o=B(t),l=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"",u=ss(t,I,Fn.Monthly)??0,d=P!==Fn.Monthly&&null!==i?cC(u,i,P):null,p=cs(t,I),h=p?ls(t,I,P):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(r?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==i||o?x(i,l)||m("pricing.free"):"—"}),null!==i&&i>0&&o&&e.jsx("span",{className:"text-sm text-slate-500",children:w(P)})]}),null!==d&&d>0&&o&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:m("subscription.savingsPercent",{percent:d})}),p?.enabled&&h&&h>0&&!y&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:m("subscription.seatPriceDisplay",{price:b(h,l),interval:w(P),included:g(p.includedSeats),includedLabel:m("pricing.included")})})]}),L.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:L.map(r=>{const n=$(t,r,P),s=r.type===Yn&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===Yn?s?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:s?"text-slate-700":"text-slate-400",children:r.name})]},r._id)})})]}),O.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:O.map(r=>{const n=$(t,r,P);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof n?g(n):"—"})]},r._id)})})]}),p?.enabled&&!y&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:m("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:g(p.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:p.maxSeats>0?g(p.maxSeats):m("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(p.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?m("subscription.seats.allIncluded"):`${g(t)} ${m("subscription.seats.extra")}`})]})})()]})]}),e.jsx(Ra,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||V||!o,progress:s,onClick:()=>F(t._id),children:s?m("pricing.processing"):o?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:280+200*U.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:280,minWidth:280}}),U.map(t=>e.jsx("col",{style:{width:200,minWidth:200}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),U.map(t=>{const r=t._id===a,n=G(t),s=V&&t._id===S,i=W(t),o=ss(t,I,Fn.Monthly)??0,c=P!==Fn.Monthly&&null!==i?cC(o,i,P):null,l=B(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"";return e.jsx("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(t._id===a?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 truncate",children:t.plan.name}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:l&&null!==i||l?x(i,u)||m("pricing.free"):"—"}),null!==i&&i>0&&l&&e.jsx("span",{className:"text-sm text-slate-500",children:w(P)})]}),null!==c&&c>0&&l&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium mt-0.5",children:m("subscription.savingsPercent",{percent:c})}),(()=>{if(y)return null;const r=cs(t,I);if(!r)return null;const n=ls(t,I,P);return!n||n<=0?null:e.jsx("div",{className:"text-xs text-slate-500 mt-1 border-t border-slate-100 pt-1",children:e.jsx("span",{children:m("subscription.seatPriceDisplay",{price:b(n,u),interval:w(P),included:g(r.includedSeats),includedLabel:m("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Ra,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||V||!l,progress:s,onClick:()=>F(t._id),children:s?m("pricing.processing"):l?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[L.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.features")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),L.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,P),s=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,s),o=t.type===Yn&&!0===n;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),O.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.limits")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),O.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,P),s=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,s);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),z.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.quotas")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),z.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,P),s=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,s);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),!y&&U.some(e=>{const t=cs(e,I);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.seats.title")}),e.jsx("td",{colSpan:U.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.seats.freeWithBase")})]}),U.map(t=>{const r=cs(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?g(r.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.maxSeats")})}),U.map(t=>{const r=cs(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?g(r.maxSeats):m("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.perExtraSeat")})}),U.map(t=>{const r=ls(t,I,P),n=t.pricingVariants?.length?I:t.plan?.currency??I??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${b(r,n)}${w(P)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.membersInWorkspace",{count:c})})]}),U.map(t=>{const r=cs(t,I);if(!r?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===a?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const n=r.includedSeats||0,s=Math.max(0,c-n);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===a?"bg-blue-50/50":"bg-white"),children:0===s?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:m("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[g(s)," ",m("subscription.seats.extra")]})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:r,onError:n,className:s="w-full",fieldClassName:a="flex flex-col gap-1.5 w-full",autoFocus:i=!0,showSuccessMessage:o=!0,hideLogo:c=!1,hideTitles:l=!1})=>{const{t:u}=sn(),[d,p]=t.useState(!1),[m,h]=t.useState(!1),{submitBetaForm:f,isLoading:g,isSubmitting:b,error:v,config:y,success:x,message:w}=(()=>{const{t:e}=sn(),r=xn(),[n,s]=t.useState(null),[a,i]=t.useState(!0),[o,c]=t.useState(!1),[l,u]=t.useState(null),[d,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),u(null);try{const e=new JE(r),n=await e.fetchConfig();t||s(n)}catch(r){t||u(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:a,isSubmitting:o,config:n,error:l,success:d,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return u(t),{success:!1,message:t}}try{c(!0),u(null),p(!1),h(null);const e=new JE(r),n=await e.submitBetaUser({name:t.name||"",email:t.email}),s="success"===n.status;return p(s),h(n.message),{success:s,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return u(r),p(!1),h(r),{success:!1,message:r}}finally{c(!1)}},[r])}})();t.useEffect(()=>{x&&o&&(p(!0),h(!0)),v&&h(!0)},[x,o,v]);const S=nd({resolver:dh(YE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{i&&S.setFocus("name")},[i,S]);const k=S.formState.isValid&&!b;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:g?e.jsxs("div",{className:Se("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",s),children:[e.jsx(hl,{className:"h-24 w-24 rounded-lg"}),e.jsx(hl,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(hl,{className:"h-4 w-16"}),e.jsx(hl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(hl,{className:"h-4 w-16"}),e.jsx(hl,{className:"h-10 w-full"})]}),e.jsx(hl,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!c&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(QE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(wu,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(async e=>{try{const t=await f(e);t.success?(r?.(),S.reset(),o&&p(!0),h(!0)):(n?.(t.message),h(!0))}catch(e){n?.(e instanceof Error?e.message:u("beta.errorMessage")),h(!0)}}),className:s,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(XE,{screen:y?.screen?.register}),e.jsx(zf,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Bf,{className:a,children:[e.jsx(Vf,{children:u("beta.nameLabel")}),e.jsx(Hf,{children:e.jsx(Kf,{...t})}),e.jsx(Gf,{}),e.jsx($f,{})]})}),e.jsx(zf,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Bf,{className:a,children:[e.jsx(Vf,{children:u("beta.emailLabel")}),e.jsx(Hf,{children:e.jsx(Kf,{...t})}),e.jsx(Gf,{}),e.jsx($f,{})]})}),e.jsx(Ra,{type:"submit",disabled:!k,className:a,children:u(b?"beta.submittingText":"beta.submitText")})]}),m&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":u("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Ra,{type:"button",onClick:()=>{h(!1),S.reset()},className:a,children:u("beta.tryAgain")})})]}),m&&d&&w&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(XE,{screen:y?.screen?.thankYou})})]})}),!m&&e.jsx("div",{children:e.jsxs("div",{children:[u("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.privacyPolicy")})," ",u("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.termsOfService")}),"."]})})]})})},exports.PricingPage=function({slug:t,children:r,loadingFallback:n,errorFallback:s}){const{items:a,plans:i,notes:o,loading:c,error:l,refetch:u}=Cn(t);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(hl,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(hl,{className:"h-64 rounded-lg"},t))})]}):l?s?e.jsx(e.Fragment,{children:s(l)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:l}):e.jsx(e.Fragment,{children:r({loading:c,error:l,items:a,plans:i,notes:o,refetch:u})})},exports.PushNotificationProvider=Tk,exports.QuotaUsageContextProvider=Ts,exports.SETTINGS_SCREENS=yk,exports.SUPPORTED_LOCALES=qr,exports.SaaSOSProvider=Hk,exports.SettingsScreen=vk,exports.SubscriptionContextProvider=On,exports.WhenAuthenticated=Gk,exports.WhenNoSubscription=rE,exports.WhenNotTrialing=aE,exports.WhenPermission=Zk,exports.WhenQuotaAvailable=oE,exports.WhenQuotaExhausted=cE,exports.WhenQuotaOverage=lE,exports.WhenQuotaThreshold=uE,exports.WhenRoles=Kk,exports.WhenSubscription=tE,exports.WhenSubscriptionToPlans=nE,exports.WhenTrialEnding=iE,exports.WhenTrialing=sE,exports.WhenUnauthenticated=$k,exports.WhenUserFeatureDisabled=eE,exports.WhenUserFeatureEnabled=Qk,exports.WhenWorkspaceFeatureDisabled=Xk,exports.WhenWorkspaceFeatureEnabled=Yk,exports.WhenWorkspaceRoles=qk,exports.WorkspaceSwitcher=function(r){const{t:n,dir:s}=sn(),{isAuthenticated:a,user:i}=Ak(),o=rt(xn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=js(),{settings:v}=Sn(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,E]=t.useState(""),C=u||d;t.useEffect(()=>{a&&o&&(0===c.length?(m(),h()):h())},[a,o]),t.useEffect(()=>{a&&o&&w>0&&f()},[w,a,o]);const N=c,A=N.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(k.toLowerCase())),_=v?.workspace?.canCreateWorkspace??!0,j=v?.workspace?.showSwitcher??!0,P=v?.workspace?.maxWorkspacesPerUser??0,T=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==_&&(0===P||T<P);return t.useEffect(()=>{!j&&c.length>0&&!l&&b(c[0]).catch(()=>{})},[j,c,l]),!j&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(C,l)}),e.jsx(wk,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(mc,{open:y,onOpenChange:x,children:[e.jsx(hc,{children:r.trigger?.(C,l)}),e.jsxs(bc,{dir:s,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(vc,{dir:s,children:[e.jsxs(yc,{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(xc,{children:n("workspace.switchDescription")})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.notLoggedIn")})}),i&&e.jsxs("div",{dir:s,className:"flex flex-col gap-4",children:[l&&e.jsx(KE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx($E,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.availableWorkspaces",{count:A.length})}),e.jsx("div",{children:e.jsx(Ra,{progress:d,disabled:d,variant:"ghost",onClick:function(){a&&o&&S(e=>e+1)},startIcon:e.jsx(na,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(aa,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Kf,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>E(e.target.value),className:"ps-10"})]}),u?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(ea,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:n("workspace.loadingWorkspaces")})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Hs,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(k?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(_b,{className:"h-64",dir:s,children:e.jsx("div",{dir:s,className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t._id===l?._id;return e.jsx(KE,{workspace:t,isCurrentWorkspace:r,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N},t._id)})})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx($E,{}),e.jsx(qE,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Mn,exports.useBillingPortal=Dn,exports.useCancelSubscription=In,exports.useCreateCheckoutSession=jn,exports.useInvoice=(e,r)=>{const{t:n}=sn(),{api:s}=kn(),[a,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await s.getInvoice(e,r);i(t.invoice)}catch(t){const s=En(t,"errors.fetchInvoice",n);u(s),Re(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[s,e,r]);return t.useEffect(()=>{d()},[d]),{invoice:a,loading:o,error:l,refetch:d}},exports.useInvoices=Rn,exports.usePermissions=ml,exports.usePlanGroup=An,exports.usePlanGroupVersions=_n,exports.usePublicPlanGroupVersion=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);a(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersion",r);l(n),Re(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else a(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{planGroupVersion:s,loading:i,error:c,refetch:u}},exports.usePublicPlans=Cn,exports.usePushNotifications=Rk,exports.useQuotaUsageContext=Rs,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=sn(),{api:s}=kn(),[a,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await s.getQuotaUsageStatus(e,r);i(t)}catch(t){const s=En(t,"errors.fetchQuotaUsage",n);u(s),Re(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[s,e,r]);return t.useEffect(()=>{d()},[d]),{status:a,loading:o,error:l,refetch:d}},exports.useRecordUsage=e=>{const{t:r}=sn(),{api:n}=kn(),[s,a]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");a(!0),o(null);try{const r=await n.recordUsage(e,t);return Tt(),r}catch(n){const s=En(n,"errors.recordUsage",r);throw o(s),Re(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{a(!1)}},[n,e]),loading:s,error:i}},exports.useResumeSubscription=Un,exports.useSaaSAuth=Ak,exports.useSaaSOs=xn,exports.useSaaSSettings=Sn,exports.useSaaSWorkspaces=js,exports.useSeatStatus=lk,exports.useSubscription=Nn,exports.useSubscriptionContext=zn,exports.useSubscriptionManagement=Tn,exports.useTranslation=sn,exports.useTrialStatus=function(){const{response:e}=zn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=dE(t.trialEnd)??dE(t.stripeCurrentPeriodEnd),n=dE(t.trialStart),s=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:s,trialEndsAt:r,trialStartedAt:n,isTrialEnding:s<=3}},[e])},exports.useUpdateSubscription=Pn,exports.useUsageLogs=(e,r,n)=>{const{t:s}=sn(),{api:a}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[u,d]=t.useState(0),[p,m]=t.useState(1),[h,f]=t.useState(!1),[g,b]=t.useState(!1),[v,y]=t.useState(!1),[x,w]=t.useState(null),S=n?.from,k=n?.to,E=n?.source,C=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),d(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...E&&{source:E},...C&&{page:C},...N&&{limit:N}},n=await a.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),d(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=En(t,"errors.fetchUsageLogs",s);w(n),Re(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[a,e,r,S,k,E,C,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:u,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext(Ok);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=Jk;
|