4a5feb12465f66947af2f40a4785344e/******/////*///// 请勿使用非法用途


过安全狗、云锁、阿里云、360、护卫神、D盾、百度云、各种杀软!

iamH4CKEERRRRRRRRRRRS

I am a hacker in the dark of a very cold night

path :/home/drive/domains/drive.vcenetwork.com/public_html/public

upload file:

List of files:

name file size edit permission action
.htaccess1125 KBFebruary 26 2023 04:58:260644
1.zip1856 KBMay 26 2025 03:52:060644
arl.txt1 KBMay 26 2025 03:58:190644
build-August 19 2024 20:27:470755
cabs.jpg.phtml34996 KBMay 25 2025 13:50:430644
cool30203 KBMay 26 2025 03:49:270644
cool.php44 KBMay 26 2025 03:50:140644
favicon-May 26 2025 07:38:380755
favicon.ico502 KBAugust 19 2024 21:12:300644
htaccess.example1125 KBMay 20 2024 07:03:520755
images-August 19 2024 20:27:470755
index.php1949 KBMay 20 2024 07:03:520755
install_files-July 31 2023 19:05:060755
invoice.css99133 KBMay 20 2024 07:03:520644
manifest.json1055 KBAugust 19 2024 21:25:160644
robots.txt1154 KBJune 07 2025 12:24:520755
storage-May 25 2025 13:49:550755
style.php26 KBMay 26 2025 03:52:280644
swagger.yaml33646 KBMay 20 2024 07:03:520755
web.config914 KBMay 20 2024 07:03:520755
import{u as Ce,j as c,c as F,a as e,C as er,T as n,O as ha,m as h,b as Be,d as A,R as D,r as u,e as Ie,f as ss,S as Mt,I as b,g as L,h as _e,$ as Rt,A as ga,i as ns,k as rs,K as tr,l as aa,n as Z,D as ae,o as oe,p as ie,q as H,F as pe,s as ar,B as x,t as E,v as V,w as ct,x as Vt,y as B,z as U,E as M,G as ce,H as Ee,J as fa,L as ba,M as ye,N as W,P as is,Q as Ue,U as sa,V as me,W as Bt,X as ls,Y as Tt,Z as sr,_ as os,a0 as Ra,a1 as et,a2 as qe,a3 as cs,a4 as Je,a5 as j,a6 as va,a7 as nr,a8 as rr,a9 as na,aa as ds,ab as R,ac as g,ad as P,ae as Ae,af as ir,ag as lr,ah as Ut,ai as Va,aj as or,ak as us,al as X,am as ot,an as ms,ao as xe,ap as cr,aq as dr,ar as ur,as as ya,at as mr,au as pr,av as ps,aw as qt,ax as tt,ay as xa,az as he,aA as we,aB as hs,aC as wa,aD as Sa,aE as Oe,aF as dt,aG as Se,aH as Ba,aI as Ot,aJ as hr,aK as gr,aL as ka,aM as Ze,aN as gs,aO as fr,aP as br,aQ as vr,aR as fs,aS as yr,aT as xr,aU as bs,aV as wr,aW as Sr,aX as kr,aY as Nr,aZ as vs,a_ as Cr,a$ as Xe,b0 as _r,b1 as $r,b2 as Na,b3 as Pr,b4 as J,b5 as Fr}from"./main.b7d280d4.js";import{D as Ar,a as Tr,b as zr,c as Ir,B as ze,F as le,d as Ne,C as ut,U as mt,A as ys,P as Er,K as xs,e as Ca,u as _a,I as Lr,N as Dr,f as Mr,S as Rr,g as $a,h as Vr,T as Br,i as ve,j as Ur,k as qr,l as Or,m as Hr,n as Xt,o as ws,p as Ss,L as ks,q as Ns,r as ra,s as Cs,t as Wr,v as Gr,w as zt,x as Ht,y as Pa,z as jr,E as z,M as Kr,G as Qr,H as Jr,J as Zr,O as Xr,Q as Yr,R as ei,V as ti,W as Ua}from"./date-picker.5c1c2eea.js";import{E as He,B as ai,a as qa}from"./Edit.b85e7693.js";import{u as _s,a as si}from"./use-resume-subscription.493553db.js";class ni{getStringForLocale(a,s){let r=this.strings[s];r||(r=ri(s,this.strings,this.defaultLocale),this.strings[s]=r);let i=r[a];if(!i)throw new Error(`Could not find intl message ${a} in ${s} locale`);return i}constructor(a,s="en-US"){this.strings={...a},this.defaultLocale=s}}function ri(t,a,s="en-US"){if(a[t])return a[t];let r=ii(t);if(a[r])return a[r];for(let i in a)if(i.startsWith(r+"-"))return a[i];return a[s]}function ii(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}function li({className:t,isCompactMode:a}){const{version:s}=Ce();return c("div",{className:F(t,"text-sm pt-26 px-12 pb-16 text-muted font-medium bg-alt flex flex-col gap-20 border-r overflow-y-auto relative"),children:[e(er,{matchDescendants:r=>r==="/admin",menu:"admin-sidebar",orientation:"vertical",onlyShowIcons:a,itemClassName:({isActive:r})=>F("block w-full rounded py-12 px-16 border-l-4",r?"bg-primary/hover border-l-primary":"border-l-transparent hover:bg-hover"),gap:"gap-8"}),e("div",{className:"mt-auto gap-14 px-16 text-xs",children:e(n,{message:"Version: :number",values:{number:s}})})]})}function oi(){return c(Ar,{name:"admin",leftSidenavCanBeCompact:!0,children:[e(Tr,{size:"sm",color:"primary",menuPosition:"admin-navbar"}),e(zr,{position:"left",size:"sm",children:e(li,{})}),e(Ir,{children:e("div",{className:"bg dark:bg-alt",children:e(ha,{})})})]})}const ci=[new ze({type:le.Select,key:"email_verified_at",label:h("Email"),description:h("Email verification status"),defaultValue:"01",defaultOperator:Ne.ne,options:[{key:"01",label:h("is confirmed"),value:{value:null,operator:Ne.ne}},{key:"02",label:h("is not confirmed"),value:{value:null,operator:Ne.eq}}]}),new ut({description:h("Date user registered or was created")}),new mt({description:h("Date user was last updated")}),new ze({type:le.Select,key:"subscriptions",label:h("Subscription"),description:h("Whether user is subscribed or not"),defaultValue:"01",options:[{key:"01",label:h("is subscribed"),value:{value:"*",operator:Ne.has}},{key:"02",label:h("is not subscribed"),value:{value:"*",operator:Ne.doesntHave}}]})];function pt({image:t,label:a,description:s}){return c("div",{className:"flex items-center gap-12 w-max",children:[t&&e(ys,{size:"md",src:t}),c("div",{children:[e("div",{children:a}),e("div",{className:"text-muted text-xs",children:s})]})]})}const K=(t,a)=>{const s=t.split("/");return a&&s.push(a),s};function di(t,a,s){return Be(K(t,a),()=>ui(t,a),{...s,keepPreviousData:!0})}function ui(t,a){return A.get(t,{params:a}).then(s=>s.data)}const $s=D.createContext(null);function ht(){return u.exports.useContext($s)}function It(t){return e(Er,{...t})}const mi=15,pi=[{key:10},{key:15},{key:20},{key:50},{key:100}];function hi({query:t}){var d;const a=Ie(),s=ss(),{params:r,setParams:i}=ht(),l=(d=t.data)==null?void 0:d.pagination;if(!l)return null;const o=e(Mt,{"data-testid":"paginate-per-page",minWidth:"min-w-auto",selectionMode:"single",disabled:t.isLoading,labelPosition:"side",size:"xs",label:e(n,{message:"Items per page"}),selectedValue:r.perPage||mi,onSelectionChange:m=>{i({...r,perPage:m})},children:pi.map(m=>e(b,{value:m.key,children:m.key},m.key))});return c("div",{className:"flex items-center justify-end gap-20 px-20 h-54 select-none",children:[!a&&o,l.from&&l.to&&e("div",{className:"text-sm","data-testid":"pagination-info","data-total":l.total,children:e(n,{message:":from - :to of :total",values:{from:l.from,to:l.to,total:s.format(l.total)}})}),c("div",{className:"text-muted",children:[e(L,{"data-testid":"paginate-prev",disabled:t.isLoading||!l.prev_page,onClick:()=>{i({...r,page:l.prev_page})},children:e(xs,{})}),e(L,{"data-testid":"paginate-next",disabled:t.isLoading||!l.next_page,onClick:()=>{i({...r,page:l.next_page})},children:e(Ca,{})})]})]})}const Oa=_e(e("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAltOutlined"),We=D.forwardRef(({variant:t="default",mode:a="single",children:s,className:r,...i},l)=>{const[o,d]=Rt(i.expandedValues,i.defaultExpandedValues||[],i.onExpandedChange);return e("div",{className:F(t==="outline"&&"space-y-10",r),ref:l,role:"presentation",children:e(ga,{children:e(ns,{children:D.Children.map(s,(m,p)=>u.exports.isValidElement(m)?u.exports.cloneElement(m,{key:m.key||p,value:m.props.value||p,mode:a,variant:t,expandedValues:o,setExpandedValues:d}):null)})})})});function be({children:t,label:a,disabled:s,bodyClassName:r,startIcon:i,description:l,endAppend:o,chevronPosition:d="right",dataTestId:m,...p}){const{expandedValues:f,setExpandedValues:v,variant:y,value:w,mode:C}=p,N=u.exports.useRef(null),S=!s&&f.includes(w),k=rs(),$=u.exports.useId(),G=`${$}-button`,T=`${$}-panel`,se=Q=>{switch(Q.key){case"ArrowDown":k.focusNext();break;case"ArrowUp":k.focusPrevious();break;case"Home":k.focusFirst();break;case"End":k.focusLast();break}},Y={open:{height:"auto",visibility:"visible",transitionEnd:{overflow:"auto"}},closed:{height:0,overflow:"hidden",transitionEnd:{visibility:"hidden"}}},ne=()=>{const Q=f.indexOf(w);if(Q>-1){const ee=[...f];ee.splice(Q,1),v(ee)}else v(C==="single"?[w]:[...f,w])},ue=e("div",{className:F(y==="minimal"&&""),children:e(tr,{"aria-hidden":"true",size:"md",className:F(s?"text-disabled":"text-muted",S&&"rotate-180 transition-transform")})});return c("div",{className:F(y==="default"&&"border-b",y==="outline"&&"border rounded",s&&"text-disabled"),children:[c("h3",{className:F("flex items-center text-sm justify-between w-full",s&&"pointer-events-none",S&&y!=="minimal"&&"border-b",y==="outline"?S?"rounded-t":"rounded":void 0),children:[c("button",{"data-testid":m,disabled:s,"aria-expanded":S,id:G,"aria-controls":T,type:"button",ref:N,onKeyDown:se,onClick:()=>{s||ne()},className:"flex items-center text-left gap-10 flex-auto pl-14 pr-10 py-10 hover:bg-hover outline-none focus-visible:bg-primary/focus",children:[d==="left"&&ue,i&&u.exports.cloneElement(i,{size:"md",className:F(i.props.className,s?"text-disabled":"text-muted")}),c("div",{className:"flex-auto overflow-hidden overflow-ellipsis",children:[e("div",{"data-testid":"accordion-label",children:a}),l&&e("div",{className:"text-muted text-xs",children:l})]}),d==="right"&&ue]}),o&&e("div",{className:"flex-shrink-0 text-sm text-muted px-4",children:o})]}),e(aa.div,{"aria-labelledby":$,role:"region",variants:Y,transition:{type:"tween",duration:.2},initial:!1,animate:S?"open":"closed",children:e("div",{className:F("p-16",r),children:t})})]})}function gi({filter:t}){return null}function fi({filters:t}){const{decodedFilters:a}=_a(t),{formId:s}=Z(),[r,i]=u.exports.useState(()=>a.map(d=>d.key));return c(ae,{className:"min-w-[300px]",maxWidth:"max-w-400",size:"auto",children:[e(oe,{padding:"px-14 py-10",leftAdornment:e(x,{size:"xs",variant:"outline",className:"mr-auto",onClick:()=>{i([])},"data-testid":"clear-filters-button",children:e(n,{message:"Clear"})}),rightAdornment:e(x,{size:"xs",variant:"flat",color:"primary",className:"ml-auto",type:"submit",form:s,"data-testid":"apply-filters-button",children:e(n,{message:"Apply"})}),children:e(n,{message:"Filter"})}),e(ie,{padding:"p-0",children:e(bi,{filters:t,expandedFilters:r,setExpandedFilters:i})})]})}function bi({filters:t,expandedFilters:a,setExpandedFilters:s}){const{decodedFilters:r,replaceAll:i}=_a(t),l={};t.forEach(p=>{const f=r.find(v=>v.key===p.key);l[p.key]=(f==null?void 0:f.value)!==void 0?{value:f.value,operator:f.operator}:{value:p.defaultValue,operator:p.defaultOperator}});const o=H({defaultValues:l}),{formId:d,close:m}=Z();return e(pe,{form:o,id:d,onSubmit:p=>{const f=Object.entries(p).filter(([v,y])=>a.includes(v)&&y!==void 0).map(([v,y])=>({key:v,...y}));i(f),m()},children:e(We,{mode:"multiple",expandedValues:a,onExpandedChange:s,children:t.map(p=>c(be,{dataTestId:`filter-${p.key}-toggle`,startIcon:e(ar,{checked:a.includes(p.key)}),value:p.key,label:e(n,{...p.label}),children:[p.description&&e("div",{className:F("text-muted text-xs",p.type!==le.BooleanToggle&&"mb-14"),children:e(n,{...p.description})}),e(vi,{filter:p})]},p.key))})})}function vi({filter:t}){switch(t.type){case le.Select:return e(Rr,{filter:t});case le.DatePicker:return e(Mr,{filter:t});case le.SelectModel:return e(Dr,{filter:t});case le.Input:return e(Lr,{filter:t});case le.BooleanToggle:return e(gi,{filter:t})}}function yi({filters:t}){const a=Ie();return c(E,{type:"popover",children:[a?e(L,{color:"primary",size:"sm",variant:"outline",radius:"rounded",className:"flex-shrink-0","data-testid":"add-filter-button",children:e(Oa,{})}):e(x,{variant:"outline",color:"primary",startIcon:e(Oa,{}),size:"sm",className:"text-muted","data-testid":"add-filter-button",children:e(n,{message:"Filter"})}),e(fi,{filters:t})]})}function xi({actions:t,filters:a}){const{trans:s}=V(),{params:r,setParams:i,searchPlaceholder:l}=ht();return c(Ps,{children:[e(ct,{inputTestId:"datatable-search",className:"flex-auto max-w-440 mr-auto",inputWrapperClassName:"mr-24 md:mr-0",placeholder:s(l),startAdornment:e($a,{}),value:r.query||"",onChange:o=>{i({...r,query:o.target.value})}}),a&&e(yi,{filters:a}),t]})}function wi({actions:t}){const{selectedRows:a}=ht();return c(Ps,{"data-testid":"datatable-selected-header",children:[e("div",{className:"mr-auto",children:e(n,{message:"[one 1 item|other :count items] selected",values:{count:a.length}})}),t]})}function Ps({children:t,...a}){return e("div",{className:"mb-24 flex items-center gap-8 md:gap-12 text-muted relative h-42",...a,children:t})}function Fs({filters:t,columns:a,searchPlaceholder:s,queryParams:r,endpoint:i,actions:l,selectedActions:o,emptyStateMessage:d,tableDomProps:m,onRowAction:p,enableSelection:f=!0,children:v}){var se;const{trans:y}=V(),{encodedFilters:w}=_a(t),[C,N]=u.exports.useState({perPage:15}),[S,k]=u.exports.useState([]),$=di(i,{...C,...r,filters:w},{onSuccess:()=>{k([])}}),G=!!(C.query||C.filters||w),T=(se=$.data)==null?void 0:se.pagination;return s||(s=h("Type to search...")),c($s.Provider,{value:{selectedRows:S,setSelectedRows:k,endpoint:i,searchPlaceholder:s,params:C,setParams:N,query:$},children:[v,e(ga,{initial:!1,mode:"wait",children:S.length?e(wi,{actions:o},"selected"):e(xi,{actions:l,filters:t},"default")}),t&&e(Vr,{className:"mb-14",filters:t}),c("div",{className:"relative border rounded",children:[$.isLoading&&e(It,{isIndeterminate:!0,className:"absolute top-0 left-0 w-full z-10","aria-label":y({message:"Loading"}),size:"xs"}),e("div",{className:"relative overflow-x-auto md:overflow-hidden",children:e(Br,{...m,"data-loaded":!$.isLoading,columns:a,data:(T==null?void 0:T.data)||[],sortDescriptor:C,onSortChange:Y=>{N({...C,...Y})},selectedRows:S,enableSelection:f,onSelectionChange:k,onAction:p})}),($.isFetched||$.isPreviousData)&&!(T!=null&&T.data.length)?e("div",{className:"pt-50","data-testid":"empty-state-message",children:u.exports.cloneElement(d,{isFiltering:G})}):void 0,e(hi,{query:$})]})]})}function Ge({title:t,headerContent:a,headerItemsAlign:s="items-end",...r}){const i=u.exports.useId();return c("div",{className:"p-12 md:p-24",children:[t&&c("div",{className:F("mb-16",a&&`flex ${s} gap-4`),children:[e(Vt,{children:t}),e("h1",{className:"text-3xl font-light",id:i,children:t}),a]}),e(Fs,{...r,tableDomProps:{"aria-labelledby":t?i:void 0}})]})}function Si(t,a){return A.delete(`${t}/${a.join(",")}`).then(s=>s.data)}function ki(){const{endpoint:t,selectedRows:a,setSelectedRows:s}=ht();return B(()=>Si(t,a),{onSuccess:()=>{U(h("Deleted [one 1 record|other :count records]",{values:{count:a.length}})),s([]),M.invalidateQueries(K(t))},onError:r=>ce(r,h("Could not delete records"))})}function at(){const t=ki(),{selectedRows:a}=ht();return c(E,{type:"modal",onClose:s=>{s&&t.mutate()},children:[e(x,{variant:"flat",color:"danger",className:"ml-auto",disabled:t.isLoading,"data-testid":"delete-rows-button",children:e(n,{message:"Delete"})}),e(Ee,{title:e(n,{message:"Delete [one 1 item|other :count items]?",values:{count:a.length}}),body:e(n,{message:"This will permanently remove the items and cannot be undone."}),confirm:e(n,{message:"Delete"}),isDanger:!0})]})}function Fe({isFiltering:t,title:a,filteringTitle:s,image:r}){const i=Ie();return e(fa,{size:i?"sm":"md",image:e(ba,{src:r}),title:t&&s?s:a,description:t&&s?e(n,{message:"Try another search query or different filters"}):void 0})}const wt=""+new URL("team.de984127.svg",import.meta.url).href,st=D.forwardRef(({children:t,to:a,elementType:s,onClick:r},i)=>Ie()?e(L,{ref:i,variant:"flat",color:"primary",radius:"rounded",className:"flex-shrink-0",size:"sm",to:a,elementType:s,onClick:r,children:e(ve,{})}):e(x,{ref:i,startIcon:e(ve,{}),variant:"flat",color:"primary",size:"sm",to:a,elementType:s,onClick:r,children:t}));function Ni(t){return B(a=>Ci(t,a),{onError:a=>ce(a)})}function Ci(t,a){return A.post(t,a).then(s=>s.data)}function _i(){const{close:t}=Z();return c(ae,{children:[e(oe,{children:e(n,{message:"Csv export"})}),e(ie,{children:e(n,{message:"Your request is being processed. We'll email you when the report is ready to download. In certain cases, it might take a little longer, depending on the number of items beings exported and the volume of activity."})}),e(ye,{children:e(x,{variant:"flat",color:"primary",onClick:t,children:e(n,{message:"Got it"})})})]})}function As({endpoint:t,payload:a}){const[s,r]=u.exports.useState(!1),i=Ni(t);return c(u.exports.Fragment,{children:[e(L,{variant:"outline",color:"primary",radius:"rounded",size:"sm",className:"flex-shrink-0",disabled:i.isLoading,onClick:()=>{i.mutate(a,{onSuccess:l=>{l.downloadPath?Ur(l.downloadPath):r(!0)}})},children:e(qr,{})}),e(E,{type:"modal",isOpen:s,onOpenChange:r,children:e(_i,{})})]})}const Ha=[{key:"name",allowsSorting:!0,sortingKey:"email",header:()=>e(n,{message:"User"}),body:t=>e(pt,{image:t.avatar,label:t.display_name,description:t.email})},{key:"subscribed",header:()=>e(n,{message:"Subscribed"}),body:t=>{var a;return(a=t.subscriptions)!=null&&a.length?e(is,{className:"icon-md text-positive"}):e(Ue,{className:"icon-md text-danger"})}},{key:"roles",header:()=>e(n,{message:"Roles"}),body:t=>e(Or,{radius:"rounded",size:"xs",children:t.roles.map(a=>e(sa,{selectable:!0,children:e(W,{className:F("capitalize"),target:"_blank",to:`/admin/roles/${a.id}/edit`,children:a.name})},a.id))})},{key:"firstName",allowsSorting:!0,header:()=>e(n,{message:"First name"}),body:t=>t.first_name},{key:"lastName",allowsSorting:!0,header:()=>e(n,{message:"Last name"}),body:t=>t.last_name},{key:"createdAt",allowsSorting:!0,header:()=>e(n,{message:"Created at"}),body:t=>e(me,{date:t.created_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",body:t=>e(W,{to:`${t.id}/edit`,children:e(L,{size:"md",className:"text-muted",children:e(He,{})})})}];function $i(){const{billing:t}=Ce();return t.enable||Ha.splice(1,1),e(u.exports.Fragment,{children:e(Ge,{endpoint:"users",title:e(n,{message:"Users"}),filters:ci,columns:Ha,actions:e(Pi,{}),queryParams:{with:"subscriptions"},selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:wt,title:e(n,{message:"No users have been created yet"}),filteringTitle:e(n,{message:"No matching users"})})})})}function Pi(){return c(u.exports.Fragment,{children:[e(As,{endpoint:"users/csv/export"}),e(st,{elementType:W,to:"new",children:e(n,{message:"Add new user"})})]})}const Fi=t=>(a,s,r)=>{const i=r.subscribe;return r.subscribe=(o,d,m)=>{let p=o;if(d){const f=(m==null?void 0:m.equalityFn)||Object.is;let v=o(r.getState());p=y=>{const w=o(y);if(!f(v,w)){const C=v;d(v=w,C)}},m!=null&&m.fireImmediately&&d(v,v)}return i(p)},t(a,s,r)},Ai=Fi;function Ti(t,a){return t.reduce((s,r,i)=>{const l=Math.floor(i/a);return s[l]||(s[l]=[]),s[l].push(r),s},[])}const zi={preview:{defaultRoute:"/",navigationRoutes:[]},sections:{general:{label:h("General"),position:1,buildBreadcrumb:()=>[{label:h("General"),location:"general"}]},themes:{label:h("Themes"),position:2,buildBreadcrumb:(t,a)=>{var l;const s=t.split("/").filter(o=>!!o),[,,,r]=s,i=[{label:h("Themes"),location:"themes"}];return r!=null&&i.push({label:(l=a.appearance.themes.all[+r])==null?void 0:l.name,location:`themes/${r}`}),i}},menus:{label:h("Menus"),position:3,buildBreadcrumb:(t,a)=>{const s=t.split("/").filter(o=>!!o),[,,...r]=s,i=[{label:h("Menus"),location:"menus"}],l=Ti(r,2);return l.forEach(([o,d],m)=>{var p,f;if(o==="menus"&&d!=null)i.push({label:(p=a.settings.menus[+d])==null?void 0:p.name,location:`menus/${d}`});else if(o==="items"&&d!=null){const[,v]=l[m-1];i.push({label:(f=a.settings.menus[+v].items[+d])==null?void 0:f.label,location:`menus/${v}/${d}`})}}),i},config:{availableRoutes:["/login","/register","/contact","/billing/pricing","/account-settings","/admin","/admin/appearance","/admin/settings","/admin/plans","/admin/subscriptions","/admin/users","/admin/roles","/admin/pages","/admin/tags","/admin/files","/admin/localizations","/admin/ads","/admin/settings/authentication","/admin/settings/branding","/admin/settings/cache","/admin/settings/providers","/api-routes"],positions:["admin-navbar","admin-sidebar","custom-page-navbar","auth-page-footer","auth-dropdown","account-settings-page","billing-page","checkout-page-navbar","checkout-page-footer","pricing-table-page","contact-us-page","notifications-page"]}},"custom-code":{label:h("Custom Code"),position:4,buildBreadcrumb:()=>[{label:h("Custom code"),location:"custom-code"}]},"seo-settings":{label:h("Seo Settings"),position:5,buildBreadcrumb:()=>[{label:h("Seo"),location:"seo"}]}}};function Ii(t){const{size:a="md",inline:s,label:r,showValueLabel:i=!!r,className:l,slider:o,children:d}=t,{domProps:m,trackRef:p,getThumbPercent:f,getThumbValueLabel:v,labelId:y,groupId:w,thumbIds:C,isDisabled:N,numberFormatter:S,minValue:k,maxValue:$,step:G,values:T,getValueLabel:se}=o;let Y="",ne=Math.max([...S.format(k)].length,[...S.format($)].length,[...S.format(G)].length);se?Y=se(T[0]):T.length===1?Y=v(0):T.length===2&&(Y=`${v(0)} \u2013 ${v(1)}`,ne=3+2*Math.max(ne,[...S.format(k)].length,[...S.format($)].length));const ue=Bt({size:a,disabled:N,labelDisplay:"flex"}),Q=F("w-full flex-shrink-0 touch-none",l,{"flex items-center":s});return c("div",{className:Q,role:"group",id:w,children:[c("div",{className:F(ue.label,"select-none"),children:[r&&e("label",{onClick:()=>{var ee;(ee=document.getElementById(C[0]))==null||ee.focus()},id:y,htmlFor:w,children:r}),i&&e("output",{htmlFor:C[0],className:"ml-auto text-right","aria-live":"off",style:ne?{width:`${ne}ch`,minWidth:`${ne}ch`}:void 0,children:Y})]}),c("div",{ref:p,className:"h-30 relative",...m,role:"presentation",children:[e("div",{className:`absolute inset-0 m-auto h-4 rounded ${N?"bg-disabled":"bg-primary-light"}`}),e("div",{className:`absolute inset-0 my-auto h-4 rounded ${N?"bg-disabled-fg":"bg-primary"}`,style:{width:`${f(0)*100}%`}}),d]})]})}function Ei({minValue:t=0,maxValue:a=100,isDisabled:s=!1,step:r=1,formatOptions:i,onChangeEnd:l,label:o,getValueLabel:d,...m}){var Ma;const p=ss(i),{addGlobalListener:f,removeGlobalListener:v}=ls(),y=u.exports.useRef(null),[w,C]=Rt(m.value?m.value:void 0,(Ma=m.defaultValue)!=null?Ma:[t],m.onChange),N=u.exports.useRef(null);N.current=w;const[S,k]=u.exports.useState(new Array(w.length).fill(!1)),$=u.exports.useRef(null);$.current=S;function G(_){return p.format(_)}const T=_=>{var q;return((q=$.current)==null?void 0:q[_])||!1},se=_=>G(w[_]),Y=_=>_===0?t:w[_-1],ne=_=>_===w.length-1?a:w[_+1],ue=(_,q)=>{if(s||!Kt(_)||!N.current)return;const $e=Y(_),Le=ne(_);q=sr(q,$e,Le,r),N.current=Wa(N.current,_,q),C(N.current)},Q=(_,q)=>{var Le;if(s||!Kt(_))return;const $e=(Le=$.current)==null?void 0:Le[_];$.current=Wa($.current||[],_,q),k($.current),l&&$e&&!$.current.some(Boolean)&&l(N.current||[])},[ee,je]=u.exports.useState(void 0),it=_=>(_-t)/(a-t),Ke=_=>it(N.current[_]),ke=(_,q)=>{ue(_,Ia(q))},re=_=>Math.round((_-t)/r)*r+t,Ia=_=>{const q=_*(a-t)+t;return Tt(re(q),t,a)},Ea=u.exports.useRef(new Array(w.length).fill(!0)),Kt=_=>Ea.current[_],jn=(_,q)=>{Ea.current[_]=q},fe=u.exports.useRef(null),La=u.exports.useRef(void 0),Kn=_=>{if(!(_.pointerType==="mouse"&&(_.button!==0||_.altKey||_.ctrlKey||_.metaKey))&&y.current&&!s&&w.every((q,$e)=>!S[$e])){const q=y.current.offsetWidth,$e=y.current.getBoundingClientRect().left,Jt=(_.clientX-$e)/q,Ft=Ia(Jt);let Te;const Qe=w.findIndex(Zt=>Ft-Zt<0);if(Qe===0)Te=Qe;else if(Qe===-1)Te=w.length-1;else{const Zt=w[Qe-1],Yn=w[Qe];Math.abs(Zt-Ft)=0&&Kt(Te)?(_.preventDefault(),fe.current=Te,je(Te),La.current=_.pointerId,Q(fe.current,!0),ue(Te,Ft),f(window,"pointerup",Da,!1)):fe.current=null}},ft=u.exports.useRef(null),{domProps:Qn}=Hr({onPointerDown:Kn,onMoveStart(){ft.current=null},onMove(_,q){var Le;const $e=((Le=y.current)==null?void 0:Le.offsetWidth)||0;if(ft.current==null&&(ft.current=Ke(fe.current||0)*$e),ft.current+=q,fe.current!=null&&y.current){const Jt=Tt(ft.current/$e,0,1);ke(fe.current,Jt)}},onMoveEnd(){fe.current!=null&&(Q(fe.current,!1),fe.current=null)}}),Da=_=>{_.pointerId===La.current&&(fe.current!=null&&(Q(fe.current,!1),fe.current=null),v(window,"pointerup",Da,!1))},Qt=u.exports.useId(),Jn=o?`${Qt}-label`:void 0,Zn=`${Qt}-group`,Xn=[...Array(w.length)].map((_,q)=>`${Qt}-thumb-${q}`);return{domProps:Qn,trackRef:y,isDisabled:s,step:r,values:w,minValue:t,maxValue:a,focusedThumb:ee,labelId:Jn,groupId:Zn,thumbIds:Xn,numberFormatter:p,getThumbPercent:Ke,getThumbMinValue:Y,getThumbMaxValue:ne,getThumbValueLabel:se,isThumbDragging:T,setThumbValue:ue,updateDraggedThumbs:Q,setThumbEditable:jn,setFocusedThumb:je,getValueLabel:d}}function Wa(t,a,s){return t[a]===s?t:[...t.slice(0,a),s,...t.slice(a+1)]}function Li({index:t,slider:a,isDisabled:s,ariaLabel:r,inputRef:i,onBlur:l}){const o=os(i),{addGlobalListener:d,removeGlobalListener:m}=ls(),{step:p,values:f,focusedThumb:v,labelId:y,thumbIds:w,isDisabled:C,getThumbPercent:N,getThumbMinValue:S,getThumbMaxValue:k,getThumbValueLabel:$,setThumbValue:G,updateDraggedThumbs:T,isThumbDragging:se,setThumbEditable:Y,setFocusedThumb:ne}=a,ue=f[t];Y(t,!s);const Q=s||C,ee=u.exports.useCallback(()=>{o.current&&o.current.focus({preventScroll:!0})},[o]),je=v===t;u.exports.useEffect(()=>{je&&ee()},[je,ee]);const it=u.exports.useRef(void 0),Ke=re=>{re.pointerId===it.current&&(ee(),T(t,!1),m(window,"pointerup",Ke,!1))},ke=F("outline-none rounded-full w-18 h-18 top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",!Q&&"focus-within:ring focus-within:ring-primary-light shadow-md",Di({isDisabled:Q,isDragging:se(t)}));return e("div",{role:"presentation",className:ke,style:{left:`${Math.max(N(t)*100,0)}%`},onPointerDown:re=>{re.button!==0||re.altKey||re.ctrlKey||re.metaKey||(ee(),it.current=re.pointerId,T(t,!0),d(window,"pointerup",Ke,!1))},children:e("input",{id:w[t],onKeyDown:Ra(()=>{T(t,!0)}),onKeyUp:Ra(()=>{T(t,!1)}),ref:o,tabIndex:Q?void 0:0,min:S(t),max:k(t),step:p,value:ue,disabled:Q,"aria-label":r,"aria-labelledby":y,"aria-orientation":"horizontal","aria-valuetext":$(t),onFocus:()=>{ne(t)},onBlur:re=>{ne(void 0),T(t,!1),l==null||l(re)},onChange:re=>{G(t,parseFloat(re.target.value))},type:"range",className:"sr-only"})})}function Di({isDisabled:t,isDragging:a}){return t?"bg-slider-disabled cursor-default":F("hover:bg-primary-dark",a?"bg-primary-dark":"bg-primary")}function Mi({inputRef:t,onBlur:a,...s}){const{onChange:r,onChangeEnd:i,value:l,defaultValue:o,...d}=s,m={...d,value:l!=null?[l]:void 0,defaultValue:o!=null?[o]:void 0,onChange:f=>{r==null||r(f[0])},onChangeEnd:f=>{i==null||i(f[0])}},p=Ei(m);return e(Ii,{...m,slider:p,children:e(Li,{index:0,slider:p,inputRef:t,onBlur:a})})}function Ri({name:t,...a}){const{field:{onChange:s,onBlur:r,value:i="",ref:l}}=et({name:t});return e(Mi,{inputRef:l,...qe({onChange:s,onBlur:r,value:i||""},a)})}const Pe=u.exports.forwardRef(({startIcon:t,children:a,className:s,...r},i)=>c(cs,{ref:i,className:F("flex items-center gap-10 w-full rounded border text-sm h-54 px-14 mb-10 bg relative hover:bg-hover",s),variant:null,...r,children:[t,e("div",{children:a}),e(Ca,{className:"icon-sm text-muted ml-auto"})]})),Ts=_e(e("path",{stroke:"#E0E0E0",d:"M24,44c-7.168,0-13-5.816-13-12.971C11,24,24,4,24,4s13,20,13,27.029C37,38.184,31.168,44,24,44z"}));function gt(){return(gt=Object.assign||function(t){for(var a=1;a=0||(i[s]=t[s]);return i}function St(t){var a=u.exports.useRef(t),s=u.exports.useRef(function(r){a.current&&a.current(r)});return a.current=t,s.current}var kt=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=1),t>s?s:t0:S.buttons>0)&&i.current?l(Ga(i.current,S,d.current)):N(!1)},C=function(){return N(!1)};function N(S){var k=m.current,$=ia(i.current),G=S?$.addEventListener:$.removeEventListener;G(k?"touchmove":"mousemove",w),G(k?"touchend":"mouseup",C)}return[function(S){var k=S.nativeEvent,$=i.current;if($&&(ja(k),!function(T,se){return se&&!yt(T)}(k,m.current)&&$)){if(yt(k)){m.current=!0;var G=k.changedTouches||[];G.length&&(d.current=G[0].identifier)}$.focus(),l(Ga($,k,d.current)),N(!0)}},function(S){var k=S.which||S.keyCode;k<37||k>40||(S.preventDefault(),o({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},N]},[o,l]),f=p[0],v=p[1],y=p[2];return u.exports.useEffect(function(){return y},[y]),e("div",{...gt({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:v,tabIndex:0,role:"slider"})})}),Fa=function(t){return t.filter(Boolean).join(" ")},Is=function(t){var a=t.color,s=t.left,r=t.top,i=r===void 0?.5:r,l=Fa(["react-colorful__pointer",t.className]);return e("div",{className:l,style:{top:100*i+"%",left:100*s+"%"},children:e("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:a}})})},te=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=Math.pow(10,a)),Math.round(s*t)/s},Vi=function(t){return Hi(la(t))},la=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?te(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?te(parseInt(t.substring(6,8),16)/255,2):1}},Bi=function(t){return Oi(qi(t))},Ui=function(t){var a=t.s,s=t.v,r=t.a,i=(200-a)*s/100;return{h:te(t.h),s:te(i>0&&i<200?a*s/100/(i<=100?i:200-i)*100:0),l:te(i/2),a:te(r,2)}},oa=function(t){var a=Ui(t);return"hsl("+a.h+", "+a.s+"%, "+a.l+"%)"},qi=function(t){var a=t.h,s=t.s,r=t.v,i=t.a;a=a/360*6,s/=100,r/=100;var l=Math.floor(a),o=r*(1-s),d=r*(1-(a-l)*s),m=r*(1-(1-a+l)*s),p=l%6;return{r:te(255*[r,d,o,o,m,r][p]),g:te(255*[m,r,r,d,o,o][p]),b:te(255*[o,o,m,r,r,d][p]),a:te(i,2)}},At=function(t){var a=t.toString(16);return a.length<2?"0"+a:a},Oi=function(t){var a=t.r,s=t.g,r=t.b,i=t.a,l=i<1?At(te(255*i)):"";return"#"+At(a)+At(s)+At(r)+l},Hi=function(t){var a=t.r,s=t.g,r=t.b,i=t.a,l=Math.max(a,s,r),o=l-Math.min(a,s,r),d=o?l===a?(s-r)/o:l===s?2+(r-a)/o:4+(a-s)/o:0;return{h:te(60*(d<0?d+6:d)),s:te(l?o/l*100:0),v:te(l/255*100),a:i}},Wi=D.memo(function(t){var a=t.hue,s=t.onChange,r=Fa(["react-colorful__hue",t.className]);return D.createElement("div",{className:r},D.createElement(zs,{onMove:function(i){s({h:360*i.left})},onKey:function(i){s({h:kt(a+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":te(a),"aria-valuemax":"360","aria-valuemin":"0"},D.createElement(Is,{className:"react-colorful__hue-pointer",left:a/360,color:oa({h:a,s:100,v:100,a:1})})))}),Gi=D.memo(function(t){var a=t.hsva,s=t.onChange,r={backgroundColor:oa({h:a.h,s:100,v:100,a:1})};return D.createElement("div",{className:"react-colorful__saturation",style:r},D.createElement(zs,{onMove:function(i){s({s:100*i.left,v:100-100*i.top})},onKey:function(i){s({s:kt(a.s+100*i.left,0,100),v:kt(a.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+te(a.s)+"%, Brightness "+te(a.v)+"%"},D.createElement(Is,{className:"react-colorful__saturation-pointer",top:1-a.v/100,left:a.s/100,color:oa(a)})))}),Es=function(t,a){if(t===a)return!0;for(var s in t)if(t[s]!==a[s])return!1;return!0},ji=function(t,a){return t.toLowerCase()===a.toLowerCase()||Es(la(t),la(a))};function Ki(t,a,s){var r=St(s),i=u.exports.useState(function(){return t.toHsva(a)}),l=i[0],o=i[1],d=u.exports.useRef({color:a,hsva:l});u.exports.useEffect(function(){if(!t.equal(a,d.current.color)){var p=t.toHsva(a);d.current={hsva:p,color:a},o(p)}},[a,t]),u.exports.useEffect(function(){var p;Es(l,d.current.hsva)||t.equal(p=t.fromHsva(l),d.current.color)||(d.current={hsva:l,color:p},r(p))},[l,t,r]);var m=u.exports.useCallback(function(p){o(function(f){return Object.assign({},f,p)})},[]);return[l,m]}var Qi=typeof window<"u"?u.exports.useLayoutEffect:u.exports.useEffect,Ji=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Ka=new Map,Zi=function(t){Qi(function(){var a=t.current?t.current.ownerDocument:document;if(a!==void 0&&!Ka.has(a)){var s=a.createElement("style");s.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Ka.set(a,s);var r=Ji();r&&s.setAttribute("nonce",r),a.head.appendChild(s)}},[])},Xi=function(t){var a=t.className,s=t.colorModel,r=t.color,i=r===void 0?s.defaultColor:r,l=t.onChange,o=Wt(t,["className","colorModel","color","onChange"]),d=u.exports.useRef(null);Zi(d);var m=Ki(s,i,l),p=m[0],f=m[1],v=Fa(["react-colorful",a]);return c("div",{...gt({},o,{ref:d,className:v}),children:[e(Gi,{hsva:p,onChange:f}),e(Wi,{hue:p.h,onChange:f,className:"react-colorful__last-control"})]})},Yi={defaultColor:"000",toHsva:Vi,fromHsva:function(t){return Bi({h:t.h,s:t.s,v:t.v,a:1})},equal:ji},el=function(t){return e(Xi,{...gt({},t,{colorModel:Yi})})},tl=/^#?([0-9A-F]{3,8})$/i,al=function(t){var a=t.color,s=a===void 0?"":a,r=t.onChange,i=t.onBlur,l=t.escape,o=t.validate,d=t.format,m=t.process,p=Wt(t,["color","onChange","onBlur","escape","validate","format","process"]),f=u.exports.useState(function(){return l(s)}),v=f[0],y=f[1],w=St(r),C=St(i),N=u.exports.useCallback(function(k){var $=l(k.target.value);y($),o($)&&w(m?m($):$)},[l,m,o,w]),S=u.exports.useCallback(function(k){o(k.target.value)||y(l(s)),C(k)},[s,l,o,C]);return u.exports.useEffect(function(){y(l(s))},[s,l]),e("input",{...gt({},p,{value:d?d(v):v,spellCheck:"false",onChange:N,onBlur:S})})},Qa=function(t){return"#"+t},sl=function(t){var a=t.prefixed,s=t.alpha,r=Wt(t,["prefixed","alpha"]),i=u.exports.useCallback(function(o){return o.replace(/([^0-9A-F]+)/gi,"").substring(0,s?8:6)},[s]),l=u.exports.useCallback(function(o){return function(d,m){var p=tl.exec(d),f=p?p[1].length:0;return f===3||f===6||!!m&&f===4||!!m&&f===8}(o,s)},[s]);return D.createElement(al,gt({},r,{escape:i,format:a?Qa:void 0,process:Qa,validate:l}))};function nl(t){return t&&t.__esModule?t.default:t}var Ls={},Ds={};Ds={alpha:"\u0623\u0644\u0641\u0627",blue:"\u0623\u0632\u0631\u0642",brightness:"\u0627\u0644\u0633\u0637\u0648\u0639",green:"\u0623\u062E\u0636\u0631",hue:"\u062F\u0631\u062C\u0629 \u0627\u0644\u0644\u0648\u0646",lightness:"\u0627\u0644\u0625\u0636\u0627\u0621\u0629",red:"\u0623\u062D\u0645\u0631",saturation:"\u0627\u0644\u062A\u0634\u0628\u0639"};var Ms={};Ms={alpha:"\u0410\u043B\u0444\u0430",blue:"\u0421\u0438\u043D\u044C\u043E",brightness:"\u042F\u0440\u043A\u043E\u0441\u0442",green:"\u0417\u0435\u043B\u0435\u043D\u043E",hue:"\u041E\u0442\u0442\u0435\u043D\u044A\u043A",lightness:"\u041B\u0435\u043A\u043E\u0442\u0430",red:"\u0427\u0435\u0440\u0432\u0435\u043D\u043E",saturation:"\u041D\u0430\u0441\u0438\u0442\u0435\u043D\u043E\u0441\u0442"};var Rs={};Rs={alpha:"Alfa",blue:"Modr\xE1",brightness:"Jas",green:"Zelen\xE1",hue:"Odst\xEDn",lightness:"Sv\u011Btlost",red:"\u010Cerven\xE1",saturation:"Sytost"};var Vs={};Vs={alpha:"Alfa",blue:"Bl\xE5",brightness:"Lysstyrke",green:"Gr\xF8n",hue:"Tone",lightness:"Lyshed",red:"R\xF8d",saturation:"Farvem\xE6tning"};var Bs={};Bs={alpha:"Alpha",blue:"Blau",brightness:"Helligkeit",green:"Gr\xFCn",hue:"Farbton",lightness:"Leuchtkraft",red:"Rot",saturation:"S\xE4ttigung"};var Us={};Us={alpha:"\u0386\u03BB\u03C6\u03B1",blue:"\u039C\u03C0\u03BB\u03B5",brightness:"\u03A6\u03C9\u03C4\u03B5\u03B9\u03BD\u03CC\u03C4\u03B7\u03C4\u03B1",green:"\u03A0\u03C1\u03AC\u03C3\u03B9\u03BD\u03BF",hue:"\u03A4\u03CC\u03BD\u03BF\u03C2",lightness:"\u03A6\u03C9\u03C4\u03B5\u03B9\u03BD\u03CC\u03C4\u03B7\u03C4\u03B1",red:"\u039A\u03CC\u03BA\u03BA\u03B9\u03BD\u03BF",saturation:"\u039A\u03BF\u03C1\u03B5\u03C3\u03BC\u03CC\u03C2"};var qs={};qs={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha"};var Os={};Os={alpha:"Alpha",blue:"Azul",brightness:"Brillo",green:"Verde",hue:"Tono",lightness:"Luminosidad",red:"Rojo",saturation:"Saturaci\xF3n"};var Hs={};Hs={alpha:"Alfa",blue:"Sinine",brightness:"Heledus",green:"Roheline",hue:"V\xE4rv",lightness:"Valgus",red:"Punane",saturation:"K\xFCllastus"};var Ws={};Ws={alpha:"Alpha",blue:"Sininen",brightness:"Kirkkaus",green:"Vihre\xE4",hue:"S\xE4vy",lightness:"Valom\xE4\xE4r\xE4",red:"Punainen",saturation:"V\xE4rikyll\xE4isyys"};var Gs={};Gs={alpha:"Alpha",blue:"Bleu",brightness:"Luminosit\xE9",green:"Vert",hue:"Teinte",lightness:"Luminosit\xE9",red:"Rouge",saturation:"Saturation"};var js={};js={alpha:"\u05D0\u05DC\u05E4\u05D0",blue:"\u05DB\u05D7\u05D5\u05DC",brightness:"\u05D1\u05D4\u05D9\u05E8\u05D5\u05EA",green:"\u05D9\u05E8\u05D5\u05E7",hue:"\u05D2\u05D5\u05D5\u05DF",lightness:"\u05DB\u05DE\u05D5\u05EA \u05D0\u05D5\u05E8",red:"\u05D0\u05D3\u05D5\u05DD",saturation:"\u05E8\u05D5\u05D5\u05D9\u05D4"};var Ks={};Ks={alpha:"Alfa",blue:"Plava",brightness:"Svjetlina",green:"Zelena",hue:"Nijansa",lightness:"Osvijetljenost",red:"Crvena",saturation:"Zasi\u0107enost"};var Qs={};Qs={alpha:"Alfa",blue:"K\xE9k",brightness:"F\xE9nyess\xE9g",green:"Z\xF6ld",hue:"Sz\xEDn\xE1rnyalat",lightness:"Vil\xE1goss\xE1g",red:"Piros",saturation:"Tel\xEDtetts\xE9g"};var Js={};Js={alpha:"Alfa",blue:"Blu",brightness:"Luminosit\xE0",green:"Verde",hue:"Tonalit\xE0",lightness:"Luminosit\xE0",red:"Rosso",saturation:"Saturazione"};var Zs={};Zs={alpha:"\u30A2\u30EB\u30D5\u30A1",blue:"\u9752",brightness:"\u660E\u308B\u3055",green:"\u7DD1",hue:"\u8272\u76F8",lightness:"\u660E\u5EA6",red:"\u8D64",saturation:"\u5F69\u5EA6"};var Xs={};Xs={alpha:"\uC54C\uD30C",blue:"\uD30C\uB791",brightness:"\uBA85\uB3C4",green:"\uCD08\uB85D",hue:"\uC0C9\uC870",lightness:"\uBC1D\uAE30",red:"\uBE68\uAC15",saturation:"\uCC44\uB3C4"};var Ys={};Ys={alpha:"Alfa",blue:"M\u0117lyna",brightness:"Ry\u0161kumas",green:"\u017Dalia",hue:"Atspalvis",lightness:"\u0160viesumas",red:"Raudona",saturation:"\u012Esotinimas"};var en={};en={alpha:"Alfa",blue:"Zila",brightness:"Spilgtums",green:"Za\u013Ca",hue:"Nokr\u0101sa",lightness:"Gai\u0161ums",red:"Sarkana",saturation:"Pies\u0101tin\u0101jums"};var tn={};tn={alpha:"Alfa",blue:"Bl\xE5",brightness:"Lysstyrke",green:"Gr\xF8nn",hue:"Fargetone",lightness:"Lyshet",red:"R\xF8d",saturation:"Metning"};var an={};an={alpha:"Alfa",blue:"Blauw",brightness:"Helderheid",green:"Groen",hue:"Kleurtoon",lightness:"Lichtsterkte",red:"Rood",saturation:"Verzadiging"};var sn={};sn={alpha:"Alfa",blue:"Niebieski",brightness:"Jasno\u015B\u0107",green:"Zielony",hue:"Odcie\u0144",lightness:"Jaskrawo\u015B\u0107",red:"Czerwony",saturation:"Nasycenie"};var nn={};nn={alpha:"Alfa",blue:"Azul",brightness:"Brilho",green:"Verde",hue:"Matiz",lightness:"Luminosidade",red:"Vermelho",saturation:"Satura\xE7\xE3o"};var rn={};rn={alpha:"Alfa",blue:"Azul",brightness:"Luminosidade",green:"Verde",hue:"Tonalidade",lightness:"Claridade",red:"Vermelho",saturation:"Satura\xE7\xE3o"};var ln={};ln={alpha:"Alfa",blue:"Albastru",brightness:"Luminozitate",green:"Verde",hue:"Nuan\u021B\u0103",lightness:"Luminozitate",red:"Ro\u0219u",saturation:"Satura\u021Bie"};var on={};on={alpha:"\u0410\u043B\u044C\u0444\u0430",blue:"\u0421\u0438\u043D\u0438\u0439",brightness:"\u042F\u0440\u043A\u043E\u0441\u0442\u044C",green:"\u0417\u0435\u043B\u0435\u043D\u044B\u0439",hue:"\u041E\u0442\u0442\u0435\u043D\u043E\u043A",lightness:"\u041E\u0441\u0432\u0435\u0449\u0435\u043D\u043D\u043E\u0441\u0442\u044C",red:"\u041A\u0440\u0430\u0441\u043D\u044B\u0439",saturation:"\u041D\u0430\u0441\u044B\u0449\u0435\u043D\u043D\u043E\u0441\u0442\u044C"};var cn={};cn={alpha:"Alfa",blue:"Modr\xE1",brightness:"Jas",green:"Zelen\xE1",hue:"Odtie\u0148",lightness:"Svetlos\u0165",red:"\u010Cerven\xE1",saturation:"S\xFDtos\u0165"};var dn={};dn={alpha:"Alfa",blue:"Modra",brightness:"Svetlost",green:"Zelena",hue:"Barva",lightness:"Lahkost",red:"Rde\u010Da",saturation:"Nasi\u010Denost"};var un={};un={alpha:"Alfa",blue:"Plava",brightness:"Osvetljenost",green:"Zelena",hue:"Nijansa",lightness:"Osvetljenje",red:"Crvena",saturation:"Zasi\u0107enje"};var mn={};mn={alpha:"Alfa",blue:"Bl\xE5tt",brightness:"Ljusstyrka",green:"Gr\xF6nt",hue:"Nyans",lightness:"Ljushet",red:"R\xF6tt",saturation:"M\xE4ttnad"};var pn={};pn={alpha:"Alfa",blue:"Mavi",brightness:"Parlakl\u0131k",green:"Ye\u015Fil",hue:"Ton",lightness:"Canl\u0131l\u0131k",red:"K\u0131rm\u0131z\u0131",saturation:"Doygunluk"};var hn={};hn={alpha:"\u0410\u043B\u044C\u0444\u0430",blue:"\u0421\u0438\u043D\u0456\u0439",brightness:"\u042F\u0441\u043A\u0440\u0430\u0432\u0456\u0441\u0442\u044C",green:"\u0417\u0435\u043B\u0435\u043D\u0438\u0439",hue:"\u0422\u043E\u043D",lightness:"\u041E\u0441\u0432\u0456\u0442\u043B\u0435\u043D\u0456\u0441\u0442\u044C",red:"\u0427\u0435\u0440\u0432\u043E\u043D\u0438\u0439",saturation:"\u041D\u0430\u0441\u0438\u0447\u0435\u043D\u0456\u0441\u0442\u044C"};var gn={};gn={alpha:"Alpha",blue:"\u84DD\u8272",brightness:"\u4EAE\u5EA6",green:"\u7EFF\u8272",hue:"\u8272\u76F8",lightness:"\u660E\u4EAE\u5EA6",red:"\u7EA2\u8272",saturation:"\u9971\u548C\u5EA6"};var fn={};fn={alpha:"Alpha",blue:"\u85CD\u8272",brightness:"\u4EAE\u5EA6",green:"\u7DA0\u8272",hue:"\u8272\u76F8",lightness:"\u660E\u4EAE",red:"\u7D05\u8272",saturation:"\u98FD\u548C\u5EA6"};Ls={"ar-AE":Ds,"bg-BG":Ms,"cs-CZ":Rs,"da-DK":Vs,"de-DE":Bs,"el-GR":Us,"en-US":qs,"es-ES":Os,"et-EE":Hs,"fi-FI":Ws,"fr-FR":Gs,"he-IL":js,"hr-HR":Ks,"hu-HU":Qs,"it-IT":Js,"ja-JP":Zs,"ko-KR":Xs,"lt-LT":Ys,"lv-LV":en,"nb-NO":tn,"nl-NL":an,"pl-PL":sn,"pt-BR":nn,"pt-PT":rn,"ro-RO":ln,"ru-RU":on,"sk-SK":cn,"sl-SI":dn,"sr-SP":un,"sv-SE":mn,"tr-TR":pn,"uk-UA":hn,"zh-CN":gn,"zh-TW":fn};const rl=new ni(nl(Ls));function nt(t){let a=De.parse(t)||Me.parse(t)||Re.parse(t);if(a)return a;throw new Error("Invalid color value: "+t)}class Aa{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(a){if(a in this)return this[a];throw new Error("Unsupported color channel: "+a)}withChannelValue(a,s){if(a in this){let r=this.clone();return r[a]=s,r}throw new Error("Unsupported color channel: "+a)}getChannelName(a,s){return rl.getStringForLocale(a,s)}getColorSpaceAxes(a){let{xChannel:s,yChannel:r}=a,i=s||this.getColorChannels().find(d=>d!==r),l=r||this.getColorChannels().find(d=>d!==i),o=this.getColorChannels().find(d=>d!==i&&d!==l);return{xChannel:i,yChannel:l,zChannel:o}}}class De extends Aa{static parse(a){let s=[];if(/^#[\da-f]+$/i.test(a)&&[4,5,7,9].includes(a.length)){const l=(a.length<6?a.replace(/[^#]/gi,"$&$&"):a).slice(1).split("");for(;l.length>0;)s.push(parseInt(l.splice(0,2).join(""),16));s[3]=s[3]!==void 0?s[3]/255:void 0}const r=a.match(/^rgba?\((.*)\)$/);r!=null&&r[1]&&(s=r[1].split(",").map(l=>Number(l.trim())),s=s.map((l,o)=>Je(l,0,o<3?255:1)));var i;return s.length<3?void 0:new De(s[0],s[1],s[2],(i=s[3])!==null&&i!==void 0?i:1)}toString(a){switch(a){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(a).toString(a)}}toFormat(a){switch(a){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+a)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const a=this.red/255,s=this.green/255,r=this.blue/255,i=Math.min(a,s,r),l=Math.max(a,s,r),o=l-i,d=l===0?0:o/l;let m=0;if(o!==0){switch(l){case a:m=(s-r)/o+(sNumber(m.trim().replace("%","")));return new Me(bn(i,360),Je(l,0,100),Je(o,0,100),Je(d!=null?d:1,0,1))}}toString(a){switch(a){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${j(this.saturation,2)}%, ${j(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${j(this.saturation,2)}%, ${j(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(a).toString(a)}}toFormat(a){switch(a){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+a)}}toHSL(){let a=this.saturation/100,s=this.brightness/100,r=s*(1-a/2);return a=r===0||r===1?0:(s-r)/Math.min(r,1-r),new Re(j(this.hue,2),j(a*100,2),j(r*100,2),this.alpha)}toRGB(){let a=this.hue,s=this.saturation/100,r=this.brightness/100,i=(l,o=(l+a/60)%6)=>r-s*r*Math.max(Math.min(o,4-o,1),0);return new De(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),this.alpha)}clone(){return new Me(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(a){switch(a){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+a)}}formatChannelValue(a,s){let r,i=this.getChannelValue(a);switch(a){case"hue":r={style:"unit",unit:"degree",unitDisplay:"narrow"};break;case"saturation":case"brightness":r={style:"percent"},i/=100;break;case"alpha":r={style:"percent"};break;default:throw new Error("Unknown color channel: "+a)}return new va(s,r).format(i)}getColorSpace(){return"hsb"}getColorChannels(){return Me.colorChannels}constructor(a,s,r,i){super(),this.hue=a,this.saturation=s,this.brightness=r,this.alpha=i}}Me.colorChannels=["hue","saturation","brightness"];const ll=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function bn(t,a){return(t%a+a)%a}class Re extends Aa{static parse(a){let s;if(s=a.match(ll)){var r;const[i,l,o,d]=((r=s[1])!==null&&r!==void 0?r:s[2]).split(",").map(m=>Number(m.trim().replace("%","")));return new Re(bn(i,360),Je(l,0,100),Je(o,0,100),Je(d!=null?d:1,0,1))}}toString(a){switch(a){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${j(this.saturation,2)}%, ${j(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${j(this.saturation,2)}%, ${j(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(a).toString(a)}}toFormat(a){switch(a){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+a)}}toHSB(){let a=this.saturation/100,s=this.lightness/100,r=s+a*Math.min(s,1-s);return a=r===0?0:2*(1-s/r),new Me(j(this.hue,2),j(a*100,2),j(r*100,2),this.alpha)}toRGB(){let a=this.hue,s=this.saturation/100,r=this.lightness/100,i=s*Math.min(r,1-r),l=(o,d=(o+a/30)%12)=>r-i*Math.max(Math.min(d-3,9-d,1),-1);return new De(Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255),this.alpha)}clone(){return new Re(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(a){switch(a){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+a)}}formatChannelValue(a,s){let r,i=this.getChannelValue(a);switch(a){case"hue":r={style:"unit",unit:"degree",unitDisplay:"narrow"};break;case"saturation":case"lightness":r={style:"percent"},i/=100;break;case"alpha":r={style:"percent"};break;default:throw new Error("Unknown color channel: "+a)}return new va(s,r).format(i)}getColorSpace(){return"hsl"}getColorChannels(){return Re.colorChannels}constructor(a,s,r,i){super(),this.hue=a,this.saturation=s,this.lightness=r,this.alpha=i}}Re.colorChannels=["hue","saturation","lightness"];nt("#ffffff");nt("hsl(0, 100%, 50%)");const ol=nt("#000000"),cl=nt("#FFFFFF");ol.toHexInt();cl.toHexInt();function dl({onChange:t,value:a,colors:s}){const r=s.map(i=>{const l=a===i;return e(cs,{onClick:()=>{t==null||t(i)},className:F("relative block flex-shrink-0 w-26 h-26 border rounded",l&&"shadow-md"),style:{backgroundColor:i},children:l&&e("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},i)});return e("div",{className:"flex flex-wrap gap-6",children:r})}const ul=[{color:"rgb(255, 255, 255)",name:h("White")},{color:"rgb(239,245,245)",name:h("Solitude")},{color:"rgb(245,213,174)",name:h("Wheat")},{color:"rgb(253,227,167)",name:h("Cape Honey")},{color:"rgb(242,222,186)",name:h("Milk punch")},{color:"rgb(97,118,75)",name:h("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:h("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:h("Cosmic Latte")},{color:"rgb(233,119,119)",name:h("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:h("Sundown")},{color:"rgb(30,139,195)",name:h("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:h("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:h("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:h("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:h("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:h("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:h("Comet"),foreground:"rgb(255, 255, 255)"}],ml=ul.map(({color:t})=>t).slice(0,14);function pl({defaultValue:t,onChange:a,colorPresets:s,showInput:r}){const[i,l]=u.exports.useState(t),o=s||ml,d=Bt({size:"sm"});return c("div",{children:[e(el,{className:"!w-auto",color:i,onChange:m=>{a==null||a(m),l(m)}}),c("div",{className:"py-20 px-12",children:[o&&e(dl,{colors:o,onChange:m=>{if(m){const p=nt(m).toString("hex");a==null||a(p),l(p)}},value:i}),r&&e("div",{className:"pt-20",children:e(sl,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:d.input,color:i,onChange:m=>{a==null||a(m),l(m)}})})]})]})}function vn({defaultValue:t,onChange:a,hideFooter:s=!1,showInput:r=!0}){const{close:i}=Z(),[l,o]=u.exports.useState(t||"");return c(ae,{size:"2xs",children:[e(pl,{showInput:r,defaultValue:l,onChange:d=>{o(d),a==null||a(d)}}),!s&&c(ye,{dividerTop:!0,children:[e(x,{variant:"text",size:"xs",onClick:()=>{i()},children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",size:"xs",onClick:()=>{i(l)},children:e(n,{message:"Apply"})})]})]})}function hl(t){return A.post("file-entries/delete",t).then(a=>a.data)}function yn(){return B(t=>hl(t),{onError:t=>ce(t)})}function xn(){const t=yn(),a=u.exports.useRef(),s=Xt(m=>m.uploadSingle),r=Xt(m=>m.updateFileUpload),i=Xt(m=>a.current?m.fileUploads.get(a.current):null),l=u.exports.useCallback((m,p)=>{a.current=s(m,p)},[s]),o=u.exports.useCallback(async m=>{var f;const p=await nr({types:(f=m==null?void 0:m.restrictions)==null?void 0:f.allowedFileTypes});l(p[0],m)},[l]),d=u.exports.useCallback(({onSuccess:m,entryPath:p})=>{var v,y,w;const f=()=>{i&&r(i.file.id,{...i,entry:void 0}),m()};if(!p&&!((v=i==null?void 0:i.entry)!=null&&v.id)){f();return}t.mutate({paths:p?[p]:void 0,entryIds:(y=i==null?void 0:i.entry)!=null&&y.id?[(w=i==null?void 0:i.entry)==null?void 0:w.id]:void 0,deleteForever:!0},{onSuccess:f})},[t,i,r]);return{uploadFile:l,selectAndUploadFile:o,percentage:(i==null?void 0:i.percentage)||0,uploadStatus:i==null?void 0:i.status,entry:i==null?void 0:i.entry,deleteEntry:d,isDeletingEntry:t.isLoading}}const gl=2*1024*1024;function fl({className:t,label:a,description:s,value:r,onChange:i,highlightSelector:l,defaultValue:o,diskPrefix:d,showRemoveButton:m,invalid:p,errorMessage:f,required:v,autoFocus:y}){const{uploadFile:w,selectAndUploadFile:C,entry:N,percentage:S,uploadStatus:k,deleteEntry:$,isDeletingEntry:G}=xn(),T=u.exports.useRef(null);rr({autoFocus:y},T);const se=u.exports.useId(),Y=a?`${se}-label`:void 0,ne=s?`${se}-description`:void 0,ue=r||(N==null?void 0:N.url),Q={showToastOnRestrictionFail:!0,restrictions:{allowedFileTypes:[na.image],maxFileSize:gl},metadata:{diskPrefix:d,disk:ws.public},onSuccess:ke=>{i==null||i(ke.url)},onError:ke=>{ke&&U.danger(ke)}},ee=Bt({description:s,descriptionPosition:"top",invalid:p}),je=c(ds,{fieldClassNames:ee,errorMessage:f,invalid:p,children:[e("input",{ref:T,"aria-labelledby":Y,"aria-describedby":ne,required:v,accept:na.image,type:"file",disabled:k==="inProgress",onChange:ke=>{var re;(re=ke.target.files)!=null&&re.length&&w(ke.target.files[0],Q)},className:F(ee.input,"py-8","file:bg-primary file:text-on-primary file:border-none file:rounded file:text-sm file:font-semibold file:px-10 file:h-24 file:mr-10")}),k==="inProgress"&&e(It,{className:"absolute bottom-0 left-0 right-0",size:"xs",isIndeterminate:!0})]}),it=e(x,{onClick:()=>{C(Q)},disabled:k==="inProgress",className:"mr-10",variant:"outline",color:"primary",size:"xs",children:e(n,{message:"Replace"})}),Ke=e(x,{variant:"outline",color:"danger",size:"xs",disabled:G,onClick:()=>{$({onSuccess:()=>i==null?void 0:i("")})},children:e(n,{message:"Remove"})});return c("div",{className:F("text-sm",t),onClick:()=>{I().preview.setHighlight(l)},children:[a&&e("div",{id:Y,className:ee.label,children:a}),s&&e("div",{className:ee.description,children:s}),e("div",{children:ue?c("div",{"aria-labelledby":Y,"aria-describedby":ne,children:[c("div",{className:"h-80 border rounded bg-chip p-6 relative overflow-hidden",children:[e("img",{className:"h-full mx-auto rounded object-contain",src:ue,alt:""}),k==="inProgress"&&e(It,{value:S,size:"xs",className:"absolute left-0 bottom-0 w-full","aria-label":"upload progress"})]}),c("div",{className:"mt-10",children:[it,m&&Ke,o&&r!==o&&e(x,{variant:"outline",color:"primary",size:"xs",onClick:()=>{i==null||i(o)},children:e(n,{message:"Use default"})})]})]}):je})]})}function Nt(t){const{field:{onChange:a,value:s=null},fieldState:{error:r}}=et({name:t.name}),i={onChange:a,value:s,invalid:r!=null,errorMessage:r?e(n,{message:"Please select an image."}):null};return e(fl,{...qe(i,t)})}function bl(){return c(u.exports.Fragment,{children:[e(vl,{}),c("div",{className:"my-24 py-24 border-y",children:[e(Pe,{to:"action-buttons",elementType:W,className:"mb-20",children:e(n,{message:"Action buttons"})}),e(Pe,{to:"primary-features",elementType:W,children:e(n,{message:"Primary features"})}),e(Pe,{to:"secondary-features",elementType:W,children:e(n,{message:"Secondary features"})})]}),e(yl,{})]})}function vl(){const t=rt(a=>{var s,r;return(r=(s=a.defaults)==null?void 0:s.settings.homepage.appearance)==null?void 0:r.headerImage});return c(R,{children:[e(g,{label:e(n,{message:"Header title"}),className:"mb-20",name:"settings.homepage.appearance.headerTitle",onFocus:()=>{I().preview.setHighlight('[data-testid="headerTitle"]')}}),e(g,{label:e(n,{message:"Header subtitle"}),className:"mb-30",inputElementType:"textarea",rows:4,name:"settings.homepage.appearance.headerSubtitle",onFocus:()=>{I().preview.setHighlight('[data-testid="headerSubtitle"]')}}),e(Nt,{name:"settings.homepage.appearance.headerImage",className:"mb-30",label:e(n,{message:"Header image"}),highlightSelector:'[data-testid="headerImage"]',defaultValue:t,diskPrefix:"homepage"}),e(Ri,{name:"settings.homepage.appearance.headerImageOpacity",label:e(n,{message:"Header image opacity"}),minValue:0,step:.1,maxValue:1,formatOptions:{style:"percent"}}),e("div",{className:"text-muted text-xs mb-20",children:e(n,{message:"In order for overlay colors to appear, header image opacity will need to be less then 100%"})}),e(Ja,{formKey:"settings.homepage.appearance.headerOverlayColor1",label:e(n,{message:"Header overlay color 1"})}),e(Ja,{formKey:"settings.homepage.appearance.headerOverlayColor2",label:e(n,{message:"Header overlay color 2"})})]})}function yl(){const t=rt(a=>{var s,r;return(r=(s=a.defaults)==null?void 0:s.settings.homepage.appearance)==null?void 0:r.footerImage});return c(u.exports.Fragment,{children:[e(g,{label:e(n,{message:"Footer title"}),className:"mb-20",name:"settings.homepage.appearance.footerTitle",onFocus:()=>{I().preview.setHighlight('[data-testid="footerTitle"]')}}),e(g,{label:e(n,{message:"Footer subtitle"}),className:"mb-20",name:"settings.homepage.appearance.footerSubtitle",onFocus:()=>{I().preview.setHighlight('[data-testid="footerSubtitle"]')}}),e(Nt,{name:"settings.homepage.appearance.footerImage",className:"mb-30",label:e(n,{message:"Footer background image"}),highlightSelector:'[data-testid="footerImage"]',defaultValue:t,diskPrefix:"homepage"})]})}function Ja({label:t,formKey:a}){const s=a,{watch:r,setValue:i}=P(),l=r(s),o=d=>{i(a,d,{shouldDirty:!0})};return c(E,{type:"popover",onClose:d=>{o(d)},children:[e(Pe,{className:"capitalize",startIcon:e(Ts,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:l}}),children:t}),e(vn,{defaultValue:l,onChange:d=>{o(d)}})]})}function Gt({children:t,...a}){const{field:{onChange:s,onBlur:r,value:i=[],ref:l},fieldState:{invalid:o,error:d}}=et({name:a.name}),m={onChange:s,onBlur:r,value:i,invalid:o,errorMessage:d==null?void 0:d.message};return e(Ss,{ref:l,...qe(m,a),children:t})}function wn(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}const xl=D.forwardRef(({valueListKey:t="permissions",...a},s)=>{const{data:r}=Ae([t]),i=(r==null?void 0:r.permissions)||(r==null?void 0:r.workspacePermissions),[l,o]=Rt(a.value,[],a.onChange),[d,m]=u.exports.useState(!1);if(!i)return null;const p=Sn(i,l,d),f=v=>{const y=[...l],w=y.findIndex(C=>C.id===v.id);w>-1&&y.splice(w,1,v),o(y)};return c(u.exports.Fragment,{children:[e(We,{variant:"outline",ref:s,children:p.map(({groupName:v,items:y,anyChecked:w})=>e(be,{label:Et(v),startIcon:w?e(ir,{size:"sm"}):void 0,children:e(ks,{children:y.map(C=>{const N=l.findIndex(k=>k.id===C.id),S=N>-1;return c("div",{children:[e(Ns,{onSelected:()=>{if(S){const k=[...l];k.splice(N,1),o(k)}else o([...l,C])},endSection:e(ra,{tabIndex:-1,checked:S,onChange:()=>{}}),description:C.description,children:C.display_name||C.name}),S&&e(wl,{permission:C,onChange:f})]},C.id)})})},v))}),e(ra,{className:"mt-30",checked:d,onChange:v=>{m(v.target.checked)},children:e(n,{message:"Show advanced permissions"})})]})});function wl({permission:t,onChange:a}){var r;if(!((r=t==null?void 0:t.restrictions)!=null&&r.length))return null;const s=(i,l)=>{const o=lr(t,d=>{const m=d.restrictions.find(p=>p.name===i);m&&(m.value=l)});a==null||a(o)};return e("div",{className:"px-40 py-20",children:t.restrictions.map((i,l)=>{const o=l===t.restrictions.length-1;return i.type==="bool"?e(ra,{description:i.description,className:F(!o&&"mb-30"),checked:Boolean(i.value),onChange:d=>{s(i.name,d.target.checked)},children:Et(i.name)},i.name):e(ct,{size:"sm",label:Et(i.name),description:i.description,type:"number",className:F(!o&&"mb-30"),value:i.value||"",onChange:d=>{s(i.name,d.target.value===""?void 0:parseInt(d.target.value))}},i.name)})})}function Ta(t){const{field:{onChange:a,value:s=[],ref:r}}=et({name:t.name});return e(xl,{ref:r,...qe({onChange:a,value:s},t)})}const Et=t=>wn(t.replace("_"," "));function Sn(t,a,s){const r=[];return t.forEach(i=>{const l=a.findIndex(d=>d.id===i.id);if(!s&&i.advanced)return;let o=r.find(d=>d.groupName===i.group);if(o||(o={groupName:i.group,anyChecked:!1,items:[]},r.push(o)),l>-1){const d={...i,restrictions:Sl(i.restrictions,a[l].restrictions)};o.anyChecked=!0,o.items.push(d)}else o.items.push(i)}),r}function Sl(t,a){return t==null?void 0:t.map(s=>{const r=a.find(i=>i.name===s.name);return r?{...s,value:r.value}:s})}function kn(){const t=Cn.sections.menus.config;return t?t.availableRoutes.map(a=>({id:a,label:a,action:a,type:"route",target:"_self"})):[]}const Yt={grid:"flex flex-wrap gap-24",button:"flex flex-col items-center rounded hover:bg-hover h-90 aspect-square"},kl=[...Array(60).keys()],Nl=D.lazy(()=>Ut(()=>import("./icon-list.2d1afe12.js"),["./icon-list.2d1afe12.js","./main.b7d280d4.js","./main.06f69299.css","./date-picker.5c1c2eea.js","./Edit.b85e7693.js","./index.6553f71f.js","./ArrowBack.974075c7.js","./Info.151f9dc2.js","./OpenInNew.cf2b6131.js","./UnfoldLess.4eafab54.js","./TaskAlt.57469708.js","./TrendingUp.9eeccb61.js","./use-resume-subscription.493553db.js"],import.meta.url));function Cl({onIconSelected:t}){const{trans:a}=V(),[s,r]=D.useState("");return c("div",{className:"py-4",children:[e(ct,{className:"mb-20",value:s,onChange:i=>{r(i.target.value)},placeholder:a({message:"Search icons..."})}),e(ga,{mode:"wait",children:e(u.exports.Suspense,{fallback:e(aa.div,{...Va,className:Yt.grid,children:kl.map((i,l)=>e("div",{className:Yt.button,children:e(or,{variant:"rect"})},l))}),children:e(aa.div,{...Va,className:Yt.grid,children:e(Nl,{searchQuery:s,onIconSelected:t})})})})]})}function _l(){return c(ae,{size:"w-850",className:"min-h-dialog",children:[e(oe,{children:e(n,{message:"Select icon"})}),e(ie,{children:e($l,{})})]})}function $l(){const{close:t}=Z();return e(Cl,{onIconSelected:a=>{t(a)}})}function Pl(t){const a=u.exports.useRef();return u.exports.useEffect(()=>{a.current=t},[t]),a.current}function lt({formPathPrefix:t,hideRoleAndPermissionFields:a}){const{trans:s}=V(),r=i=>t?`${t}.${i}`:i;return c(u.exports.Fragment,{children:[e(g,{className:"mb-20",name:r("label"),label:e(n,{message:"Label"}),placeholder:s(h("No label...")),startAppend:e(Fl,{prefixName:r})}),e(Al,{prefixName:r}),!a&&c(u.exports.Fragment,{children:[e(Tl,{prefixName:r}),e(zl,{prefixName:r})]}),e(Il,{prefixName:r})]})}function Fl({prefixName:t,...a}){const{watch:s,setValue:r}=P(),i=t("icon"),l=s(i),o=l&&us(l);return c(E,{type:"modal",onClose:d=>{(d||d===null)&&r(i,d,{shouldDirty:!0})},children:[e(L,{className:"text-muted icon-sm",variant:"outline",size:"md",...a,children:o?e(o,{}):e(He,{})}),e(_l,{})]})}function Al({prefixName:t}){const a=P(),s=a.watch(t("type")),r=Pl(s),{data:i}=Ae(["menuItemCategories"]),l=(i==null?void 0:i.menuItemCategories)||[],o=l.find(p=>p.type===s),{trans:d}=V(),m=kn();return u.exports.useEffect(()=>{r&&r!==s&&a.setValue(t("action"),"")},[s,r,a,t]),c(u.exports.Fragment,{children:[c(X,{className:"mb-20",name:t("type"),selectionMode:"single",label:e(n,{message:"Type"}),children:[e(b,{value:"link",children:e(n,{message:"Custom link"})}),e(b,{value:"route",children:e(n,{message:"Site page"})}),l.map(p=>e(b,{value:p.type,children:p.name},p.type))]}),s==="link"&&e(g,{className:"mb-20",required:!0,type:"url",name:t("action"),placeholder:d({message:"Enter a url..."}),label:e(n,{message:"Url"})}),s==="route"&&e(ot,{className:"mb-20",required:!0,items:m,name:t("action"),openMenuOnFocus:!0,label:e(n,{message:"Page"}),children:p=>e(b,{value:p.id,children:p.label},p.id)}),o&&e(ot,{className:"mb-20",required:!0,items:o.items,name:t("action"),openMenuOnFocus:!0,label:o.name,children:p=>e(b,{value:p.action,children:p.label})})]})}function Tl({prefixName:t}){const{data:a}=Ae(["roles","permissions"]),s=(a==null?void 0:a.roles)||[],{trans:r}=V();return e(Gt,{className:"mb-20",placeholder:r({message:"Add role..."}),label:e(n,{message:"Only show if user has role"}),name:t("roles"),chipSize:"sm",suggestions:s,valueKey:"id",displayWith:i=>{var l;return(l=s.find(o=>o.id===i.id))==null?void 0:l.name},children:i=>e(b,{value:i.id,capitalizeFirst:!0,children:i.name},i.id)})}function zl({prefixName:t}){const{data:a}=Ae(["roles","permissions"]),{trans:s}=V(),r=u.exports.useMemo(()=>Sn((a==null?void 0:a.permissions)||[],[],!1),[a==null?void 0:a.permissions]);return e(Gt,{label:e(n,{message:"Only show if user has permissions"}),placeholder:s({message:"Add permission..."}),chipSize:"sm",suggestions:r,name:t("permissions"),valueKey:"name",children:({groupName:i,items:l})=>e(ms,{label:Et(i),children:l.map(o=>e(b,{value:o.name,description:o.description,children:o.display_name||o.name},o.name))},i)})}function Il({prefixName:t}){return P().watch(t("type"))!=="link"?null:c(X,{className:"mt-20",selectionMode:"single",name:t("target"),label:e(n,{message:"Open link in"}),children:[e(b,{value:"_self",children:e(n,{message:"Same window"})}),e(b,{value:"_blank",children:e(n,{message:"New window"})})]})}function El(){const[t,a]=u.exports.useState(["cta1"]);return c(We,{variant:"outline",expandedValues:t,onExpandedChange:s=>{a(s),s.length&&I().preview.setHighlight(`[data-testid="${s[0]}"]`)},children:[e(be,{value:"cta1",label:e(n,{message:"Header button 1"}),children:e(lt,{formPathPrefix:"settings.homepage.appearance.actions.cta1"})}),e(be,{value:"ct2",label:e(n,{message:"Header button 2"}),children:e(lt,{formPathPrefix:"settings.homepage.appearance.actions.cta2"})}),e(be,{value:"cta3",label:e(n,{message:"Footer button"}),children:e(lt,{formPathPrefix:"settings.homepage.appearance.actions.cta3"})})]})}function Ll(){const{fields:t,remove:a,append:s}=xe({name:"settings.homepage.appearance.primaryFeatures"}),[r,i]=u.exports.useState([0]);return c("div",{children:[e(We,{variant:"outline",expandedValues:r,onExpandedChange:l=>{i(l),l.length&&I().preview.setHighlight(`[data-testid="primary-root-${l[0]}"]`)},children:t.map((l,o)=>c(be,{value:o,label:e(n,{message:`Primary feature ${o+1}`}),children:[e(Dl,{index:o}),e("div",{className:"text-right",children:e(x,{size:"xs",variant:"outline",color:"danger",onClick:()=>{a(o)},children:e(n,{message:"Remove"})})})]},l.id))}),e("div",{className:"mt-20 text-right",children:e(x,{size:"xs",variant:"outline",color:"primary",startIcon:e(ve,{}),onClick:()=>{s({}),i([t.length])},children:e(n,{message:"Add feature"})})})]})}function Dl({index:t}){const a=rt(s=>{var r,i,l;return(l=(i=(r=s.defaults)==null?void 0:r.settings.homepage.appearance)==null?void 0:i.primaryFeatures[t])==null?void 0:l.image});return c(R,{children:[e(Nt,{name:`settings.homepage.appearance.primaryFeatures.${t}.image`,className:"mb-30",label:e(n,{message:"Image"}),highlightSelector:`[data-testid="primary-image-${t}"]`,defaultValue:a,diskPrefix:"homepage"}),e(g,{name:`settings.homepage.appearance.primaryFeatures.${t}.title`,label:e(n,{message:"Title"}),className:"mb-20",onFocus:()=>{I().preview.setHighlight(`[data-testid="primary-title-${t}"]`)}}),e(g,{name:`settings.homepage.appearance.primaryFeatures.${t}.subtitle`,label:e(n,{message:"Subtitle"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{I().preview.setHighlight(`[data-testid="primary-subtitle-${t}"]`)}})]})}function Ml(){const{fields:t,remove:a,append:s}=xe({name:"settings.homepage.appearance.secondaryFeatures"}),[r,i]=u.exports.useState([0]);return c("div",{children:[e(We,{variant:"outline",expandedValues:r,onExpandedChange:l=>{i(l),l.length&&I().preview.setHighlight(`[data-testid="secondary-root-${l[0]}"]`)},children:t.map((l,o)=>c(be,{value:o,label:e(n,{message:`Secondary feature ${o+1}`}),children:[e(Rl,{index:o}),e("div",{className:"text-right",children:e(x,{size:"xs",variant:"outline",color:"danger",onClick:()=>{a(o)},children:e(n,{message:"Remove"})})})]},l.id))}),e("div",{className:"mt-20 text-right",children:e(x,{size:"xs",variant:"outline",color:"primary",startIcon:e(ve,{}),onClick:()=>{s({}),i([t.length])},children:e(n,{message:"Add feature"})})})]})}function Rl({index:t}){return c(R,{children:[e(Nt,{name:`settings.homepage.appearance.secondaryFeatures.${t}.image`,className:"mb-30",label:e(n,{message:"Image"}),highlightSelector:`[data-testid="secondary-image-${t}"]`,defaultValue:Vl(t),diskPrefix:"homepage"}),e(g,{name:`settings.homepage.appearance.secondaryFeatures.${t}.title`,label:e(n,{message:"Title"}),className:"mb-20",onFocus:()=>{I().preview.setHighlight(`[data-testid="secondary-title-${t}"]`)}}),e(g,{name:`settings.homepage.appearance.secondaryFeatures.${t}.subtitle`,label:e(n,{message:"Subtitle"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{I().preview.setHighlight(`[data-testid="secondary-subtitle-${t}"]`)}}),e(g,{name:`settings.homepage.appearance.secondaryFeatures.${t}.description`,label:e(n,{message:"Description"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{I().preview.setHighlight(`[data-testid="secondary-description-${t}"]`)}})]})}function Vl(t){var a,s;return(s=((a=I().defaults)==null?void 0:a.settings.homepage.appearance).secondaryFeatures[t])==null?void 0:s.image}const Nn={preview:{defaultRoute:"drive",navigationRoutes:["s","drive"]},sections:{"landing-page":{label:h("Landing Page"),position:1,previewRoute:"/",routes:[{path:"landing-page",element:e(bl,{})},{path:"landing-page/action-buttons",element:e(El,{})},{path:"landing-page/primary-features",element:e(Ll,{})},{path:"landing-page/secondary-features",element:e(Ml,{})}],buildBreadcrumb:(t,a)=>{const r=t.split("/").filter(l=>!!l).pop(),i=[{label:h("Landing page"),location:"landing-page"}];return r==="action-buttons"&&i.push({label:h("Action buttons"),location:"landing-page/action-buttons"}),r==="primary-features"&&i.push({label:h("Primary features"),location:"landing-page/primary-features"}),r==="secondary-features"&&i.push({label:h("Secondary features"),location:"landing-page/secondary-features"}),i}},menus:{config:{positions:["drive-navbar","drive-sidebar","homepage-navbar","shareable-link-page","footer","footer-secondary"],availableRoutes:["/drive","/drive/shares","/drive/recent","/drive/starred","/drive/trash"]}}}},Cn=cr.all([zi,Nn]),rt=dr()(Ai(ur((t,a)=>({defaults:null,iframeWindow:null,config:Cn,setDefaults:s=>{t(r=>{r.defaults={...s}})},setIframeWindow:s=>{t(()=>({iframeWindow:s}))},preview:{navigate:s=>{var o;const r=(o=a().config)==null?void 0:o.sections[s],i=(r==null?void 0:r.previewRoute)||"/",l=a().iframeWindow;i&&bt(l,{type:"navigate",to:i})},setValues:s=>{const r=a().iframeWindow;bt(r,{type:"setValues",values:s})},setThemeColor:(s,r)=>{const i=a().iframeWindow;bt(i,{type:"setThemeColor",name:s,value:r})},setActiveTheme:s=>{const r=a().iframeWindow;bt(r,{type:"setActiveTheme",themeId:s})},setCustomCode:(s,r)=>{const i=a().iframeWindow;bt(i,{type:"setCustomCode",mode:s,value:r})},setHighlight:s=>{t(()=>{var l;let r=null;const i=(l=a().iframeWindow)==null?void 0:l.document;i&&s&&(r=i.querySelector(s)),r&&requestAnimationFrame(()=>{!r||r.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})})})}}}))));function bt(t,a){t&&t.postMessage({source:"be-appearance-editor",...a},"*")}function I(){return rt.getState()}function Bl(t){return A.post("admin/appearance",{changes:t}).then(a=>a.data)}function Ul(){return B(t=>Bl(t),{onSuccess:()=>{U(h("Changes saved"))},onError:t=>ce(t)})}function ql(){return Be(["admin/appearance/values"],()=>Ol(),{staleTime:1/0})}function Ol(){return A.get("admin/appearance/values").then(t=>t.data)}function Hl(){const{pathname:t}=ya(),{getValues:a}=P(),[s,r]=u.exports.useState(null);return u.exports.useEffect(()=>{var l;const[,,i]=t.split("/").filter(o=>!!o);if(i){const o=(l=I().config)==null?void 0:l.sections[i];if(o){r([{label:h("Appearance"),location:""},...o.buildBreadcrumb(t,a())]);return}}r(null)},[t,a]),!s||s.length<2?null:c("div",{className:"flex items-center border-b h-60 flex-shrink-0",children:[e(L,{iconSize:"md",radius:"rounded-none",className:"text-muted h-full w-50 flex-shrink-0",elementType:W,to:`/admin/appearance/${s[s.length-2].location}`,children:e(xs,{})}),c("div",{className:"border-l p-10 min-w-0",children:[e("div",{className:"text-xs text-muted",children:e(n,{message:"Customizing"})}),e("div",{className:"flex items-center gap-4 text-sm mt-2",children:s.map((i,l)=>{const o=s.length-1===l,d=l===0,m=e(mr,{value:i.label});return d?null:c(u.exports.Fragment,{children:[e("div",{className:F("whitespace-nowrap overflow-hidden overflow-ellipsis min-w-0",o&&"text-primary",o?"flex-shrink-0":"flex-auto"),children:m}),!o&&e(Ca,{className:"icon-sm text-muted flex-shrink-0"})]},l)})})]})]})}function Wl(){const{isAppearanceEditorActive:t}=pr(),{data:a}=ql(),{base_url:s}=Ce(),r=u.exports.useRef(null),{pathname:i}=ya(),l=Ie();return u.exports.useEffect(()=>{(a==null?void 0:a.defaults)&&!I().defaults&&I().setDefaults(a.defaults)},[a]),u.exports.useEffect(()=>{r.current&&I().setIframeWindow(r.current.contentWindow)},[]),u.exports.useEffect(()=>{const o=i.split("/")[3];I().preview.navigate(o)},[i]),t?e(ps,{to:"/admin"}):c("div",{className:"md:flex items-center h-full",children:[e(Vt,{children:e(n,{message:"Appearance"})}),e(Gl,{values:a==null?void 0:a.values}),e("div",{className:"flex-auto h-full relative",children:e("iframe",{ref:r,className:F("w-full h-full",l&&"hidden"),src:`${s}?appearanceEditor=true`})})]})}function Gl({values:t}){const a=e("div",{className:"flex items-center justify-center flex-auto h-full",children:e(qt,{isIndeterminate:!0,"aria-label":"Loading editor"})});return e(u.exports.Fragment,{children:e("div",{className:"bg relative w-full md:w-320 shadow-lg border-r h-full z-10",children:t?e(jl,{defaultValues:t}):a})})}function jl({defaultValues:t}){const a=H({defaultValues:t}),{watch:s,reset:r}=a,i=Ul();return u.exports.useEffect(()=>{const l=s(o=>{I().preview.setValues(o)});return()=>l.unsubscribe()},[s]),c(pe,{className:"h-full flex flex-col",form:a,onSubmit:l=>{i.mutate(l,{onSuccess:()=>r(l)})},children:[e(Kl,{isLoading:i.isLoading}),e(Hl,{}),e("div",{className:"px-14 py-20 flex-auto overflow-y-auto",children:e(Cs,{children:e(ha,{})})})]})}function Kl({isLoading:t}){const{formState:{dirtyFields:a}}=P(),s=Object.keys(a).length;return c("div",{className:"border-b flex items-center h-50 pr-10 flex-shrink-0",children:[e(L,{border:"border-r",className:"text-muted",elementType:W,to:"..",children:e(Ue,{})}),e("div",{className:"pl-10",children:e(n,{message:"Appearance editor"})}),e(x,{variant:"flat",color:"primary",className:"block ml-auto",disabled:!s||t,type:"submit",children:s?e(n,{message:"Save"}):e(n,{message:"Saved"})})]})}function Ql(){const t=tt(),{trans:a}=V(),{fields:s,append:r}=xe({name:"settings.menus",keyName:"key"});return c(u.exports.Fragment,{children:[e("div",{children:s.map((i,l)=>e(Pe,{to:`${l}`,elementType:W,children:i.name},i.key))}),e("div",{className:"text-right",children:e(x,{variant:"outline",color:"primary",startIcon:e(ve,{}),size:"xs",onClick:()=>{const i=xa(10);r({name:a(h("New menu :number",{values:{number:s.length+1}})),id:i,positions:[],items:[]}),t(`${s.length}`)},children:e(n,{message:"Create menu"})})})]})}function _n({title:t=e(n,{message:"Add menu item"})}){const{data:a}=Ae(["menuItemCategories"]),s=(a==null?void 0:a.menuItemCategories)||[],r=kn();return c(ae,{size:"sm",children:[e(oe,{children:t}),e(ie,{children:c(We,{variant:"outline",children:[e(be,{label:e(n,{message:"Link"}),bodyClassName:"max-h-240 overflow-y-auto",children:e(Jl,{})}),e(be,{label:e(n,{message:"Route"}),bodyClassName:"max-h-240 overflow-y-auto",children:e(Za,{items:r})}),s.map(i=>e(be,{label:i.name,children:e(Za,{items:i.items})},i.name))]})})]})}function Jl(){const t=H({defaultValues:{id:xa(6),type:"link",target:"_blank"}}),{close:a}=Z();return c(pe,{form:t,onSubmit:s=>{a(s)},children:[e(g,{required:!0,name:"label",label:e(n,{message:"Label"}),className:"mb-20"}),e(g,{required:!0,type:"url",name:"action",placeholder:"https://",label:e(n,{message:"Url"}),className:"mb-20"}),e("div",{className:"text-right",children:e(x,{type:"submit",variant:"flat",color:"primary",size:"xs",children:e(n,{message:"Add to menu"})})})]})}function Za({items:t}){const{close:a}=Z();return e(ks,{children:t.map(s=>e(Ns,{startIcon:e(ve,{size:"sm"}),onSelected:()=>{if(s.label){const r=s.label.split("/").pop();s.label=r?wn(r):s.label,s.id=xa(6)}a(s)},children:s.label},s.id))})}const Zl=_e(e("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"DragIndicatorOutlined"),Xl=""+new URL("dropdown-menu.c9b3bd6a.svg",import.meta.url).href;function Yl(t,a,s){const r=Tt(a,0,t.length-1),i=Tt(s,0,t.length-1);if(r===i)return t;const l=t[r],o=i{O={sortables:[...a],activeSortable:t,activeIndex:a.indexOf(t),finalIndex:a.indexOf(t)},so()},onDragEnd:()=>{!O||(no(),i==null||i(O.activeIndex,O.finalIndex),O=null)},getData:()=>{}}),{droppableProps:p}=Gr({id:t,ref:r,types:[s],disabled:o,onDragEnter:()=>{if(!O)return;const f=O.sortables.indexOf(t),v=O.sortables.indexOf(O.activeSortable);Yl(O.sortables,v,f);const y=O.sortables.map(w=>{var C;return(C=zt.get(w))==null?void 0:C.rect});O.sortables.forEach((w,C)=>{if(!O)return;const N=eo(y,f,O.activeIndex),S=y[C],k=N[C],$=zt.get(w);if(($==null?void 0:$.ref.current)&&k&&S){const G=k.left-S.left,T=k.top-S.top;$.ref.current.style.transform=`translate3d(${G}px, ${T}px, 0)`}}),O.finalIndex=f}});return{sortableProps:{...qe(d,p)},dragHandleRef:m}}const ao="transform 0.2s cubic-bezier(0.2, 0, 0, 1)";function so(){!O||O.sortables.forEach((t,a)=>{const s=zt.get(t);!(s!=null&&s.ref.current)||(s.ref.current.style.transition=ao,(O==null?void 0:O.activeIndex)===a&&(s.ref.current.style.opacity="0.4"))})}function no(){!O||O.sortables.forEach(t=>{const a=zt.get(t);a!=null&&a.ref.current&&(a.ref.current.style.transform="",a.ref.current.style.transition="",a.ref.current.style.opacity="",a.ref.current.style.zIndex="")})}function ro(){const{menuIndex:t}=he(),a=tt(),{getValues:s}=P(),r=`settings.menus.${t}`,i=s(r);return u.exports.useEffect(()=>{i?I().preview.setHighlight(`[data-menu-id="${i.id}"]`):a("/admin/appearance/menus")},[a,i]),i?e(io,{formPath:r}):null}function io({formPath:t}){const{site:{has_mobile_app:a}}=Ce(),s=rt(l=>{var o;return(o=l.config)==null?void 0:o.sections.menus.config}),r=u.exports.useMemo(()=>{const l=[...s==null?void 0:s.positions];return a&&l.push("mobile-app-about"),l.map(o=>({key:o,name:o.replaceAll("-"," ")}))},[s,a]),i=xe({name:`${t}.items`,keyName:"key"});return c(u.exports.Fragment,{children:[c("div",{className:"mb-30 pb-30 border-b",children:[e(g,{name:`${t}.name`,label:e(n,{message:"Menu name"}),className:"mb-20",autoFocus:!0}),e(Gt,{chipSize:"sm",name:`${t}.positions`,valueKey:"id",label:e(n,{message:"Menu positions"}),description:e(n,{message:"Where should this menu appear on the site"}),children:r.map(l=>e(b,{value:l.key,capitalizeFirst:!0,children:l.name},l.key))})]}),e(lo,{fieldArray:i}),e("div",{className:"text-right",children:e(oo,{})})]})}function lo({fieldArray:{append:t,fields:a,move:s}}){const r=tt();return c(u.exports.Fragment,{children:[c("div",{className:"flex items-center gap-16 justify-between flex-shrink-0",children:[e(n,{message:"Menu items"}),c(E,{type:"popover",placement:"right",offset:20,onClose:i=>{i&&(t({...i}),r(`items/${a.length}`))},children:[e(x,{variant:"outline",color:"primary",size:"xs",startIcon:e(ve,{}),children:e(n,{message:"Add"})}),e(_n,{})]})]}),c("div",{className:"mt-20 flex-shrink-0",children:[a.map((i,l)=>e(co,{item:i,items:a,index:l,onSortEnd:(o,d)=>{s(o,d)}},i.key)),!a.length&&e(fa,{size:"xs",className:"my-40",image:e(ba,{src:Xl}),title:e(n,{message:"No menu items yet"}),description:e(n,{message:"Click \u201Cadd\u201C button to start adding links, pages, routes and other items to this menu. "})})]})]})}function oo(){const t=tt(),{menuIndex:a}=he(),{fields:s,remove:r}=xe({name:"settings.menus",keyName:"key"});if(!a)return null;const i=s[+a];return c(E,{type:"modal",onClose:l=>{if(l){const o=s.findIndex(d=>d.id===i.id);r(o),t("/admin/appearance/menus")}},children:[e(x,{variant:"outline",color:"danger",size:"xs",startIcon:e(Ht,{}),children:e(n,{message:"Delete menu"})}),e(Ee,{isDanger:!0,title:e(n,{message:"Delete menu"}),body:e(n,{message:"Are you sure you want to delete \u201C:name\u201C?",values:{name:i.name}}),confirm:e(n,{message:"Delete"})})]})}function co({item:t,items:a,index:s,onSortEnd:r}){const i=u.exports.useRef(null),{sortableProps:l,dragHandleRef:o}=to({item:t,items:a,type:"menuEditorSortable",ref:i,onSortEnd:r}),d=t.icon&&us(t.icon),m=c("div",{className:"text-muted flex items-center gap-4 text-xs",children:[d&&e(d,{size:"sm"}),"(",e(n,{message:"No label..."}),")"]});return e(u.exports.Fragment,{children:e(Pe,{elementType:W,to:`items/${s}`,ref:i,...l,children:c("div",{className:"flex items-center gap-10",children:[e(L,{ref:o,size:"sm",children:e(Zl,{className:"text-muted hover:cursor-move"})}),e("div",{children:t.label||m})]})})})}function uo(){const{menuIndex:t,menuItemIndex:a}=he(),s=we(),{getValues:r}=P(),i=`settings.menus.${t}.items.${a}`,l=r(i);return u.exports.useEffect(()=>{l&&I().preview.setHighlight(`[data-menu-item-id="${l.id}"]`)},[s,l]),!l||a==null?null:e(mo,{formPath:i})}function mo({formPath:t}){return c(u.exports.Fragment,{children:[e(lt,{formPathPrefix:t}),e("div",{className:"text-right mt-40",children:e(po,{})})]})}function po(){const t=we(),{menuIndex:a,menuItemIndex:s}=he(),{fields:r,remove:i}=xe({name:`settings.menus.${+a}.items`});if(!s)return null;const l=r[+s];return c(E,{type:"modal",onClose:o=>{o&&s&&(i(+s),t(`/admin/appearance/menus/${a}`))},children:[e(x,{variant:"outline",color:"danger",size:"xs",startIcon:e(Ht,{}),children:e(n,{message:"Delete this item"})}),e(Ee,{isDanger:!0,title:e(n,{message:"Delete menu item"}),body:e(n,{message:"Are you sure you want to delete \u201C:name\u201C?",values:{name:l.label}}),confirm:e(n,{message:"Delete"})})]})}function ho(){return c(u.exports.Fragment,{children:[e(vt,{label:e(n,{message:"Favicon"}),description:e(n,{message:"This will generate different size favicons. Image should be at least 512x512 in size."}),type:"favicon"}),e(vt,{label:e(n,{message:"Light logo"}),description:e(n,{message:"Will be used on dark backgrounds."}),type:"logo_light"}),e(vt,{label:e(n,{message:"Dark logo"}),description:e(n,{message:"Will be used on light backgrounds. Will default to light logo if left empty."}),type:"logo_dark"}),e(vt,{label:e(n,{message:"Mobile light logo"}),description:e(n,{message:"Will be used on light backgrounds on mobile. Will default to desktop logo if left empty."}),type:"logo_light_mobile"}),e(vt,{label:e(n,{message:"Mobile dark logo"}),description:e(n,{message:"Will be used on dark backgrounds on mobile.Will default to desktop if left empty."}),type:"logo_dark_mobile"}),e(go,{}),e(fo,{})]})}function vt({label:t,description:a,type:s}){const r=rt(i=>{var l;return(l=i.defaults)==null?void 0:l.settings.branding[s]});return e(Nt,{name:`settings.branding.${s}`,className:"border-b pb-30 mb-30",highlightSelector:'[data-logo="navbar"]',label:t,description:a,diskPrefix:"branding_media",defaultValue:r})}function go(){return e(g,{name:"appearance.env.app_name",required:!0,className:"mt-20",label:e(n,{message:"Site name"})})}function fo(){return e(g,{name:"settings.branding.site_description",className:"mt-20",inputElementType:"textarea",rows:4,label:e(n,{message:"Site description"})})}function bo(t=1,a=1e4){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0]/(4294967295+1);return t=Math.ceil(t),a=Math.floor(a),Math.floor(r*(a-t+1))+t}function vo(){const{trans:t}=V(),a=tt(),{data:{themes:s}}=hs(),{fields:r,append:i}=xe({name:"appearance.themes.all",keyName:"key"});return u.exports.useEffect(()=>{s.selectedThemeId&&I().preview.setActiveTheme(s.selectedThemeId)},[s.selectedThemeId]),c(u.exports.Fragment,{children:[e("div",{className:"mb-20",children:e(x,{size:"xs",variant:"outline",color:"primary",startIcon:e(ve,{}),onClick:()=>{var o;const l=(o=I().defaults)==null?void 0:o.appearance.themes.light;i({id:bo(),name:t(h("New theme")),colors:l}),a(`${r.length+1}`)},children:e(n,{message:"New theme"})})}),r.map((l,o)=>e(Pe,{to:`${o}`,elementType:wa,children:l.name},l.key))]})}function yo(){const{fields:t}=xe({name:"appearance.seo"});return e(u.exports.Fragment,{children:t.map((a,s)=>e(g,{className:"mb-20",name:`appearance.seo.${s}.value`,label:a.name,placeholder:a.defaultValue,inputElementType:"textarea",rows:3},a.id))})}const xo=D.lazy(()=>Ut(()=>import("./ace-editor.2ba06f56.js"),["./ace-editor.2ba06f56.js","./main.b7d280d4.js","./main.06f69299.css","./index.9b3ee2f7.js"],import.meta.url));function wo({defaultValue:t,mode:a="html",title:s}){const[r,i]=u.exports.useState(t),[l,o]=u.exports.useState(!0);return c(ae,{size:"fullscreen",className:"h-full w-full",children:[e(oe,{children:s}),e(ie,{className:"relative flex-auto",padding:"p-0",children:e(u.exports.Suspense,{fallback:e("div",{className:"flex items-center justify-center w-full h-400",children:e(qt,{"aria-label":"Loading editor...",isIndeterminate:!0,size:"md"})}),children:e(xo,{mode:a,onChange:d=>{i(d)},defaultValue:r||"",onIsValidChange:o})})}),e(So,{isValid:l,value:r})]})}function So({isValid:t,value:a}){const{close:s}=Z();return c(ye,{dividerTop:!0,children:[e(x,{onClick:()=>s(),children:e(n,{message:"Cancel"})}),e(x,{disabled:!t,variant:"flat",color:"primary",onClick:()=>{s(a)},children:e(n,{message:"Save"})})]})}function ko(){return c(u.exports.Fragment,{children:[e(Xa,{mode:"css"}),e(Xa,{mode:"html"})]})}function Xa({mode:t}){const{getValues:a}=P(),{setValue:s}=P(),r=t==="html"?e(n,{message:"Custom HTML & JavaScript"}):e(n,{message:"Custom CSS"});return c(E,{type:"modal",onClose:i=>{i!=null&&(s(`appearance.custom_code.${t}`,i,{shouldDirty:!0}),I().preview.setCustomCode(t,i))},children:[e(Pe,{children:r}),e(wo,{title:r,defaultValue:a(`appearance.custom_code.${t}`)||"",mode:t})]})}const No=""+new URL("articles.8bfd9f17.svg",import.meta.url).href,Co=t=>{const a=t.customPages.types.length>1?[new ze({type:le.Select,key:"type",label:h("Type"),description:h("Type of the page"),defaultValue:"default",options:t.customPages.types.map(s=>({value:s.type,label:s.label,key:s.type}))})]:[];return[new ze({type:le.SelectModel,model:Pa,key:"user_id",label:h("User"),description:h("User page was created by")}),...a,new ut({description:h("Date page was created")}),new mt({description:h("Date page was last updated")})]},_o=[{key:"slug",allowsSorting:!0,header:()=>e(n,{message:"Slug"}),body:t=>e(W,{target:"_blank",to:`/pages/${t.slug}`,className:Sa,children:t.slug})},{key:"user_id",allowsSorting:!0,header:()=>e(n,{message:"Owner"}),body:t=>t.user&&e(pt,{image:t.user.avatar,label:t.user.display_name,description:t.user.email})},{key:"type",header:()=>e(n,{message:"Type"}),body:t=>e(n,{message:t.type}),width:"w-1"},{key:"updated_at",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at}),width:"w-1"},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-1",body:t=>e(L,{size:"md",className:"text-muted",elementType:W,to:`${t.id}/edit`,children:e(He,{})})}];function $o(){const t=u.exports.useContext(Oe),a=u.exports.useMemo(()=>Co(t),[t]);return e(Ge,{endpoint:"custom-pages",title:e(n,{message:"Custom pages"}),filters:a,columns:_o,queryParams:{with:"user"},actions:e(Po,{}),selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:No,title:e(n,{message:"No pages have been created yet"}),filteringTitle:e(n,{message:"No matching pages"})})})}function Po(){return e(st,{elementType:W,to:"new",children:e(n,{message:"New page"})})}function Fo(t){return A.get(`custom-pages/${t}`).then(a=>a.data)}function Ao(){const{pageId:t}=he();return Be(["custom-pages",t],()=>Fo(t),{enabled:!!t})}const To=D.lazy(()=>Ut(()=>import("./text-editor.ccac43e8.js"),["./text-editor.ccac43e8.js","./main.b7d280d4.js","./main.06f69299.css","./format.eba72cc5.js","./Edit.b85e7693.js","./date-picker.5c1c2eea.js","./index.6553f71f.js","./ArrowBack.974075c7.js","./UnfoldLess.4eafab54.js","./use-resume-subscription.493553db.js","./text-editor.b603c7db.css"],import.meta.url));function Ya({allowSlugEditing:t=!0,endpoint:a}){const{data:s,isFetched:r,fetchStatus:i}=Ao(),l=!r&&i!=="idle",o=H();return u.exports.useEffect(()=>{s!=null&&s.page&&o.reset(s.page)},[o,s==null?void 0:s.page]),e(u.exports.Suspense,{fallback:e(dt,{}),children:e("div",{className:"min-h-full",children:!l&&e(To,{page:s==null?void 0:s.page,allowSlugEditing:t,endpoint:a})})})}const zo=[{label:h("Drive"),to:"drive"}],$n=[{label:h("General"),to:"general"},...zo,{label:h("Subscriptions"),to:"subscriptions"},{label:h("Localization"),to:"localization"},{label:h("Authentication"),to:"authentication"},{label:h("Uploading"),to:"uploading"},{label:h("Mail"),to:"mail"},{label:h("Cache"),to:"cache"},{label:h("Analytics"),to:"analytics"},{label:h("Logging"),to:"logging"},{label:h("Queue"),to:"queue"},{label:h("Recaptcha"),to:"recaptcha"},{label:h("GDPR"),to:"gdpr"},{label:h("Menus"),to:"/admin/appearance/menus"},{label:h("Seo"),to:"/admin/appearance/seo-settings"},{label:h("Themes"),to:"/admin/appearance/themes"}];function Io({className:t}){const a=Ie();return c("div",{className:F(t,"md:flex gap-30 bg-paper min-h-full items-start p-24 container mx-auto"),children:[e(Vt,{children:e(n,{message:"Settings"})}),a?e(Eo,{}):e(Lo,{}),e("div",{className:"md:px-30 flex-auto bg-paper relative max-w-500",children:e(ha,{})})]})}function Eo(){const{pathname:t}=ya(),a=tt(),s=t.split("/").pop();return e(Mt,{minWidth:"min-w-none",className:"w-full bg-paper mb-24",selectionMode:"single",selectedValue:s,onSelectionChange:r=>{a(r)},children:$n.map(r=>e(b,{value:r.to,children:e(n,{...r.label})},r.to))})}function Lo(){return e("div",{className:"w-240 sticky top-24 flex-shrink-0",children:$n.map(t=>e(wa,{to:t.to,className:({isActive:a})=>F("block p-14 whitespace-nowrap mb-8 rounded border-l-4 text-sm transition-bg-color",a?"bg-primary/selected border-l-primary font-medium":"border-l-transparent hover:bg-hover"),children:e(n,{...t.label})},t.to))})}function Ct(){return Be(["fetchAdminSettings"],()=>Do(),{staleTime:1/0})}function Do(){return A.get("settings").then(t=>t.data)}function Mo(){return A.post("sitemap/generate").then(t=>t.data)}function Ro(){return B(()=>Mo(),{onSuccess:()=>{U(h("Sitemap generated"))},onError:t=>ce(t)})}const ea=t=>t instanceof Date,Vo=t=>Object.keys(t).length===0,ca=t=>t!=null&&typeof t=="object",es=(t,...a)=>Object.prototype.hasOwnProperty.call(t,...a),ta=t=>ca(t)&&Vo(t),Bo=()=>Object.create(null),da=(t,a)=>{if(t===a)return{};if(!ca(t)||!ca(a))return a;const s=Object.keys(t).reduce((r,i)=>(es(a,i)||(r[i]=void 0),r),Bo());return ea(t)||ea(a)?t.valueOf()==a.valueOf()?{}:a:Object.keys(a).reduce((r,i)=>{if(!es(t,i))return r[i]=a[i],r;const l=da(t[i],a[i]);return ta(l)&&!ea(l)&&(ta(t[i])||!ta(a[i]))||(r[i]=l),r},s)};function Pn(t){const{data:a}=Ct();return B(s=>{var l,o,d,m;(o=(l=s.client)==null?void 0:l.cookie_notice)!=null&&o.button&&(s.client.cookie_notice.button=JSON.stringify(s.client.cookie_notice.button)),(m=(d=s.client)==null?void 0:d.registration)!=null&&m.policies&&(s.client.registration.policies=JSON.stringify(s.client.registration.policies));const r=s.client?da(a.client,s.client):null,i=s.server?da(a.server,s.server):null;return Uo({client:r,server:i,files:s.files})},{onSuccess:()=>{U(h("Settings updated"),{position:"bottom-right"}),M.invalidateQueries(["fetchAdminSettings"])},onError:s=>Se(s,t)})}function Uo({client:t,server:a,files:s}){const r=new FormData;return t&&r.set("client",JSON.stringify(Ba.dot(t))),a&&r.set("server",JSON.stringify(Ba.dot(a))),Object.entries(s||{}).forEach(([i,l])=>{r.set(i,l)}),A.post("settings",r,{headers:{"Content-Type":"multipart/form-data"}}).then(i=>i.data)}function ge({title:t,description:a,children:s}){const{data:r}=Ct();return c("section",{children:[c("div",{className:"mb-40",children:[e("h2",{className:"text-xl mb-4",children:t}),e("div",{className:"text-sm text-muted",children:a})]}),r?e(qo,{defaultValues:r,children:s}):e(qt,{isIndeterminate:!0,"aria-label":"Loading settings..."})]})}function qo({children:t,defaultValues:a}){const s=H({defaultValues:a}),r=Pn(s);return c(u.exports.Fragment,{children:[c(pe,{form:s,onBeforeSubmit:()=>{const i=s.formState.errors,l=Object.keys(i).filter(o=>o.endsWith("_group"));s.clearErrors(l)},onSubmit:i=>{r.mutate(i)},children:[t,e("div",{className:"mt-40",children:e(x,{type:"submit",variant:"flat",color:"primary",disabled:r.isLoading,children:e(n,{message:"Update"})})})]}),r.isLoading&&e(It,{size:"xs",className:"absolute -bottom-14 left-30 w-full",isIndeterminate:!0,"aria-label":"Saving settings..."})]})}function Ve(){return e("div",{className:"h-1 bg-divider my-30"})}function _t({link:t,className:a}){const{site:s}=Ce();return s.hide_docs_button?null:c("div",{className:F("flex items-center gap-8",a),children:[e(jr,{size:"sm"}),e(Ot,{href:t,children:e(n,{message:"Learn more."})})]})}function Oo(){return c(ge,{title:e(n,{message:"General"}),description:e(n,{message:"Configure site url, homepage, theme and other general settings."}),children:[e(Ho,{}),e(Ve,{}),e(Wo,{}),e(Ve,{}),e(Go,{}),e(Ve,{}),e(jo,{})]})}function Ho(){const{data:t}=Ct();if(!t)return null;let a=null;const s=t.server,r=s.newAppUrl&&s.newAppUrl!==s.app_url;return r&&(a=e("div",{className:"text-sm text-danger mt-20",children:e(n,{values:{baseUrl:s.app_url,currentUrl:s.newAppUrl,b:i=>e("b",{children:i})},message:"Base site url is set as :baseUrl in configuration, but current url is :currentUrl. It is recommended to set the primary url you want to use in configuration file and then redirect all other url versions to this primary version via cpanel or .htaccess file."})})),c(R,{children:[e(g,{invalid:!!r,name:"server.app_url",label:e(n,{message:"Primary site url"}),description:e(_t,{link:"https://support.vebto.com/help-center/articles/35/primary-site-url"})}),a]})}function Wo(){const{homepage:t}=u.exports.useContext(Oe);return e("div",{children:e(X,{name:"client.homepage.type",selectionMode:"single",label:e(n,{message:"Site home page"}),description:e(n,{message:"Which page should be used as site homepage"}),children:t.options.map(a=>e(b,{value:a.value,children:e(n,{...a.label})},a.value))})})}function Go(){const{data:{themes:t}}=hs();return c(u.exports.Fragment,{children:[c(X,{className:"mb-20",name:"client.themes.default_id",selectionMode:"single",label:e(n,{message:"Default site theme"}),description:e(n,{message:"Which theme to use for users that have not chosen a theme manually."}),children:[e(b,{value:0,children:e(n,{message:"System"})}),t.all.map(a=>e(b,{value:a.id,children:a.name},a.id))]}),e(z,{name:"client.themes.user_change",description:e(n,{message:"Allow users to manually change site theme."}),children:e(n,{message:"Allow theme change"})})]})}function jo(){const t=Ro(),{base_url:a}=Ce(),s=`${a}/storage/sitemaps/sitemap-index.xml`,r=e(Ot,{href:s,children:s});return c(R,{children:[e(x,{variant:"outline",size:"xs",color:"primary",disabled:t.isLoading,onClick:()=>{t.mutate()},children:e(n,{message:"Generate sitemap"})}),e("div",{className:"text-sm text-muted mt-14",children:e(n,{message:"Once generated, sitemap url will be: :url",values:{url:r}})})]})}function Ko(t){return nt(t).toString("rgb").replace("rgb(","").replace(")","").replace(/, ?/g," ")}function Qo(t){try{return nt(`rgb(${t.split(" ").join(",")})`).toString("hex")}catch{return t}}const Jo=_e(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined");function Zo(){const{getValues:t,setValue:a}=P(),{themeIndex:s}=he(),r=t(`appearance.themes.all.${+s}`);return c(E,{type:"modal",onClose:i=>{!i||t("appearance.themes.all").forEach((l,o)=>{if(l.id===i.id){a(`appearance.themes.all.${o}`,i,{shouldDirty:!0});return}if(i.default_light){a(`appearance.themes.all.${o}`,{...l,default_light:!1},{shouldDirty:!0});return}if(i.default_dark){a(`appearance.themes.all.${o}`,{...l,default_dark:!1},{shouldDirty:!0});return}})},children:[e(x,{size:"xs",variant:"outline",color:"primary",startIcon:e(Jo,{}),children:e(n,{message:"Settings"})}),e(Xo,{theme:r})]})}function Xo({theme:t}){const a=H({defaultValues:t}),{close:s,formId:r}=Z();return u.exports.useEffect(()=>{const i=a.watch((l,{name:o})=>{o==="default_light"&&l.default_light&&a.setValue("default_dark",!1),o==="default_dark"&&l.default_dark&&a.setValue("default_light",!1)});return()=>i.unsubscribe()},[a]),c(ae,{children:[e(oe,{children:e(n,{message:"Update settings"})}),e(ie,{children:c(pe,{form:a,id:r,onSubmit:i=>{s(i)},children:[e(g,{name:"name",label:e(n,{message:"Name"}),className:"mb-30",autoFocus:!0}),e(z,{name:"is_dark",className:"mb-20 pb-20 border-b",description:e(n,{message:"Whether this theme has light text on dark background."}),children:e(n,{message:"Dark theme"})}),e(z,{name:"default_light",className:"mb-30",description:e(n,{message:"When light mode is selected, this theme will be used."}),children:e(n,{message:"Default for light mode"})}),e(z,{name:"default_dark",description:e(n,{message:"When dark mode is selected, this theme will be used."}),children:e(n,{message:"Default for dark mode"})})]})}),c(ye,{children:[e(x,{onClick:()=>{s()},children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",type:"submit",form:r,disabled:!a.formState.isDirty,children:e(n,{message:"Save"})})]})]})}const Yo=_e(e("path",{d:"M6 13c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91zm14 0c0-4.42-3.58-8-8-8-.06 0-.12.01-.18.01l1.09-1.09L11.5 2.5 8 6l3.5 3.5 1.41-1.41-1.08-1.08c.06 0 .12-.01.17-.01 3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93z"}),"RestartAltOutlined");function ec(){const t=we(),{themeIndex:a}=he(),[s,r]=u.exports.useState(!1),{setValue:i,getValues:l}=P(),{fields:o,remove:d}=xe({name:"appearance.themes.all"}),m=()=>{if(o.length<=1){U.danger(h("At least one theme is required"));return}a&&(t("/admin/appearance/themes"),d(+a),i("appearance.themes.selectedThemeId",null))};return c(u.exports.Fragment,{children:[c(hr,{onItemSelected:p=>{if(p==="delete")r(!0);else if(p==="reset"){const f=`appearance.themes.all.${+a}`,v=l(`${f}.is_dark`)?I().defaults.appearance.themes.dark:I().defaults.appearance.themes.light;Object.entries(v).forEach(([y,w])=>{I().preview.setThemeColor(y,w)}),i(`${f}.colors`,v,{shouldDirty:!0})}},children:[e(L,{size:"md",className:"text-muted",children:e(Kr,{})}),c(gr,{children:[e(b,{value:"reset",startIcon:e(Yo,{}),children:e(n,{message:"Reset colors"})}),e(b,{value:"delete",startIcon:e(Ht,{}),children:e(n,{message:"Delete"})})]})]}),e(E,{type:"modal",isOpen:s,onClose:p=>{p&&m(),r(!1)},children:e(Ee,{isDanger:!0,title:e(n,{message:"Delete theme"}),body:e(n,{message:"Are you sure you want to delete this theme?"}),confirm:e(n,{message:"Delete"})})})]})}function tc(){const t=tt(),{themeIndex:a}=he(),{getValues:s}=P(),r=s(`appearance.themes.all.${+a}`);return u.exports.useEffect(()=>{r||t("/admin/appearance/themes")},[t,r]),u.exports.useEffect(()=>{r!=null&&r.id&&I().preview.setActiveTheme(r.id)},[r==null?void 0:r.id]),r?c(u.exports.Fragment,{children:[c("div",{className:"mb-20 flex items-center gap-10 justify-between",children:[e(Zo,{}),e(ec,{})]}),e("div",{children:Object.entries(r.colors).filter(([i])=>!i.endsWith("opacity")).map(([i,l])=>e(ac,{colorName:i,initialThemeValue:l,theme:r},i))})]}):null}function ac({theme:t,colorName:a,initialThemeValue:s}){const{setValue:r}=P(),{themeIndex:i}=he(),[l,o]=u.exports.useState(s),d=p=>{o(p),I().preview.setThemeColor(a,p)};u.exports.useEffect(()=>{o(s)},[s]);const m=Qo(s);return c(E,{currentValue:m,type:"popover",placement:"right",offset:10,onClose:p=>{p&&p!==m?(r(`appearance.themes.all.${+i}.colors.${a}`,l,{shouldDirty:!0}),r("appearance.themes.selectedThemeId",t.id)):d(s)},children:[e(Pe,{className:"capitalize",startIcon:e(Ts,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:`rgb(${l})`}}),children:a.replace("--be-","").replace("-"," ")}),e(vn,{defaultValue:m,onChange:p=>{d(Ko(p))}})]})}function sc(){return c(ge,{title:e(n,{message:"Drive"}),description:e(n,{message:"Configure defaults for drive user dashboard."}),children:[c(ka,{required:!0,className:"mb-30",size:"md",name:"client.drive.default_view",orientation:"vertical",label:e(n,{message:"Default view mode"}),description:e(n,{message:"Which view mode should user drive use by default."}),children:[e(Ze,{value:"list",children:e(n,{message:"List"})}),e(Ze,{value:"grid",children:e(n,{message:"Grid"})})]}),e(z,{className:"mb-30",name:"client.drive.send_share_notification",description:e(n,{message:"Send a notification to user when a file or folder is shared with them."}),children:e(n,{message:"Share notifications"})}),e(z,{name:"client.share.suggest_emails",description:e(n,{message:"Suggest email address of existing users when sharing a file or folder."}),children:e(n,{message:"Suggest emails"})})]})}const nc=[{path:"drive",element:e(sc,{})}];function de({children:t,name:a,separatorBottom:s=!0,separatorTop:r=!0}){const{formState:{errors:i}}=P(),l=u.exports.useRef(null),o=i[a];return u.exports.useEffect(()=>{var d;o&&((d=l.current)==null||d.scrollIntoView({behavior:"smooth"}))},[o]),c("div",{className:F(s&&"border-b mb-20 pb-20",r&&"border-t mt-20 pt-20",o&&"border-y-error"),ref:l,children:[t(!!o),o&&e("div",{className:"text-danger text-sm mt-20",dangerouslySetInnerHTML:{__html:o.message}})]})}function ua({children:t,...a}){const{field:{onChange:s,onBlur:r,value:i=[],ref:l},fieldState:{invalid:o,error:d}}=et({name:a.name}),m=u.exports.useMemo(()=>{const f=i;return typeof f=="string"?JSON.parse(f):f},[i]),p={onChange:f=>{const v=JSON.stringify(f.map(y=>y.name));s(v)},onBlur:r,value:m,invalid:o,errorMessage:d==null?void 0:d.message};return e(Ss,{ref:l,...qe(p,a)})}const $t=D.createContext(null);function Fn(t){const{size:a="md",children:s,className:r,isLazy:i,overflow:l="overflow-hidden"}=t,o=u.exports.useRef([]),d=u.exports.useId(),[m,p]=Rt(t.selectedTab,t.defaultSelectedTab||0,t.onTabChange),f=u.exports.useMemo(()=>({selectedTab:m,setSelectedTab:p,tabsRef:o,size:a,isLazy:i,id:d}),[m,d,i,p,a]);return e($t.Provider,{value:f,children:e("div",{className:F(r,l,"max-w-full"),children:s})})}function rc(){const{tabsRef:t,selectedTab:a}=u.exports.useContext($t),[s,r]=u.exports.useState({width:void 0,transform:void 0,className:void 0});return gs(()=>{if(a!=null&&t.current){const i=t.current[a];r(l=>({width:`${i.offsetWidth}px`,transform:`translateX(${i.offsetLeft}px)`,className:l.width===void 0?"":"transition-all"}))}},[r,a,t]),e("div",{className:F("absolute bottom-0 left-0 h-2 bg-primary",s.className),role:"presentation",style:{width:s.width,transform:s.transform}})}function An({children:t,center:a,expand:s,className:r}){const i=u.exports.Children.toArray(t);return e(ns,{children:c("div",{className:F("flex relative max-w-full overflow-auto border-b",r),role:"tablist","aria-orientation":"horizontal",children:[i.map((l,o)=>u.exports.isValidElement(l)?u.exports.cloneElement(l,{index:o,className:F(l.props.className,s&&"flex-auto",a&&o===0&&"ml-auto",a&&o===i.length-1&&"mr-auto")}):null),e(rc,{})]})})}function Lt({index:t,className:a,isDisabled:s,children:r,padding:i,elementType:l="button",to:o,relative:d}){const{selectedTab:m,setSelectedTab:p,tabsRef:f,size:v="md",id:y}=u.exports.useContext($t),w=t===m,C=rs(),N=i||(v==="sm"?"px-12":"px-18"),S=F("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded",ic({isDisabled:s,isSelected:w}),a,v==="md"&&`${N} h-48`,v==="sm"&&`${N} h-32`,!s&&"cursor-pointer"),k=T=>{switch(T.key){case"ArrowLeft":C.focusPrevious();break;case"ArrowRight":C.focusNext();break;case"Home":C.focusFirst();break;case"End":C.focusLast();break}},$=w?0:-1;return e(l,{disabled:s,id:`${y}-${t}-tab`,"aria-controls":`${y}-${t}-tabpanel`,type:"button",role:"tab","aria-selected":w,tabIndex:s?void 0:$,onKeyDown:k,onClick:()=>{p(t)},to:o,relative:d,className:S,ref:T=>{f.current&&T&&(f.current[t]=T)},children:r})}function ic({isDisabled:t,isSelected:a}){return t?"text-disabled cursor-default":a?"text-primary":"text-muted hover:text-main"}function Tn({children:t,className:a}){const{selectedTab:s,isLazy:r}=u.exports.useContext($t),i=u.exports.Children.toArray(t);let l;return r?l=u.exports.cloneElement(i[s],{index:s}):l=i.map((o,d)=>{if(u.exports.isValidElement(o)){const m=d===s;return u.exports.cloneElement(o,{index:d,"aria-hidden":!m,className:m?o.props.className:F(o.props.className,"hidden")})}return null}),e("div",{className:a,children:l})}function Dt({className:t,children:a,index:s,...r}){const{id:i}=u.exports.useContext($t),[l,o]=u.exports.useState(0),d=u.exports.useRef(null);return gs(()=>{if(d!=null&&d.current){const m=()=>{const f=fr(d.current,{tabbable:!0});o(f.nextNode()?void 0:0)};m();const p=new MutationObserver(m);return p.observe(d.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{p.disconnect()}}},[d]),e("div",{tabIndex:l,ref:d,id:`${i}-${s}-tabpanel`,"aria-labelledby":`${i}-${s}-tab`,className:F(t,"focus-visible:outline-primary-light"),role:"tabpanel",...r,children:a})}function lc(){const{trans:t}=V();return e(ge,{title:e(n,{message:"Subscriptions"}),description:e(n,{message:"Configure gateway integration, accepted cards, invoices and other related settings."}),children:c(Fn,{children:[c(An,{children:[e(Lt,{children:e(n,{message:"General"})}),e(Lt,{children:e(n,{message:"Invoices"})})]}),c(Tn,{className:"pt-30",children:[c(Dt,{children:[e(z,{name:"client.billing.enable",description:e(n,{message:"Enable or disable all subscription related functionality across the site."}),children:e(n,{message:"Enable subscriptions"})}),e(Ve,{}),e(oc,{}),e(cc,{}),e(Ve,{}),e(ua,{name:"client.billing.accepted_cards",placeholder:t({message:"Add new card..."})})]}),c(Dt,{children:[e(g,{inputElementType:"textarea",rows:5,label:e(n,{message:"Invoice address"}),name:"client.billing.invoice.address",className:"mb-30"}),e(g,{inputElementType:"textarea",rows:5,label:e(n,{message:"Invoice notes"}),description:e(n,{message:"Default notes to show under `notes` section of user invoice. Optional."}),name:"client.billing.invoice.notes"})]})]})]})})}function oc(){const{watch:t}=P(),a=t("client.billing.paypal.enable");return c("div",{className:"mb-30",children:[e(z,{name:"client.billing.paypal.enable",description:c("div",{children:[e(n,{message:"Enable PayPal payment gateway integration."}),e(_t,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/147/configuring-paypal"})]}),children:e(n,{message:"PayPal gateway"})}),a&&e(de,{name:"paypal_group",children:s=>c(u.exports.Fragment,{children:[e(g,{name:"server.paypal_client_id",label:e(n,{message:"PayPal Client ID"}),required:!0,invalid:s,className:"mb-20"}),e(g,{name:"server.paypal_secret",label:e(n,{message:"PayPal Secret"}),required:!0,invalid:s,className:"mb-20"}),e(g,{name:"server.paypal_webhook_id",label:e(n,{message:"PayPal Webhook ID"}),required:!0,invalid:s,className:"mb-20"}),e(z,{name:"client.billing.paypal_test_mode",invalid:s,description:e("div",{children:e(n,{message:"Allows testing PayPal payments with sandbox accounts."})}),children:e(n,{message:"PayPal test mode"})})]})})]})}function cc(){const{watch:t}=P(),a=t("client.billing.stripe.enable");return c(R,{children:[e(z,{name:"client.billing.stripe.enable",description:c("div",{children:[e(n,{message:"Enable Stripe payment gateway integration."}),e(_t,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/148/configuring-stripe"})]}),children:e(n,{message:"Stripe gateway"})}),a&&e(de,{name:"stripe_group",separatorBottom:!1,children:s=>c(u.exports.Fragment,{children:[e(g,{name:"server.stripe_key",label:e(n,{message:"Stripe Client ID"}),required:!0,className:"mb-20",invalid:s}),e(g,{name:"server.stripe_secret",label:e(n,{message:"Stripe Secret"}),required:!0,className:"mb-20",invalid:s}),e(g,{name:"server.stripe_webhook_secret",label:e(n,{message:"Stripe webhook signing secret"}),required:!0,className:"mb-20",invalid:s})]})})]})}function dc(){const{data:t}=Ae(["timezones","localizations"]),a=Qr();return c(ge,{title:e(n,{message:"Localization"}),description:e(n,{message:"Configure global date, time and language settings."}),children:[c(ot,{className:"mb-30",required:!0,name:"client.dates.default_timezone",openMenuOnFocus:!0,label:e(n,{message:"Default timezone"}),description:e(n,{message:"Which timezone should be selected by default for new users and guests."}),children:[e(b,{value:"auto",children:e(n,{message:"Auto"})},"auto"),Object.entries((t==null?void 0:t.timezones)||{}).map(([s,r])=>e(ms,{label:s,children:r.map(i=>e(b,{value:i.value,children:i.text},i.value))},s))]}),c(X,{name:"client.locale.default",className:"mb-30",selectionMode:"single",label:e(n,{message:"Default language"}),description:e(n,{message:"Which localization should be selected by default for new users and guests."}),children:[e(b,{value:"auto",children:e(n,{message:"Auto"})},"auto"),((t==null?void 0:t.localizations)||[]).map(s=>e(b,{value:s.language,capitalizeFirst:!0,children:s.name},s.language))]}),c(ka,{required:!0,className:"mb-30",size:"sm",name:"client.dates.format",orientation:"vertical",label:e(n,{message:"Date verbosity"}),description:e(n,{message:"Default verbosity for all dates displayed across the site. Month/day order and separators will be adjusted automatically, based on user's locale."}),children:[e(Ze,{value:"auto",children:e(n,{message:"Auto"})},"auto"),Object.entries(br).map(([s,r])=>e(Ze,{value:s,children:e(me,{date:a,options:r})},s))]}),e(z,{name:"client.i18n.enable",description:e(n,{message:"If disabled, site will always be shown in default language and user will not be able to change their locale."}),children:e(n,{message:"Enable translations"})})]})}function uc(){return c(ge,{title:e(n,{message:"Authentication"}),description:e(n,{message:"Configure registration, social login and related 3rd party integrations."}),children:[e(mc,{}),e(z,{className:"mb-30",name:"client.registration.disable",description:e(n,{message:"All registration related functionality (including social login) will be disabled."}),children:e(n,{message:"Disable registration"})}),e(z,{name:"client.single_device_login",description:e(n,{message:"Only allow one device to be logged into user account at the same time."}),children:e(n,{message:"Single device login"})}),e(pc,{}),e(hc,{}),e(gc,{}),e(fc,{})]})}function mc(){const{watch:t}=P(),a=t("server.mail_setup");return e(z,{className:"mb-30",name:"client.require_email_confirmation",description:c(u.exports.Fragment,{children:[e(n,{message:"Require newly registered users to validate their email address before being able to login."}),!a&&e("p",{className:"mt-10 text-danger",children:e(n,{message:"Outgoing mail method needs to be setup before enabling this setting. Fix now",values:{a:s=>e(W,{className:"font-bold block underline",to:"/admin/settings/mail#outgoing-emails",children:s})}})})]}),children:e(n,{message:"Require email confirmation"})})}function pc(){const{watch:t}=P(),{envato:a}=Ce(),s=t("client.social.envato.enable");return a!=null&&a.enable?e(de,{separatorBottom:!1,name:"envato_group",children:r=>c(R,{children:[e(z,{invalid:r,name:"client.social.envato.enable",description:e(n,{message:"Enable logging into the site via envato."}),children:e(n,{message:"Envato login"})}),s&&c(R,{children:[e(g,{invalid:r,className:"mt-30",name:"server.envato_id",label:e(n,{message:"Envato ID"}),required:!0}),e(g,{invalid:r,className:"mt-30",name:"server.envato_secret",label:e(n,{message:"Envato secret"}),required:!0}),e(g,{invalid:r,className:"mt-30",name:"server.envato_personal_token",label:e(n,{message:"Envato personal token"}),required:!0})]})]})}):null}function hc(){const{watch:t}=P(),a=t("client.social.google.enable");return e(de,{name:"google_group",children:s=>c(R,{children:[e(z,{invalid:s,name:"client.social.google.enable",description:e(n,{message:"Enable logging into the site via google."}),children:e(n,{message:"Google login"})}),a&&c(R,{children:[e(g,{invalid:s,className:"mt-30",name:"server.google_id",label:e(n,{message:"Google client ID"}),required:!0}),e(g,{className:"mt-30",name:"server.google_secret",label:e(n,{message:"Google client secret"}),required:!0})]})]})})}function gc(){const{watch:t}=P(),a=t("client.social.facebook.enable");return e(de,{name:"facebook_group",separatorTop:!1,children:s=>c(R,{children:[e(z,{invalid:s,name:"client.social.facebook.enable",description:e(n,{message:"Enable logging into the site via facebook."}),children:e(n,{message:"Facebook login"})}),a&&c(R,{children:[e(g,{invalid:s,className:"mt-30",name:"server.facebook_id",label:e(n,{message:"Facebook app ID"}),required:!0}),e(g,{invalid:s,className:"mt-30",name:"server.facebook_secret",label:e(n,{message:"Facebook app secret"}),required:!0})]})]})})}function fc(){const{watch:t}=P(),a=t("client.social.twitter.enable");return e(de,{name:"twitter_group",separatorTop:!1,separatorBottom:!1,children:s=>c(R,{children:[e(z,{invalid:s,name:"client.social.twitter.enable",description:e(n,{message:"Enable logging into the site via twitter."}),children:e(n,{message:"Twitter login"})}),a&&c(R,{children:[e(g,{invalid:s,className:"mt-30",name:"server.twitter_id",label:e(n,{message:"Twitter ID"}),required:!0}),e(g,{invalid:s,className:"mt-30",name:"server.twitter_secret",label:e(n,{message:"Twitter secret"}),required:!0})]})]})})}function Ye({title:t,description:a,actions:s,color:r="primary",className:i}){return c("div",{className:F(i,"p-10 rounded border-l-4",r==="positive"&&"bg-positive/focus border-l-positive",r==="warning"&&"bg-warning/focus border-l-warning",r==="danger"&&"bg-danger/focus border-l-danger",r==="primary"&&"bg-primary/focus border-l-primary"),children:[t&&e("div",{className:"text-sm mb-4 font-medium",children:t}),a&&e("div",{className:"text-sm",children:a}),s&&e("div",{className:"mt-14",children:s})]})}function bc(){return A.get("uploads/server-max-file-size").then(t=>t.data)}function vc(){return Be(["MaxServerUploadSize"],()=>bc())}const yc=["B","KB","MB","GB","TB","PB"];function ts(t,a){if(t==null)return 0;switch(a){case"KB":return t*1024;case"MB":return t*1024**2;case"GB":return t*1024**3;case"TB":return t*1024**4;case"PB":return t*1024**5;default:return t}}const xc=0x630000000000,xt=D.forwardRef(({name:t,...a},s)=>{const{field:{onChange:r,onBlur:i,value:l="",ref:o},fieldState:{invalid:d,error:m}}=et({name:t}),[p,f]=u.exports.useState(""),[v,y]=u.exports.useState("MB");u.exports.useEffect(()=>{if(l==null||l===""){f("");return}const{amount:N,unit:S}=wc({bytes:Math.min(l,xc)});y(S||"MB"),f(Number.isNaN(N)?"":N)},[l,v]);const w={onChange:N=>{const S=parseInt(N.target.value);if(Number.isNaN(S))r(S);else{const k=ts(parseInt(N.target.value),v);r(k)}},onBlur:i,value:p,invalid:d,errorMessage:m==null?void 0:m.message,inputRef:o},C=e(Mt,{minWidth:"min-w-80",selectionMode:"single",selectedValue:v,disabled:!l,onSelectionChange:N=>{const S=ts(p||0,N);r(S)},children:yc.slice(0,5).map(N=>e(b,{value:N,children:N==="B"?"Bytes":N},N))});return e(ct,{...qe(w,a),type:"number",ref:s,endAppend:C})}),wc=vr(({bytes:t})=>{const a=fs(t);if(!a)return{amount:"",unit:"MB"};let s=parseInt(a.split(" ")[0]);return s=Math.round(s),{amount:s,unit:a.split(" ")[1]}});function Sc(){const{trans:t}=V();return B(()=>kc(),{onSuccess:()=>{U(t(h("CORS file updated"))),M.invalidateQueries(["Query Key"])},onError:a=>ce(a)})}function kc(){return A.post("s3/cors/upload").then(t=>t.data)}function Nc(){return B(t=>Cc(t),{onError:t=>ce(t)})}function Cc(t){return A.post("settings/uploading/dropbox-refresh-token",t).then(a=>a.data)}function _c({isInvalid:t}){const{watch:a,setValue:s}=P(),r=a("server.storage_dropbox_app_key"),i=a("server.storage_dropbox_app_secret");return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-20",name:"server.storage_dropbox_app_key",label:e(n,{message:"Dropbox application key"}),required:!0}),e(g,{invalid:t,className:"mb-20",name:"server.storage_dropbox_app_secret",label:e(n,{message:"Dropbox application secret"}),required:!0}),e(g,{invalid:t,className:"mb-20",name:"server.storage_dropbox_refresh_token",label:e(n,{message:"Dropbox refresh token"}),required:!0}),c(E,{type:"modal",onClose:l=>{l&&s("server.storage_dropbox_refresh_token",l)},children:[e(x,{variant:"outline",color:"primary",size:"xs",disabled:!r||!i,children:e(n,{message:"Get dropbox refresh token"})}),e($c,{appKey:r,appSecret:i})]})]})}function $c({appKey:t,appSecret:a}){const s=H(),{formId:r,close:i}=Z(),l=Nc();return c(ae,{children:[e(oe,{children:e(n,{message:"Connected dropbox account"})}),e(ie,{children:c(pe,{id:r,form:s,onSubmit:o=>{l.mutate({app_key:t,app_secret:a,access_code:o.accessCode},{onSuccess:d=>{i(d.refreshToken)}})},children:[c("div",{className:"mb-20 pb-20 border-b",children:[e("div",{className:"text-muted text-sm mb-10",children:e(n,{message:"Click the 'get access code' button to get dropbox access code, then paste it into the field below."})}),e(x,{variant:"outline",color:"primary",size:"xs",elementType:"a",target:"_blank",href:`https://www.dropbox.com/oauth2/authorize?client_id=${t}&token_access_type=offline&response_type=code`,children:e(n,{message:"Get access code"})})]}),e(g,{name:"accessCode",label:e(n,{message:"Dropbox access code"}),required:!0})]})}),c(ye,{children:[e(x,{onClick:()=>{i()},children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",form:r,type:"submit",disabled:!t||!a||l.isLoading,children:e(n,{message:"Connect"})})]})]})}function Pc(){const{trans:t}=V();return c(ge,{title:e(n,{message:"Uploading"}),description:e(n,{message:"Configure size and type of files that users are able to upload. This will affect all uploads across the site."}),children:[e(Ac,{}),e(Tc,{}),e(zc,{}),e(de,{name:"static_delivery_group",children:a=>c(ka,{invalid:a,size:"sm",name:"server.static_file_delivery",orientation:"vertical",label:e(n,{message:"File delivery optimization"}),description:e(n,{message:"Both X-Sendfile and X-Accel need to be enabled on the server first. When enabled, it will reduce server memory and CPU usage when previewing or downloading files, especially for large files."}),children:[e(Ze,{value:"",children:e(n,{message:"None"})}),e(Ze,{value:"xsendfile",children:e(n,{message:"X-Sendfile (Apache)"})}),e(Ze,{value:"xaccel",children:e(n,{message:"X-Accel (Nginx)"})})]})}),e(xt,{className:"mb-30",name:"client.uploads.chunk_size",min:1,label:e(n,{message:"Chunk size"}),placeholder:"Infinity",description:e(n,{message:"Size (in bytes) for each file chunk. It should only be changed if there is a maximum upload size on your server or proxy (for example cloudflare). If chunk size is larger then limit on the server, uploads will fail."})}),e(Fc,{}),e(Ve,{}),e(xt,{min:1,name:"client.uploads.max_size",className:"mb-30",label:e(n,{message:"Maximum file size"}),description:e(n,{message:"Maximum size (in bytes) for a single file user can upload."})}),e(xt,{min:1,name:"client.uploads.available_space",className:"mb-30",label:e(n,{message:"Available space"}),description:e(n,{message:"Disk space (in bytes) each user uploads are allowed to take up. This can be overridden per user."})}),e(ua,{name:"client.uploads.allowed_extensions",className:"mb-30",label:e(n,{message:"Allowed extensions"}),placeholder:t(h("Add extension...")),description:e(n,{message:"List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types."})}),e(ua,{name:"client.uploads.blocked_extensions",label:e(n,{message:"Blocked extensions"}),placeholder:t(h("Add extension...")),description:e(n,{message:"Prevent uploading of these file types, even if they are allowed above."})})]})}function Fc(){const{data:t}=vc();return e(Ye,{color:"warning",description:e(n,{message:"Maximum upload size on your server currently is set to :size",values:{size:t==null?void 0:t.maxSize,b:a=>e("b",{children:a})}})})}function Ac(){const{watch:t,clearErrors:a}=P();return t("server.uploads_disk_driver")?c(X,{className:"mb-30",selectionMode:"single",name:"server.uploads_disk_driver",label:e(n,{message:"User Uploads Storage Method"}),description:e(n,{message:"Where should user private file uploads be stored."}),onSelectionChange:()=>{a()},children:[e(b,{value:"local",children:e(n,{message:"Local Disk (Default)"})}),e(b,{value:"ftp",children:"FTP"}),e(b,{value:"digitalocean_s3",children:"DigitalOcean Spaces"}),e(b,{value:"backblaze_s3",children:"Backblaze"}),e(b,{value:"s3",children:"Amazon S3 (Or compatible service)"}),e(b,{value:"dropbox",children:"Dropbox"}),e(b,{value:"rackspace",children:"Rackspace"})]}):null}function Tc(){const{watch:t,clearErrors:a}=P();return t("server.public_disk_driver")?c(X,{label:e(n,{message:"Public Uploads Storage Method"}),selectionMode:"single",name:"server.public_disk_driver",description:e(n,{message:"Where should user public uploads (like avatars) be stored."}),onSelectionChange:()=>{a()},children:[e(b,{value:"local",children:e(n,{message:"Local Disk (Default)"})}),e(b,{value:"s3",children:"Amazon S3"}),e(b,{value:"ftp",children:"FTP"}),e(b,{value:"digitalocean_s3",children:"DigitalOcean Spaces"}),e(b,{value:"backblaze_s3",children:"Backblaze"})]}):null}function zc(){const{watch:t}=P(),a=[t("server.uploads_disk_driver"),t("server.public_disk_driver")];return a[0]==="local"&&a[1]==="local"?null:e(de,{separatorBottom:!1,name:"storage_group",children:s=>{if(a.includes("s3"))return e(Ic,{isInvalid:s});if(a.includes("ftp"))return e(Dc,{isInvalid:s});if(a.includes("dropbox"))return e(_c,{isInvalid:s});if(a.includes("digitalocean_s3"))return e(Ec,{isInvalid:s});if(a.includes("backblaze_s3"))return e(Lc,{isInvalid:s})}})}function Ic({isInvalid:t}){return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-30",name:"server.storage_s3_key",label:e(n,{message:"Amazon S3 key"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_s3_secret",label:e(n,{message:"Amazon S3 secret"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_s3_region",label:e(n,{message:"Amazon S3 region"}),pattern:"[a-z1-9\\-]+",placeholder:"us-east-1",required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_s3_bucket",label:e(n,{message:"Amazon S3 bucket"}),required:!0}),e(g,{invalid:t,name:"server.storage_s3_endpoint",label:e(n,{message:"Amazon S3 endpoint"}),description:e(n,{message:"Only change endpoint if you are using another S3 compatible storage service."})}),e(za,{invalid:t})]})}function Ec({isInvalid:t}){return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-30",name:"server.storage_digitalocean_key",label:e(n,{message:"DigitalOcean key"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_digitalocean_secret",label:e(n,{message:"DigitalOcean secret"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_digitalocean_region",label:e(n,{message:"DigitalOcean region"}),pattern:"[a-z0-9\\-]+",placeholder:"us-east-1",required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_digitalocean_bucket",label:e(n,{message:"DigitalOcean bucket"}),required:!0}),e(za,{invalid:t})]})}function Lc({isInvalid:t}){return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-30",name:"server.storage_backblaze_key",label:e(n,{message:"Backblaze KeyID"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_backblaze_secret",label:e(n,{message:"Backblaze applicationKey"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_backblaze_region",label:e(n,{message:"Backblaze Region"}),pattern:"[a-z0-9\\-]+",placeholder:"us-west-002",required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_backblaze_bucket",label:e(n,{message:"Backblaze bucket name"}),required:!0}),e(za,{invalid:t})]})}function za({invalid:t}){var i,l;const a=Sc(),{data:s}=Ct(),r=((i=s==null?void 0:s.server.uploads_disk_driver)==null?void 0:i.endsWith("s3"))||((l=s==null?void 0:s.server.public_disk_driver)==null?void 0:l.endsWith("s3"));return c(u.exports.Fragment,{children:[e(z,{className:"mt-30",invalid:t,name:"client.uploads.s3_direct_upload",description:c("div",{children:[e("p",{children:e(n,{message:"Upload files directly from the browser to s3 without going through the server. It will save on server bandwidth and should result in faster upload times. This should be enabled, unless storage provider does not support multipart uploads."})}),e("p",{className:"mt-10",children:e(n,{message:"If s3 provider is not configured to allow uploads from browser, this can be done automatically via CORS button below, when valid credentials are saved."})})]}),children:e(n,{message:"Direct upload"})}),e(x,{variant:"flat",color:"primary",size:"xs",className:"mt-20",onClick:()=>{a.mutate()},disabled:!r||a.isLoading,children:e(n,{message:"Configure CORS"})})]})}function Dc({isInvalid:t}){return c(R,{children:[e(g,{invalid:t,className:"mb-30",name:"server.storage_ftp_host",label:e(n,{message:"FTP hostname"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_ftp_username",label:e(n,{message:"FTP username"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_ftp_password",label:e(n,{message:"FTP password"}),type:"password",required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.storage_ftp_root",label:e(n,{message:"FTP directory"}),placeholder:"/"}),e(g,{invalid:t,className:"mb-30",name:"server.storage_ftp_port",label:e(n,{message:"FTP port"}),type:"number",min:0,placeholder:"21"}),e(z,{invalid:t,name:"server.storage_ftp_passive",className:"mb-30",children:e(n,{message:"Passive"})}),e(z,{invalid:t,name:"server.storage_ftp_ssl",children:e(n,{message:"SSL"})})]})}function Mc({isInvalid:t}){return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-30",name:"server.mailgun_domain",label:e(n,{message:"Mailgun domain"}),description:e(n,{message:"Usually the domain of your site (site.com)"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.mailgun_secret",label:e(n,{message:"Mailgun API key"}),description:e(n,{message:"Should start with `key-`"}),required:!0}),e(g,{invalid:t,name:"server.mailgun_endpoint",label:e(n,{message:"Mailgun endpoint"}),description:e(n,{message:"Can be left empty, if your mailgun account is in the US region."}),placeholder:"api.eu.mailgun.net"})]})}function Rc({isInvalid:t}){return c(R,{children:[e(g,{invalid:t,className:"mb-30",name:"server.mail_host",label:e(n,{message:"SMTP host"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.mail_username",label:e(n,{message:"SMTP username"}),required:!0}),e(g,{invalid:t,className:"mb-30",type:"password",name:"server.mail_password",label:e(n,{message:"SMTP password"}),required:!0}),e(g,{invalid:t,className:"mb-30",type:"number",name:"server.mail_port",label:e(n,{message:"SMTP port"})}),e(g,{invalid:t,className:"mb-30",type:"password",name:"server.mail_encryption",label:e(n,{message:"SMTP encryption"})})]})}function Vc({isInvalid:t}){return c(u.exports.Fragment,{children:[e(g,{invalid:t,className:"mb-30",name:"server.ses_key",label:e(n,{message:"SES key"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.ses_secret",label:e(n,{message:"SES secret"}),required:!0}),e(g,{invalid:t,name:"server.ses_region",label:e(n,{message:"SES region"}),placeholder:"us-east-1",required:!0})]})}function Bc({isInvalid:t}){return e(g,{invalid:t,name:"server.postmark_token",label:e(n,{message:"Postmark token"}),required:!0})}const as=_e([e("path",{fill:"#4caf50",d:"M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"},"0"),e("path",{fill:"#1e88e5",d:"M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"},"1"),e("polygon",{fill:"#e53935",points:"35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"},"2"),e("path",{fill:"#c62828",d:"M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8h0C4.924,8,3,9.924,3,12.298z"},"3"),e("path",{fill:"#fbc02d",d:"M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8h0 C43.076,8,45,9.924,45,12.298z"},"4")],"Gmail","0 0 48 48");function Uc(){const{watch:t,setValue:a}=P(),{connectSocial:s}=yr(),r=t("server.connectedGmailAccount"),i=t("client.mail.handler")==="gmailApi",l=async()=>{const m=await s("secure/settings/mail/gmail/connect");if((m==null?void 0:m.status)==="SUCCESS"){const p=m.callbackData.profile.email;a("server.connectedGmailAccount",p),U(h("Connected gmail account: :email",{values:{email:p}}))}},o=e(x,{variant:"outline",color:"primary",startIcon:e(as,{}),onClick:()=>{l()},children:e(n,{message:"Connect gmail account"})}),d=c("div",{className:"px-14 py-6 rounded bg-alt border flex items-center gap-14 text-sm",children:[e(as,{size:"lg"}),r,e(x,{variant:"text",color:"primary",className:"ml-auto",onClick:()=>{l()},children:e(n,{message:"Reconnect"})})]});return c(u.exports.Fragment,{children:[i&&e(g,{name:"client.gmail.incoming.topicName",minLength:10,required:!0,label:e(n,{message:"Gmail topic name"}),description:e(n,{message:"Google cloud Pub/Sub topic name."}),className:"mb-30"}),e("div",{className:"text-sm mb-12",children:e(n,{message:"Gmail account"})}),r?d:o]})}function qc(){const{watch:t,clearErrors:a}=P(),s=[t("server.mail_driver"),t("client.mail.handler")],r=[];return s.includes("mailgun")&&r.push(Mc),s.includes("smtp")&&r.push(Rc),s.includes("ses")&&r.push(Vc),s.includes("postmark")&&r.push(Bc),s.includes("gmailApi")&&r.push(Uc),e(de,{separatorTop:!1,separatorBottom:!1,name:"mail_group",children:i=>c(u.exports.Fragment,{children:[c(X,{onSelectionChange:()=>{a()},invalid:i,selectionMode:"single",name:"server.mail_driver",label:e(n,{message:"Outgoing mail method"}),description:c("div",{children:[e(n,{message:"Which method should be used for sending outgoing application emails (like registration confirmation)"}),e(_t,{className:"mt-8",link:"https://support.vebto.com/help-center/articles/42/44/155/incoming-emails"})]}),children:[e(b,{value:"mailgun",children:"Mailgun"}),e(b,{value:"gmailApi",children:"Gmail Api"}),e(b,{value:"smtp",children:"SMTP"}),e(b,{value:"postmark",children:"Postmark"}),e(b,{value:"ses",children:"Ses (Amazon Simple Email Service)"}),e(b,{value:"sendmail",children:"SendMail"}),e(b,{value:"log",children:"Log (Email will be saved to error log)"})]}),r.length&&e("div",{className:"mt-30",children:r.map((l,o)=>e(l,{isInvalid:i},o))})]})})}function Oc(){const{clearErrors:t}=P(),{settings:a}=u.exports.useContext(Oe);return a!=null&&a.showIncomingMailMethod?c(X,{onSelectionChange:()=>{t()},className:"my-30",selectionMode:"single",name:"client.mail_handler",label:e(n,{message:"Incoming mail method"}),description:c("div",{children:[e(n,{message:"Which method should be used to handle incoming application emails."}),e(_t,{className:"mt-8",link:"https://support.vebto.com/help-center/articles/76/configuring-email-provider"})]}),children:[e(b,{value:"mailgun",children:"Mailgun"}),e(b,{value:"gmailApi",children:"Gmail Api"}),e(b,{value:"null",children:"Rest API (Send emails via http API)"}),e(b,{value:"pipe",children:"Pipe (Pipe emails directly)"})]}):null}function Hc(){return c(ge,{title:e(n,{message:"Mail settings"}),description:e(n,{message:"Change incoming and outgoing email handlers, email credentials and other related settings."}),children:[e(g,{id:"outgoing-emails",className:"mb-30",type:"email",name:"server.mail_from_address",label:e(n,{message:"From address"}),description:e(n,{message:"All outgoing application emails will be sent from this email address."}),required:!0}),e(Wc,{}),e(g,{className:"mb-30",name:"server.mail_from_name",label:e(n,{message:"From name"}),description:e(n,{message:"All outgoing application emails will be sent using this name."}),required:!0}),e(Ye,{color:"warning",description:e(n,{message:"Your selected mail method must be authorized to send emails using this address and name."})}),e(Ve,{}),e(Oc,{}),e(qc,{})]})}function Wc(){const{base_url:t}=Ce(),a=`${t}/contact`;return e(g,{className:"mb-30",type:"email",name:"client.mail.contact_page_address",label:e(n,{message:"Contact page address"}),description:e(n,{values:{contactPageUrl:e(Ot,{href:a,children:a})},message:"Where emails from :contactPageUrl page should be sent to."})})}function Gc(){return A.post("cache/flush").then(t=>t.data)}function jc(){return B(()=>Gc(),{onSuccess:()=>{U(h("Cache cleared"))},onError:t=>ce(t)})}function Kc(){const t=jc();return c(ge,{title:e(n,{message:"Cache settings"}),description:e(n,{message:"Select cache provider and manually clear cache."}),children:[e(Qc,{}),e(x,{type:"button",variant:"outline",size:"xs",color:"primary",disabled:t.isLoading,onClick:()=>{t.mutate()},children:e(n,{message:"Clear cache"})}),e(Ye,{color:"warning",className:"mt-30",description:e(n,{message:'"File" is the best option for most cases and should not be changed, unless you are familiar with another cache method and have it set up on the server already.'})})]})}function Qc(){const{watch:t,clearErrors:a}=P(),s=t("server.cache_driver");let r=null;return s==="memcached"&&(r=Jc),e(de,{separatorTop:!1,name:"cache_group",children:i=>c(R,{children:[c(X,{invalid:i,onSelectionChange:()=>{a()},selectionMode:"single",name:"server.cache_driver",label:e(n,{message:"Cache method"}),description:e(n,{message:"Which method should be used for storing and retrieving cached items."}),children:[e(b,{value:"file",children:e(n,{message:"File (Default)"})}),e(b,{value:"array",children:e(n,{message:"None"})}),e(b,{value:"apc",children:"APC"}),e(b,{value:"memcached",children:"Memcached"}),e(b,{value:"redis",children:"Redis"})]}),r&&e("div",{className:"mt-30",children:e(r,{isInvalid:i})})]})})}function Jc({isInvalid:t}){return c(R,{children:[e(g,{invalid:t,className:"mb-30",name:"server.memcached_host",label:e(n,{message:"Memcached host"}),required:!0}),e(g,{invalid:t,type:"number",name:"server.memcached_port",label:e(n,{message:"Memcached port"}),required:!0})]})}function Zc(){return c(ge,{title:e(n,{message:"Error logging"}),description:e(n,{message:"Configure site error logging and related 3rd party integrations."}),children:[e(Xc,{}),e(Ye,{className:"mt-30",color:"positive",description:e(n,{values:{a:t=>e(Ot,{href:"https://sentry.io",children:t})},message:"Sentry integration provides real-time error tracking and helps identify and fix issues when site is in production."})})]})}function Xc(){const{clearErrors:t}=P();return e(de,{separatorTop:!1,separatorBottom:!1,name:"logging_group",children:a=>e(g,{onChange:()=>{t()},invalid:a,name:"server.sentry_dsn",type:"url",minLength:30,required:!0,label:e(n,{message:"Sentry DSN"})})})}function Yc(){return c(ge,{title:e(n,{message:"Queue"}),description:e(n,{message:"Select active queue method and enter related 3rd party API keys."}),children:[e(Ye,{color:"positive",className:"mb-30",description:e(n,{message:"Queues allow to defer time consuming tasks, such as sending an email, until a later time. Deferring these tasks can speed up web requests to the application."})}),e(Ye,{color:"warning",className:"mb-30",description:e(n,{message:"All methods except sync require additional setup, which should be performed before changing the queue method. Consult documentation for more information."})}),e(ed,{})]})}function ed(){const{watch:t,clearErrors:a}=P(),s=t("server.queue_driver");let r=null;return s==="sqs"&&(r=td),e(de,{separatorTop:!1,separatorBottom:!1,name:"queue_group",children:i=>c(R,{children:[c(X,{invalid:i,onSelectionChange:()=>{a()},selectionMode:"single",name:"server.queue_driver",label:e(n,{message:"Queue method"}),required:!0,children:[e(b,{value:"sync",children:e(n,{message:"Sync (Default)"})}),e(b,{value:"beanstalkd",children:"Beanstalkd"}),e(b,{value:"database",children:e(n,{message:"Database"})}),e(b,{value:"sqs",children:e(n,{message:"SQS (Amazon simple queue service)"})}),e(b,{value:"redis",children:"Redis"})]}),r&&e("div",{className:"mt-30",children:e(r,{isInvalid:i})})]})})}function td({isInvalid:t}){return c(R,{children:[e(g,{invalid:t,className:"mb-30",name:"server.sqs_queue_key",label:e(n,{message:"SQS queue key"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.sqs_queue_secret",label:e(n,{message:"SQS queue secret"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.sqs_queue_prefix",label:e(n,{message:"SQS queue prefix"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.sqs_queue_name",label:e(n,{message:"SQS queue name"}),required:!0}),e(g,{invalid:t,className:"mb-30",name:"server.sqs_queue_region",label:e(n,{message:"SQS queue region"}),required:!0})]})}function ad(){const{settings:t}=u.exports.useContext(Oe);return c(ge,{title:e(n,{message:"Recaptcha"}),description:e(n,{message:"Configure google recaptcha integration and credentials."}),children:[(t==null?void 0:t.showRecaptchaLinkSwitch)&&e(z,{className:"mb-30",name:"client.recaptcha.enable.link_creation",description:e(n,{message:"Enable recaptcha integration when creating links from homepage or user dashboard."}),children:e(n,{message:"Link creation"})}),e(z,{className:"mb-30",name:"client.recaptcha.enable.contact",description:e(n,{message:'Enable recaptcha integration for "contact us" page.'}),children:e(n,{message:"Contact page"})}),e(z,{className:"mb-30",name:"client.recaptcha.enable.register",description:e(n,{message:"Enable recaptcha integration for registration page."}),children:e(n,{message:"Registration page"})}),e(sd,{})]})}function sd(){const{clearErrors:t}=P();return e(de,{separatorTop:!1,separatorBottom:!1,name:"recaptcha_group",children:a=>c(R,{children:[e(g,{className:"mb-30",onChange:()=>{t()},invalid:a,name:"client.recaptcha.site_key",label:e(n,{message:"Recaptcha v3 site key"})}),e(g,{onChange:()=>{t()},invalid:a,name:"client.recaptcha.secret_key",label:e(n,{message:"Recaptcha v3 secret key"})})]})})}const nd=D.forwardRef((t,a)=>{const s=os(a),{fieldProps:r,inputProps:i}=xr({...t,focusRef:s}),l=Bt(t);return e(ds,{ref:a,fieldClassNames:l,...r,children:e("input",{type:"file",ref:s,...i,className:F(l.input,"py-8","file:bg-primary file:text-on-primary file:border-none file:rounded file:text-sm file:font-semibold file:px-10 file:h-24 file:mr-10")})})});function rd({name:t,...a}){const{field:{onChange:s,onBlur:r,ref:i},fieldState:{invalid:l,error:o}}=et({name:t}),[d,m]=D.useState(""),p={onChange:f=>{var v;s((v=f.target.files)==null?void 0:v[0]),m(f.target.value)},onBlur:r,value:d,invalid:l,errorMessage:o==null?void 0:o.message};return e(nd,{ref:i,...qe(p,a)})}function id(){return e(ge,{title:e(n,{message:"Recaptcha"}),description:e(n,{message:"Configure google recaptcha integration and credentials."}),children:e(ld,{})})}function ld(){const{clearErrors:t}=P();return e(de,{separatorTop:!1,separatorBottom:!1,name:"analytics_group",children:a=>c(u.exports.Fragment,{children:[e(rd,{className:"mb-30",onChange:()=>{t()},invalid:a,name:"files.certificate",accept:".json",label:e(n,{message:"Google service account key file (.json)"})}),e(g,{className:"mb-30",onChange:()=>{t()},invalid:a,name:"server.analytics_property_id",type:"number",label:e(n,{message:"Google analytics property ID"})}),e(g,{className:"mb-30",onChange:()=>{t()},invalid:a,name:"client.analytics.tracking_code",placeholder:"G-******",min:"1",max:"20",description:e(n,{message:"Google analytics measurement ID only, not the whole javascript snippet."}),label:e(n,{message:"Google tag manager measurement ID"})}),e(g,{name:"client.analytics.gchart_api_key",label:e(n,{message:"Google maps javascript API key"}),description:e(n,{message:"Only required in order to show world geochart on integrated analytics pages."})})]})})}function od(t){const a=we();return B(s=>cd(s),{onSuccess:(s,r)=>{U(h("User updated")),M.invalidateQueries([K("users")]),bs(r.id),a("/admin/users")},onError:s=>Se(s,t)})}function cd({id:t,...a}){return a.roles&&(a.roles=a.roles.map(s=>s.id)),A.put(`users/${t}`,a).then(s=>s.data)}function dd(){const[t,a]=u.exports.useState(!1),s=u.exports.useRef(),r=u.exports.useCallback(i=>{var l;if(i){const o=new IntersectionObserver(([d])=>a(d.intersectionRatio<1),{threshold:[1]});s.current=o,o.observe(i)}else s.current&&((l=s.current)==null||l.disconnect())},[]);return{isSticky:t,sentinelRef:r}}function Pt({onSubmit:t,form:a,title:s,children:r,isLoading:i=!1}){const{isSticky:l,sentinelRef:o}=dd();return c(pe,{onSubmit:t,onBeforeSubmit:()=>{a.clearErrors()},form:a,children:[e("div",{ref:o}),e("div",{className:F("sticky top-0 my-12 md:my-24 z-10 transition-shadow",l&&"bg-paper shadow"),children:c("div",{className:"container mx-auto flex items-center md:items-start gap-24 py-14 px-24",children:[e("h1",{className:"text-xl md:text-3xl",children:s}),e(x,{className:"ml-auto",variant:"flat",color:"primary",type:"submit",disabled:i,children:e(n,{message:"Save"})})]})}),e("div",{className:"container mx-auto px-24 pb-24",children:e("div",{className:"rounded",children:r})})]})}function zn({onSubmit:t,form:a,title:s,isLoading:r,avatarManager:i,resendEmailButton:l,children:o}){const{require_email_confirmation:d}=Ce(),{data:m}=Ae(["roles","permissions"]);return c(Pt,{onSubmit:t,form:a,title:s,isLoading:r,children:[c("div",{className:"flex items-start gap-40 md:gap-80 mb-40",children:[i,c("div",{className:"flex-auto",children:[o,e(g,{className:"mb-30",name:"first_name",label:e(n,{message:"First name"})}),e(g,{name:"last_name",label:e(n,{message:"Last name"})})]})]}),c("div",{className:"border-t border-b mb-30 pb-30 pt-30",children:[e(z,{className:F(l&&"mb-30"),disabled:!d,name:"email_verified_at",description:e(n,{message:"Whether email address has been confirmed. User will not be able to login until address is confirmed, unless confirmation is disabled from settings page."}),children:e(n,{message:"Email confirmed"})}),l]}),e(xt,{className:"mb-30",name:"available_space",label:e(n,{message:"Allowed storage space"}),description:e(n,{values:{a:p=>e(W,{className:Sa,target:"_blank",to:"/admin/settings/uploading",children:p})},message:"Total storage space all user uploads are allowed to take up. If left empty, this value will be inherited from any roles or subscriptions user has, or from 'Available space' setting in Uploading settings page."})}),e(Gt,{className:"mb-30",name:"roles",label:e(n,{message:"Roles"}),suggestions:m==null?void 0:m.roles,children:p=>e(b,{value:p.id,children:p.name},p.id)}),c("div",{className:"mt-30 pt-30 border-t",children:[e("div",{className:"text-sm mb-10",children:e(n,{message:"Permissions"})}),e(Ta,{name:"permissions"})]})]})}function ud(){var m;const t=H(),{require_email_confirmation:a}=Ce(),{userId:s}=he(),r=od(t),i=wr(),{data:l,isLoading:o}=Sr(s,{with:["subscriptions","roles","permissions"]});if(u.exports.useEffect(()=>{(l==null?void 0:l.user)&&!t.getValues().id&&t.reset({first_name:l.user.first_name,last_name:l.user.last_name,roles:l.user.roles,permissions:l.user.permissions,id:l.user.id,email_verified_at:Boolean(l.user.email_verified_at),available_space:l.user.available_space})},[l==null?void 0:l.user,t]),o)return e(dt,{});const d=e(x,{size:"xs",variant:"outline",color:"primary",disabled:!a||i.isLoading||((m=l==null?void 0:l.user)==null?void 0:m.email_verified_at)!=null,onClick:()=>{i.mutate({email:l.user.email})},children:e(n,{message:"Resend email"})});return e(zn,{onSubmit:p=>{r.mutate(p)},form:t,title:e(n,{values:{email:l==null?void 0:l.user.email},message:"Edit \u201C:email\u201C"}),isLoading:r.isLoading,avatarManager:e(md,{user:l.user,onChange:()=>{bs(s)}}),resendEmailButton:d,children:e(g,{className:"mb-30",name:"password",type:"password",label:e(n,{message:"New password"})})})}function md({user:t,onChange:a}){const s=kr({user:t}),r=Nr({user:t});return e(vs,{value:t.avatar,isLoading:s.isLoading||r.isLoading,onUpload:i=>{s.mutate({file:i},{onSuccess:a})},onRemove:()=>{r.mutate(void 0,{onSuccess:a})}})}function pd(t){const a=we();return B(s=>hd(s),{onSuccess:()=>{U(h("User created")),M.invalidateQueries([K("users")]),a("/admin/users")},onError:s=>Se(s,t)})}function hd(t){return t.roles&&(t.roles=t.roles.map(a=>a.id)),A.post("users",t).then(a=>a.data)}function gd(){const t=H(),a=pd(t),s=e(Cs,{children:e(fd,{})});return c(zn,{onSubmit:r=>{a.mutate(r)},form:t,title:e(n,{message:"Add new user"}),isLoading:a.isLoading,avatarManager:s,children:[e(g,{className:"mb-30",name:"email",type:"email",label:e(n,{message:"Email"})}),e(g,{className:"mb-30",name:"password",type:"password",label:e(n,{message:"Password"})})]})}function fd(){const{uploadFile:t,uploadStatus:a}=xn(),s=yn(),{watch:r,setValue:i}=H(),l=r("avatar"),o=m=>{t(m,{metadata:{disk:ws.public,diskPrefix:"avatars"},restrictions:{maxFileSize:Cr,allowedFileTypes:[na.image]},showToastOnRestrictionFail:!0,onSuccess:({url:p})=>{i("avatar",p)}})},d=()=>{!l||s.mutate({paths:[l],deleteForever:!0})};return e(vs,{value:l,isLoading:a==="inProgress"||s.isLoading,onUpload:o,onRemove:d})}const bd=_e(e("path",{d:"m12.87 15.07-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7 1.62-4.33L19.12 17h-3.24z"}),"TranslateOutlined"),In=t=>{const a=["getLocaleWithLines"];return t!=null&&a.push(t),a};function vd(t){return Be(In(t),()=>yd(t),{staleTime:1/0})}function yd(t){return A.get(`localizations/${t}`).then(a=>a.data)}function xd({id:t,...a}){return A.put(`localizations/${t}`,a).then(s=>s.data)}function En(t){return B(a=>xd(a),{onSuccess:()=>{U(h("Localization updated")),M.invalidateQueries(K("localizations")),M.invalidateQueries(In())},onError:a=>t?Se(a,t):ce(a)})}function wd({localization:t}){const{formId:a,close:s}=Z(),r=H({defaultValues:{id:t.id,name:t.name,language:t.language}}),{data:i}=Ae(["languages"]),l=(i==null?void 0:i.languages)||[],o=En(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Update localization"})}),e(ie,{children:c(pe,{form:r,id:a,onSubmit:d=>{o.mutate(d,{onSuccess:s})},children:[e(g,{name:"name",label:e(n,{message:"Name"}),className:"mb-30",required:!0}),e(ot,{required:!0,name:"language",label:e(n,{message:"Language"}),selectionMode:"single",useOptionLabelAsInputValue:!0,children:l.map(d=>e(b,{value:d.code,children:d.name},d.code))})]})}),c(ye,{children:[e(x,{onClick:s,children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",type:"submit",form:a,disabled:o.isLoading,children:e(n,{message:"Save"})})]})]})}function Sd(t){return A.post("localizations",t).then(a=>a.data)}function kd(t){return B(a=>Sd(a),{onSuccess:()=>{U(h("Localization created")),M.invalidateQueries(K("localizations"))},onError:a=>Se(a,t)})}function Nd(){const{formId:t,close:a}=Z(),s=H({defaultValues:{language:"en"}}),{data:r}=Ae(["languages"]),i=(r==null?void 0:r.languages)||[],l=kd(s);return c(ae,{children:[e(oe,{children:e(n,{message:"Create localization"})}),e(ie,{children:c(pe,{form:s,id:t,onSubmit:o=>{l.mutate(o,{onSuccess:a})},children:[e(g,{autoFocus:!0,name:"name",label:e(n,{message:"Name"}),className:"mb-30",required:!0}),e(ot,{required:!0,name:"language",label:e(n,{message:"Language"}),selectionMode:"single",useOptionLabelAsInputValue:!0,children:i.map(o=>e(b,{value:o.code,children:o.name},o.code))})]})}),c(ye,{children:[e(x,{onClick:a,children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",type:"submit",form:t,disabled:l.isLoading,children:e(n,{message:"Save"})})]})]})}const Cd=""+new URL("around-the-world.df9b11c5.svg",import.meta.url).href,_d=[{key:"name",allowsSorting:!0,sortingKey:"name",header:()=>e(n,{message:"Name"}),body:t=>t.name},{key:"language",allowsSorting:!0,sortingKey:"language",header:()=>e(n,{message:"Language code"}),body:t=>t.language,width:"w-1"},{key:"updatedAt",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at}),width:"w-1"},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-1",body:t=>c("div",{className:"text-muted",children:[e(W,{to:`${t.id}/translate`,children:e(Xe,{label:e(n,{message:"Translate"}),children:e(L,{size:"md",children:e(bd,{})})})}),c(E,{type:"modal",children:[e(Xe,{label:e(n,{message:"Edit"}),children:e(L,{children:e(He,{})})}),e(wd,{localization:t})]})]})}];function $d(){return e(Ge,{endpoint:"localizations",title:e(n,{message:"Localizations"}),columns:_d,actions:e(Pd,{}),selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:Cd,title:e(n,{message:"No localizations have been created yet"}),filteringTitle:e(n,{message:"No matching localizations"})})})}function Pd(){return e(u.exports.Fragment,{children:c(E,{type:"modal",children:[e(st,{children:e(n,{message:"Add new localization"})}),e(Nd,{})]})})}function Fd(){const{formId:t,close:a}=Z(),s=H();return c(ae,{children:[e(oe,{children:e(n,{message:"Add translation"})}),e(ie,{children:c(pe,{form:s,id:t,onSubmit:r=>{a(r)},children:[e(Ye,{className:"mb-30",title:e(n,{message:"Add a new translation, if it does not exist already."}),description:e(n,{message:"This should only need to be done for things like custom menu items."})}),e(g,{inputElementType:"textarea",rows:2,autoFocus:!0,name:"key",label:e(n,{message:"Translation key"}),className:"mb-30",required:!0}),e(g,{inputElementType:"textarea",rows:2,name:"value",label:e(n,{message:"Translation value"}),required:!0})]})}),c(ye,{children:[e(x,{onClick:a,children:e(n,{message:"Cancel"})}),e(x,{variant:"flat",color:"primary",type:"submit",form:t,children:e(n,{message:"Add"})})]})]})}function Ad(){const{localeId:t}=he(),{data:a,isLoading:s}=vd(t),r=a==null?void 0:a.localization;return s||!r?e(dt,{}):e(Td,{localization:r})}function Td({localization:t}){const[a,s]=u.exports.useState(t.lines||{}),r=we(),i=En(),[l,o]=u.exports.useState("");return c("form",{className:"p-14 md:p-24 flex flex-col h-full",onSubmit:d=>{d.preventDefault(),i.mutate({id:t.id,lines:a},{onSuccess:()=>{r("/admin/localizations")}})},children:[e(zd,{localization:t,setLines:s,lines:a,searchQuery:l,setSearchQuery:o,isLoading:i.isLoading}),e(Id,{lines:a,setLines:s,searchQuery:l})]})}function zd({localization:t,searchQuery:a,setSearchQuery:s,isLoading:r,lines:i,setLines:l}){const o=we(),d=Ie(),{trans:m}=V();return c("div",{className:"flex-shrink-0",children:[c(ai,{size:"lg",className:"mb-16",children:[e(qa,{onSelected:()=>{o("/admin/localizations")},children:e(n,{message:"Localizations"})}),e(qa,{children:e(n,{message:":locale translations",values:{locale:t.name}})})]}),c("div",{className:"mb-24 flex items-center gap-32 md:gap-12",children:[e("div",{className:"max-w-440 flex-auto",children:e(ct,{value:a,onChange:p=>s(p.target.value),startAdornment:e($a,{}),placeholder:m({message:"Type to search..."})})}),c(E,{type:"modal",onClose:p=>{if(p){const f={...i};f[p.key]=p.value,l(f)}},children:[!d&&e(x,{className:"ml-auto",variant:"outline",color:"primary",startIcon:e(ve,{}),children:e(n,{message:"Add new"})}),e(Fd,{})]}),e(x,{variant:"flat",color:"primary",type:"submit",disabled:r,children:d?e(n,{message:"Save"}):e(n,{message:"Save translations"})})]})]})}function Id({searchQuery:t,lines:a,setLines:s}){const r=u.exports.useMemo(()=>Object.entries(a).filter(([o,d])=>{const m=t==null?void 0:t.toLowerCase();return!m||(o==null?void 0:o.toLowerCase().includes(m))||(d==null?void 0:d.toLowerCase().includes(m))}),[a,t]),i=u.exports.useRef(null),l=Jr({count:r.length,getScrollElement:()=>i.current,estimateSize:()=>123});return e("div",{className:"flex-auto overflow-y-auto",ref:i,children:e("div",{className:"relative w-full",style:{height:`${l.getTotalSize()}px`},children:l.getVirtualItems().map(o=>{const[d,m]=r[o.index];return e("div",{className:"w-full absolute top-0 left-0",style:{height:`${o.size}px`,transform:`translateY(${o.start}px)`},children:c("div",{className:"rounded border mb-10 md:mr-10",children:[c("div",{className:"flex items-center gap-24 justify-between px-10 py-2 border-b",children:[e("label",{className:"text-xs font-semibold flex-auto",htmlFor:d,children:d}),e(L,{size:"xs",className:"text-muted",onClick:()=>{const p={...a};delete p[d],s(p)},children:e(Ue,{})})]}),e("div",{children:e("textarea",{id:d,name:d,defaultValue:m,className:"w-full bg-inherit block rounded resize-none outline-none focus-visible:ring-2 p-10 text-sm",rows:2,onChange:p=>{const f={...a};f[d]=p.target.value,s(f)}})})]})},d)})})})}function Ed(t){const{close:a}=Z();return e(ae,{size:"fullscreen",children:c(ie,{padding:"p-0",children:[e(L,{size:"lg",color:"paper",className:"absolute top-0 right-0 text-white",onClick:()=>{a()},children:e(Ue,{})}),e("img",{...t})]})})}function Ld(){var a;const t=Ct();return c("div",{className:"container mx-auto p-12 md:p-24",children:[e(Vt,{children:e(n,{message:"Ads"})}),e("h1",{className:"font-light text-2xl md:text-3xl mb-20 md:mb-40",children:e(n,{message:"Predefined Ad slots"})}),t.isLoading?e(qt,{isIndeterminate:!0}):e(Dd,{defaultValues:((a=t.data)==null?void 0:a.client.ads)||{}})]})}function Dd({defaultValues:t}){const{admin:{ads:a}}=u.exports.useContext(Oe),s=H({defaultValues:{client:{ads:t}}}),r=Pn(s);return c(pe,{form:s,onSubmit:i=>{r.mutate(i)},children:[a.map(i=>e(Md,{adConfig:i},i.slot)),e(z,{name:"client.ads.disable",className:"mb-30",description:e(n,{message:"Disable all add related functionality across the site."}),children:e(n,{message:"Disable ads"})}),e(x,{type:"submit",variant:"flat",color:"primary",disabled:r.isLoading,children:e(n,{message:"Save"})})]})}function Md({adConfig:t}){const a=Ie();return c("div",{className:"flex items-center gap-24",children:[e(g,{className:"mb-30 flex-auto",name:`client.${t.slot}`,inputElementType:"textarea",rows:8,label:e(n,{...t.description})}),!a&&c(E,{type:"modal",children:[e("button",{type:"button",className:"outline-none focus-visible:ring cursor-zoom-in rounded overflow-hidden hover:scale-105 transition",children:e("img",{src:t.image,className:"w-auto h-[186px] border",alt:"Ad slot example"})}),e(Ed,{src:t.image})]})]})}function Rd(){const t=rt(s=>{var r;return(r=s.config)==null?void 0:r.sections}),a=u.exports.useMemo(()=>t?Object.entries(t||[]).map(([s,r])=>({...r,key:s})).sort((s,r)=>((s==null?void 0:s.position)||1)-((r==null?void 0:r.position)||1)):[],[t]);return e(u.exports.Fragment,{children:a.map(s=>e(Pe,{to:s.key,elementType:wa,children:e(n,{...s.label})},s.key))})}const Vd=[new ze({type:le.Select,key:"type",label:h("Type"),description:h("Type of the role"),defaultValue:"01",defaultOperator:Ne.ne,options:[{key:"01",label:h("Sitewide"),value:"sitewide"},{key:"02",label:h("Workspace"),value:"workspace"}]}),new ut({description:h("Date role was created")}),new mt({description:h("Date role was last updated")})],Bd=[{key:"name",allowsSorting:!0,header:()=>e(n,{message:"Role"}),body:t=>c("div",{children:[e("div",{children:t.name}),e("div",{className:"text-muted text-xs",children:t.description})]})},{key:"type",allowsSorting:!0,header:()=>e(n,{message:"Type"}),body:t=>t.type,width:"w-1"},{key:"updated_at",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at}),width:"w-1"},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",body:t=>e(W,{to:`${t.id}/edit`,children:e(L,{size:"md",className:"text-muted",children:e(He,{})})})}];function Ud(){return e(Ge,{endpoint:"roles",title:e(n,{message:"Roles"}),columns:Bd,filters:Vd,actions:e(qd,{}),selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:wt,title:e(n,{message:"No roles have been created yet"}),filteringTitle:e(n,{message:"No matching roles"})})})}function qd(){return c(u.exports.Fragment,{children:[e(As,{endpoint:"roles/csv/export"}),e(st,{elementType:W,to:"new",children:e(n,{message:"Add new role"})})]})}const Ln=t=>`roles/${t}`;function Od(t){return A.get(Ln(t)).then(a=>a.data)}function Hd(){const{roleId:t}=he();return Be([Ln(t)],()=>Od(t))}const Dn=t=>`roles/${t}`;function Wd(){const{trans:t}=V(),a=we();return B(s=>Gd(s),{onSuccess:s=>{U(t(h("Role updated"))),M.invalidateQueries([Dn(s.role.id)]),M.invalidateQueries(K("roles")),a("/admin/roles")},onError:s=>ce(s)})}function Gd({id:t,...a}){return A.put(Dn(t),a).then(s=>s.data)}function Mn({isInternal:t=!1}){const{trans:a}=V(),{workspaces:s}=Ce(),{watch:r}=P(),i=r("type");return c(R,{children:[e(g,{label:e(n,{message:"Name"}),name:"name",className:"mb-20",required:!0}),e(g,{label:e(n,{message:"Description"}),name:"description",inputElementType:"textarea",placeholder:a(h("Role description...")),rows:4,className:"mb-20"}),s.integrated&&c(X,{label:e(n,{message:"Type"}),name:"type",selectionMode:"single",className:"mb-20",description:e(n,{message:"Whether this role will be assigned to users globally on the site or only within workspaces."}),children:[e(b,{value:"sitewide",children:e(n,{message:"Sitewide"})}),e(b,{value:"workspace",children:e(n,{message:"Workspace"})})]}),!t&&c(R,{children:[e(z,{name:"default",className:"mb-20",description:e(n,{message:"Assign this role to new users automatically."}),children:e(n,{message:"Default"})}),i==="sitewide"&&e(z,{name:"guests",description:e(n,{message:"Assign this role to guests (not logged in users)."}),children:e(n,{message:"Guests"})})]}),e("h2",{className:"mb-10 mt-30 text-lg",children:e(n,{message:"Permissions"})}),e(Ta,{name:"permissions",valueListKey:i==="sitewide"?"permissions":"workspacePermissions"})]})}function jd({onUserSelected:t}){var p;const{close:a}=Z(),[s,r]=u.exports.useState(""),{trans:i}=V(),l=Zr(Pa,{query:s,perPage:14}),o=((p=l.data)==null?void 0:p.results)||[],d=e(fa,{className:"pt-20",size:"sm",title:e(n,{message:"No matching users"}),description:e(n,{message:"Try another search query"}),image:e(ba,{src:wt})}),m=f=>{a(),t(f)};return c(ae,{children:[e(oe,{children:e(n,{message:"Select a user"})}),c(ie,{children:[e(ct,{autoFocus:!0,className:"mb-20",startAdornment:e($a,{}),placeholder:i(h("Search for user by name or email")),value:s,onChange:f=>{r(f.target.value)}}),!l.isLoading&&!o.length&&d,e("div",{className:"grid grid-cols-2 gap-x-10",children:o.map(f=>e(Kd,{user:f,onUserSelected:m},f.id))})]})]})}function Kd({user:t,onUserSelected:a}){return c("div",{className:"flex items-center gap-10 outline-none focus-visible:ring ring-offset-4 hover:bg-hover p-10 rounded",role:"button",tabIndex:0,onClick:()=>{a(t)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),a(t))},children:[e(ys,{src:t.image}),c("div",{className:"overflow-hidden",children:[e("div",{className:"text-ellipsis overflow-hidden",children:t.name}),e("div",{className:"text-muted text-ellipsis overflow-hidden",children:t.description})]})]},t.id)}function Qd(t){return B(({userIds:a})=>Jd({userIds:a,roleId:t.id}),{onSuccess:(a,s)=>{U(h("Removed [one 1 user|other {count} users] from \u201C{role}\u201C",{values:{count:s.userIds.length,role:t.name}}))},onError:a=>ce(a)})}function Jd({roleId:t,userIds:a}){return A.post(`roles/${t}/remove-users`,{userIds:a}).then(s=>s.data)}function Zd(t){return B(({userIds:a})=>Xd({userIds:a,roleId:t.id}),{onSuccess:(a,s)=>{U(h("Assigned [one 1 user|other {count} users] to {role}",{values:{count:s.userIds.length,role:t.name}}))},onError:a=>ce(a)})}function Xd({roleId:t,userIds:a}){return A.post(`roles/${t}/add-users`,{userIds:a}).then(s=>s.data)}const Rn={key:"name",allowsSorting:!0,sortingKey:"email",header:()=>e(n,{message:"User"}),body:t=>e(pt,{image:t.avatar,label:t.display_name,description:t.email}),width:"col-w-3"},Yd=[Rn,{key:"first_name",allowsSorting:!0,header:()=>e(n,{message:"First name"}),body:t=>t.first_name},{key:"last_name",allowsSorting:!0,header:()=>e(n,{message:"Last name"}),body:t=>t.last_name},{key:"created_at",allowsSorting:!0,header:()=>e(n,{message:"Assigned at"}),body:t=>e(me,{date:t.created_at})}],eu=[Rn];function tu({role:t}){const a=Ie();return t.guests||t.type==="workspace"?e("div",{className:"pt-30 pb-10",children:e(Fe,{image:wt,title:e(n,{message:"Users can't be assigned to this role"})})}):e(Fs,{endpoint:"users",columns:a?eu:Yd,queryParams:{roleId:`${t.id}`},actions:e(au,{role:t}),selectedActions:e(su,{role:t}),emptyStateMessage:e(Fe,{image:wt,title:e(n,{message:"No users have been assigned to this role yet"}),filteringTitle:e(n,{message:"No matching users"})})})}function au({role:t}){const a=Zd(t);return c(E,{type:"modal",children:[e(x,{variant:"flat",color:"primary",disabled:a.isLoading,children:e(n,{message:"Assign user"})}),e(jd,{onUserSelected:s=>{a.mutate({userIds:[s.id]},{onSuccess:()=>{M.invalidateQueries(K("users",{roleId:`${t.id}`}))}})}})]})}function su({role:t}){const a=Qd(t),{selectedRows:s}=ht();return c(E,{type:"modal",onClose:r=>{r&&a.mutate({userIds:s},{onSuccess:()=>{M.invalidateQueries(K("users",{roleId:`${t.id}`}))}})},children:[e(x,{variant:"flat",color:"danger",disabled:a.isLoading,children:e(n,{message:"Remove users"})}),e(Ee,{title:e(n,{message:"Remove [one 1 user|other :count users] from \u201C:name\u201C role?",values:{count:s.length,name:t.name}}),body:e(n,{message:"This will permanently remove the users."}),confirm:e(n,{message:"Remove"}),isDanger:!0})]})}function nu(){const t=Hd();return t.status!=="success"?e(dt,{}):e(ru,{role:t.data.role})}function ru({role:t}){const a=H({defaultValues:t}),s=Wd();return e(Pt,{form:a,onSubmit:r=>{s.mutate(r)},title:e(n,{message:"Edit \u201C:name\u201C role",values:{name:t.name}}),isLoading:s.isLoading,children:c(Fn,{isLazy:!0,children:[c(An,{children:[e(Lt,{children:e(n,{message:"Settings"})}),e(Lt,{children:e(n,{message:"Users"})})]}),c(Tn,{className:"pt-20",children:[e(Dt,{children:e(Mn,{isInternal:t.internal})}),e(Dt,{children:e(tu,{role:t})})]})]})})}const iu="roles";function lu(t){const{trans:a}=V();return B(s=>ou(s),{onSuccess:()=>{U(a(h("Created new role"))),M.invalidateQueries(K("roles"))},onError:s=>Se(s,t)})}function ou({id:t,...a}){return A.post(iu,a).then(s=>s.data)}function cu(){const t=H({defaultValues:{type:"sitewide"}}),a=lu(t),s=we();return e(Pt,{form:t,onSubmit:r=>{a.mutate(r,{onSuccess:i=>{s(`/admin/roles/${i.role.id}/edit`)}})},title:e(n,{message:"Add new role"}),isLoading:a.isLoading,children:e(Mn,{})})}const du=t=>[new ze({type:le.Select,key:"type",label:h("Type"),description:h("Type of the tag"),defaultValue:t[0].name,defaultOperator:Ne.ne,options:t.map(a=>({key:a.name,label:h(a.name),value:a.name}))}),new ut({description:h("Date role was created")}),new mt({description:h("Date role was last updated")})],Vn=""+new URL("software-engineer.ba026106.svg",import.meta.url).href;function Bn({form:t,onSubmit:a,formId:s}){const{tags:{types:r}}=u.exports.useContext(Oe),i=t.watch("type"),l=!!r.find(o=>o.name===i&&o.system);return c(pe,{id:s,form:t,onSubmit:a,children:[e(g,{name:"name",label:e(n,{message:"Name"}),description:e(n,{message:"Unique tag identifier."}),className:"mb-20",required:!0,autoFocus:!0}),e(g,{name:"display_name",label:e(n,{message:"Display name"}),description:e(n,{message:"User friendly tag name."}),className:"mb-20"}),e(X,{name:"type",selectionMode:"single",disabled:l,children:r.filter(o=>!o.system).map(o=>e(b,{value:o.name,children:e(n,{message:o.name})},o.name))})]})}function uu(t){const{trans:a}=V();return B(s=>mu(s),{onSuccess:()=>{U(a(h("Tag created"))),M.invalidateQueries(K("tags"))},onError:s=>Se(s,t)})}function mu(t){return A.post("tags",t).then(a=>a.data)}function pu(){const{close:t,formId:a}=Z(),{tags:{types:s}}=u.exports.useContext(Oe),r=H({defaultValues:{type:s[0].name}}),i=uu(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Add new tag"})}),e(ie,{children:e(Bn,{formId:a,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{t()}})}})}),c(ye,{children:[e(x,{onClick:()=>{t()},children:e(n,{message:"Cancel"})}),e(x,{form:a,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}function hu(t){const{trans:a}=V();return B(s=>gu(s),{onSuccess:()=>{U(a(h("Tag updated"))),M.invalidateQueries(K("tags"))},onError:s=>Se(s,t)})}function gu({id:t,...a}){return A.put(`tags/${t}`,a).then(s=>s.data)}function fu({tag:t}){const{close:a,formId:s}=Z(),r=H({defaultValues:{id:t.id,name:t.name,display_name:t.display_name,type:t.type}}),i=hu(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Update \u201C:name\u201C tag",values:{name:t.name}})}),e(ie,{children:e(Bn,{formId:s,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{a()}})}})}),c(ye,{children:[e(x,{onClick:()=>{a()},children:e(n,{message:"Cancel"})}),e(x,{form:s,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const bu=[{key:"name",allowsSorting:!0,header:()=>e(n,{message:"Name"}),body:t=>t.name,width:"col-w-2"},{key:"type",allowsSorting:!0,header:()=>e(n,{message:"Type"}),body:t=>t.type},{key:"display_name",allowsSorting:!0,header:()=>e(n,{message:"Display name"}),body:t=>t.display_name,width:"col-w-2"},{key:"updated_at",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",body:t=>c(E,{type:"modal",children:[e(L,{size:"md",className:"text-muted",children:e(He,{})}),e(fu,{tag:t})]})}];function vu(){const{tags:t}=u.exports.useContext(Oe),a=u.exports.useMemo(()=>du(t.types),[t.types]);return e(Ge,{endpoint:"tags",title:e(n,{message:"Tags"}),columns:bu,filters:a,actions:e(yu,{}),selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:Vn,title:e(n,{message:"No tags have been created yet"}),filteringTitle:e(n,{message:"No matching tags"})})})}function yu(){return e(R,{children:c(E,{type:"modal",children:[e(st,{children:e(n,{message:"Add new tag"})}),e(pu,{})]})})}const xu=u.exports.memo(({bytes:t})=>e(u.exports.Fragment,{children:fs(t)})),wu=_e(e("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}),"VisibilityOutlined"),Su=""+new URL("upload.cabfc914.svg",import.meta.url).href,ku=[{key:"name",allowsSorting:!0,header:()=>e(n,{message:"Name"}),body:t=>c("div",{children:[e("div",{children:t.name}),e("div",{className:"text-muted text-xs",children:t.file_name})]})},{key:"owner_id",allowsSorting:!0,header:()=>e(n,{message:"Uploader"}),body:t=>{var s;const a=(s=t.users)==null?void 0:s[0];return a?e(pt,{image:a.avatar,label:a.display_name,description:a.email}):null}},{key:"type",allowsSorting:!0,header:()=>e(n,{message:"Type"}),body:t=>c("div",{className:"flex items-center gap-12",children:[e(_r,{type:t.type,className:"w-24 h-24 overflow-hidden"}),e("div",{className:"capitalize",children:t.type})]})},{key:"public",allowsSorting:!0,width:"w-1",header:()=>e(n,{message:"Public"}),body:t=>t.public?e(is,{className:"icon-md text-positive"}):e(Ue,{className:"icon-md text-danger"})},{key:"file_size",allowsSorting:!0,width:"w-1",header:()=>e(n,{message:"File size"}),body:t=>e(xu,{bytes:t.file_size})},{key:"updated_at",allowsSorting:!0,width:"w-1",header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),width:"w-1",hideHeader:!0,align:"end",body:t=>c(E,{type:"modal",children:[e(L,{size:"md",className:"text-muted",children:e(wu,{})}),e(Yr,{entries:[t]})]})}];function Nu(){return e(Ge,{endpoint:"file-entries",title:e(n,{message:"Uploaded files and folders"}),columns:ku,filters:Xr,selectedActions:e(at,{}),emptyStateMessage:e(Fe,{image:Su,title:e(n,{message:"Nothing has been uploaded yet"}),filteringTitle:e(n,{message:"No matching files or folders"})})})}const Cu=[new ze({type:le.Select,key:"ends_at",label:h("Status"),description:h("Whether subscription is active or cancelled"),defaultValue:"active",options:[{key:"active",label:h("Active"),value:{value:null,operator:Ne.eq}},{key:"cancelled",label:h("Cancelled"),value:{value:null,operator:Ne.ne}}]}),new ze({type:le.Select,key:"gateway_name",label:h("Gateway"),description:h("With which payment provider was subscription created"),defaultValue:"stripe",options:[{key:"stripe",label:h("Stripe"),value:"stripe"},{key:"paypal",label:h("PayPal"),value:"paypal"},{key:"none",label:h("None"),value:"none"}]}),new ei({key:"renews_at",label:h("Renew date"),description:h("Date subscription will renew")}),new ut({description:h("Date subscription was created")}),new mt({description:h("Date subscription was last updated")})],_u=""+new URL("subscriptions.7eacea42.svg",import.meta.url).href;function $u(t){const{trans:a}=V();return B(s=>Pu(s),{onSuccess:()=>{U(a(h("Subscription updated"))),M.invalidateQueries(K("billing/subscriptions"))},onError:s=>Se(s,t)})}function Pu({id:t,...a}){return A.put(`billing/subscriptions/${t}`,a).then(s=>s.data)}function Un({form:t,onSubmit:a,formId:s}){var o,d;const r=$r(),i=t.watch("product_id"),l=(o=r.data)==null?void 0:o.products.find(m=>m.id===i);return c(pe,{id:s,form:t,onSubmit:a,children:[e(ti,{name:"user_id",className:"mb-20",modelType:Pa,label:e(n,{message:"User"}),openMenuOnFocus:!0}),e(X,{name:"product_id",selectionMode:"single",className:"mb-20",label:e(n,{message:"Plan"}),children:(d=r.data)==null?void 0:d.products.filter(m=>!m.free).map(m=>e(b,{value:m.id,children:e(n,{message:m.name})},m.id))}),!(l!=null&&l.free)&&e(X,{name:"price_id",selectionMode:"single",className:"mb-20",label:e(n,{message:"Price"}),children:l==null?void 0:l.prices.map(m=>e(b,{value:m.id,children:e(Na,{price:m})},m.id))}),e(g,{inputElementType:"textarea",rows:3,name:"description",label:e(n,{message:"Description"}),className:"mb-20"}),e(Ua,{className:"mb-20",name:"renews_at",granularity:"day",label:e(n,{message:"Renews at"}),description:e(n,{message:"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."})}),e(Ua,{className:"mb-20",name:"ends_at",granularity:"day",label:e(n,{message:"Ends at"}),description:e(n,{message:"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."})})]})}function Fu({subscription:t}){const{close:a,formId:s}=Z(),r=H({defaultValues:{id:t.id,product_id:t.product_id,price_id:t.price_id,description:t.description,renews_at:t.renews_at,ends_at:t.ends_at,user_id:t.user_id}}),i=$u(r);return c(ae,{size:"md",children:[e(oe,{children:e(n,{message:"Update subscription"})}),e(ie,{children:e(Un,{formId:s,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{a()}})}})}),c(ye,{children:[e(x,{onClick:()=>{a()},children:e(n,{message:"Cancel"})}),e(x,{form:s,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const qn="billing/subscriptions";function Au(t){const{trans:a}=V();return B(s=>Tu(s),{onSuccess:()=>{U(a(h("Subscription created"))),M.invalidateQueries(K(qn))},onError:s=>Se(s,t)})}function Tu(t){return A.post(qn,t).then(a=>a.data)}function zu(){const{close:t,formId:a}=Z(),s=H({}),r=Au(s);return c(ae,{children:[e(oe,{children:e(n,{message:"Add new subscription"})}),e(ie,{children:e(Un,{formId:a,form:s,onSubmit:i=>{r.mutate(i,{onSuccess:()=>{t()}})}})}),c(ye,{children:[e(x,{onClick:()=>{t()},children:e(n,{message:"Cancel"})}),e(x,{form:a,disabled:r.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const Iu=_e(e("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"PauseOutlined"),Eu=_e(e("path",{d:"M10 8.64 15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z"}),"PlayArrowOutlined"),jt="billing/subscriptions",Lu=[{key:"usr_id",allowsSorting:!0,header:()=>e(n,{message:"Customer"}),body:t=>e(pt,{image:t.user.avatar,label:t.user.display_name,description:t.user.email})},{key:"status",header:()=>e(n,{message:"Status"}),width:"w-1",body:t=>t.valid?e(sa,{size:"xs",color:"positive",radius:"rounded",className:"w-max",children:e(n,{message:"Active"})}):e(sa,{size:"xs",radius:"rounded",className:"w-max",children:e(n,{message:"Cancelled"})})},{key:"product_id",allowsSorting:!0,header:()=>e(n,{message:"Plan"}),body:t=>{var a;return(a=t.product)==null?void 0:a.name},width:"w-1"},{key:"gateway",allowsSorting:!0,header:()=>e(n,{message:"Gateway"}),body:t=>e("span",{className:"capitalize",children:t.gateway_name})},{key:"renews_at",allowsSorting:!0,header:()=>e(n,{message:"Renews at"}),body:t=>e(me,{date:t.renews_at}),width:"w-1"},{key:"ends_at",allowsSorting:!0,header:()=>e(n,{message:"Ends at"}),body:t=>e(me,{date:t.ends_at}),width:"w-1"},{key:"created_at",allowsSorting:!0,header:()=>e(n,{message:"Created at"}),body:t=>e(me,{date:t.created_at}),width:"w-1"},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",body:t=>e(Ru,{subscription:t}),width:"w-1"}];function Du(){return e(Ge,{endpoint:jt,title:e(n,{message:"Subscriptions"}),columns:Lu,filters:Cu,actions:e(Mu,{}),enableSelection:!1,selectedActions:e(at,{}),queryParams:{with:"product"},emptyStateMessage:e(Fe,{image:_u,title:e(n,{message:"No subscriptions have been created yet"}),filteringTitle:e(n,{message:"No matching subscriptions"})})})}function Mu(){return e(R,{children:c(E,{type:"modal",children:[e(st,{children:e(n,{message:"Add new subscription"})}),e(zu,{})]})})}function Ru({subscription:t}){return c(u.exports.Fragment,{children:[c(E,{type:"modal",children:[e(L,{size:"md",className:"text-muted",children:e(He,{})}),e(Fu,{subscription:t})]}),t.cancelled?e(Bu,{subscription:t}):e(Vu,{subscription:t}),e(Uu,{subscription:t})]})}function Vu({subscription:t}){const a=_s(),s=()=>{a.mutate({subscriptionId:t.id},{onSuccess:()=>{M.invalidateQueries(K(jt))}})};return c(E,{type:"modal",onClose:r=>{r&&s()},children:[e(Xe,{label:e(n,{message:"Cancel subscription"}),children:e(L,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(Iu,{})})}),e(Ee,{title:e(n,{message:"Cancel subscription"}),body:c("div",{children:[e(n,{message:"Are you sure you want to cancel this subscription?"}),e("div",{className:"font-semibold text-sm mt-10",children:e(n,{message:"This will put user on grace period until their next scheduled renewal date. Subscription can be renewed until that date by user or from admin area."})})]}),confirm:e(n,{message:"Confirm"})})]})}function Bu({subscription:t}){const a=si(),s=()=>{a.mutate({subscriptionId:t.id},{onSuccess:()=>{M.invalidateQueries(K(jt))}})};return c(E,{type:"modal",onClose:r=>{r&&s()},children:[e(Xe,{label:e(n,{message:"Renew subscription"}),children:e(L,{size:"md",className:"text-muted",onClick:s,disabled:a.isLoading,children:e(Eu,{})})}),e(Ee,{title:e(n,{message:"Resume subscription"}),body:c("div",{children:[e(n,{message:"Are you sure you want to resume this subscription?"}),e("div",{className:"font-semibold text-sm mt-10",children:e(n,{message:"This will put user on their original plan and billing cycle."})})]}),confirm:e(n,{message:"Confirm"})})]})}function Uu({subscription:t}){const a=_s(),s=()=>{a.mutate({subscriptionId:t.id,delete:!0},{onSuccess:()=>{M.invalidateQueries(K(jt))}})};return c(E,{type:"modal",onClose:r=>{r&&s()},children:[e(Xe,{label:e(n,{message:"Delete subscription"}),children:e(L,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(Ue,{})})}),e(Ee,{title:e(n,{message:"Delete subscription"}),body:c("div",{children:[e(n,{message:"Are you sure you want to delete this subscription?"}),e("div",{className:"font-semibold text-sm mt-10",children:e(n,{message:"This will permanently delete the subscription and immediately cancel it on billing gateway. Subscription will not be renewable anymore."})})]}),confirm:e(n,{message:"Confirm"})})]})}const qu=_e(e("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"SyncOutlined");function Ou(){const{trans:t}=V();return B(()=>Hu(),{onSuccess:()=>{U(t(h("Plans synced")))},onError:a=>ce(a,h("Could not sync plans"))})}function Hu(){return A.post("billing/products/sync").then(t=>t.data)}const Wu=t=>`billing/products/${t}`;function Gu(){const{trans:t}=V();return B(a=>ju(a),{onSuccess:()=>{U(t(h("Plan deleted"))),M.invalidateQueries(K("billing/products"))},onError:a=>ce(a)})}function ju({productId:t}){return A.delete(Wu(t)).then(a=>a.data)}const Ku=[new ze({type:le.Select,key:"subscriptions",label:h("Subscriptions"),description:h("Whether plan has any active subscriptions"),defaultValue:"01",options:[{key:"01",label:h("Has active subscriptions"),value:{value:"*",operator:Ne.has}},{key:"02",label:h("Does not have active subscriptions"),value:{value:"*",operator:Ne.doesntHave}}]}),new ut({description:h("Date plan was created")}),new mt({description:h("Date plan was last updated")})],Qu=[{key:"name",allowsSorting:!0,header:()=>e(n,{message:"Name"}),body:t=>{const a=t.prices[0];return e(pt,{label:t.name,description:t.free?e(n,{message:"Free"}):e(Na,{price:a})})}},{key:"created_at",allowsSorting:!0,header:()=>e(n,{message:"Created"}),body:t=>e(me,{date:t.created_at}),align:"end"},{key:"updated_at",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(me,{date:t.updated_at}),width:"w-1"},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-1",body:t=>c(u.exports.Fragment,{children:[e(L,{size:"md",className:"text-muted",elementType:W,to:`/admin/plans/${t.id}/edit`,children:e(He,{})}),e(Zu,{product:t})]})}];function Ju(){const t=we();return e(Ge,{endpoint:"billing/products",title:e(n,{message:"Subscription plans"}),columns:Qu,actions:e(Xu,{}),enableSelection:!1,filters:Ku,onRowAction:a=>{t(`/admin/plans/${a.id}/edit`)},emptyStateMessage:e(Fe,{image:Vn,title:e(n,{message:"No plans have been created yet"}),filteringTitle:e(n,{message:"No matching plans"})})})}function Zu({product:t}){const a=Gu();return c(E,{type:"modal",onClose:s=>{s&&a.mutate({productId:t.id})},children:[e(Xe,{label:e(n,{message:"Delete plan"}),children:e(L,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(Ht,{})})}),e(Ee,{title:e(n,{message:"Delete plan"}),body:e(n,{message:"Are you sure you want to delete this plan?"}),confirm:e(n,{message:"Delete"})})]})}function Xu(){const t=Ou();return c(u.exports.Fragment,{children:[e(Xe,{label:e(n,{message:"Sync plans with Stripe & PayPal"}),children:e(L,{color:"primary",variant:"outline",radius:"rounded",size:"sm",disabled:t.isLoading,onClick:()=>{t.mutate()},children:e(qu,{})})}),e(st,{elementType:W,to:"/admin/plans/new",children:e(n,{message:"Add new plan"})})]})}const On=t=>`billing/products/${t}`;function Yu(){const{productId:t}=he();return Be([On(t)],()=>em(t))}function em(t){return A.get(On(t)).then(a=>a.data)}const ma=[{key:"day1",label:h("Daily"),interval:"day",interval_count:1},{key:"week1",label:h("Weekly"),interval:"week",interval_count:1},{key:"month1",label:h("Monthly"),interval:"month",interval_count:1},{key:"month3",label:h("Every 3 months"),interval:"month",interval_count:3},{key:"month6",label:h("Every 6 months"),interval:"month",interval_count:6},{key:"year1",label:h("Yearly"),interval:"year",interval_count:1},{key:"custom",label:h("Custom"),interval:null,interval_count:null}];function tm({index:t,onRemovePrice:a}){const s=Ae(["currencies"]),r=u.exports.useMemo(()=>{var y;return(y=s.data)!=null&&y.currencies?Object.values(s.data.currencies):[]},[s.data]),{watch:i,getValues:l}=P(),o=!i("id"),d=i(`prices.${t}.id`)==null,m=i(`prices.${t}.subscriptions_count`)||0,[p,f]=u.exports.useState(()=>{const y=l(`prices.${t}.interval`),w=l(`prices.${t}.interval_count`),C=ma.find(N=>N.key===`${y}${w}`);return C?C.key:"custom"}),v=o||d||!m;return c(u.exports.Fragment,{children:[!v&&e("p",{className:"text-muted text-sm max-w-500 mb-20",children:e(n,{message:"This price can't modified or deleted, because it has [one 1 subscriber|other :count subscribers]. You can instead add a new price.",values:{count:m}})}),e(g,{required:!0,disabled:!v,label:e(n,{message:"Amount"}),type:"number",min:1,step:.01,name:`prices.${t}.amount`,className:"mb-20"}),e(ot,{required:!0,disabled:!v,label:e(n,{message:"Currency"}),name:`prices.${t}.currency`,items:r,selectionMode:"single",className:"mb-20",children:y=>e(b,{value:y.code,children:`${y.code}: ${y.name}`},y.code)}),e(am,{disabled:!v,index:t,value:p,onValueChange:f}),p==="custom"&&e(sm,{disabled:!v,index:t}),e("div",{className:"text-right",children:e(x,{size:"xs",variant:"outline",color:"danger",disabled:!v,onClick:()=>{a()},children:e(n,{message:"Delete price"})})})]})}function am({index:t,value:a,onValueChange:s,disabled:r}){const{setValue:i}=P();return e(Mt,{label:e(n,{message:"Billing period"}),disabled:r,className:"mb-20",selectionMode:"single",selectedValue:a,onSelectionChange:l=>{if(s(l),l!=="custom"){const o=ma.find(d=>d.key===l);o&&(i(`prices.${t}.interval`,o.interval),i(`prices.${t}.interval_count`,o.interval_count))}},children:ma.map(l=>e(b,{value:l.key,children:e(n,{...l.label})},l.key))})}function sm({index:t,disabled:a}){const{watch:s}=P(),r=s(`prices.${t}.interval`);let i;return r==="day"?i=365:r==="week"?i=52:i=12,c("div",{className:"flex border rounded w-min",children:[e("div",{className:"px-18 flex items-center text-sm",children:e(n,{message:"Every"})}),e(g,{inputShadow:"shadow-none",inputBorder:"border-none",className:"border-l border-r w-80",name:`prices.${t}.interval_count`,type:"number",min:1,max:i,disabled:a,required:!0}),c(X,{inputShadow:"shadow-none",inputBorder:"border-none",name:`prices.${t}.interval`,selectionMode:"single",disabled:a,children:[e(b,{value:"day",children:e(n,{message:"Days"})}),e(b,{value:"week",children:e(n,{message:"Weeks"})}),e(b,{value:"month",children:e(n,{message:"Months"})})]})]})}function Hn(){return c(u.exports.Fragment,{children:[e(g,{name:"name",label:e(n,{message:"Name"}),className:"mb-20",required:!0,autoFocus:!0}),e(g,{name:"description",label:e(n,{message:"Description"}),className:"mb-20",inputElementType:"textarea",rows:4}),c(X,{name:"position",selectionMode:"single",label:e(n,{message:"Position in pricing table"}),className:"mb-20",children:[e(b,{value:0,children:e(n,{message:"First"})}),e(b,{value:1,children:e(n,{message:"Second"})}),e(b,{value:2,children:e(n,{message:"Third"})}),e(b,{value:3,children:e(n,{message:"Fourth"})}),e(b,{value:4,children:e(n,{message:"Fifth"})})]}),e(xt,{className:"mb-30",name:"available_space",label:e(n,{message:"Allowed storage space"}),description:e(n,{values:{a:t=>e(W,{className:Sa,target:"_blank",to:"/admin/settings/uploading",children:t})},message:"Total storage space all user uploads are allowed to take up."})}),e(z,{name:"recommended",className:"mb-20",description:e(n,{message:"Plan will be displayed more prominently on pricing page."}),children:e(n,{message:"Recommend"})}),e(z,{name:"hidden",className:"mb-20",description:e(n,{message:"Plan will not be shown on pricing or upgrade pages."}),children:e(n,{message:"Hidden"})}),e(z,{name:"free",className:"mb-20",description:e(n,{message:"Will be assigned to all users, if they are not subscribed already."}),children:e(n,{message:"Free"})}),e(pa,{children:e(n,{message:"Feature list"})}),e(nm,{}),e(rm,{}),e(pa,{children:e(n,{message:"Permissions"})}),e(Ta,{name:"permissions"})]})}function pa({children:t}){return e("h2",{className:"mt-40 mb-20 text-base font-semibold",children:t})}function nm(){const{fields:t,append:a,remove:s}=xe({name:"feature_list"});return c("div",{children:[t.map((r,i)=>c("div",{className:"flex gap-10 mb-10",children:[e(g,{name:`feature_list.${i}.value`,size:"sm",className:"flex-auto"}),e(L,{size:"sm",color:"primary",className:"flex-shrink-0",onClick:()=>{s(i)},children:e(Ue,{})})]},r.id)),e(x,{variant:"text",color:"primary",startIcon:e(ve,{}),size:"xs",onClick:()=>{a({value:""})},children:e(n,{message:"Add another line"})})]})}function rm(){var l;const{watch:t,formState:{errors:a}}=P(),{fields:s,append:r,remove:i}=xe({name:"prices",keyName:"key"});return t("free")?null:c(u.exports.Fragment,{children:[e(pa,{children:e(n,{message:"Pricing"})}),((l=a.prices)==null?void 0:l.message)&&e("div",{className:"text-sm text-danger mb-20",children:a.prices.message}),e(We,{variant:"outline",className:"mb-10",children:s.map((o,d)=>e(be,{label:e(Na,{price:o}),children:e(tm,{index:d,onRemovePrice:()=>{i(d)}})},o.key))}),e(x,{variant:"text",color:"primary",startIcon:e(ve,{}),size:"xs",onClick:()=>{r({currency:"USD",amount:1,interval_count:1,interval:"month"})},children:e(n,{message:"Add another price"})})]})}const Wn=t=>`billing/products/${t}`;function im(t){const{trans:a}=V(),s=we();return B(r=>lm(r),{onSuccess:r=>{U(a(h("Plan updated"))),M.invalidateQueries([Wn(r.product.id)]),M.invalidateQueries(K("billing/products")),s("/admin/plans")},onError:r=>Se(r,t)})}function lm({id:t,...a}){const s={...a,feature_list:a.feature_list.map(r=>r.value)};return A.put(Wn(t),s).then(r=>r.data)}function om(){const t=Yu();return t.status!=="success"?e(dt,{}):e(cm,{product:t.data.product})}function cm({product:t}){const a=H({defaultValues:{...t,feature_list:t.feature_list.map(r=>({value:r}))}}),s=im(a);return e(Pt,{form:a,onSubmit:r=>{s.mutate(r)},title:e(n,{message:"Edit \u201C:name\u201C plan",values:{name:t.name}}),isLoading:s.isLoading,children:e(Hn,{})})}const Gn="billing/products";function dm(t){const{trans:a}=V(),s=we();return B(r=>um(r),{onSuccess:()=>{U(a(h("Plan updated"))),M.invalidateQueries([Gn]),M.invalidateQueries(K("billing/products")),s("/admin/plans")},onError:r=>Se(r,t)})}function um(t){const a={...t,feature_list:t.feature_list.map(s=>s.value)};return A.post(Gn,a).then(s=>s.data)}function mm(){const t=H({defaultValues:{free:!1,recommended:!1}}),a=dm(t);return e(Pt,{form:t,onSubmit:s=>{a.mutate(s)},title:e(n,{message:"Create new plan"}),isLoading:a.isLoading,children:e(Hn,{})})}function pm(){return c(ge,{title:e(n,{message:"GDPR"}),description:e(n,{message:"Configure settings related to EU General Data Protection Regulation."}),children:[e(hm,{}),e(Ve,{}),e(gm,{})]})}function hm(){const{watch:t}=P(),a=t("client.cookie_notice.enable");return c("div",{children:[e(z,{name:"client.cookie_notice.enable",className:"mb-20",description:e(n,{message:"Whether cookie notice should be shown automatically to users from EU until it is accepted."}),children:e(n,{message:"Enable cookie notice"})}),a&&c(u.exports.Fragment,{children:[c("div",{className:"border-b pb-6 mb-20",children:[e("div",{className:"text-sm font-medium border-b pb-10 mb-20",children:e(n,{message:"Information button"})}),e(lt,{hideRoleAndPermissionFields:!0,formPathPrefix:"client.cookie_notice.button"})]}),c(X,{name:"client.cookie_notice.position",selectionMode:"single",label:e(n,{message:"Cookie notice position"}),className:"mb-20",children:[e(b,{value:"top",children:e(n,{message:"Top"})}),e(b,{value:"bottom",children:e(n,{message:"Bottom"})})]})]})]})}function gm(){const{fields:t,append:a,remove:s}=xe({name:"client.registration.policies"});return c(u.exports.Fragment,{children:[e("div",{className:"mb-6 text-sm",children:e(n,{message:"Registration policies"})}),e("div",{className:"text-xs text-muted",children:e(n,{message:"Create policies that will be shown on registration page. User will be required to accept them by toggling a checkbox."})}),e(We,{className:"mt-16",variant:"outline",children:t.map((r,i)=>e(be,{label:r.label,chevronPosition:"left",endAppend:e(L,{radius:"rounded",variant:"text",color:"danger",size:"sm",onClick:()=>{s(i)},children:e(Ue,{})}),children:e(lt,{hideRoleAndPermissionFields:!0,formPathPrefix:`client.register_policies.${i}`})},r.id))}),c(E,{type:"modal",onClose:r=>{r&&a(r)},children:[e(x,{className:"mt-12",variant:"link",color:"primary",startIcon:e(ve,{}),size:"xs",children:e(n,{message:"Add another policy"})}),e(_n,{title:e(n,{message:"Add policy"})})]})]})}const fm=[],bm=D.lazy(()=>Ut(()=>import("./admin-report-page.88a1246b.js"),["./admin-report-page.88a1246b.js","./main.b7d280d4.js","./main.06f69299.css","./TrendingUp.9eeccb61.js","./date-picker.5c1c2eea.js","./Edit.b85e7693.js","./index.6553f71f.js","./use-resume-subscription.493553db.js"],import.meta.url)),vm=[{path:"appearance",element:e(J,{permission:"appearance.update",children:e(Wl,{})}),children:[{index:!0,element:e(Rd,{})},{path:"general",element:e(ho,{})},{path:"seo-settings",element:e(yo,{})},{path:"custom-code",element:e(ko,{})},{path:"themes",element:e(vo,{})},{path:"themes/:themeIndex",element:e(tc,{})},{path:"menus",element:e(Ql,{})},{path:"menus/:menuIndex",element:e(ro,{})},{path:"menus/:menuIndex/items/:menuItemIndex",element:e(uo,{})},...Object.values(Nn.sections).flatMap(t=>t.routes||[])]},{path:"/",element:e(oi,{}),children:[...fm,{path:"/",element:e(D.Suspense,{fallback:e(dt,{}),children:e(bm,{})})},{path:"users",element:e(J,{permission:"users.update",children:e($i,{})})},{path:"users/new",element:e(J,{permission:"users.update",children:e(gd,{})})},{path:"users/:userId/edit",element:e(J,{permission:"users.update",children:e(ud,{})})},{path:"roles",element:e(J,{permission:"roles.update",children:e(Ud,{})})},{path:"roles/new",element:e(J,{permission:"roles.update",children:e(cu,{})})},{path:"roles/:roleId/edit",element:e(J,{permission:"roles.update",children:e(nu,{})})},{path:"subscriptions",element:e(J,{permission:"subscriptions.update",children:e(Du,{})})},{path:"plans",element:e(J,{permission:"plans.update",children:e(Ju,{})})},{path:"plans/new",element:e(J,{permission:"plans.update",children:e(mm,{})})},{path:"plans/:productId/edit",element:e(J,{permission:"plans.update",children:e(om,{})})},{path:"custom-pages",element:e(J,{permission:"custom_pages.update",children:e($o,{})})},{path:"custom-pages/new",element:e(J,{permission:"custom_pages.update",children:e(Ya,{})})},{path:"custom-pages/:pageId/edit",element:e(J,{permission:"custom_pages.update",children:e(Ya,{})})},{path:"tags",element:e(J,{permission:"tags.update",children:e(vu,{})})},{path:"localizations",element:e(J,{permission:"localizations.update",children:e($d,{})})},{path:"localizations/:localeId/translate",element:e(Ad,{})},{path:"files",element:e(J,{permission:"files.update",children:e(Nu,{})})},{path:"ads",element:e(J,{permission:"settings.update",children:e(Ld,{})})},{path:"settings",element:e(J,{permission:"settings.update",children:e(Io,{})}),children:[{index:!0,element:e(ps,{to:"general",replace:!0})},{path:"general",element:e(Oo,{})},{path:"subscriptions",element:e(lc,{})},{path:"localization",element:e(dc,{})},{path:"authentication",element:e(uc,{})},{path:"uploading",element:e(Pc,{})},{path:"mail",element:e(Hc,{})},{path:"cache",element:e(Kc,{})},{path:"analytics",element:e(id,{})},{path:"logging",element:e(Zc,{})},{path:"queue",element:e(Yc,{})},{path:"recaptcha",element:e(ad,{})},{path:"gdpr",element:e(pm,{})},...nc]}]},{path:"*",element:e(Fr,{})}];function ym(){return Pr(vm)}const Nm=Object.freeze(Object.defineProperty({__proto__:null,default:ym},Symbol.toStringTag,{value:"Module"}));export{wo as A,vn as C,Zl as D,xu as F,K as P,Yo as R,qu as S,bd as T,wu as V,dd as a,Oa as b,Iu as c,Eu as d,Jo as e,Nm as f,Yt as i,Qo as t,xn as u}; //# sourceMappingURL=admin-routes.da893e6b.js.map