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 Pe,j as c,c as F,a as e,C as Yn,T as n,O as ba,m as p,b as Oe,d as E,R as W,r as u,e as Ee,f as os,S as qt,I as b,g as M,h as Ne,$ as _t,A as Mt,i as cs,k as ds,K as er,l as St,n as Y,D as ae,o as oe,p as ie,q as Q,F as ue,s as tr,B as y,t as D,v as V,w as ct,x as va,y as Dt,z as Lt,P as us,E as Bt,G as B,H as O,J as q,L as me,M as Le,N as ya,Q as xa,U as fe,V as be,W as g,X as Z,Y as ms,Z as He,_ as ia,a0 as ge,a1 as Ae,a2 as wa,a3 as hs,a4 as Rt,a5 as et,a6 as ar,a7 as ps,a8 as Wa,a9 as $t,aa as gs,ab as Ze,ac as X,ad as Sa,ae as ka,af as K,ag as tt,ah as z,ai as Fe,aj as sr,ak as fs,al as bs,am as nr,an as Ot,ao as vs,ap as G,aq as ys,ar as Ce,as as rr,at as ir,au as lr,av as Na,aw as or,ax as cr,ay as xs,az as Ca,aA as Ht,aB as at,aC as _a,aD as dr,aE as ve,aF as _e,aG as ws,aH as $a,aI as Pa,aJ as We,aK as dt,aL as Ga,aM as Wt,aN as ur,aO as mr,aP as Fa,aQ as Xe,aR as Ss,aS as hr,aT as pr,aU as gr,aV as ks,aW as fr,aX as br,aY as vr,aZ as yr,a_ as xr,a$ as wr,b0 as Sr,b1 as kr,b2 as Nr,b3 as za,b4 as Cr,b5 as ee,b6 as _r}from"./main.fcd554a6.js";import{D as $r,a as Pr,b as Fr,c as zr,F as ne,d as le,e as ut,u as mt,A as Ns,K as Ia,f as Gt,g as Aa,I as Ir,N as Ar,h as Tr,C as Er,S as Lr,B as Mr,i as Dr,T as Rr,j as ke,k as Vr,l as Ur,m as la,n as T,o as qr,p as Br,q as oa,r as jt,s as Or,t as Hr,v as Wr,w as Je,x as Kt,U as Ta,L as Gr,M as jr,y as Kr,z as Qr,E as Jr,G as Zr,H as Xr,J as Yr,O as ei,P as ti}from"./file-entry-index-filters.398da9db.js";import{E as Ge,B as ai,a as ja}from"./Edit.5be662f9.js";import{u as Cs,a as si}from"./use-resume-subscription.c9b7d602.js";function ni({className:t,isCompactMode:a}){const{version:s}=Pe();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(Yn,{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"}),!a&&e("div",{className:"mt-auto gap-14 px-16 text-xs",children:e(n,{message:"Version: :number",values:{number:s}})})]})}function ri(){return c($r,{name:"admin",leftSidenavCanBeCompact:!0,children:[e(Pr,{size:"sm",color:"primary",menuPosition:"admin-navbar"}),e(Fr,{position:"left",size:"sm",children:e(ni,{})}),e(zr,{children:e("div",{className:"bg dark:bg-alt",children:e(ba,{})})})]})}const ii=[{key:"email_verified_at",label:p("Email"),description:p("Email verification status"),defaultOperator:ne.ne,control:{type:le.Select,defaultValue:"01",options:[{key:"01",label:p("is confirmed"),value:{value:null,operator:ne.ne}},{key:"02",label:p("is not confirmed"),value:{value:null,operator:ne.eq}}]}},ut({description:p("Date user registered or was created")}),mt({description:p("Date user was last updated")}),{key:"subscriptions",label:p("Subscription"),description:p("Whether user is subscribed or not"),defaultOperator:ne.eq,control:{type:le.Select,defaultValue:"01",options:[{key:"01",label:p("is subscribed"),value:{value:"*",operator:ne.has}},{key:"02",label:p("is not subscribed"),value:{value:"*",operator:ne.doesntHave}}]}}];function ht({image:t,label:a,description:s,labelClassName:r,avatarSize:i="md"}){return c("div",{className:"flex items-center gap-12",children:[t&&e(Ns,{size:i,className:"flex-shrink-0",src:t}),c("div",{className:"overflow-hidden min-w-0",children:[e("div",{className:F(r,"overflow-hidden overflow-ellipsis"),children:a}),s&&e("div",{className:"text-muted text-xs overflow-hidden overflow-ellipsis",children:s})]})]})}const te=(t,a)=>{const s=t.split("/");return a&&s.push(a),s};function li(t,a,s){return Oe(te(t,a),()=>oi(t,a),{...s,keepPreviousData:!0})}function oi(t,a){return E.get(t,{params:a}).then(s=>s.data)}const _s=W.createContext(null);function Ea(){return u.exports.useContext(_s)}function ci(t){return"next_cursor"in t?t.next_cursor!=null:"last_page"in t?t.current_page0&&t.data.length>=t.per_page}const di=15,ui=[{key:10},{key:15},{key:20},{key:50},{key:100}];function mi({query:t,onPerPageChange:a,onPageChange:s,className:r}){var h;const i=Ee(),l=os(),o=(h=t.data)==null?void 0:h.pagination;if(!o)return null;const d=e(qt,{minWidth:"min-w-auto",selectionMode:"single",disabled:t.isLoading,labelPosition:"side",size:"xs",label:e(n,{message:"Items per page"}),selectedValue:o.per_page||di,onSelectionChange:m=>{a==null||a(m)},children:ui.map(m=>e(b,{value:m.key,children:m.key},m.key))});return c("div",{className:F("flex items-center justify-end gap-20 px-20 h-54 select-none",r),children:[!i&&d,o.from&&o.to&&"total"in o&&e("div",{className:"text-sm",children:e(n,{message:":from - :to of :total",values:{from:o.from,to:o.to,total:l.format(o.total)}})}),c("div",{className:"text-muted",children:[e(M,{disabled:t.isFetching||o.current_page<2,onClick:()=>{s==null||s((o==null?void 0:o.current_page)-1)},children:e(Ia,{})}),e(M,{disabled:t.isFetching||!ci(o),onClick:()=>{s==null||s((o==null?void 0:o.current_page)+1)},children:e(Gt,{})})]})]})}const hi=Ne(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"),je=W.forwardRef(({variant:t="default",mode:a="single",children:s,className:r,isLazy:i,...l},o)=>{const[d,h]=_t(l.expandedValues,l.defaultExpandedValues||[],l.onExpandedChange);return e("div",{className:F(t==="outline"&&"space-y-10",r),ref:o,role:"presentation",children:e(Mt,{children:e(cs,{children:W.Children.map(s,(m,f)=>u.exports.isValidElement(m)?u.exports.cloneElement(m,{key:m.key||f,value:m.props.value||f,mode:a,variant:t,expandedValues:d,setExpandedValues:h,isLazy:i}):null)})})})});function Se({children:t,label:a,disabled:s,bodyClassName:r,labelClassName:i,startIcon:l,description:o,endAppend:d,chevronPosition:h="right",dataTestId:m,...f}){const{expandedValues:v,setExpandedValues:N,variant:C,value:P,mode:S,isLazy:$}=f,k=u.exports.useRef(null),w=!s&&v.includes(P),I=u.exports.useRef(!1);w&&(I.current=!0);const A=ds(),L=u.exports.useId(),J=`${L}-button`,U=`${L}-panel`,ce=xe=>{switch(xe.key){case"ArrowDown":A.focusNext();break;case"ArrowUp":A.focusPrevious();break;case"Home":A.focusFirst();break;case"End":A.focusLast();break}},j={open:{height:"auto",visibility:"visible",transitionEnd:{overflow:"auto"}},closed:{height:0,overflow:"hidden",transitionEnd:{visibility:"hidden"}}},de=()=>{const xe=v.indexOf(P);if(xe>-1){const $e=[...v];$e.splice(xe,1),N($e)}else N(S==="single"?[P]:[...v,P])},se=e("div",{className:F(C==="minimal"&&""),children:e(er,{"aria-hidden":"true",size:"md",className:F(s?"text-disabled":"text-muted",w&&"rotate-180 transition-transform")})});return c("div",{className:F(C==="default"&&"border-b",C==="outline"&&"border rounded",s&&"text-disabled"),children:[c("h3",{className:F("flex items-center text-sm justify-between w-full",s&&"pointer-events-none",w&&C!=="minimal"?"border-b":"border-b border-b-transparent",C==="outline"?w?"rounded-t":"rounded":void 0),children:[c("button",{"data-testid":m,disabled:s,"aria-expanded":w,id:J,"aria-controls":U,type:"button",ref:k,onKeyDown:ce,onClick:()=>{s||de()},className:"flex items-center text-left gap-10 flex-auto py-10 outline-none pl-14 pr-10 hover:bg-hover focus-visible:bg-primary/focus",children:[h==="left"&&se,l&&u.exports.cloneElement(l,{size:"md",className:F(l.props.className,s?"text-disabled":"text-muted")}),c("div",{className:"flex-auto overflow-hidden overflow-ellipsis",children:[e("div",{className:i,"data-testid":"accordion-label",children:a}),o&&e("div",{className:"text-muted text-xs",children:o})]}),h==="right"&&se]}),d&&e("div",{className:"flex-shrink-0 text-sm text-muted px-4",children:d})]}),e(St.div,{"aria-labelledby":L,role:"region",variants:j,transition:{type:"tween",duration:.2},initial:!1,animate:w?"open":"closed",children:e("div",{className:F("p-16",r),children:!$||I?t:null})})]})}function pi({filter:t}){return null}function gi({filters:t}){const{decodedFilters:a}=Aa(t),{formId:s}=Y(),[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(y,{size:"xs",variant:"outline",className:"mr-auto",onClick:()=>{i([])},children:e(n,{message:"Clear"})}),rightAdornment:e(y,{size:"xs",variant:"flat",color:"primary",className:"ml-auto",type:"submit",form:s,children:e(n,{message:"Apply"})}),children:e(n,{message:"Filter"})}),e(ie,{padding:"p-0",children:e(fi,{filters:t,expandedFilters:r,setExpandedFilters:i})})]})}function fi({filters:t,expandedFilters:a,setExpandedFilters:s}){const{decodedFilters:r,replaceAll:i}=Aa(t),l={};t.forEach(m=>{const f=r.find(v=>v.key===m.key);l[m.key]=(f==null?void 0:f.value)!==void 0?f:{value:m.control.defaultValue,operator:m.defaultOperator}});const o=Q({defaultValues:l}),{formId:d,close:h}=Y();return e(ue,{form:o,id:d,onSubmit:m=>{const f=Object.entries(m).filter(([v,N])=>a.includes(v)&&N!==void 0).map(([v,N])=>({key:v,...N}));i(f),h()},children:e(je,{mode:"multiple",expandedValues:a,onExpandedChange:s,children:t.map(m=>c(Se,{dataTestId:`filter-${m.key}-toggle`,startIcon:e(tr,{checked:a.includes(m.key)}),value:m.key,label:e(n,{...m.label}),bodyClassName:"max-h-288 overflow-y-auto compact-scrollbar",children:[m.description&&e("div",{className:F("text-muted text-xs",m.control.type!==le.BooleanToggle&&"mb-14"),children:e(n,{...m.description})}),e(bi,{filter:m})]},m.key))})})}function bi({filter:t}){switch(t.control.type){case le.Select:return e(Lr,{filter:t});case le.ChipField:return e(Er,{filter:t});case le.DateRangePicker:return e(Tr,{filter:t});case le.SelectModel:return e(Ar,{filter:t});case le.Input:return e(Ir,{filter:t});case le.BooleanToggle:return e(pi,{filter:t});case"custom":const a=t.control.panel;return e(a,{filter:t});default:return null}}function vi({filters:t,icon:a=e(hi,{}),color:s="primary",variant:r="outline",size:i="sm",disabled:l}){const o=Ee();return c(D,{type:"popover",children:[o?e(M,{color:s,size:"sm",variant:r,disabled:l,radius:"rounded",children:a}):e(y,{variant:r,color:s,startIcon:a,disabled:l,size:i,children:e(n,{message:"Filter"})}),e(gi,{filters:t})]})}function yi({actions:t,filters:a,filtersLoading:s,searchPlaceholder:r=p("Type to search..."),searchValue:i="",onSearchChange:l}){const{trans:o}=V();return c($s,{children:[e(ct,{inputTestId:"datatable-search",className:"flex-auto max-w-440 mr-auto",inputWrapperClassName:"mr-24 md:mr-0",placeholder:o(r),startAdornment:e(va,{}),value:i,onChange:d=>{l(d.target.value)}}),a&&e(vi,{filters:a,disabled:s}),t]})}function $s({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 xi({actions:t,selectedItemsCount:a}){return c($s,{"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}})}),t]})}function wi(){return c(St.div,{className:"flex items-center gap-6 h-30",...Dt,children:[e(Lt,{variant:"rect",size:"h-full w-144",radius:"rounded-md"}),e(Lt,{variant:"rect",size:"h-full w-112",radius:"rounded-md"}),e(Lt,{variant:"rect",size:"h-full w-172",radius:"rounded-md"})]},"filter-list-skeleton")}function Ps({filters:t,filtersLoading:a,columns:s,searchPlaceholder:r,queryParams:i,endpoint:l,actions:o,selectedActions:d,emptyStateMessage:h,tableDomProps:m,onRowAction:f,enableSelection:v=!0,selectionStyle:N="checkbox",children:C,cellHeight:P,collapseTableOnMobile:S=!0}){var de;const $=Ee(),{trans:k}=V(),{encodedFilters:w}=Aa(t),[I,A]=u.exports.useState({perPage:15}),[L,J]=u.exports.useState([]),U=li(l,{...I,...i,[Mr]:w},{onSuccess:()=>{J([])}}),ce=!!(I.query||I.filters||w),j=(de=U.data)==null?void 0:de.pagination;return c(_s.Provider,{value:{selectedRows:L,setSelectedRows:J,endpoint:l,params:I,setParams:A,query:U},children:[C,e(Mt,{initial:!1,mode:"wait",children:L.length?e(xi,{selectedItemsCount:L.length,actions:d},"selected"):e(yi,{searchPlaceholder:r,searchValue:I.query,onSearchChange:se=>A({...I,query:se}),actions:o,filters:t,filtersLoading:a},"default")}),t&&e("div",{className:"mb-14",children:e(Mt,{initial:!1,mode:"wait",children:a&&w?e(wi,{}):e(St.div,{...Dt,children:e(Dr,{filters:t})},"filter-list")})}),c("div",{className:F("relative rounded",(!$||!S)&&"border"),children:[U.isLoading&&e(us,{isIndeterminate:!0,className:"absolute top-0 left-0 w-full z-10","aria-label":k({message:"Loading"}),size:"xs"}),e("div",{className:"relative overflow-x-auto md:overflow-hidden",children:e(Rr,{...m,columns:s,data:(j==null?void 0:j.data)||[],sortDescriptor:I,onSortChange:se=>{A({...I,...se})},selectedRows:L,enableSelection:v,selectionStyle:N,onSelectionChange:J,onAction:f,collapseOnMobile:S,cellHeight:P})}),(U.isFetched||U.isPreviousData)&&!(j!=null&&j.data.length)?e("div",{className:"pt-50",children:u.exports.cloneElement(h,{isFiltering:ce})}):void 0,e(mi,{query:U,onPageChange:se=>A({...I,page:se}),onPerPageChange:se=>A({...I,perPage:se})})]})]})}function Ke({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(Bt,{children:t}),e("h1",{className:"text-3xl font-light",id:i,children:t}),a]}),e(Ps,{...r,tableDomProps:{"aria-labelledby":t?i:void 0}})]})}function Si(){const{endpoint:t,selectedRows:a,setSelectedRows:s}=Ea();return B(()=>ki(t,a),{onSuccess:()=>{O(p("Deleted [one 1 record|other :count records]",{values:{count:a.length}})),s([]),q.invalidateQueries(te(t))},onError:r=>me(r,p("Could not delete records"))})}function ki(t,a){return E.delete(`${t}/${a.join(",")}`).then(s=>s.data)}function st(){const t=Si(),{selectedRows:a}=Ea();return c(D,{type:"modal",onClose:s=>{s&&t.mutate()},children:[e(y,{variant:"flat",color:"danger",className:"ml-auto",disabled:t.isLoading,"data-testid":"delete-rows-button",children:e(n,{message:"Delete"})}),e(Le,{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 Te({isFiltering:t,title:a,filteringTitle:s,image:r,className:i}){const l=Ee();return e(ya,{className:i,size:l?"sm":"md",image:e(xa,{src:r}),title:t&&s?s:a,description:t&&s?e(n,{message:"Try another search query or different filters"}):void 0})}const kt=""+new URL("team.de984127.svg",import.meta.url).href,nt=W.forwardRef(({children:t,to:a,elementType:s,onClick:r},i)=>Ee()?e(M,{ref:i,variant:"flat",color:"primary",radius:"rounded",className:"flex-shrink-0",size:"sm",to:a,elementType:s,onClick:r,children:e(ke,{})}):e(y,{ref:i,startIcon:e(ke,{}),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=>me(a)})}function Ci(t,a){return E.post(t,a).then(s=>s.data)}function _i(){const{close:t}=Y();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(fe,{children:e(y,{variant:"flat",color:"primary",onClick:t,children:e(n,{message:"Got it"})})})]})}function Fs({endpoint:t,payload:a}){const[s,r]=u.exports.useState(!1),i=Ni(t);return c(u.exports.Fragment,{children:[e(M,{variant:"outline",color:"primary",radius:"rounded",size:"sm",className:"flex-shrink-0",disabled:i.isLoading,onClick:()=>{i.mutate(a,{onSuccess:l=>{l.downloadPath?Vr(l.downloadPath):r(!0)}})},children:e(Ur,{})}),e(D,{type:"modal",isOpen:s,onOpenChange:r,children:e(_i,{})})]})}function $i(t,a){return B(s=>Pi(a,s),{onSuccess:()=>{O(p("User suspended")),q.invalidateQueries(["users"])},onError:s=>be(s,t)})}function Pi(t,a){return E.post(`users/${t}/ban`,a).then(s=>s.data)}function Fi({user:t}){const{trans:a}=V(),{close:s,formId:r}=Y(),i=Q({defaultValues:{permanent:!0}}),l=i.watch("permanent"),o=$i(i,t.id);return c(ae,{children:[e(oe,{children:e(n,{message:"Suspend \u201C:name\u201C",values:{name:t.display_name}})}),e(ie,{children:c(ue,{id:r,form:i,onSubmit:d=>o.mutate(d,{onSuccess:()=>s()}),children:[e(la,{name:"ban_until",label:e(n,{message:"Suspend until"}),disabled:l}),e(T,{name:"permanent",className:"mt-12",children:e(n,{message:"Permanent"})}),e(g,{className:"mt-24",name:"comment",inputElementType:"textarea",maxLength:250,label:e(n,{message:"Reason"}),placeholder:a(p("Optional"))})]})}),c(fe,{children:[e(y,{onClick:()=>s(),children:e(n,{message:"Cancel"})}),e(y,{form:r,variant:"flat",color:"primary",type:"submit",disabled:o.isLoading,children:e(n,{message:"Suspend"})})]})]})}const zs=Ne(e("path",{d:"m20 17.17-3.37-3.38c.64.22 1.23.48 1.77.76.97.51 1.58 1.52 1.6 2.62zm1.19 4.02-1.41 1.41-2.61-2.6H4v-2.78c0-1.12.61-2.15 1.61-2.66 1.29-.66 2.87-1.22 4.67-1.45L1.39 4.22 2.8 2.81l18.39 18.38zM15.17 18l-3-3H12c-2.37 0-4.29.73-5.48 1.34-.32.16-.52.5-.52.88V18h9.17zM12 6c1.1 0 2 .9 2 2 0 .86-.54 1.59-1.3 1.87l1.48 1.48C15.28 10.64 16 9.4 16 8c0-2.21-1.79-4-4-4-1.4 0-2.64.72-3.35 1.82l1.48 1.48C10.41 6.54 11.14 6 12 6z"}),"PersonOffOutlined");function zi(t){return B(()=>Ii(t),{onSuccess:()=>{O(p("User unsuspended")),q.invalidateQueries(["users"])},onError:a=>me(a)})}function Ii(t){return E.delete(`users/${t}/unban`).then(a=>a.data)}const Ka=[{key:"name",allowsSorting:!0,sortingKey:"email",width:"flex-3 min-w-200",visibleInMode:"all",header:()=>e(n,{message:"User"}),body:t=>e(ht,{image:t.avatar,label:t.display_name,description:t.email})},{key:"subscribed",header:()=>e(n,{message:"Subscribed"}),width:"w-96",body:t=>{var a;return(a=t.subscriptions)!=null&&a.length?e(ms,{className:"icon-md text-positive"}):e(He,{className:"icon-md text-danger"})}},{key:"roles",header:()=>e(n,{message:"Roles"}),body:t=>e(qr,{radius:"rounded",size:"xs",children:t.roles.map(a=>e(ia,{selectable:!0,children:e(Z,{className:F("capitalize"),target:"_blank",to:`/admin/roles/${a.id}/edit`,children:e(n,{message: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,width:"w-96",header:()=>e(n,{message:"Created at"}),body:t=>e("time",{children:e(ge,{date:t.created_at})})},{key:"actions",header:()=>e(n,{message:"Actions"}),width:"w-84 flex-shrink-0",hideHeader:!0,align:"end",visibleInMode:"all",body:t=>c("div",{className:"text-muted",children:[e(Z,{to:`${t.id}/edit`,children:e(Ae,{label:e(n,{message:"Edit user"}),children:e(M,{size:"md",children:e(Ge,{})})})}),t.banned_at?e(Ei,{user:t}):c(D,{type:"modal",children:[e(Ae,{label:e(n,{message:"Suspend user"}),children:e(M,{size:"md",children:e(zs,{})})}),e(Fi,{user:t})]})]})}];function Ai(){const{billing:t}=Pe(),a=t.enable?Ka:Ka.filter(s=>s.key!=="subscribed");return e(u.exports.Fragment,{children:e(Ke,{endpoint:"users",title:e(n,{message:"Users"}),filters:ii,columns:a,actions:e(Ti,{}),queryParams:{with:"subscriptions,bans"},selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:kt,title:e(n,{message:"No users have been created yet"}),filteringTitle:e(n,{message:"No matching users"})})})})}function Ti(){return c(u.exports.Fragment,{children:[e(Fs,{endpoint:"users/csv/export"}),e(nt,{elementType:Z,to:"new",children:e(n,{message:"Add new user"})})]})}function Ei({user:t}){const a=zi(t.id);return c(D,{type:"modal",onClose:s=>{s&&a.mutate()},children:[e(Ae,{label:e(n,{message:"Remove suspension"}),children:e(M,{size:"md",color:"danger",children:e(zs,{})})}),e(Le,{isDanger:!0,title:e(n,{message:"Suspend \u201C:name\u201C",values:{name:t.display_name}}),body:e(n,{message:"Are you sure you want to remove suspension from this user?"}),confirm:e(n,{message:"Unsuspend"})})]})}const Li=t=>(a,s,r)=>{const i=r.subscribe;return r.subscribe=(o,d,h)=>{let m=o;if(d){const f=(h==null?void 0:h.equalityFn)||Object.is;let v=o(r.getState());m=N=>{const C=o(N);if(!f(v,C)){const P=v;d(v=C,P)}},h!=null&&h.fireImmediately&&d(v,v)}return i(m)},t(a,s,r)},Mi=Li;function Di(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 Ri={preview:{defaultRoute:"/",navigationRoutes:[]},sections:{general:{label:p("General"),position:1,buildBreadcrumb:()=>[{label:p("General"),location:"general"}]},themes:{label:p("Themes"),position:2,buildBreadcrumb:(t,a)=>{var l;const s=t.split("/").filter(o=>!!o),[,,,r]=s,i=[{label:p("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:p("Menus"),position:3,buildBreadcrumb:(t,a)=>{const s=t.split("/").filter(o=>!!o),[,,...r]=s,i=[{label:p("Menus"),location:"menus"}],l=Di(r,2);return l.forEach(([o,d],h)=>{var m,f;if(o==="menus"&&d!=null)i.push({label:(m=a.settings.menus[+d])==null?void 0:m.name,location:`menus/${d}`});else if(o==="items"&&d!=null){const[,v]=l[h-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","footer","footer-secondary"]}},"custom-code":{label:p("Custom Code"),position:4,buildBreadcrumb:()=>[{label:p("Custom code"),location:"custom-code"}]},"seo-settings":{label:p("SEO Settings"),position:5,buildBreadcrumb:()=>[{label:p("SEO"),location:"seo"}]}}};function Vi(t){const{size:a="md",inline:s,label:r,showValueLabel:i=!!r,className:l,width:o="w-full",slider:d,children:h,trackColor:m="primary",fillColor:f="primary"}=t,{domProps:v,trackRef:N,getThumbPercent:C,getThumbValueLabel:P,labelId:S,groupId:$,thumbIds:k,isDisabled:w,numberFormatter:I,minValue:A,maxValue:L,step:J,values:U,getValueLabel:ce}=d;let j="",de=Math.max([...I.format(A)].length,[...I.format(L)].length,[...I.format(J)].length);ce?j=ce(U[0]):U.length===1?j=P(0):U.length===2&&(j=`${P(0)} \u2013 ${P(1)}`,de=3+2*Math.max(de,[...I.format(A)].length,[...I.format(L)].length));const se=wa({size:a,disabled:w,labelDisplay:"flex"}),xe=F("touch-none",l,o,{"flex items-center":s});return c("div",{className:xe,role:"group",id:$,children:[(r||i)&&c("div",{className:F(se.label,"select-none"),children:[r&&e("label",{onClick:()=>{var $e;($e=document.getElementById(k[0]))==null||$e.focus()},id:S,htmlFor:$,children:r}),i&&e("output",{htmlFor:k[0],className:"ml-auto text-right","aria-live":"off",style:de?{width:`${de}ch`,minWidth:`${de}ch`}:void 0,children:j})]}),c("div",{ref:N,className:"h-30 relative",...v,role:"presentation",children:[e("div",{className:`absolute inset-0 m-auto h-4 rounded ${Ui(m,w)}`}),e("div",{className:`absolute inset-0 my-auto h-4 rounded ${qi(f,w)}`,style:{width:`${C(0)*100}%`}}),h]})]})}function Ui(t,a){switch(a&&(t="disabled"),t){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return t}}function qi(t,a){switch(a&&(t="disabled"),t){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return t}}function Bi({minValue:t=0,maxValue:a=100,isDisabled:s=!1,step:r=1,formatOptions:i,onChangeEnd:l,onPointerDown:o,label:d,getValueLabel:h,showThumbOnHoverOnly:m,thumbSize:f,...v}){var Ha;const[N,C]=u.exports.useState(!1),P=os(i),{addGlobalListener:S,removeGlobalListener:$}=hs(),k=u.exports.useRef(null),[w,I]=_t(v.value?v.value:void 0,(Ha=v.defaultValue)!=null?Ha:[t],v.onChange),A=u.exports.useRef(null);A.current=w;const[L,J]=u.exports.useState(new Array(w.length).fill(!1)),U=u.exports.useRef(null);U.current=L;function ce(_){return P.format(_)}const j=_=>{var H;return((H=U.current)==null?void 0:H[_])||!1},de=_=>ce(w[_]),se=_=>_===0?t:w[_-1],xe=_=>_===w.length-1?a:w[_+1],$e=(_,H)=>{if(s||!Xt(_)||!A.current)return;const ze=se(_),Ve=xe(_);H=ar(H,ze,Ve,r),A.current=Qa(A.current,_,H),I(A.current)},Me=(_,H)=>{var Ve;if(s||!Xt(_))return;const ze=(Ve=U.current)==null?void 0:Ve[_];U.current=Qa(U.current||[],_,H),J(U.current),l&&ze&&!U.current.some(Boolean)&&l(A.current||[])},[lt,gt]=u.exports.useState(void 0),At=_=>{const H=Math.min(1,(_-t)/(a-t));return isNaN(H)?0:H},ft=_=>At(A.current[_]),Zt=(_,H)=>{$e(_,Ua(H))},pe=_=>Math.round((_-t)/r)*r+t,Ua=_=>{const H=_*(a-t)+t;return Rt(pe(H),t,a)},qa=u.exports.useRef(new Array(w.length).fill(!0)),Xt=_=>qa.current[_],Wn=(_,H)=>{qa.current[_]=H},we=u.exports.useRef(null),Ba=u.exports.useRef(void 0),Gn=_=>{if(!(_.pointerType==="mouse"&&(_.button!==0||_.altKey||_.ctrlKey||_.metaKey))&&(o==null||o(),k.current&&!s&&w.every((H,ze)=>!L[ze]))){const H=k.current.offsetWidth,ze=k.current.getBoundingClientRect().left,ea=(_.clientX-ze)/H,Tt=Ua(ea);let De;const Qe=w.findIndex(ta=>Tt-ta<0);if(Qe===0)De=Qe;else if(Qe===-1)De=w.length-1;else{const ta=w[Qe-1],Xn=w[Qe];Math.abs(ta-Tt)=0&&Xt(De)?(_.preventDefault(),we.current=De,gt(De),Ba.current=_.pointerId,Me(we.current,!0),$e(De,Tt),S(window,"pointerup",Oa,!1)):we.current=null}},bt=u.exports.useRef(null),{domProps:jn}=Br({onPointerDown:Gn,onMoveStart(){bt.current=null},onMove(_,H){var Ve;const ze=((Ve=k.current)==null?void 0:Ve.offsetWidth)||0;if(bt.current==null&&(bt.current=ft(we.current||0)*ze),bt.current+=H,we.current!=null&&k.current){const ea=Rt(bt.current/ze,0,1);Zt(we.current,ea)}},onMoveEnd(){we.current!=null&&(Me(we.current,!1),we.current=null)}}),Kn=et(jn,{onPointerEnter:()=>{C(!0)},onPointerLeave:()=>{C(!1)}}),Oa=_=>{_.pointerId===Ba.current&&(we.current!=null&&(Me(we.current,!1),we.current=null),$(window,"pointerup",Oa,!1))},Yt=u.exports.useId(),Qn=d?`${Yt}-label`:void 0,Jn=`${Yt}-group`,Zn=[...Array(w.length)].map((_,H)=>`${Yt}-thumb-${H}`);return{domProps:Kn,trackRef:k,isDisabled:s,step:r,values:w,minValue:t,maxValue:a,focusedThumb:lt,labelId:Qn,groupId:Jn,thumbIds:Zn,numberFormatter:P,getThumbPercent:ft,getThumbMinValue:se,getThumbMaxValue:xe,getThumbValueLabel:de,isThumbDragging:j,setThumbValue:$e,updateDraggedThumbs:Me,setThumbEditable:Wn,setFocusedThumb:gt,getValueLabel:h,isPointerOver:N,showThumbOnHoverOnly:m,thumbSize:f}}function Qa(t,a,s){return t[a]===s?t:[...t.slice(0,a),s,...t.slice(a+1)]}function Oi({index:t,slider:a,isDisabled:s,ariaLabel:r,inputRef:i,onBlur:l,fillColor:o="primary"}){const d=ps(i),{addGlobalListener:h,removeGlobalListener:m}=hs(),{step:f,values:v,focusedThumb:N,labelId:C,thumbIds:P,isDisabled:S,getThumbPercent:$,getThumbMinValue:k,getThumbMaxValue:w,getThumbValueLabel:I,setThumbValue:A,updateDraggedThumbs:L,isThumbDragging:J,setThumbEditable:U,setFocusedThumb:ce,isPointerOver:j,showThumbOnHoverOnly:de,thumbSize:se="w-18 h-18"}=a,xe=J(t),$e=v[t];U(t,!s);const Me=s||S,lt=u.exports.useCallback(()=>{d.current&&d.current.focus({preventScroll:!0})},[d]),gt=N===t;u.exports.useEffect(()=>{gt&<()},[gt,lt]);const At=u.exports.useRef(void 0),ft=pe=>{pe.pointerId===At.current&&(lt(),L(t,!1),m(window,"pointerup",ft,!1))},Zt=F("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",se,!Me&&"shadow-md",Hi({fillColor:o,isDisabled:Me,isDragging:xe}),de&&xe||j?"visible":"invisible");return e("div",{role:"presentation",className:Zt,style:{left:`${Math.max($(t)*100,0)}%`},onPointerDown:pe=>{pe.button!==0||pe.altKey||pe.ctrlKey||pe.metaKey||(lt(),At.current=pe.pointerId,L(t,!0),h(window,"pointerup",ft,!1))},children:e("input",{id:P[t],onKeyDown:Wa(()=>{L(t,!0)}),onKeyUp:Wa(()=>{L(t,!1)}),ref:d,tabIndex:Me?void 0:0,min:k(t),max:w(t),step:f,value:$e,disabled:Me,"aria-label":r,"aria-labelledby":C,"aria-orientation":"horizontal","aria-valuetext":I(t),onFocus:()=>{ce(t)},onBlur:pe=>{ce(void 0),L(t,!1),l==null||l(pe)},onChange:pe=>{A(t,parseFloat(pe.target.value))},type:"range",className:"sr-only"})})}function Hi({isDisabled:t,isDragging:a,fillColor:s}){return t?"bg-slider-disabled cursor-default":s&&s!=="primary"?s:F("hover:bg-primary-dark",a?"bg-primary-dark":"bg-primary")}function Wi({inputRef:t,onBlur:a,...s}){const{onChange:r,onChangeEnd:i,value:l,defaultValue:o,...d}=s,h={...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])}},m=Bi(h);return e(Vi,{...h,slider:m,children:e(Oi,{fillColor:s.fillColor,index:0,slider:m,inputRef:t,onBlur:a})})}function Gi({name:t,...a}){const{field:{onChange:s,onBlur:r,value:i="",ref:l}}=$t({name:t});return e(Wi,{inputRef:l,...et({onChange:s,onBlur:r,value:i||""},a)})}const Ie=u.exports.forwardRef(({startIcon:t,children:a,className:s,...r},i)=>c(gs,{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(Gt,{className:"icon-sm text-muted ml-auto"})]})),Is=Ne(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 pt(){return(pt=Object.assign||function(t){for(var a=1;a=0||(i[s]=t[s]);return i}function Nt(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 Ct=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=1),t>s?s:t0:$.buttons>0)&&i.current?l(Ja(i.current,$,d.current)):S(!1)},P=function(){return S(!1)};function S($){var k=h.current,w=ca(i.current),I=$?w.addEventListener:w.removeEventListener;I(k?"touchmove":"mousemove",C),I(k?"touchend":"mouseup",P)}return[function($){var k=$.nativeEvent,w=i.current;if(w&&(Za(k),!function(A,L){return L&&!xt(A)}(k,h.current)&&w)){if(xt(k)){h.current=!0;var I=k.changedTouches||[];I.length&&(d.current=I[0].identifier)}w.focus(),l(Ja(w,k,d.current)),S(!0)}},function($){var k=$.which||$.keyCode;k<37||k>40||($.preventDefault(),o({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},S]},[o,l]),f=m[0],v=m[1],N=m[2];return u.exports.useEffect(function(){return N},[N]),e("div",{...pt({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:v,tabIndex:0,role:"slider"})})}),La=function(t){return t.filter(Boolean).join(" ")},Ts=function(t){var a=t.color,s=t.left,r=t.top,i=r===void 0?.5:r,l=La(["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}})})},re=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=Math.pow(10,a)),Math.round(s*t)/s},ji=function(t){return Xi(da(t))},da=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?re(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?re(parseInt(t.substring(6,8),16)/255,2):1}},Ki=function(t){return Zi(Ji(t))},Qi=function(t){var a=t.s,s=t.v,r=t.a,i=(200-a)*s/100;return{h:re(t.h),s:re(i>0&&i<200?a*s/100/(i<=100?i:200-i)*100:0),l:re(i/2),a:re(r,2)}},ua=function(t){var a=Qi(t);return"hsl("+a.h+", "+a.s+"%, "+a.l+"%)"},Ji=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),h=r*(1-(1-a+l)*s),m=l%6;return{r:re(255*[r,d,o,o,h,r][m]),g:re(255*[h,r,r,d,o,o][m]),b:re(255*[o,o,h,r,r,d][m]),a:re(i,2)}},Et=function(t){var a=t.toString(16);return a.length<2?"0"+a:a},Zi=function(t){var a=t.r,s=t.g,r=t.b,i=t.a,l=i<1?Et(re(255*i)):"";return"#"+Et(a)+Et(s)+Et(r)+l},Xi=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:re(60*(d<0?d+6:d)),s:re(l?o/l*100:0),v:re(l/255*100),a:i}},Yi=W.memo(function(t){var a=t.hue,s=t.onChange,r=La(["react-colorful__hue",t.className]);return W.createElement("div",{className:r},W.createElement(As,{onMove:function(i){s({h:360*i.left})},onKey:function(i){s({h:Ct(a+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":re(a),"aria-valuemax":"360","aria-valuemin":"0"},W.createElement(Ts,{className:"react-colorful__hue-pointer",left:a/360,color:ua({h:a,s:100,v:100,a:1})})))}),el=W.memo(function(t){var a=t.hsva,s=t.onChange,r={backgroundColor:ua({h:a.h,s:100,v:100,a:1})};return W.createElement("div",{className:"react-colorful__saturation",style:r},W.createElement(As,{onMove:function(i){s({s:100*i.left,v:100-100*i.top})},onKey:function(i){s({s:Ct(a.s+100*i.left,0,100),v:Ct(a.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+re(a.s)+"%, Brightness "+re(a.v)+"%"},W.createElement(Ts,{className:"react-colorful__saturation-pointer",top:1-a.v/100,left:a.s/100,color:ua(a)})))}),Es=function(t,a){if(t===a)return!0;for(var s in t)if(t[s]!==a[s])return!1;return!0},tl=function(t,a){return t.toLowerCase()===a.toLowerCase()||Es(da(t),da(a))};function al(t,a,s){var r=Nt(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 m=t.toHsva(a);d.current={hsva:m,color:a},o(m)}},[a,t]),u.exports.useEffect(function(){var m;Es(l,d.current.hsva)||t.equal(m=t.fromHsva(l),d.current.color)||(d.current={hsva:l,color:m},r(m))},[l,t,r]);var h=u.exports.useCallback(function(m){o(function(f){return Object.assign({},f,m)})},[]);return[l,h]}var sl=typeof window<"u"?u.exports.useLayoutEffect:u.exports.useEffect,nl=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Xa=new Map,rl=function(t){sl(function(){var a=t.current?t.current.ownerDocument:document;if(a!==void 0&&!Xa.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}`,Xa.set(a,s);var r=nl();r&&s.setAttribute("nonce",r),a.head.appendChild(s)}},[])},il=function(t){var a=t.className,s=t.colorModel,r=t.color,i=r===void 0?s.defaultColor:r,l=t.onChange,o=Qt(t,["className","colorModel","color","onChange"]),d=u.exports.useRef(null);rl(d);var h=al(s,i,l),m=h[0],f=h[1],v=La(["react-colorful",a]);return c("div",{...pt({},o,{ref:d,className:v}),children:[e(el,{hsva:m,onChange:f}),e(Yi,{hue:m.h,onChange:f,className:"react-colorful__last-control"})]})},ll={defaultColor:"000",toHsva:ji,fromHsva:function(t){return Ki({h:t.h,s:t.s,v:t.v,a:1})},equal:tl},ol=function(t){return e(il,{...pt({},t,{colorModel:ll})})},cl=/^#?([0-9A-F]{3,8})$/i,dl=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,h=t.process,m=Qt(t,["color","onChange","onBlur","escape","validate","format","process"]),f=u.exports.useState(function(){return l(s)}),v=f[0],N=f[1],C=Nt(r),P=Nt(i),S=u.exports.useCallback(function(k){var w=l(k.target.value);N(w),o(w)&&C(h?h(w):w)},[l,h,o,C]),$=u.exports.useCallback(function(k){o(k.target.value)||N(l(s)),P(k)},[s,l,o,P]);return u.exports.useEffect(function(){N(l(s))},[s,l]),e("input",{...pt({},m,{value:d?d(v):v,spellCheck:"false",onChange:S,onBlur:$})})},Ya=function(t){return"#"+t},ul=function(t){var a=t.prefixed,s=t.alpha,r=Qt(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,h){var m=cl.exec(d),f=m?m[1].length:0;return f===3||f===6||!!h&&f===4||!!h&&f===8}(o,s)},[s]);return W.createElement(dl,pt({},r,{escape:i,format:a?Ya:void 0,process:Ya,validate:l}))};class ml{getStringForLocale(a,s){let r=this.strings[s];r||(r=hl(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 hl(t,a,s="en-US"){if(a[t])return a[t];let r=pl(t);if(a[r])return a[r];for(let i in a)if(i.startsWith(r+"-"))return a[i];return a[s]}function pl(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}function gl(t){return t&&t.__esModule?t.default:t}var Ls={},Ms={};Ms={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 Ds={};Ds={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 Us={};Us={alpha:"Alpha",blue:"Blau",brightness:"Helligkeit",green:"Gr\xFCn",hue:"Farbton",lightness:"Leuchtkraft",red:"Rot",saturation:"S\xE4ttigung"};var qs={};qs={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 Bs={};Bs={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 hn={};hn={alpha:"Alfa",blue:"Mavi",brightness:"Parlakl\u0131k",green:"Ye\u015Fil",hue:"Ton",lightness:"Canl\u0131l\u0131k",red:"K\u0131rm\u0131z\u0131",saturation:"Doygunluk"};var pn={};pn={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":Ms,"bg-BG":Ds,"cs-CZ":Rs,"da-DK":Vs,"de-DE":Us,"el-GR":qs,"en-US":Bs,"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":hn,"uk-UA":pn,"zh-CN":gn,"zh-TW":fn};const fl=new ml(gl(Ls));function rt(t){let a=Ue.parse(t)||qe.parse(t)||Be.parse(t);if(a)return a;throw new Error("Invalid color value: "+t)}class Ma{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 fl.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 Ue extends Ma{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)=>Ze(l,0,o<3?255:1)));var i;return s.length<3?void 0:new Ue(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 h=0;if(o!==0){switch(l){case a:h=(s-r)/o+(sNumber(h.trim().replace("%","")));return new qe(bn(i,360),Ze(l,0,100),Ze(o,0,100),Ze(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}, ${X(this.saturation,2)}%, ${X(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${X(this.saturation,2)}%, ${X(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 Be(X(this.hue,2),X(a*100,2),X(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 Ue(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),this.alpha)}clone(){return new qe(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 Sa(s,r).format(i)}getColorSpace(){return"hsb"}getColorChannels(){return qe.colorChannels}constructor(a,s,r,i){super(),this.hue=a,this.saturation=s,this.brightness=r,this.alpha=i}}ka(qe,"colorChannels",["hue","saturation","brightness"]);const vl=/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 Be extends Ma{static parse(a){let s;if(s=a.match(vl)){var r;const[i,l,o,d]=((r=s[1])!==null&&r!==void 0?r:s[2]).split(",").map(h=>Number(h.trim().replace("%","")));return new Be(bn(i,360),Ze(l,0,100),Ze(o,0,100),Ze(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}, ${X(this.saturation,2)}%, ${X(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${X(this.saturation,2)}%, ${X(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 qe(X(this.hue,2),X(a*100,2),X(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 Ue(Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255),this.alpha)}clone(){return new Be(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 Sa(s,r).format(i)}getColorSpace(){return"hsl"}getColorChannels(){return Be.colorChannels}constructor(a,s,r,i){super(),this.hue=a,this.saturation=s,this.lightness=r,this.alpha=i}}ka(Be,"colorChannels",["hue","saturation","lightness"]);rt("#ffffff");rt("hsl(0, 100%, 50%)");const yl=rt("#000000"),xl=rt("#FFFFFF");yl.toHexInt();xl.toHexInt();function wl({onChange:t,value:a,colors:s}){const r=s.map(i=>{const l=a===i;return e(gs,{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 Sl=[{color:"rgb(255, 255, 255)",name:p("White")},{color:"rgb(239,245,245)",name:p("Solitude")},{color:"rgb(245,213,174)",name:p("Wheat")},{color:"rgb(253,227,167)",name:p("Cape Honey")},{color:"rgb(242,222,186)",name:p("Milk punch")},{color:"rgb(97,118,75)",name:p("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:p("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:p("Cosmic Latte")},{color:"rgb(233,119,119)",name:p("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:p("Sundown")},{color:"rgb(30,139,195)",name:p("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:p("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:p("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:p("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:p("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:p("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:p("Comet"),foreground:"rgb(255, 255, 255)"}],kl=Sl.map(({color:t})=>t).slice(0,14);function Nl({defaultValue:t,onChange:a,colorPresets:s,showInput:r}){const[i,l]=u.exports.useState(t),o=s||kl,d=wa({size:"sm"});return c("div",{children:[e(ol,{className:"!w-auto",color:i,onChange:h=>{a==null||a(h),l(h)}}),c("div",{className:"py-20 px-12",children:[o&&e(wl,{colors:o,onChange:h=>{if(h){const m=rt(h).toString("hex");a==null||a(m),l(m)}},value:i}),r&&e("div",{className:"pt-20",children:e(ul,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:d.input,color:i,onChange:h=>{a==null||a(h),l(h)}})})]})]})}function vn({defaultValue:t,onChange:a,hideFooter:s=!1,showInput:r=!0}){const{close:i}=Y(),[l,o]=u.exports.useState(t||"");return c(ae,{size:"2xs",children:[e(Nl,{showInput:r,defaultValue:l,onChange:d=>{o(d),a==null||a(d)}}),!s&&c(fe,{dividerTop:!0,children:[e(y,{variant:"text",size:"xs",onClick:()=>{i()},children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",size:"xs",onClick:()=>{i(l)},children:e(n,{message:"Apply"})})]})]})}function Cl(){return c(u.exports.Fragment,{children:[e(_l,{}),c("div",{className:"my-24 py-24 border-y",children:[e(Ie,{to:"action-buttons",elementType:Z,className:"mb-20",children:e(n,{message:"Action buttons"})}),e(Ie,{to:"primary-features",elementType:Z,children:e(n,{message:"Primary features"})}),e(Ie,{to:"secondary-features",elementType:Z,children:e(n,{message:"Secondary features"})})]}),e($l,{})]})}function _l(){const t=it(a=>{var s,r;return(r=(s=a.defaults)==null?void 0:s.settings.homepage.appearance)==null?void 0:r.headerImage});return c(K,{children:[e(g,{label:e(n,{message:"Header title"}),className:"mb-20",name:"settings.homepage.appearance.headerTitle",onFocus:()=>{R().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:()=>{R().preview.setHighlight('[data-testid="headerSubtitle"]')}}),e(tt,{name:"settings.homepage.appearance.headerImage",className:"mb-30",label:e(n,{message:"Header image"}),defaultValue:t,diskPrefix:"homepage"}),e(Gi,{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(es,{formKey:"settings.homepage.appearance.headerOverlayColor1",label:e(n,{message:"Header overlay color 1"})}),e(es,{formKey:"settings.homepage.appearance.headerOverlayColor2",label:e(n,{message:"Header overlay color 2"})})]})}function $l(){const t=it(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:()=>{R().preview.setHighlight('[data-testid="footerTitle"]')}}),e(g,{label:e(n,{message:"Footer subtitle"}),className:"mb-20",name:"settings.homepage.appearance.footerSubtitle",onFocus:()=>{R().preview.setHighlight('[data-testid="footerSubtitle"]')}}),e(tt,{name:"settings.homepage.appearance.footerImage",className:"mb-30",label:e(n,{message:"Footer background image"}),defaultValue:t,diskPrefix:"homepage"})]})}function es({label:t,formKey:a}){const s=a,{watch:r,setValue:i}=z(),l=r(s),o=d=>{i(a,d,{shouldDirty:!0})};return c(D,{type:"popover",onClose:d=>{o(d)},children:[e(Ie,{className:"capitalize",startIcon:e(Is,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:l}}),children:t}),e(vn,{defaultValue:l,onChange:d=>{o(d)}})]})}function yn(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}const Pl=W.forwardRef(({valueListKey:t="permissions",...a},s)=>{const{data:r}=Fe([t]),i=(r==null?void 0:r.permissions)||(r==null?void 0:r.workspacePermissions),[l,o]=_t(a.value,[],a.onChange),[d,h]=u.exports.useState(!1);if(!i)return null;const m=xn(i,l,d),f=v=>{const N=[...l],C=N.findIndex(P=>P.id===v.id);C>-1&&N.splice(C,1,v),o(N)};return c(u.exports.Fragment,{children:[e(je,{variant:"outline",ref:s,children:m.map(({groupName:v,items:N,anyChecked:C})=>e(Se,{label:e(n,{message:Ra(v)}),startIcon:C?e(sr,{size:"sm"}):void 0,children:e(fs,{children:N.map(P=>{const S=l.findIndex(k=>k.id===P.id),$=S>-1;return c("div",{children:[e(bs,{onSelected:()=>{if($){const k=[...l];k.splice(S,1),o(k)}else o([...l,P])},endSection:e(oa,{tabIndex:-1,checked:$,onChange:()=>{}}),description:e(n,{message:P.description}),children:e(n,{message:P.display_name||P.name})}),$&&e(Fl,{permission:P,onChange:f})]},P.id)})})},v))}),e(oa,{className:"mt-30",checked:d,onChange:v=>{h(v.target.checked)},children:e(n,{message:"Show advanced permissions"})})]})});function Fl({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=nr(t,d=>{const h=d.restrictions.find(m=>m.name===i);h&&(h.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,d=e(n,{message:Ra(i.name)}),h=i.description?e(n,{message:i.description}):void 0;return i.type==="bool"?e(oa,{description:h,className:F(!o&&"mb-30"),checked:Boolean(i.value),onChange:m=>{s(i.name,m.target.checked)},children:d},i.name):e(ct,{size:"sm",label:d,description:h,type:"number",className:F(!o&&"mb-30"),value:i.value||"",onChange:m=>{s(i.name,m.target.value===""?void 0:parseInt(m.target.value))}},i.name)})})}function Da(t){const{field:{onChange:a,value:s=[],ref:r}}=$t({name:t.name});return e(Pl,{ref:r,...et({onChange:a,value:s},t)})}const Ra=t=>yn(t.replace("_"," "));function xn(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:zl(i.restrictions,a[l].restrictions)};o.anyChecked=!0,o.items.push(d)}else o.items.push(i)}),r}function zl(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 wn(){const t=kn.sections.menus.config;return t?t.availableRoutes.map(a=>({id:a,label:a,action:a,type:"route",target:"_self"})):[]}const aa={grid:"flex flex-wrap gap-24",button:"flex flex-col items-center rounded hover:bg-hover h-90 aspect-square"},Il=[...Array(60).keys()],Al=W.lazy(()=>Ot(()=>import("./icon-list.5ddc2d93.js"),["./icon-list.5ddc2d93.js","./main.fcd554a6.js","./main.e8a562e5.css","./file-entry-index-filters.398da9db.js","./Edit.5be662f9.js","./ArrowBack.953d9159.js","./Info.5c8dba99.js","./OpenInNew.a526f51f.js","./UnfoldLess.0d39fb88.js","./TaskAlt.cb080f03.js","./TrendingUp.90fad761.js","./UnfoldMore.a50d7b82.js","./use-resume-subscription.c9b7d602.js"],import.meta.url));function Tl({onIconSelected:t}){const{trans:a}=V(),[s,r]=W.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(Mt,{mode:"wait",children:e(u.exports.Suspense,{fallback:e(St.div,{...Dt,className:aa.grid,children:Il.map((i,l)=>e("div",{className:aa.button,children:e(Lt,{variant:"rect"})},l))}),children:e(St.div,{...Dt,className:aa.grid,children:e(Al,{searchQuery:s,onIconSelected:t})})})})]})}function El(){return c(ae,{size:"w-850",className:"min-h-dialog",children:[e(oe,{children:e(n,{message:"Select icon"})}),e(ie,{children:e(Ll,{})})]})}function Ll(){const{close:t}=Y();return e(Tl,{onIconSelected:a=>{t(a)}})}function Ml(t){const a=u.exports.useRef();return u.exports.useEffect(()=>{a.current=t},[t]),a.current}function ot({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(p("No label...")),startAppend:e(Dl,{prefixName:r})}),e(Rl,{prefixName:r}),!a&&c(u.exports.Fragment,{children:[e(Vl,{prefixName:r}),e(Ul,{prefixName:r})]}),e(ql,{prefixName:r})]})}function Dl({prefixName:t,...a}){const{watch:s,setValue:r}=z(),i=t("icon"),l=s(i),o=l&&vs(l);return c(D,{type:"modal",onClose:d=>{(d||d===null)&&r(i,d,{shouldDirty:!0})},children:[e(M,{className:"text-muted icon-sm",variant:"outline",size:"md",...a,children:o?e(o,{}):e(Ge,{})}),e(El,{})]})}function Rl({prefixName:t}){const a=z(),s=a.watch(t("type")),r=Ml(s),{data:i}=Fe(["menuItemCategories"]),l=(i==null?void 0:i.menuItemCategories)||[],o=l.find(m=>m.type===s),{trans:d}=V(),h=wn();return u.exports.useEffect(()=>{r&&r!==s&&a.setValue(t("action"),"")},[s,r,a,t]),c(u.exports.Fragment,{children:[c(G,{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(m=>e(b,{value:m.type,children:m.name},m.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(G,{className:"mb-20",required:!0,items:h,name:t("action"),label:e(n,{message:"Page"}),searchPlaceholder:d(p("Search pages")),showSearchField:!0,selectionMode:"single",children:m=>e(b,{value:m.id,children:m.label},m.id)}),o&&e(G,{className:"mb-20",required:!0,items:o.items,name:t("action"),showSearchField:!0,searchPlaceholder:d(p("Search...")),selectionMode:"single",label:e(n,{message:o.name}),children:m=>e(b,{value:m.action,children:e(n,{message:m.label})})})]})}function Vl({prefixName:t}){const{data:a}=Fe(["roles","permissions"]),s=(a==null?void 0:a.roles)||[],{trans:r}=V();return e(jt,{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:e(n,{message:i.name})},i.id)})}function Ul({prefixName:t}){const{data:a}=Fe(["roles","permissions"]),{trans:s}=V(),r=u.exports.useMemo(()=>xn((a==null?void 0:a.permissions)||[],[],!1),[a==null?void 0:a.permissions]);return console.log(r),e(jt,{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(ys,{label:Ra(i),children:l.map(o=>e(b,{value:o.name,description:e(n,{message:o.description}),children:e(n,{message:o.display_name||o.name})},o.name))},i)})}function ql({prefixName:t}){return z().watch(t("type"))!=="link"?null:c(G,{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 Bl(){const[t,a]=u.exports.useState(["cta1"]);return c(je,{variant:"outline",expandedValues:t,onExpandedChange:s=>{a(s),s.length&&R().preview.setHighlight(`[data-testid="${s[0]}"]`)},children:[e(Se,{value:"cta1",label:e(n,{message:"Header button 1"}),children:e(ot,{formPathPrefix:"settings.homepage.appearance.actions.cta1"})}),e(Se,{value:"ct2",label:e(n,{message:"Header button 2"}),children:e(ot,{formPathPrefix:"settings.homepage.appearance.actions.cta2"})}),e(Se,{value:"cta3",label:e(n,{message:"Footer button"}),children:e(ot,{formPathPrefix:"settings.homepage.appearance.actions.cta3"})})]})}function Ol(){const{fields:t,remove:a,append:s}=Ce({name:"settings.homepage.appearance.primaryFeatures"}),[r,i]=u.exports.useState([0]);return c("div",{children:[e(je,{variant:"outline",expandedValues:r,onExpandedChange:l=>{i(l),l.length&&R().preview.setHighlight(`[data-testid="primary-root-${l[0]}"]`)},children:t.map((l,o)=>c(Se,{value:o,label:e(n,{message:`Primary feature ${o+1}`}),children:[e(Hl,{index:o}),e("div",{className:"text-right",children:e(y,{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(y,{size:"xs",variant:"outline",color:"primary",startIcon:e(ke,{}),onClick:()=>{s({}),i([t.length])},children:e(n,{message:"Add feature"})})})]})}function Hl({index:t}){const a=it(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(K,{children:[e(tt,{name:`settings.homepage.appearance.primaryFeatures.${t}.image`,className:"mb-30",label:e(n,{message:"Image"}),defaultValue:a,diskPrefix:"homepage"}),e(g,{name:`settings.homepage.appearance.primaryFeatures.${t}.title`,label:e(n,{message:"Title"}),className:"mb-20",onFocus:()=>{R().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:()=>{R().preview.setHighlight(`[data-testid="primary-subtitle-${t}"]`)}})]})}function Wl(){const{fields:t,remove:a,append:s}=Ce({name:"settings.homepage.appearance.secondaryFeatures"}),[r,i]=u.exports.useState([0]);return c("div",{children:[e(je,{variant:"outline",expandedValues:r,onExpandedChange:l=>{i(l),l.length&&R().preview.setHighlight(`[data-testid="secondary-root-${l[0]}"]`)},children:t.map((l,o)=>c(Se,{value:o,label:e(n,{message:`Secondary feature ${o+1}`}),children:[e(Gl,{index:o}),e("div",{className:"text-right",children:e(y,{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(y,{size:"xs",variant:"outline",color:"primary",startIcon:e(ke,{}),onClick:()=>{s({}),i([t.length])},children:e(n,{message:"Add feature"})})})]})}function Gl({index:t}){return c(K,{children:[e(tt,{name:`settings.homepage.appearance.secondaryFeatures.${t}.image`,className:"mb-30",label:e(n,{message:"Image"}),defaultValue:jl(t),diskPrefix:"homepage"}),e(g,{name:`settings.homepage.appearance.secondaryFeatures.${t}.title`,label:e(n,{message:"Title"}),className:"mb-20",onFocus:()=>{R().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:()=>{R().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:()=>{R().preview.setHighlight(`[data-testid="secondary-description-${t}"]`)}})]})}function jl(t){var a,s;return(s=((a=R().defaults)==null?void 0:a.settings.homepage.appearance).secondaryFeatures[t])==null?void 0:s.image}const Sn={preview:{defaultRoute:"drive",navigationRoutes:["s","drive"]},sections:{"landing-page":{label:p("Landing Page"),position:1,previewRoute:"/",routes:[{path:"landing-page",element:e(Cl,{})},{path:"landing-page/action-buttons",element:e(Bl,{})},{path:"landing-page/primary-features",element:e(Ol,{})},{path:"landing-page/secondary-features",element:e(Wl,{})}],buildBreadcrumb:(t,a)=>{const r=t.split("/").filter(l=>!!l).pop(),i=[{label:p("Landing page"),location:"landing-page"}];return r==="action-buttons"&&i.push({label:p("Action buttons"),location:"landing-page/action-buttons"}),r==="primary-features"&&i.push({label:p("Primary features"),location:"landing-page/primary-features"}),r==="secondary-features"&&i.push({label:p("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"]}}}},kn=rr.all([Ri,Sn]),it=ir()(Mi(lr((t,a)=>({defaults:null,iframeWindow:null,config:kn,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&&vt(l,{type:"navigate",to:i})},setValues:s=>{const r=a().iframeWindow;vt(r,{type:"setValues",values:s})},setThemeColor:(s,r)=>{const i=a().iframeWindow;vt(i,{type:"setThemeColor",name:s,value:r})},setActiveTheme:s=>{const r=a().iframeWindow;vt(r,{type:"setActiveTheme",themeId:s})},setCustomCode:(s,r)=>{const i=a().iframeWindow;vt(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 vt(t,a){t&&t.postMessage({source:"be-appearance-editor",...a},"*")}function R(){return it.getState()}function Kl(t){return E.post("admin/appearance",{changes:t}).then(a=>a.data)}function Ql(){return B(t=>Kl(t),{onSuccess:()=>{O(p("Changes saved"))},onError:t=>me(t)})}function Jl(){return Oe(["admin/appearance/values"],()=>Zl(),{staleTime:1/0})}function Zl(){return E.get("admin/appearance/values").then(t=>t.data)}function Xl(){const{pathname:t}=Na(),{getValues:a}=z(),[s,r]=u.exports.useState(null);return u.exports.useEffect(()=>{var l;const[,,i]=t.split("/").filter(o=>!!o);if(i){const o=(l=R().config)==null?void 0:l.sections[i];if(o){r([{label:p("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(M,{iconSize:"md",radius:"rounded-none",className:"text-muted h-full w-50 flex-shrink-0",elementType:Z,to:`/admin/appearance/${s[s.length-2].location}`,children:e(Ia,{})}),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,h=e(or,{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:h}),!o&&e(Gt,{className:"icon-sm text-muted flex-shrink-0"})]},l)})})]})]})}function Yl(){const{isAppearanceEditorActive:t}=cr(),{data:a}=Jl(),{base_url:s}=Pe(),r=u.exports.useRef(null),{pathname:i}=Na(),l=Ee();return u.exports.useEffect(()=>{(a==null?void 0:a.defaults)&&!R().defaults&&R().setDefaults(a.defaults)},[a]),u.exports.useEffect(()=>{r.current&&R().setIframeWindow(r.current.contentWindow)},[]),u.exports.useEffect(()=>{const o=i.split("/")[3];R().preview.navigate(o)},[i]),t?e(xs,{to:"/admin"}):c("div",{className:"md:flex items-center h-full",children:[e(Bt,{children:e(n,{message:"Appearance"})}),e(eo,{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 eo({values:t}){const a=e("div",{className:"flex items-center justify-center flex-auto h-full",children:e(Ht,{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(to,{defaultValues:t}):a})})}function to({defaultValues:t}){const a=Q({defaultValues:t}),{watch:s,reset:r}=a,i=Ql();return u.exports.useEffect(()=>{const l=s(o=>{R().preview.setValues(o)});return()=>l.unsubscribe()},[s]),c(ue,{className:"h-full flex flex-col",form:a,onSubmit:l=>{i.mutate(l,{onSuccess:()=>r(l)})},children:[e(ao,{isLoading:i.isLoading}),e(Xl,{}),e("div",{className:"px-14 py-20 flex-auto overflow-y-auto",children:e(Ca,{children:e(ba,{})})})]})}function ao({isLoading:t}){const{formState:{dirtyFields:a}}=z(),s=Object.keys(a).length;return c("div",{className:"border-b flex items-center h-50 pr-10 flex-shrink-0",children:[e(M,{border:"border-r",className:"text-muted",elementType:Z,to:"..",children:e(He,{})}),e("div",{className:"pl-10",children:e(n,{message:"Appearance editor"})}),e(y,{variant:"flat",color:"primary",className:"block ml-auto",disabled:!s||t,type:"submit",children:s?e(n,{message:"Save"}):e(n,{message:"Saved"})})]})}function so(){const t=at(),{trans:a}=V(),{fields:s,append:r}=Ce({name:"settings.menus",keyName:"key"});return c(u.exports.Fragment,{children:[e("div",{children:s.map((i,l)=>e(Ie,{to:`${l}`,elementType:Z,children:i.name},i.key))}),e("div",{className:"text-right",children:e(y,{variant:"outline",color:"primary",startIcon:e(ke,{}),size:"xs",onClick:()=>{const i=_a(10);r({name:a(p("New menu :number",{values:{number:s.length+1}})),id:i,positions:[],items:[]}),t(`${s.length}`)},children:e(n,{message:"Create menu"})})})]})}function Nn({title:t=e(n,{message:"Add menu item"})}){const{data:a}=Fe(["menuItemCategories"]),s=(a==null?void 0:a.menuItemCategories)||[],r=wn();return c(ae,{size:"sm",children:[e(oe,{children:t}),e(ie,{children:c(je,{variant:"outline",children:[e(Se,{label:e(n,{message:"Link"}),bodyClassName:"max-h-240 overflow-y-auto",children:e(no,{})}),e(Se,{label:e(n,{message:"Route"}),bodyClassName:"max-h-240 overflow-y-auto",children:e(ts,{items:r})}),s.map(i=>e(Se,{label:e(n,{message:i.name}),children:e(ts,{items:i.items})},i.name))]})})]})}function no(){const t=Q({defaultValues:{id:_a(6),type:"link",target:"_blank"}}),{close:a}=Y();return c(ue,{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(y,{type:"submit",variant:"flat",color:"primary",size:"xs",children:e(n,{message:"Add to menu"})})})]})}function ts({items:t}){const{close:a}=Y();return e(fs,{children:t.map(s=>e(bs,{startIcon:e(ke,{size:"sm"}),onSelected:()=>{if(s.label){const r=s.label.split("/").pop();s.label=r?yn(r):s.label,s.id=_a(6)}a(s)},children:s.label},s.id))})}const ro=Ne(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"),io=""+new URL("dropdown-menu.c9b3bd6a.svg",import.meta.url).href;function lo(t,a,s){const r=Rt(a,0,t.length-1),i=Rt(s,0,t.length-1);if(r===i)return t;const l=t[r],o=i{x&&x.sortables.length!==a.length&&(x.sortables=[...a],x.activeIndex=a.indexOf(t))},[a,t]);const{draggableProps:N,dragHandleRef:C}=Or({id:t,ref:r,type:s,preview:d,disabled:h,onDragStart:()=>{var S;v.current=null,x={sortables:[...a],activeSortable:t,activeIndex:a.indexOf(t),finalIndex:a.indexOf(t),dropPosition:null,scrollParent:r.current?dr(r.current):void 0,scrollListener:()=>{Wr(Je)}},f==="liveSort"&&mo(),l==null||l(),(S=x.scrollParent)==null||S.addEventListener("scroll",x.scrollListener)},onDragEnd:()=>{var S;!x||(f==="liveSort"&&ho(),x.dropPosition=null,m==null||m(x.dropPosition),x.activeIndex!==x.finalIndex&&(i==null||i(x.activeIndex,x.finalIndex)),(S=x.scrollParent)==null||S.removeEventListener("scroll",x.scrollListener),as(),o==null||o(),x=null)},getData:()=>{}}),{droppableProps:P}=Hr({id:t,ref:r,types:[s],disabled:h,allowDragEventsFromItself:!0,onDragOver:(S,$)=>{var A;if(!x||f!=="line")return;const k=x.dropPosition;let w=null;const I=(A=Je.get(t))==null?void 0:A.rect;if(I){const L=I.top+I.height/2;$.clientY<=L?w="before":$.clientY>=L&&(w="after")}if(w!==k){const L=x.sortables.indexOf(t);if(x.dropPosition=w,m==null||m(x.dropPosition),as(),r.current)if(x.dropPosition==="after")sa(r.current,"bottom");else if(L===0)sa(r.current,"top");else{const ce=x.sortables[L-1],j=Je.get(ce);j!=null&&j.ref.current&&sa(j.ref.current,"bottom")}const J=a.indexOf(t);if(x.activeIndex===J){x.finalIndex=x.activeIndex;return}(L>x.activeIndex?"after":"before")==="after"?x.finalIndex=x.dropPosition==="before"?J-1:J:x.finalIndex=x.dropPosition==="after"?J+1:J}},onDragEnter:()=>{if(!x||f==="line")return;const S=x.sortables.indexOf(t),$=x.sortables.indexOf(x.activeSortable);lo(x.sortables,$,S);const k=x.sortables.map(w=>{var I;return(I=Je.get(w))==null?void 0:I.rect});x.sortables.forEach((w,I)=>{if(!x)return;const A=oo(k,S,x.activeIndex),L=k[I],J=A[I],U=Je.get(w);if((U==null?void 0:U.ref.current)&&J&&L){const ce=J.left-L.left,j=J.top-L.top;U.ref.current.style.transform=`translate3d(${ce}px, ${j}px, 0)`}}),x.finalIndex=S},onDragLeave:()=>{!x||f!=="line"||(x.dropPosition=null,m==null||m(x.dropPosition))}});return{sortableProps:{...et(N,P)},dragHandleRef:C}}const uo="transform 0.2s cubic-bezier(0.2, 0, 0, 1)";function mo(){!x||x.sortables.forEach((t,a)=>{const s=Je.get(t);!(s!=null&&s.ref.current)||(s.ref.current.style.transition=uo,(x==null?void 0:x.activeIndex)===a&&(s.ref.current.style.opacity="0.4"))})}function ho(){!x||x.sortables.forEach(t=>{const a=Je.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 as(){x!=null&&x.linePreviewEl&&(x.linePreviewEl.style.borderBottomColor="",x.linePreviewEl.style.borderTopColor="",x.linePreviewEl=void 0)}function sa(t,a){const s="rgb(var(--be-primary))";a==="top"?t.style.borderTopColor=s:t.style.borderBottomColor=s,x&&(x.linePreviewEl=t)}function po(){const{menuIndex:t}=ve(),a=at(),{getValues:s}=z(),r=`settings.menus.${t}`,i=s(r);return u.exports.useEffect(()=>{i?R().preview.setHighlight(`[data-menu-id="${i.id}"]`):a("/admin/appearance/menus")},[a,i]),i?e(go,{formPath:r}):null}function go({formPath:t}){const{site:{has_mobile_app:a}}=Pe(),s=it(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=Ce({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(jt,{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(fo,{fieldArray:i}),e("div",{className:"text-right",children:e(bo,{})})]})}function fo({fieldArray:{append:t,fields:a,move:s}}){const r=at();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(D,{type:"popover",placement:"right",offset:20,onClose:i=>{i&&(t({...i}),r(`items/${a.length}`))},children:[e(y,{variant:"outline",color:"primary",size:"xs",startIcon:e(ke,{}),children:e(n,{message:"Add"})}),e(Nn,{})]})]}),c("div",{className:"mt-20 flex-shrink-0",children:[a.map((i,l)=>e(vo,{item:i,items:a,index:l,onSortEnd:(o,d)=>{s(o,d)}},i.key)),a.length?null:e(ya,{size:"xs",className:"my-40",image:e(xa,{src:io}),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 bo(){const t=at(),{menuIndex:a}=ve(),{fields:s,remove:r}=Ce({name:"settings.menus",keyName:"key"});if(!a)return null;const i=s[+a];return c(D,{type:"modal",onClose:l=>{if(l){const o=s.findIndex(d=>d.id===i.id);r(o),t("/admin/appearance/menus")}},children:[e(y,{variant:"outline",color:"danger",size:"xs",startIcon:e(Kt,{}),children:e(n,{message:"Delete menu"})}),e(Le,{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 vo({item:t,items:a,index:s,onSortEnd:r}){const i=u.exports.useRef(null),{sortableProps:l,dragHandleRef:o}=co({item:t,items:a,type:"menuEditorSortable",ref:i,onSortEnd:r,previewVariant:"liveSort"}),d=t.icon&&vs(t.icon),h=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(Ie,{elementType:Z,to:`items/${s}`,ref:i,...l,children:c("div",{className:"flex items-center gap-10",children:[e(M,{ref:o,size:"sm",children:e(ro,{className:"text-muted hover:cursor-move"})}),e("div",{children:t.label||h})]})})})}function yo(){const{menuIndex:t,menuItemIndex:a}=ve(),s=_e(),{getValues:r}=z(),i=`settings.menus.${t}.items.${a}`,l=r(i);return u.exports.useEffect(()=>{l&&R().preview.setHighlight(`[data-menu-item-id="${l.id}"]`)},[s,l]),!l||a==null?null:e(xo,{formPath:i})}function xo({formPath:t}){return c(u.exports.Fragment,{children:[e(ot,{formPathPrefix:t}),e("div",{className:"text-right mt-40",children:e(wo,{})})]})}function wo(){const t=_e(),{menuIndex:a,menuItemIndex:s}=ve(),{fields:r,remove:i}=Ce({name:`settings.menus.${+a}.items`});if(!s)return null;const l=r[+s];return c(D,{type:"modal",onClose:o=>{o&&s&&(i(+s),t(`/admin/appearance/menus/${a}`))},children:[e(y,{variant:"outline",color:"danger",size:"xs",startIcon:e(Kt,{}),children:e(n,{message:"Delete this item"})}),e(Le,{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 So(){return c(u.exports.Fragment,{children:[e(yt,{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(yt,{label:e(n,{message:"Light logo"}),description:e(n,{message:"Will be used on dark backgrounds."}),type:"logo_light"}),e(yt,{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(yt,{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(yt,{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(ko,{}),e(No,{})]})}function yt({label:t,description:a,type:s}){const r=it(i=>{var l;return(l=i.defaults)==null?void 0:l.settings.branding[s]});return e(tt,{name:`settings.branding.${s}`,className:"border-b pb-30 mb-30",label:t,description:a,diskPrefix:"branding_media",defaultValue:r,onChange:()=>{R().preview.setHighlight('[data-logo="navbar"]')}})}function ko(){return e(g,{name:"appearance.env.app_name",required:!0,className:"mt-20",label:e(n,{message:"Site name"})})}function No(){return e(g,{name:"settings.branding.site_description",className:"mt-20",inputElementType:"textarea",rows:4,label:e(n,{message:"Site description"})})}function Co(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 _o(){const{trans:t}=V(),a=at(),{data:{themes:s}}=ws(),{fields:r,append:i}=Ce({name:"appearance.themes.all",keyName:"key"});return u.exports.useEffect(()=>{s.selectedThemeId&&R().preview.setActiveTheme(s.selectedThemeId)},[s.selectedThemeId]),c(u.exports.Fragment,{children:[e("div",{className:"mb-20",children:e(y,{size:"xs",variant:"outline",color:"primary",startIcon:e(ke,{}),onClick:()=>{var o;const l=(o=R().defaults)==null?void 0:o.appearance.themes.light;i({id:Co(),name:t(p("New theme")),colors:l}),a(`${r.length+1}`)},children:e(n,{message:"New theme"})})}),r.map((l,o)=>e(Ie,{to:`${o}`,elementType:$a,children:l.name},l.key))]})}function $o(){const{fields:t}=Ce({name:"appearance.seo"});return e(u.exports.Fragment,{children:t.map((a,s)=>e(g,{className:"mb-20",name:`appearance.seo.${s}.value`,label:e(n,{message:a.name}),placeholder:a.defaultValue,inputElementType:"textarea",rows:3},a.id))})}const Po=W.lazy(()=>Ot(()=>import("./ace-editor.629df466.js"),["./ace-editor.629df466.js","./main.fcd554a6.js","./main.e8a562e5.css","./index.9b3ee2f7.js"],import.meta.url));function Fo({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(Ht,{"aria-label":"Loading editor...",isIndeterminate:!0,size:"md"})}),children:e(Po,{mode:a,onChange:d=>{i(d)},defaultValue:r||"",onIsValidChange:o})})}),e(zo,{isValid:l,value:r})]})}function zo({isValid:t,value:a}){const{close:s}=Y();return c(fe,{dividerTop:!0,children:[e(y,{onClick:()=>s(),children:e(n,{message:"Cancel"})}),e(y,{disabled:!t,variant:"flat",color:"primary",onClick:()=>{s(a)},children:e(n,{message:"Save"})})]})}function Io(){return c(u.exports.Fragment,{children:[e(ss,{mode:"css"}),e(ss,{mode:"html"})]})}function ss({mode:t}){const{getValues:a}=z(),{setValue:s}=z(),r=t==="html"?e(n,{message:"Custom HTML & JavaScript"}):e(n,{message:"Custom CSS"});return c(D,{type:"modal",onClose:i=>{i!=null&&(s(`appearance.custom_code.${t}`,i,{shouldDirty:!0}),R().preview.setCustomCode(t,i))},children:[e(Ie,{children:r}),e(Fo,{title:r,defaultValue:a(`appearance.custom_code.${t}`)||"",mode:t})]})}const Ao=""+new URL("articles.8bfd9f17.svg",import.meta.url).href,To=t=>{const a=t.customPages.types.length>1?[{control:{type:le.Select,defaultValue:"default",options:t.customPages.types.map(s=>({value:s.type,label:s.label,key:s.type}))},key:"type",label:p("Type"),description:p("Type of the page"),defaultOperator:ne.eq}]:[];return[{key:"user_id",label:p("User"),description:p("User page was created by"),defaultOperator:ne.eq,control:{type:le.SelectModel,model:Ta}},...a,ut({description:p("Date page was created")}),mt({description:p("Date page was last updated")})]},Eo=[{key:"slug",allowsSorting:!0,width:"flex-2 min-w-200",visibleInMode:"all",header:()=>e(n,{message:"Slug"}),body:t=>e(Z,{target:"_blank",to:`/pages/${t.slug}`,className:Pa,children:t.slug})},{key:"user_id",allowsSorting:!0,width:"flex-2 min-w-140",header:()=>e(n,{message:"Owner"}),body:t=>t.user&&e(ht,{image:t.user.avatar,label:t.user.display_name,description:t.user.email})},{key:"type",maxWidth:"max-w-100",header:()=>e(n,{message:"Type"}),body:t=>e(n,{message:t.type})},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-84 flex-shrink-0",visibleInMode:"all",body:t=>e(M,{size:"md",className:"text-muted",elementType:Z,to:`${t.id}/edit`,children:e(Ge,{})})}];function Lo(){const t=u.exports.useContext(We),a=u.exports.useMemo(()=>To(t),[t]);return e(Ke,{endpoint:"custom-pages",title:e(n,{message:"Custom pages"}),filters:a,columns:Eo,queryParams:{with:"user"},actions:e(Mo,{}),selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:Ao,title:e(n,{message:"No pages have been created yet"}),filteringTitle:e(n,{message:"No matching pages"})})})}function Mo(){return e(nt,{elementType:Z,to:"new",children:e(n,{message:"New page"})})}function Do(t){return E.get(`custom-pages/${t}`).then(a=>a.data)}function Ro(){const{pageId:t}=ve();return Oe(["custom-pages",t],()=>Do(t),{enabled:!!t})}const Vo=W.lazy(()=>Ot(()=>import("./text-editor.ee7a4592.js"),["./text-editor.ee7a4592.js","./main.fcd554a6.js","./main.e8a562e5.css","./format.eba72cc5.js","./Edit.5be662f9.js","./file-entry-index-filters.398da9db.js","./ArrowBack.953d9159.js","./UnfoldLess.0d39fb88.js","./UnfoldMore.a50d7b82.js","./use-resume-subscription.c9b7d602.js","./text-editor.b603c7db.css"],import.meta.url));function ns({allowSlugEditing:t=!0,endpoint:a}){const{data:s,isFetched:r,fetchStatus:i}=Ro(),l=!r&&i!=="idle",o=Q();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(Vo,{page:s==null?void 0:s.page,allowSlugEditing:t,endpoint:a})})})}const Uo=[{label:p("Drive"),to:"drive"}],Cn=[{label:p("General"),to:"general"},...Uo,{label:p("Subscriptions"),to:"subscriptions"},{label:p("Localization"),to:"localization"},{label:p("Authentication"),to:"authentication"},{label:p("Uploading"),to:"uploading"},{label:p("Mail"),to:"mail"},{label:p("Cache"),to:"cache"},{label:p("Analytics"),to:"analytics"},{label:p("Logging"),to:"logging"},{label:p("Queue"),to:"queue"},{label:p("Recaptcha"),to:"recaptcha"},{label:p("GDPR"),to:"gdpr"},{label:p("Menus"),to:"/admin/appearance/menus"},{label:p("Seo"),to:"/admin/appearance/seo-settings"},{label:p("Themes"),to:"/admin/appearance/themes"}];function qo({className:t}){const a=Ee();return c("div",{className:F(t,"md:flex gap-30 min-h-full items-start p-24 container mx-auto"),children:[e(Bt,{children:e(n,{message:"Settings"})}),a?e(Bo,{}):e(Oo,{}),e("div",{className:"md:px-30 flex-auto relative max-w-500",children:e(ba,{})})]})}function Bo(){const{pathname:t}=Na(),a=at(),s=t.split("/").pop();return e(qt,{minWidth:"min-w-none",className:"w-full bg-paper mb-24",selectionMode:"single",selectedValue:s,onSelectionChange:r=>{a(r)},children:Cn.map(r=>e(b,{value:r.to,children:e(n,{...r.label})},r.to))})}function Oo(){return e("div",{className:"w-240 sticky top-24 flex-shrink-0",children:Cn.map(t=>e($a,{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 Pt(){return Oe(["fetchAdminSettings"],()=>Ho(),{staleTime:1/0})}function Ho(){return E.get("settings").then(t=>t.data)}function Wo(){return E.post("sitemap/generate").then(t=>t.data)}function Go(){return B(()=>Wo(),{onSuccess:()=>{O(p("Sitemap generated"))},onError:t=>me(t)})}const na=t=>t instanceof Date,jo=t=>Object.keys(t).length===0,ma=t=>t!=null&&typeof t=="object",rs=(t,...a)=>Object.prototype.hasOwnProperty.call(t,...a),ra=t=>ma(t)&&jo(t),Ko=()=>Object.create(null),ha=(t,a)=>{if(t===a)return{};if(!ma(t)||!ma(a))return a;const s=Object.keys(t).reduce((r,i)=>(rs(a,i)||(r[i]=void 0),r),Ko());return na(t)||na(a)?t.valueOf()==a.valueOf()?{}:a:Object.keys(a).reduce((r,i)=>{if(!rs(t,i))return r[i]=a[i],r;const l=ha(t[i],a[i]);return ra(l)&&!na(l)&&(ra(t[i])||!ra(a[i]))||(r[i]=l),r},s)};function _n(t){const{data:a}=Pt();return B(s=>{var l,o,d,h,m,f;(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)),(h=(d=s.client)==null?void 0:d.registration)!=null&&h.policies&&(s.client.registration.policies=JSON.stringify(s.client.registration.policies)),(f=(m=s.client)==null?void 0:m.artistPage)!=null&&f.tabs&&(s.client.artistPage.tabs=JSON.stringify(s.client.artistPage.tabs));const r=s.client?ha(a.client,s.client):null,i=s.server?ha(a.server,s.server):null;return Qo({client:r,server:i,files:s.files})},{onSuccess:()=>{O(p("Settings updated"),{position:"bottom-right"}),q.invalidateQueries(["fetchAdminSettings"])},onError:s=>be(s,t)})}function Qo({client:t,server:a,files:s}){const r=new FormData;return t&&r.set("client",JSON.stringify(Ga.dot(t))),a&&r.set("server",JSON.stringify(Ga.dot(a))),Object.entries(s||{}).forEach(([i,l])=>{r.set(i,l)}),E.post("settings",r,{headers:{"Content-Type":"multipart/form-data"}}).then(i=>i.data)}function ye({title:t,description:a,children:s}){const{data:r}=Pt();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(Jo,{defaultValues:r,children:s}):e(Ht,{isIndeterminate:!0,"aria-label":"Loading settings..."})]})}function Jo({children:t,defaultValues:a}){const s=Q({defaultValues:a}),r=_n(s);return c(u.exports.Fragment,{children:[c(ue,{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(y,{type:"submit",variant:"flat",color:"primary",disabled:r.isLoading,children:e(n,{message:"Update"})})})]}),r.isLoading&&e(us,{size:"xs",className:"absolute -bottom-14 left-30 w-full",isIndeterminate:!0,"aria-label":"Saving settings..."})]})}function Re(){return e("div",{className:"h-1 bg-divider my-30"})}function Ft({link:t,className:a}){const{site:s}=Pe();return s.hide_docs_button?null:c("div",{className:F("flex items-center gap-8",a),children:[e(Gr,{size:"sm"}),e(Wt,{href:t,children:e(n,{message:"Learn more"})})]})}function Zo(){return c(ye,{title:e(n,{message:"General"}),description:e(n,{message:"Configure site url, homepage, theme and other general settings."}),children:[e(Xo,{}),e(Re,{}),e(Yo,{}),e(Re,{}),e(ec,{}),e(Re,{}),e(tc,{})]})}function Xo(){const{data:t}=Pt();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(u.exports.Fragment,{children:[e(g,{invalid:!!r,name:"server.app_url",label:e(n,{message:"Primary site url"}),description:e(Ft,{link:"https://support.vebto.com/help-center/articles/35/primary-site-url"})}),a]})}function Yo(){var i,l;const{watch:t}=z(),{homepage:a}=u.exports.useContext(We),{data:s}=Fe(["menuItemCategories"]),r=t("client.homepage.type");return c("div",{children:[c(G,{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:[a.options.map(o=>e(b,{value:o.value,children:e(n,{...o.label})},o.value)),(i=s==null?void 0:s.menuItemCategories)==null?void 0:i.map(o=>e(b,{value:o.type,children:o.name},o.type))]}),(l=s==null?void 0:s.menuItemCategories)==null?void 0:l.map(o=>r===o.type?e(G,{className:"mt-24",name:"client.homepage.value",selectionMode:"single",label:e(n,{message:"Homepage :name",values:{name:o.name}}),children:o.items.map(d=>e(b,{value:d.model_id,children:d.label},d.label))},o.name):null)]})}function ec(){const{data:{themes:t}}=ws();return c(u.exports.Fragment,{children:[c(G,{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(T,{name:"client.themes.user_change",description:e(n,{message:"Allow users to manually change site theme."}),children:e(n,{message:"Allow theme change"})})]})}function tc(){const t=Go(),{base_url:a}=Pe(),s=`${a}/storage/sitemaps/sitemap-index.xml`,r=e(Wt,{href:s,children:s});return c(K,{children:[e(y,{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 ac(t){return rt(t).toString("rgb").replace("rgb(","").replace(")","").replace(/, ?/g," ")}function sc(t){try{return rt(`rgb(${t.split(" ").join(",")})`).toString("hex")}catch{return t}}const nc=Ne(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined");function rc(){const{getValues:t,setValue:a}=z(),{themeIndex:s}=ve(),r=t(`appearance.themes.all.${+s}`);return c(D,{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(y,{size:"xs",variant:"outline",color:"primary",startIcon:e(nc,{}),children:e(n,{message:"Settings"})}),e(ic,{theme:r})]})}function ic({theme:t}){const a=Q({defaultValues:t}),{close:s,formId:r}=Y();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(ue,{form:a,id:r,onSubmit:i=>{s(i)},children:[e(g,{name:"name",label:e(n,{message:"Name"}),className:"mb-30",autoFocus:!0}),e(T,{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(T,{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(T,{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(fe,{children:[e(y,{onClick:()=>{s()},children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",type:"submit",form:r,disabled:!a.formState.isDirty,children:e(n,{message:"Save"})})]})]})}const lc=Ne(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 oc(){const t=_e(),{themeIndex:a}=ve(),[s,r]=u.exports.useState(!1),{setValue:i,getValues:l}=z(),{fields:o,remove:d}=Ce({name:"appearance.themes.all"}),h=()=>{if(o.length<=1){O.danger(p("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(ur,{onItemSelected:m=>{if(m==="delete")r(!0);else if(m==="reset"){const f=`appearance.themes.all.${+a}`,v=l(`${f}.is_dark`)?R().defaults.appearance.themes.dark:R().defaults.appearance.themes.light;Object.entries(v).forEach(([N,C])=>{R().preview.setThemeColor(N,C)}),i(`${f}.colors`,v,{shouldDirty:!0})}},children:[e(M,{size:"md",className:"text-muted",children:e(jr,{})}),c(mr,{children:[e(b,{value:"reset",startIcon:e(lc,{}),children:e(n,{message:"Reset colors"})}),e(b,{value:"delete",startIcon:e(Kt,{}),children:e(n,{message:"Delete"})})]})]}),e(D,{type:"modal",isOpen:s,onClose:m=>{m&&h(),r(!1)},children:e(Le,{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 cc(){const t=at(),{themeIndex:a}=ve(),{getValues:s}=z(),r=s(`appearance.themes.all.${+a}`);return u.exports.useEffect(()=>{r||t("/admin/appearance/themes")},[t,r]),u.exports.useEffect(()=>{r!=null&&r.id&&R().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(rc,{}),e(oc,{})]}),e("div",{children:Object.entries(r.colors).filter(([i])=>!i.endsWith("opacity")).map(([i,l])=>e(dc,{colorName:i,initialThemeValue:l,theme:r},i))})]}):null}function dc({theme:t,colorName:a,initialThemeValue:s}){const{setValue:r}=z(),{themeIndex:i}=ve(),[l,o]=u.exports.useState(s),d=m=>{o(m),R().preview.setThemeColor(a,m)};u.exports.useEffect(()=>{o(s)},[s]);const h=sc(s);return c(D,{currentValue:h,type:"popover",placement:"right",offset:10,onClose:m=>{m&&m!==h?(r(`appearance.themes.all.${+i}.colors.${a}`,l,{shouldDirty:!0}),r("appearance.themes.selectedThemeId",t.id)):d(s)},children:[e(Ie,{className:"capitalize",startIcon:e(Is,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:`rgb(${l})`}}),children:a.replace("--be-","").replace("-"," ")}),e(vn,{defaultValue:h,onChange:m=>{d(ac(m))}})]})}function uc(){return c(ye,{title:e(n,{message:"Drive"}),description:e(n,{message:"Configure defaults for drive user dashboard."}),children:[c(Fa,{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(Xe,{value:"list",children:e(n,{message:"List"})}),e(Xe,{value:"grid",children:e(n,{message:"Grid"})})]}),e(T,{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(T,{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 mc=[{path:"drive",element:e(uc,{})}];function he({children:t,name:a,separatorBottom:s=!0,separatorTop:r=!0}){const{formState:{errors:i}}=z(),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 pa({children:t,...a}){const{field:{onChange:s,onBlur:r,value:i=[],ref:l},fieldState:{invalid:o,error:d}}=$t({name:a.name}),h=u.exports.useMemo(()=>{const f=i;return typeof f=="string"?JSON.parse(f):f},[i]),m={onChange:f=>{const v=JSON.stringify(f.map(N=>N.name));s(v)},onBlur:r,value:h,invalid:o,errorMessage:d==null?void 0:d.message};return e(Kr,{ref:l,...et(m,a)})}const zt=W.createContext(null);function $n(t){const{size:a="md",children:s,className:r,isLazy:i,overflow:l="overflow-hidden"}=t,o=u.exports.useRef([]),d=u.exports.useId(),[h,m]=_t(t.selectedTab,t.defaultSelectedTab||0,t.onTabChange),f=u.exports.useMemo(()=>({selectedTab:h,setSelectedTab:m,tabsRef:o,size:a,isLazy:i,id:d}),[h,d,i,m,a]);return e(zt.Provider,{value:f,children:e("div",{className:F(r,l,"max-w-full"),children:s})})}function hc(){const{tabsRef:t,selectedTab:a}=u.exports.useContext(zt),[s,r]=u.exports.useState({width:void 0,transform:void 0,className:void 0});return Ss(()=>{if(a!=null&&t.current){const i=t.current[a];if(!i)return;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 Pn({children:t,center:a,expand:s,className:r}){const i=u.exports.Children.toArray(t);return e(cs,{children:c("div",{className:F("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",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(hc,{})]})})}function Vt({index:t,className:a,isDisabled:s,children:r,padding:i,elementType:l="button",to:o,relative:d}){const{selectedTab:h,setSelectedTab:m,tabsRef:f,size:v="md",id:N}=u.exports.useContext(zt),C=t===h,P=ds(),S=i||(v==="sm"?"px-12":"px-18"),$=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 whitespace-nowrap min-w-min",pc({isDisabled:s,isSelected:C}),a,v==="md"&&`${S} h-48`,v==="sm"&&`${S} h-32`,!s&&"cursor-pointer"),k=A=>{switch(A.key){case"ArrowLeft":P.focusPrevious();break;case"ArrowRight":P.focusNext();break;case"Home":P.focusFirst();break;case"End":P.focusLast();break}},w=C?0:-1;return e(l,{disabled:s,id:`${N}-${t}-tab`,"aria-controls":`${N}-${t}-tabpanel`,type:"button",role:"tab","aria-selected":C,tabIndex:s?void 0:w,onKeyDown:k,onClick:()=>{m(t)},to:o,relative:d,className:$,ref:A=>{f.current&&A&&(f.current[t]=A)},children:r})}function pc({isDisabled:t,isSelected:a}){return t?"text-disabled cursor-default":a?"text-primary":"text-muted hover:text-main"}function Fn({children:t,className:a}){const{selectedTab:s,isLazy:r}=u.exports.useContext(zt),i=u.exports.Children.toArray(t).filter(o=>!!o);let l;if(r){const o=i[s];l=u.exports.isValidElement(o)?u.exports.cloneElement(i[s],{index:s}):null}else l=i.map((o,d)=>{if(u.exports.isValidElement(o)){const h=d===s;return u.exports.cloneElement(o,{index:d,"aria-hidden":!h,className:h?o.props.className:F(o.props.className,"hidden")})}return null});return e("div",{className:a,children:l})}function Ut({className:t,children:a,index:s,...r}){const{id:i}=u.exports.useContext(zt),[l,o]=u.exports.useState(0),d=u.exports.useRef(null);return Ss(()=>{if(d!=null&&d.current){const h=()=>{const f=hr(d.current,{tabbable:!0});o(f.nextNode()?void 0:0)};h();const m=new MutationObserver(h);return m.observe(d.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{m.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 gc(){const{trans:t}=V();return e(ye,{title:e(n,{message:"Subscriptions"}),description:e(n,{message:"Configure gateway integration, accepted cards, invoices and other related settings."}),children:c($n,{children:[c(Pn,{children:[e(Vt,{children:e(n,{message:"General"})}),e(Vt,{children:e(n,{message:"Invoices"})})]}),c(Fn,{className:"pt-30",children:[c(Ut,{children:[e(T,{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(Re,{}),e(fc,{}),e(bc,{}),e(Re,{}),e(pa,{name:"client.billing.accepted_cards",placeholder:t({message:"Add new card..."})})]}),c(Ut,{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 fc(){const{watch:t}=z(),a=t("client.billing.paypal.enable");return c("div",{className:"mb-30",children:[e(T,{name:"client.billing.paypal.enable",description:c("div",{children:[e(n,{message:"Enable PayPal payment gateway integration."}),e(Ft,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/147/configuring-paypal"})]}),children:e(n,{message:"PayPal gateway"})}),a&&e(he,{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(T,{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 bc(){const{watch:t}=z(),a=t("client.billing.stripe.enable");return c(K,{children:[e(T,{name:"client.billing.stripe.enable",description:c("div",{children:[e(n,{message:"Enable Stripe payment gateway integration."}),e(Ft,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/148/configuring-stripe"})]}),children:e(n,{message:"Stripe gateway"})}),a&&e(he,{name:"stripe_group",separatorBottom:!1,children:s=>c(u.exports.Fragment,{children:[e(g,{name:"server.stripe_key",label:e(n,{message:"Stripe publishable key"}),required:!0,className:"mb-20",invalid:s}),e(g,{name:"server.stripe_secret",label:e(n,{message:"Stripe secret key"}),required:!0,className:"mb-20",invalid:s}),e(g,{name:"server.stripe_webhook_secret",label:e(n,{message:"Stripe webhook signing secret"}),className:"mb-20",invalid:s})]})})]})}function vc(){const{data:t}=Fe(["timezones","localizations"]),a=Qr(),{trans:s}=V();return c(ye,{title:e(n,{message:"Localization"}),description:e(n,{message:"Configure global date, time and language settings."}),children:[c(G,{className:"mb-30",required:!0,name:"client.dates.default_timezone",showSearchField:!0,selectionMode:"single",label:e(n,{message:"Default timezone"}),searchPlaceholder:s(p("Search timezones")),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(([r,i])=>e(ys,{label:r,children:i.map(l=>e(b,{value:l.value,children:l.text},l.value))},r))]}),c(G,{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(r=>e(b,{value:r.language,capitalizeFirst:!0,children:r.name},r.language))]}),c(Fa,{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(Xe,{value:"auto",children:e(n,{message:"Auto"})},"auto"),Object.entries(pr).map(([r,i])=>e(Xe,{value:r,children:e(ge,{date:a,options:i})},r))]}),e(T,{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 yc(){return c(ye,{title:e(n,{message:"Authentication"}),description:e(n,{message:"Configure registration, social login and related 3rd party integrations."}),children:[e(xc,{}),e(T,{className:"mb-24",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(T,{className:"mb-24",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(T,{name:"client.social.compact_buttons",description:e(n,{message:"Use compact design for social login buttons."}),children:e(n,{message:"Compact buttons"})}),e(wc,{}),e(Sc,{}),e(kc,{}),e(Nc,{}),e(Re,{}),e(g,{inputElementType:"textarea",rows:3,className:"mt-24",name:"client.auth.domain_blacklist",label:e(n,{message:"Domain blacklist"}),description:e(n,{message:"Comma separated list of domains. Users will not be able to register or login using any email adress from specified domains."})})]})}function xc(){const{watch:t}=z(),a=t("server.mail_setup");return e(T,{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(Z,{className:"font-bold block underline",to:"/admin/settings/mail#outgoing-emails",children:s})}})})]}),children:e(n,{message:"Require email confirmation"})})}function wc(){const{watch:t}=z(),{envato:a}=Pe(),s=t("client.social.envato.enable");return a!=null&&a.enable?e(he,{separatorBottom:!1,name:"envato_group",children:r=>c(K,{children:[e(T,{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(K,{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 Sc(){const{watch:t}=z(),a=t("client.social.google.enable");return e(he,{name:"google_group",children:s=>c(K,{children:[e(T,{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(K,{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 kc(){const{watch:t}=z(),a=t("client.social.facebook.enable");return e(he,{name:"facebook_group",separatorTop:!1,children:s=>c(K,{children:[e(T,{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(K,{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 Nc(){const{watch:t}=z(),a=t("client.social.twitter.enable");return e(he,{name:"twitter_group",separatorTop:!1,separatorBottom:!1,children:s=>c(K,{children:[e(T,{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(K,{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",r==="positive"&&"bg-positive/focus border-l-positive border-l-4",r==="warning"&&"bg-warning/focus border-l-warning border-l-4",r==="danger"&&"bg-danger/focus border-l-danger border-l-4",r==="primary"&&"bg-primary/focus border-l-primary border-l-4",r==="neutral"&&"bg-paper border"),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 Cc(){return E.get("uploads/server-max-file-size").then(t=>t.data)}function _c(){return Oe(["MaxServerUploadSize"],()=>Cc())}const $c=["B","KB","MB","GB","TB","PB"];function is(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 Pc=0x630000000000,wt=W.forwardRef(({name:t,...a},s)=>{const{field:{onChange:r,onBlur:i,value:l="",ref:o},fieldState:{invalid:d,error:h}}=$t({name:t}),[m,f]=u.exports.useState(""),[v,N]=u.exports.useState("MB");u.exports.useEffect(()=>{if(l==null||l===""){f("");return}const{amount:S,unit:$}=Fc({bytes:Math.min(l,Pc)});N($||"MB"),f(Number.isNaN(S)?"":S)},[l,v]);const C={onChange:S=>{const $=parseInt(S.target.value);if(Number.isNaN($))r($);else{const k=is(parseInt(S.target.value),v);r(k)}},onBlur:i,value:m,invalid:d,errorMessage:h==null?void 0:h.message,inputRef:o},P=e(qt,{minWidth:"min-w-80",selectionMode:"single",selectedValue:v,disabled:!l,onSelectionChange:S=>{const $=is(m||0,S);r($)},children:$c.slice(0,5).map(S=>e(b,{value:S,children:S==="B"?"Bytes":S},S))});return e(ct,{...et(C,a),type:"number",ref:s,endAppend:P})}),Fc=gr(({bytes:t})=>{const a=ks(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 zc(){const{trans:t}=V();return B(()=>Ic(),{onSuccess:()=>{O(t(p("CORS file updated"))),q.invalidateQueries(["Query Key"])},onError:a=>me(a)})}function Ic(){return E.post("s3/cors/upload").then(t=>t.data)}function Ac(){return B(t=>Tc(t),{onError:t=>me(t)})}function Tc(t){return E.post("settings/uploading/dropbox-refresh-token",t).then(a=>a.data)}function Ec({isInvalid:t}){const{watch:a,setValue:s}=z(),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(D,{type:"modal",onClose:l=>{l&&s("server.storage_dropbox_refresh_token",l)},children:[e(y,{variant:"outline",color:"primary",size:"xs",disabled:!r||!i,children:e(n,{message:"Get dropbox refresh token"})}),e(Lc,{appKey:r,appSecret:i})]})]})}function Lc({appKey:t,appSecret:a}){const s=Q(),{formId:r,close:i}=Y(),l=Ac();return c(ae,{children:[e(oe,{children:e(n,{message:"Connected dropbox account"})}),e(ie,{children:c(ue,{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(y,{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(fe,{children:[e(y,{onClick:()=>{i()},children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",form:r,type:"submit",disabled:!t||!a||l.isLoading,children:e(n,{message:"Connect"})})]})]})}function Mc(){const{trans:t}=V();return c(ye,{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(Rc,{}),e(Vc,{}),e(Uc,{}),e(he,{name:"static_delivery_group",children:a=>c(Fa,{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(Xe,{value:"",children:e(n,{message:"None"})}),e(Xe,{value:"xsendfile",children:e(n,{message:"X-Sendfile (Apache)"})}),e(Xe,{value:"xaccel",children:e(n,{message:"X-Accel (Nginx)"})})]})}),e(wt,{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(Dc,{}),e(Re,{}),e(wt,{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(wt,{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(pa,{name:"client.uploads.allowed_extensions",className:"mb-30",label:e(n,{message:"Allowed extensions"}),placeholder:t(p("Add extension...")),description:e(n,{message:"List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types."})}),e(pa,{name:"client.uploads.blocked_extensions",label:e(n,{message:"Blocked extensions"}),placeholder:t(p("Add extension...")),description:e(n,{message:"Prevent uploading of these file types, even if they are allowed above."})})]})}function Dc(){const{data:t}=_c();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 Rc(){const{watch:t,clearErrors:a}=z();return t("server.uploads_disk_driver")?c(G,{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 Vc(){const{watch:t,clearErrors:a}=z();return t("server.public_disk_driver")?c(G,{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 Uc(){const{watch:t}=z(),a=[t("server.uploads_disk_driver"),t("server.public_disk_driver")];return a[0]==="local"&&a[1]==="local"?null:e(he,{separatorBottom:!1,name:"storage_group",children:s=>{if(a.includes("s3"))return e(qc,{isInvalid:s});if(a.includes("ftp"))return e(Hc,{isInvalid:s});if(a.includes("dropbox"))return e(Ec,{isInvalid:s});if(a.includes("digitalocean_s3"))return e(Bc,{isInvalid:s});if(a.includes("backblaze_s3"))return e(Oc,{isInvalid:s})}})}function qc({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"}),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(Va,{invalid:t})]})}function Bc({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(Va,{invalid:t})]})}function Oc({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(Va,{invalid:t})]})}function Va({invalid:t}){var i,l;const a=zc(),{data:s}=Pt(),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(T,{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(y,{variant:"flat",color:"primary",size:"xs",className:"mt-20",onClick:()=>{a.mutate()},disabled:!r||a.isLoading,children:e(n,{message:"Configure CORS"})})]})}function Hc({isInvalid:t}){return c(K,{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(T,{invalid:t,name:"server.storage_ftp_passive",className:"mb-30",children:e(n,{message:"Passive"})}),e(T,{invalid:t,name:"server.storage_ftp_ssl",children:e(n,{message:"SSL"})})]})}function Wc({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 Gc({isInvalid:t}){return c(K,{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",name:"server.mail_encryption",label:e(n,{message:"SMTP encryption"})})]})}function jc({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 Kc({isInvalid:t}){return e(g,{invalid:t,name:"server.postmark_token",label:e(n,{message:"Postmark token"}),required:!0})}const ls=Ne([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 Qc(){const{watch:t,setValue:a}=z(),{connectSocial:s}=fr(),r=t("server.connectedGmailAccount"),i=t("client.mail.handler")==="gmailApi",l=async()=>{const h=await s("secure/settings/mail/gmail/connect");if((h==null?void 0:h.status)==="SUCCESS"){const m=h.callbackData.profile.email;a("server.connectedGmailAccount",m),O(p("Connected gmail account: :email",{values:{email:m}}))}},o=e(y,{variant:"outline",color:"primary",startIcon:e(ls,{}),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(ls,{size:"lg"}),r,e(y,{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 Jc(){const{watch:t,clearErrors:a}=z(),s=[t("server.mail_driver"),t("client.mail.handler")],r=[];return s.includes("mailgun")&&r.push(Wc),s.includes("smtp")&&r.push(Gc),s.includes("ses")&&r.push(jc),s.includes("postmark")&&r.push(Kc),s.includes("gmailApi")&&r.push(Qc),e(he,{separatorTop:!1,separatorBottom:!1,name:"mail_group",children:i=>c(u.exports.Fragment,{children:[c(G,{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(Ft,{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))}):null]})})}function Zc(){const{clearErrors:t}=z(),{settings:a}=u.exports.useContext(We);return a!=null&&a.showIncomingMailMethod?c(G,{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(Ft,{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 Xc(){return c(ye,{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(Yc,{}),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(Re,{}),e(Zc,{}),e(Jc,{})]})}function Yc(){const{base_url:t}=Pe(),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(Wt,{href:a,children:a})},message:"Where emails from :contactPageUrl page should be sent to."})})}function ed(){return E.post("cache/flush").then(t=>t.data)}function td(){return B(()=>ed(),{onSuccess:()=>{O(p("Cache cleared"))},onError:t=>me(t)})}function ad(){const t=td();return c(ye,{title:e(n,{message:"Cache settings"}),description:e(n,{message:"Select cache provider and manually clear cache."}),children:[e(sd,{}),e(y,{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 sd(){const{watch:t,clearErrors:a}=z(),s=t("server.cache_driver");let r=null;return s==="memcached"&&(r=nd),e(he,{separatorTop:!1,name:"cache_group",children:i=>c(K,{children:[c(G,{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 nd({isInvalid:t}){return c(K,{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 rd(){return c(ye,{title:e(n,{message:"Error logging"}),description:e(n,{message:"Configure site error logging and related 3rd party integrations."}),children:[e(id,{}),e(Ye,{className:"mt-30",color:"positive",description:e(n,{values:{a:t=>e(Wt,{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 id(){const{clearErrors:t}=z();return e(he,{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 ld(){return c(ye,{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(od,{})]})}function od(){const{watch:t,clearErrors:a}=z(),s=t("server.queue_driver");let r=null;return s==="sqs"&&(r=cd),e(he,{separatorTop:!1,separatorBottom:!1,name:"queue_group",children:i=>c(K,{children:[c(G,{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 cd({isInvalid:t}){return c(K,{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 dd(){const{settings:t}=u.exports.useContext(We);return c(ye,{title:e(n,{message:"Recaptcha"}),description:e(n,{message:"Configure google recaptcha integration and credentials."}),children:[(t==null?void 0:t.showRecaptchaLinkSwitch)&&e(T,{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(T,{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(T,{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(ud,{})]})}function ud(){const{clearErrors:t}=z();return e(he,{separatorTop:!1,separatorBottom:!1,name:"recaptcha_group",children:a=>c(K,{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 md=W.forwardRef((t,a)=>{const s=ps(a),{fieldProps:r,inputProps:i}=br({...t,focusRef:s}),l=wa(t);return e(vr,{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 hd({name:t,...a}){const{field:{onChange:s,onBlur:r,ref:i},fieldState:{invalid:l,error:o}}=$t({name:t}),[d,h]=W.useState(""),m={onChange:f=>{var v;s((v=f.target.files)==null?void 0:v[0]),h(f.target.value)},onBlur:r,value:d,invalid:l,errorMessage:o==null?void 0:o.message};return e(md,{ref:i,...et(m,a)})}function pd(){return e(ye,{title:e(n,{message:"Analytics"}),description:e(n,{message:"Configure google analytics integration and credentials."}),children:e(gd,{})})}function gd(){const{clearErrors:t}=z();return e(he,{separatorTop:!1,separatorBottom:!1,name:"analytics_group",children:a=>c(u.exports.Fragment,{children:[e(hd,{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 fd(t){const a=_e();return B(s=>bd(s),{onSuccess:(s,r)=>{O(p("User updated")),q.invalidateQueries(["users"]),a("/admin/users")},onError:s=>be(s,t)})}function bd({id:t,...a}){return a.roles&&(a.roles=a.roles.map(s=>s.id)),E.put(`users/${t}`,a).then(s=>s.data)}function vd(){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 It({onSubmit:t,form:a,title:s,children:r,actions:i,backButton:l,isLoading:o=!1,disableSaveWhenNotDirty:d=!1,wrapInContainer:h=!0}){const{isSticky:m,sentinelRef:f}=vd(),v=d?Object.keys(a.formState.dirtyFields).length:!0;return c(ue,{onSubmit:t,onBeforeSubmit:()=>a.clearErrors(),form:a,children:[e("div",{ref:f}),e("div",{className:F("sticky top-0 my-12 md:my-24 z-10 transition-shadow",m&&"bg-paper shadow"),children:c("div",{className:F("flex items-center md:items-start gap-24 py-14",h&&"container mx-auto px-24"),children:[l,e("h1",{className:"text-xl md:text-3xl whitespace-nowrap overflow-hidden overflow-ellipsis md:mr-64",children:s}),e("div",{className:"mr-auto"}),i,e(y,{variant:"flat",color:"primary",type:"submit",disabled:o||!v,children:e(n,{message:"Save"})})]})}),e("div",{className:h?"container mx-auto px-24 pb-24":void 0,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}=Pe(),{data:h}=Fe(["roles","permissions"]);return c(It,{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(T,{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(wt,{className:"mb-30",name:"available_space",label:e(n,{message:"Allowed storage space"}),description:e(n,{values:{a:m=>e(Z,{className:Pa,target:"_blank",to:"/admin/settings/uploading",children:m})},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(jt,{className:"mb-30",name:"roles",label:e(n,{message:"Roles"}),suggestions:h==null?void 0:h.roles,children:m=>e(b,{value:m.id,children:m.name},m.id)}),c("div",{className:"mt-30 pt-30 border-t",children:[e("div",{className:"text-sm mb-10",children:e(n,{message:"Permissions"})}),e(Da,{name:"permissions"})]})]})}function yd(){var h;const t=Q(),{require_email_confirmation:a}=Pe(),{userId:s}=ve(),r=fd(t),i=yr(),{data:l,isLoading:o}=xr(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,avatar:l.user.avatar})},[l==null?void 0:l.user,t]),o)return e(dt,{});const d=e(y,{size:"xs",variant:"outline",color:"primary",disabled:!a||i.isLoading||((h=l==null?void 0:l.user)==null?void 0:h.email_verified_at)!=null,onClick:()=>{i.mutate({email:l.user.email})},children:e(n,{message:"Resend email"})});return e(zn,{onSubmit:m=>{r.mutate(m)},form:t,title:e(n,{values:{email:l==null?void 0:l.user.email},message:"Edit \u201C:email\u201C"}),isLoading:r.isLoading,avatarManager:e(xd,{user:l.user,onChange:()=>{q.invalidateQueries(["users"])}}),resendEmailButton:d,children:e(g,{className:"mb-30",name:"password",type:"password",label:e(n,{message:"New password"})})})}function xd({user:t,onChange:a}){const s=wr({user:t}),r=Sr({user:t});return e(Ca,{children:e(tt,{name:"avatar",diskPrefix:"avatars",variant:"avatar",stretchPreview:!0,label:e(n,{message:"Profile image"}),previewSize:"w-90 h-90",showRemoveButton:!0,onChange:i=>{i?s.mutate({url:i}):r.mutate(),a()}})})}function wd(t){const a=_e();return B(s=>Sd(s),{onSuccess:()=>{O(p("User created")),q.invalidateQueries(te("users")),a("/admin/users")},onError:s=>be(s,t)})}function Sd(t){return t.roles&&(t.roles=t.roles.map(a=>a.id)),E.post("users",t).then(a=>a.data)}function kd(){const t=Q(),a=wd(t),s=e(Ca,{children:e(tt,{name:"avatar",diskPrefix:"avatars",variant:"avatar",stretchPreview:!0,label:e(n,{message:"Profile image"}),previewSize:"w-90 h-90",showRemoveButton:!0})});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"})})]})}const Nd=Ne(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 Cd(t){return Oe(In(t),()=>_d(t),{staleTime:1/0})}function _d(t){return E.get(`localizations/${t}`).then(a=>a.data)}function $d({id:t,...a}){return E.put(`localizations/${t}`,a).then(s=>s.data)}function An(t){return B(a=>$d(a),{onSuccess:()=>{O(p("Localization updated")),q.invalidateQueries(te("localizations")),q.invalidateQueries(In())},onError:a=>t?be(a,t):me(a)})}function Pd({localization:t}){const{trans:a}=V(),{formId:s,close:r}=Y(),i=Q({defaultValues:{id:t.id,name:t.name,language:t.language}}),{data:l}=Fe(["languages"]),o=(l==null?void 0:l.languages)||[],d=An(i);return c(ae,{children:[e(oe,{children:e(n,{message:"Update localization"})}),e(ie,{children:c(ue,{form:i,id:s,onSubmit:h=>{d.mutate(h,{onSuccess:r})},children:[e(g,{name:"name",label:e(n,{message:"Name"}),className:"mb-30",required:!0}),e(G,{required:!0,name:"language",label:e(n,{message:"Language"}),selectionMode:"single",showSearchField:!0,searchPlaceholder:a(p("Search languages")),children:o.map(h=>e(b,{value:h.code,children:h.name},h.code))})]})}),c(fe,{children:[e(y,{onClick:r,children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",type:"submit",form:s,disabled:d.isLoading,children:e(n,{message:"Save"})})]})]})}function Fd(t){return E.post("localizations",t).then(a=>a.data)}function zd(t){return B(a=>Fd(a),{onSuccess:()=>{O(p("Localization created")),q.invalidateQueries(te("localizations"))},onError:a=>be(a,t)})}function Id(){const{trans:t}=V(),{formId:a,close:s}=Y(),r=Q({defaultValues:{language:"en"}}),{data:i}=Fe(["languages"]),l=(i==null?void 0:i.languages)||[],o=zd(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Create localization"})}),e(ie,{children:c(ue,{form:r,id:a,onSubmit:d=>{o.mutate(d,{onSuccess:s})},children:[e(g,{autoFocus:!0,name:"name",label:e(n,{message:"Name"}),className:"mb-30",required:!0}),e(G,{required:!0,name:"language",label:e(n,{message:"Language"}),selectionMode:"single",showSearchField:!0,searchPlaceholder:t(p("Search languages")),children:l.map(d=>e(b,{value:d.code,children:d.name},d.code))})]})}),c(fe,{children:[e(y,{onClick:s,children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",type:"submit",form:a,disabled:o.isLoading,children:e(n,{message:"Save"})})]})]})}const Ad=""+new URL("around-the-world.df9b11c5.svg",import.meta.url).href,Td=[{key:"name",allowsSorting:!0,sortingKey:"name",visibleInMode:"all",width:"flex-3 min-w-200",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},{key:"updatedAt",allowsSorting:!0,width:"w-100",header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-84 flex-shrink-0",visibleInMode:"all",body:t=>c("div",{className:"text-muted",children:[e(Z,{to:`${t.id}/translate`,children:e(Ae,{label:e(n,{message:"Translate"}),children:e(M,{size:"md",children:e(Nd,{})})})}),c(D,{type:"modal",children:[e(Ae,{label:e(n,{message:"Edit"}),children:e(M,{children:e(Ge,{})})}),e(Pd,{localization:t})]})]})}];function Ed(){return e(Ke,{endpoint:"localizations",title:e(n,{message:"Localizations"}),columns:Td,actions:e(Ld,{}),selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:Ad,title:e(n,{message:"No localizations have been created yet"}),filteringTitle:e(n,{message:"No matching localizations"})})})}function Ld(){return e(u.exports.Fragment,{children:c(D,{type:"modal",children:[e(nt,{children:e(n,{message:"Add new localization"})}),e(Id,{})]})})}function Md(){const{formId:t,close:a}=Y(),s=Q();return c(ae,{children:[e(oe,{children:e(n,{message:"Add translation"})}),e(ie,{children:c(ue,{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(fe,{children:[e(y,{onClick:a,children:e(n,{message:"Cancel"})}),e(y,{variant:"flat",color:"primary",type:"submit",form:t,children:e(n,{message:"Add"})})]})]})}function Dd(){const{localeId:t}=ve(),{data:a,isLoading:s}=Cd(t),r=a==null?void 0:a.localization;return s||!r?e(dt,{}):e(Rd,{localization:r})}function Rd({localization:t}){const[a,s]=u.exports.useState(t.lines||{}),r=_e(),i=An(),[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(Vd,{localization:t,setLines:s,lines:a,searchQuery:l,setSearchQuery:o,isLoading:i.isLoading}),e(Ud,{lines:a,setLines:s,searchQuery:l})]})}function Vd({localization:t,searchQuery:a,setSearchQuery:s,isLoading:r,lines:i,setLines:l}){const o=_e(),d=Ee(),{trans:h}=V();return c("div",{className:"flex-shrink-0",children:[c(ai,{size:"lg",className:"mb-16",children:[e(ja,{onSelected:()=>{o("/admin/localizations")},children:e(n,{message:"Localizations"})}),e(ja,{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:m=>s(m.target.value),startAdornment:e(va,{}),placeholder:h({message:"Type to search..."})})}),c(D,{type:"modal",onClose:m=>{if(m){const f={...i};f[m.key]=m.value,l(f)}},children:[!d&&e(y,{className:"ml-auto",variant:"outline",color:"primary",startIcon:e(ke,{}),children:e(n,{message:"Add new"})}),e(Md,{})]}),e(y,{variant:"flat",color:"primary",type:"submit",disabled:r,children:d?e(n,{message:"Save"}):e(n,{message:"Save translations"})})]})]})}function Ud({searchQuery:t,lines:a,setLines:s}){const r=u.exports.useMemo(()=>Object.entries(a).filter(([o,d])=>{const h=t==null?void 0:t.toLowerCase();return!h||(o==null?void 0:o.toLowerCase().includes(h))||(d==null?void 0:d.toLowerCase().includes(h))}),[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,h]=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(M,{size:"xs",className:"text-muted",onClick:()=>{const m={...a};delete m[d],s(m)},children:e(He,{})})]}),e("div",{children:e("textarea",{id:d,name:d,defaultValue:h,className:"w-full bg-inherit block rounded resize-none outline-none focus-visible:ring-2 p-10 text-sm",rows:2,onChange:m=>{const f={...a};f[d]=m.target.value,s(f)}})})]})},d)})})})}function qd(t){const{close:a}=Y(),{image:s,images:r}=t,[i,l]=_t(t.activeIndex,t.defaultActiveIndex,t.onActiveIndexChange),o=s||(r==null?void 0:r[i]);return e(ae,{size:"fullscreenTakeover",background:"bg-black/80",children:c(ie,{padding:"p-0",className:"w-full h-full",children:[e(M,{size:"lg",color:"paper",className:"absolute top-0 right-0 text-white z-20",onClick:()=>{a()},children:e(He,{})}),c("div",{className:"relative p-40 flex items-center justify-center w-full h-full",children:[r!=null&&r.length?e(M,{size:"lg",color:"white",variant:"flat",className:"absolute my-auto top-0 bottom-0 left-20",radius:"rounded",disabled:i<1,onClick:()=>{l(i-1)},children:e(Ia,{})}):null,e("img",{src:o,alt:"",className:"max-h-full w-auto shadow object-contain"}),r!=null&&r.length?e(M,{size:"lg",color:"white",variant:"flat",className:"absolute my-auto top-0 bottom-0 right-20",radius:"rounded",disabled:i+1===(r==null?void 0:r.length),onClick:()=>{l(i+1)},children:e(Gt,{})}):null]})]})})}function Bd(){var a;const t=Pt();return c("div",{className:"container mx-auto p-12 md:p-24",children:[e(Bt,{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(Ht,{isIndeterminate:!0}):e(Od,{defaultValues:((a=t.data)==null?void 0:a.client.ads)||{}})]})}function Od({defaultValues:t}){const{admin:{ads:a}}=u.exports.useContext(We),s=Q({defaultValues:{client:{ads:t}}}),r=_n(s);return c(ue,{form:s,onSubmit:i=>{r.mutate(i)},children:[a.map(i=>e(Hd,{adConfig:i},i.slot)),e(T,{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(y,{type:"submit",variant:"flat",color:"primary",disabled:r.isLoading,children:e(n,{message:"Save"})})]})}function Hd({adConfig:t}){const a=Ee();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(D,{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(qd,{image:t.image})]})]})}function Wd(){const t=it(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(Ie,{to:s.key,elementType:$a,children:e(n,{...s.label})},s.key))})}const Gd=[{key:"type",label:p("Type"),description:p("Type of the role"),defaultOperator:ne.ne,control:{type:le.Select,defaultValue:"01",options:[{key:"01",label:p("Sitewide"),value:"sitewide"},{key:"02",label:p("Workspace"),value:"workspace"}]}},ut({description:p("Date role was created")}),mt({description:p("Date role was last updated")})],jd=[{key:"name",allowsSorting:!0,visibleInMode:"all",header:()=>e(n,{message:"Role"}),body:t=>c("div",{children:[e("div",{children:e(n,{message:t.name})}),e("div",{className:"text-muted text-xs overflow-x-hidden overflow-ellipsis",children:t.description?e(n,{message:t.description}):void 0})]})},{key:"type",maxWidth:"max-w-100",allowsSorting:!0,header:()=>e(n,{message:"Type"}),body:t=>e(n,{message:t.type})},{key:"updated_at",maxWidth:"max-w-100",allowsSorting:!0,header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,visibleInMode:"all",align:"end",width:"w-42 flex-shrink-0",body:t=>e(Z,{to:`${t.id}/edit`,children:e(M,{size:"md",className:"text-muted",children:e(Ge,{})})})}];function Kd(){return e(Ke,{endpoint:"roles",title:e(n,{message:"Roles"}),columns:jd,filters:Gd,actions:e(Qd,{}),selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:kt,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(Fs,{endpoint:"roles/csv/export"}),e(nt,{elementType:Z,to:"new",children:e(n,{message:"Add new role"})})]})}const Tn=t=>`roles/${t}`;function Jd(t){return E.get(Tn(t)).then(a=>a.data)}function Zd(){const{roleId:t}=ve();return Oe([Tn(t)],()=>Jd(t))}const En=t=>`roles/${t}`;function Xd(){const{trans:t}=V(),a=_e();return B(s=>Yd(s),{onSuccess:s=>{O(t(p("Role updated"))),q.invalidateQueries([En(s.role.id)]),q.invalidateQueries(te("roles")),a("/admin/roles")},onError:s=>me(s)})}function Yd({id:t,...a}){return E.put(En(t),a).then(s=>s.data)}function Ln({isInternal:t=!1}){const{trans:a}=V(),{workspaces:s}=Pe(),{watch:r}=z(),i=r("type");return c(K,{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(p("Role description...")),rows:4,className:"mb-20"}),s.integrated&&c(G,{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(K,{children:[e(T,{name:"default",className:"mb-20",description:e(n,{message:"Assign this role to new users automatically."}),children:e(n,{message:"Default"})}),i==="sitewide"&&e(T,{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(Da,{name:"permissions",valueListKey:i==="sitewide"?"permissions":"workspacePermissions"})]})}function eu({onUserSelected:t}){var m;const{close:a}=Y(),[s,r]=u.exports.useState(""),{trans:i}=V(),l=Zr(Ta,{query:s,perPage:14}),o=((m=l.data)==null?void 0:m.results)||[],d=e(ya,{className:"pt-20",size:"sm",title:e(n,{message:"No matching users"}),description:e(n,{message:"Try another search query"}),image:e(xa,{src:kt})}),h=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(va,{}),placeholder:i(p("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(tu,{user:f,onUserSelected:h},f.id))})]})]})}function tu({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(Ns,{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 au(t){return B(({userIds:a})=>su({userIds:a,roleId:t.id}),{onSuccess:(a,s)=>{O(p("Removed [one 1 user|other :count users] from \u201C{role}\u201C",{values:{count:s.userIds.length,role:t.name}}))},onError:a=>me(a)})}function su({roleId:t,userIds:a}){return E.post(`roles/${t}/remove-users`,{userIds:a}).then(s=>s.data)}function nu(t){return B(({userIds:a})=>ru({userIds:a,roleId:t.id}),{onSuccess:(a,s)=>{O(p("Assigned [one 1 user|other :count users] to {role}",{values:{count:s.userIds.length,role:t.name}}))},onError:a=>me(a)})}function ru({roleId:t,userIds:a}){return E.post(`roles/${t}/add-users`,{userIds:a}).then(s=>s.data)}const Mn={key:"name",allowsSorting:!0,sortingKey:"email",header:()=>e(n,{message:"User"}),body:t=>e(ht,{image:t.avatar,label:t.display_name,description:t.email}),width:"col-w-3"},iu=[Mn,{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(ge,{date:t.created_at})}],lu=[Mn];function ou({role:t}){const a=Ee();return t.guests||t.type==="workspace"?e("div",{className:"pt-30 pb-10",children:e(Te,{image:kt,title:e(n,{message:"Users can't be assigned to this role"})})}):e(Ps,{endpoint:"users",columns:a?lu:iu,queryParams:{roleId:`${t.id}`},actions:e(cu,{role:t}),selectedActions:e(du,{role:t}),emptyStateMessage:e(Te,{image:kt,title:e(n,{message:"No users have been assigned to this role yet"}),filteringTitle:e(n,{message:"No matching users"})})})}function cu({role:t}){const a=nu(t);return c(D,{type:"modal",children:[e(y,{variant:"flat",color:"primary",disabled:a.isLoading,children:e(n,{message:"Assign user"})}),e(eu,{onUserSelected:s=>{a.mutate({userIds:[s.id]},{onSuccess:()=>{q.invalidateQueries(te("users",{roleId:`${t.id}`}))}})}})]})}function du({role:t}){const a=au(t),{selectedRows:s}=Ea();return c(D,{type:"modal",onClose:r=>{r&&a.mutate({userIds:s},{onSuccess:()=>{q.invalidateQueries(te("users",{roleId:`${t.id}`}))}})},children:[e(y,{variant:"flat",color:"danger",disabled:a.isLoading,children:e(n,{message:"Remove users"})}),e(Le,{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 uu(){const t=Zd();return t.status!=="success"?e(dt,{}):e(mu,{role:t.data.role})}function mu({role:t}){const a=Q({defaultValues:t}),s=Xd();return e(It,{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($n,{isLazy:!0,children:[c(Pn,{children:[e(Vt,{children:e(n,{message:"Settings"})}),e(Vt,{children:e(n,{message:"Users"})})]}),c(Fn,{className:"pt-20",children:[e(Ut,{children:e(Ln,{isInternal:t.internal})}),e(Ut,{children:e(ou,{role:t})})]})]})})}const hu="roles";function pu(t){const{trans:a}=V();return B(s=>gu(s),{onSuccess:()=>{O(a(p("Created new role"))),q.invalidateQueries(te("roles"))},onError:s=>be(s,t)})}function gu({id:t,...a}){return E.post(hu,a).then(s=>s.data)}function fu(){const t=Q({defaultValues:{type:"sitewide"}}),a=pu(t),s=_e();return e(It,{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(Ln,{})})}const bu=t=>[{key:"type",label:p("Type"),description:p("Type of the tag"),defaultOperator:ne.ne,control:{type:le.Select,defaultValue:t[0].name,options:t.map(a=>({key:a.name,label:p(a.name),value:a.name}))}},ut({description:p("Date tag was created")}),mt({description:p("Date tag was last updated")})],Dn=""+new URL("software-engineer.ba026106.svg",import.meta.url).href;function Rn({form:t,onSubmit:a,formId:s}){const{tags:{types:r}}=u.exports.useContext(We),i=t.watch("type"),l=!!r.find(o=>o.name===i&&o.system);return c(ue,{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(G,{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 vu(t){const{trans:a}=V();return B(s=>yu(s),{onSuccess:()=>{O(a(p("Tag created"))),q.invalidateQueries(te("tags"))},onError:s=>be(s,t)})}function yu(t){return E.post("tags",t).then(a=>a.data)}function xu(){const{close:t,formId:a}=Y(),{tags:{types:s}}=u.exports.useContext(We),r=Q({defaultValues:{type:s[0].name}}),i=vu(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Add new tag"})}),e(ie,{children:e(Rn,{formId:a,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{t()}})}})}),c(fe,{children:[e(y,{onClick:()=>{t()},children:e(n,{message:"Cancel"})}),e(y,{form:a,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}function wu(t){const{trans:a}=V();return B(s=>Su(s),{onSuccess:()=>{O(a(p("Tag updated"))),q.invalidateQueries(te("tags"))},onError:s=>be(s,t)})}function Su({id:t,...a}){return E.put(`tags/${t}`,a).then(s=>s.data)}function ku({tag:t}){const{close:a,formId:s}=Y(),r=Q({defaultValues:{id:t.id,name:t.name,display_name:t.display_name,type:t.type}}),i=wu(r);return c(ae,{children:[e(oe,{children:e(n,{message:"Update \u201C:name\u201C tag",values:{name:t.name}})}),e(ie,{children:e(Rn,{formId:s,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{a()}})}})}),c(fe,{children:[e(y,{onClick:()=>{a()},children:e(n,{message:"Cancel"})}),e(y,{form:s,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const Nu=[{key:"name",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e(n,{message:"Name"}),body:t=>t.name},{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},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:t=>c(D,{type:"modal",children:[e(M,{size:"md",className:"text-muted",children:e(Ge,{})}),e(ku,{tag:t})]})}];function Cu(){const{tags:t}=u.exports.useContext(We),a=u.exports.useMemo(()=>bu(t.types),[t.types]);return e(Ke,{endpoint:"tags",title:e(n,{message:"Tags"}),columns:Nu,filters:a,actions:e(_u,{}),selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:Dn,title:e(n,{message:"No tags have been created yet"}),filteringTitle:e(n,{message:"No matching tags"})})})}function _u(){return e(K,{children:c(D,{type:"modal",children:[e(nt,{children:e(n,{message:"Add new tag"})}),e(xu,{})]})})}const $u=u.exports.memo(({bytes:t})=>e(u.exports.Fragment,{children:ks(t)})),Pu=Ne(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"),Fu=""+new URL("upload.cabfc914.svg",import.meta.url).href,zu=[{key:"name",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e(n,{message:"Name"}),body:t=>c(u.exports.Fragment,{children:[e("div",{className:"overflow-x-hidden overflow-ellipsis",children:t.name}),e("div",{className:"text-muted text-xs overflow-x-hidden overflow-ellipsis",children:t.file_name})]})},{key:"owner_id",allowsSorting:!0,width:"flex-3 min-w-200",header:()=>e(n,{message:"Uploader"}),body:t=>{var s;const a=(s=t.users)==null?void 0:s[0];return a?e(ht,{image:a.avatar,label:a.display_name,description:a.email}):null}},{key:"type",width:"w-100 flex-shrink-0",allowsSorting:!0,header:()=>e(n,{message:"Type"}),body:t=>c("div",{className:"flex items-center gap-12",children:[e(kr,{type:t.type,className:"w-24 h-24 overflow-hidden"}),e("div",{className:"capitalize",children:t.type})]})},{key:"public",allowsSorting:!0,width:"w-60 flex-shrink-0",header:()=>e(n,{message:"Public"}),body:t=>t.public?e(ms,{className:"icon-md text-positive"}):e(He,{className:"icon-md text-danger"})},{key:"file_size",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e(n,{message:"File size"}),body:t=>e($u,{bytes:t.file_size})},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:t=>c(D,{type:"modal",children:[e(M,{size:"md",className:"text-muted",children:e(Pu,{})}),e(Yr,{entries:[t]})]})}];function Iu(){return e(Ke,{endpoint:"file-entries",title:e(n,{message:"Uploaded files and folders"}),columns:zu,filters:Xr,selectedActions:e(st,{}),emptyStateMessage:e(Te,{image:Fu,title:e(n,{message:"Nothing has been uploaded yet"}),filteringTitle:e(n,{message:"No matching files or folders"})})})}const Au=[{key:"ends_at",label:p("Status"),description:p("Whether subscription is active or cancelled"),defaultOperator:ne.eq,control:{type:le.Select,defaultValue:"active",options:[{key:"active",label:p("Active"),value:{value:null,operator:ne.eq}},{key:"cancelled",label:p("Cancelled"),value:{value:null,operator:ne.ne}}]}},{control:{type:le.Select,defaultValue:"stripe",options:[{key:"stripe",label:p("Stripe"),value:"stripe"},{key:"paypal",label:p("PayPal"),value:"paypal"},{key:"none",label:p("None"),value:"none"}]},key:"gateway_name",label:p("Gateway"),description:p("With which payment provider was subscription created"),defaultOperator:ne.eq},ei({key:"renews_at",label:p("Renew date"),description:p("Date subscription will renew")}),ut({description:p("Date subscription was created")}),mt({description:p("Date subscription was last updated")})],Tu=""+new URL("subscriptions.7eacea42.svg",import.meta.url).href;function Eu(t){const{trans:a}=V();return B(s=>Lu(s),{onSuccess:()=>{O(a(p("Subscription updated"))),q.invalidateQueries(te("billing/subscriptions"))},onError:s=>be(s,t)})}function Lu({id:t,...a}){return E.put(`billing/subscriptions/${t}`,a).then(s=>s.data)}function Vn({form:t,onSubmit:a,formId:s}){var o,d;const r=Nr(),i=t.watch("product_id"),l=(o=r.data)==null?void 0:o.products.find(h=>h.id===i);return c(ue,{id:s,form:t,onSubmit:a,children:[e(ti,{name:"user_id",className:"mb-20",modelType:Ta,label:e(n,{message:"User"}),openMenuOnFocus:!0}),e(G,{name:"product_id",selectionMode:"single",className:"mb-20",label:e(n,{message:"Plan"}),children:(d=r.data)==null?void 0:d.products.filter(h=>!h.free).map(h=>e(b,{value:h.id,children:e(n,{message:h.name})},h.id))}),!(l!=null&&l.free)&&e(G,{name:"price_id",selectionMode:"single",className:"mb-20",label:e(n,{message:"Price"}),children:l==null?void 0:l.prices.map(h=>e(b,{value:h.id,children:e(za,{price:h})},h.id))}),e(g,{inputElementType:"textarea",rows:3,name:"description",label:e(n,{message:"Description"}),className:"mb-20"}),e(la,{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(la,{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 Mu({subscription:t}){const{close:a,formId:s}=Y(),r=Q({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=Eu(r);return c(ae,{size:"md",children:[e(oe,{children:e(n,{message:"Update subscription"})}),e(ie,{children:e(Vn,{formId:s,form:r,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{a()}})}})}),c(fe,{children:[e(y,{onClick:()=>{a()},children:e(n,{message:"Cancel"})}),e(y,{form:s,disabled:i.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const Un="billing/subscriptions";function Du(t){const{trans:a}=V();return B(s=>Ru(s),{onSuccess:()=>{O(a(p("Subscription created"))),q.invalidateQueries(te(Un))},onError:s=>be(s,t)})}function Ru(t){return E.post(Un,t).then(a=>a.data)}function Vu(){const{close:t,formId:a}=Y(),s=Q({}),r=Du(s);return c(ae,{children:[e(oe,{children:e(n,{message:"Add new subscription"})}),e(ie,{children:e(Vn,{formId:a,form:s,onSubmit:i=>{r.mutate(i,{onSuccess:()=>{t()}})}})}),c(fe,{children:[e(y,{onClick:()=>{t()},children:e(n,{message:"Cancel"})}),e(y,{form:a,disabled:r.isLoading,variant:"flat",color:"primary",type:"submit",children:e(n,{message:"Save"})})]})]})}const Uu=Ne(e("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"PauseOutlined"),qu=Ne(e("path",{d:"M10 8.64 15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z"}),"PlayArrowOutlined"),Jt="billing/subscriptions",Bu=[{key:"usr_id",allowsSorting:!0,width:"flex-3 min-w-200",visibleInMode:"all",header:()=>e(n,{message:"Customer"}),body:t=>e(ht,{image:t.user.avatar,label:t.user.display_name,description:t.user.email})},{key:"status",width:"w-100 flex-shrink-0",header:()=>e(n,{message:"Status"}),body:t=>t.valid?e(ia,{size:"xs",color:"positive",radius:"rounded",className:"w-max",children:e(n,{message:"Active"})}):e(ia,{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}},{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(ge,{date:t.renews_at})},{key:"ends_at",allowsSorting:!0,header:()=>e(n,{message:"Ends at"}),body:t=>e(ge,{date:t.ends_at})},{key:"created_at",allowsSorting:!0,header:()=>e(n,{message:"Created at"}),body:t=>e(ge,{date:t.created_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),hideHeader:!0,align:"end",visibleInMode:"all",width:"w-128 flex-shrink-0",body:t=>e(Wu,{subscription:t})}];function Ou(){return e(Ke,{endpoint:Jt,title:e(n,{message:"Subscriptions"}),columns:Bu,filters:Au,actions:e(Hu,{}),enableSelection:!1,selectedActions:e(st,{}),queryParams:{with:"product"},emptyStateMessage:e(Te,{image:Tu,title:e(n,{message:"No subscriptions have been created yet"}),filteringTitle:e(n,{message:"No matching subscriptions"})})})}function Hu(){return e(K,{children:c(D,{type:"modal",children:[e(nt,{children:e(n,{message:"Add new subscription"})}),e(Vu,{})]})})}function Wu({subscription:t}){return c(u.exports.Fragment,{children:[c(D,{type:"modal",children:[e(M,{size:"md",className:"text-muted",children:e(Ge,{})}),e(Mu,{subscription:t})]}),t.cancelled?e(ju,{subscription:t}):e(Gu,{subscription:t}),e(Ku,{subscription:t})]})}function Gu({subscription:t}){const a=Cs(),s=()=>{a.mutate({subscriptionId:t.id},{onSuccess:()=>{q.invalidateQueries(te(Jt))}})};return c(D,{type:"modal",onClose:r=>{r&&s()},children:[e(Ae,{label:e(n,{message:"Cancel subscription"}),children:e(M,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(Uu,{})})}),e(Le,{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 ju({subscription:t}){const a=si(),s=()=>{a.mutate({subscriptionId:t.id},{onSuccess:()=>{q.invalidateQueries(te(Jt))}})};return c(D,{type:"modal",onClose:r=>{r&&s()},children:[e(Ae,{label:e(n,{message:"Renew subscription"}),children:e(M,{size:"md",className:"text-muted",onClick:s,disabled:a.isLoading,children:e(qu,{})})}),e(Le,{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 Ku({subscription:t}){const a=Cs(),s=()=>{a.mutate({subscriptionId:t.id,delete:!0},{onSuccess:()=>{q.invalidateQueries(te(Jt))}})};return c(D,{type:"modal",onClose:r=>{r&&s()},children:[e(Ae,{label:e(n,{message:"Delete subscription"}),children:e(M,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(He,{})})}),e(Le,{isDanger:!0,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=Ne(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 Ju(){const{trans:t}=V();return B(()=>Zu(),{onSuccess:()=>{O(t(p("Plans synced")))},onError:a=>me(a,p("Could not sync plans"))})}function Zu(){return E.post("billing/products/sync").then(t=>t.data)}const Xu=t=>`billing/products/${t}`;function Yu(){const{trans:t}=V();return B(a=>em(a),{onSuccess:()=>{O(t(p("Plan deleted"))),q.invalidateQueries(te("billing/products"))},onError:a=>me(a)})}function em({productId:t}){return E.delete(Xu(t)).then(a=>a.data)}const tm=[{key:"subscriptions",label:p("Subscriptions"),description:p("Whether plan has any active subscriptions"),defaultOperator:ne.eq,control:{type:le.Select,defaultValue:"01",options:[{key:"01",label:p("Has active subscriptions"),value:{value:"*",operator:ne.has}},{key:"02",label:p("Does not have active subscriptions"),value:{value:"*",operator:ne.doesntHave}}]}},ut({description:p("Date plan was created")}),mt({description:p("Date plan was last updated")})],am=[{key:"name",allowsSorting:!0,visibleInMode:"all",header:()=>e(n,{message:"Name"}),body:t=>{const a=t.prices[0];return e(ht,{label:t.name,description:t.free?e(n,{message:"Free"}):e(za,{price:a})})}},{key:"created_at",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e(n,{message:"Created"}),body:t=>e(ge,{date:t.created_at})},{key:"updated_at",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e(n,{message:"Last updated"}),body:t=>e(ge,{date:t.updated_at})},{key:"actions",header:()=>e(n,{message:"Actions"}),visibleInMode:"all",hideHeader:!0,align:"end",maxWidth:"max-w-84",body:t=>c(u.exports.Fragment,{children:[e(M,{size:"md",className:"text-muted",elementType:Z,to:`/admin/plans/${t.id}/edit`,children:e(Ge,{})}),e(nm,{product:t})]})}];function sm(){const t=_e();return e(Ke,{endpoint:"billing/products",title:e(n,{message:"Subscription plans"}),columns:am,actions:e(rm,{}),enableSelection:!1,filters:tm,onRowAction:a=>{t(`/admin/plans/${a.id}/edit`)},emptyStateMessage:e(Te,{image:Dn,title:e(n,{message:"No plans have been created yet"}),filteringTitle:e(n,{message:"No matching plans"})})})}function nm({product:t}){const a=Yu();return c(D,{type:"modal",onClose:s=>{s&&a.mutate({productId:t.id})},children:[e(Ae,{label:e(n,{message:"Delete plan"}),children:e(M,{size:"md",className:"text-muted",disabled:a.isLoading,children:e(Kt,{})})}),e(Le,{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 rm(){const t=Ju();return c(u.exports.Fragment,{children:[e(Ae,{label:e(n,{message:"Sync plans with Stripe & PayPal"}),children:e(M,{color:"primary",variant:"outline",radius:"rounded",size:"sm",disabled:t.isLoading,onClick:()=>{t.mutate()},children:e(Qu,{})})}),e(nt,{elementType:Z,to:"/admin/plans/new",children:e(n,{message:"Add new plan"})})]})}const qn=t=>`billing/products/${t}`;function im(){const{productId:t}=ve();return Oe([qn(t)],()=>lm(t))}function lm(t){return E.get(qn(t)).then(a=>a.data)}const ga=[{key:"day1",label:p("Daily"),interval:"day",interval_count:1},{key:"week1",label:p("Weekly"),interval:"week",interval_count:1},{key:"month1",label:p("Monthly"),interval:"month",interval_count:1},{key:"month3",label:p("Every 3 months"),interval:"month",interval_count:3},{key:"month6",label:p("Every 6 months"),interval:"month",interval_count:6},{key:"year1",label:p("Yearly"),interval:"year",interval_count:1},{key:"custom",label:p("Custom"),interval:null,interval_count:null}];function om({index:t,onRemovePrice:a}){const{trans:s}=V(),r=Fe(["currencies"]),i=u.exports.useMemo(()=>{var C;return(C=r.data)!=null&&C.currencies?Object.values(r.data.currencies):[]},[r.data]),{watch:l,getValues:o}=z(),d=!l("id"),h=l(`prices.${t}.id`)==null,m=l(`prices.${t}.subscriptions_count`)||0,[f,v]=u.exports.useState(()=>{const C=o(`prices.${t}.interval`),P=o(`prices.${t}.interval_count`),S=ga.find($=>$.key===`${C}${P}`);return S?S.key:"custom"}),N=d||h||!m;return c(u.exports.Fragment,{children:[!N&&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:!N,label:e(n,{message:"Amount"}),type:"number",min:.1,step:.01,name:`prices.${t}.amount`,className:"mb-20"}),e(G,{required:!0,disabled:!N,label:e(n,{message:"Currency"}),name:`prices.${t}.currency`,items:i,showSearchField:!0,searchPlaceholder:s(p("Search currencies")),selectionMode:"single",className:"mb-20",children:C=>e(b,{value:C.code,children:`${C.code}: ${C.name}`},C.code)}),e(cm,{disabled:!N,index:t,value:f,onValueChange:v}),f==="custom"&&e(dm,{disabled:!N,index:t}),e("div",{className:"text-right",children:e(y,{size:"xs",variant:"outline",color:"danger",disabled:!N,onClick:()=>{a()},children:e(n,{message:"Delete price"})})})]})}function cm({index:t,value:a,onValueChange:s,disabled:r}){const{setValue:i}=z();return e(qt,{label:e(n,{message:"Billing period"}),disabled:r,className:"mb-20",selectionMode:"single",selectedValue:a,onSelectionChange:l=>{if(s(l),l!=="custom"){const o=ga.find(d=>d.key===l);o&&(i(`prices.${t}.interval`,o.interval),i(`prices.${t}.interval_count`,o.interval_count))}},children:ga.map(l=>e(b,{value:l.key,children:e(n,{...l.label})},l.key))})}function dm({index:t,disabled:a}){const{watch:s}=z(),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(G,{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 Bn(){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(G,{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(wt,{className:"mb-30",name:"available_space",label:e(n,{message:"Allowed storage space"}),description:e(n,{values:{a:t=>e(Z,{className:Pa,target:"_blank",to:"/admin/settings/uploading",children:t})},message:"Total storage space all user uploads are allowed to take up."})}),e(T,{name:"recommended",className:"mb-20",description:e(n,{message:"Plan will be displayed more prominently on pricing page."}),children:e(n,{message:"Recommend"})}),e(T,{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(T,{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(fa,{children:e(n,{message:"Feature list"})}),e(um,{}),e(mm,{}),e(fa,{children:e(n,{message:"Permissions"})}),e(Da,{name:"permissions"})]})}function fa({children:t}){return e("h2",{className:"mt-40 mb-20 text-base font-semibold",children:t})}function um(){const{fields:t,append:a,remove:s}=Ce({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(M,{size:"sm",color:"primary",className:"flex-shrink-0",onClick:()=>{s(i)},children:e(He,{})})]},r.id)),e(y,{variant:"text",color:"primary",startIcon:e(ke,{}),size:"xs",onClick:()=>{a({value:""})},children:e(n,{message:"Add another line"})})]})}function mm(){var l;const{watch:t,formState:{errors:a}}=z(),{fields:s,append:r,remove:i}=Ce({name:"prices",keyName:"key"});return t("free")?null:c(u.exports.Fragment,{children:[e(fa,{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(je,{variant:"outline",className:"mb-10",children:s.map((o,d)=>e(Se,{label:e(za,{price:o}),children:e(om,{index:d,onRemovePrice:()=>{i(d)}})},o.key))}),e(y,{variant:"text",color:"primary",startIcon:e(ke,{}),size:"xs",onClick:()=>{r({currency:"USD",amount:1,interval_count:1,interval:"month"})},children:e(n,{message:"Add another price"})})]})}const On=t=>`billing/products/${t}`;function hm(t){const{trans:a}=V(),s=_e();return B(r=>pm(r),{onSuccess:r=>{O(a(p("Plan updated"))),q.invalidateQueries([On(r.product.id)]),q.invalidateQueries(te("billing/products")),s("/admin/plans")},onError:r=>be(r,t)})}function pm({id:t,...a}){const s={...a,feature_list:a.feature_list.map(r=>r.value)};return E.put(On(t),s).then(r=>r.data)}function gm(){const t=im();return t.status!=="success"?e(dt,{}):e(fm,{product:t.data.product})}function fm({product:t}){const a=Q({defaultValues:{...t,feature_list:t.feature_list.map(r=>({value:r}))}}),s=hm(a);return e(It,{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(Bn,{})})}const Hn="billing/products";function bm(t){const{trans:a}=V(),s=_e();return B(r=>vm(r),{onSuccess:()=>{O(a(p("Plan created"))),q.invalidateQueries([Hn]),q.invalidateQueries(te("billing/products")),s("/admin/plans")},onError:r=>be(r,t)})}function vm(t){const a={...t,feature_list:t.feature_list.map(s=>s.value)};return E.post(Hn,a).then(s=>s.data)}function ym(){const t=Q({defaultValues:{free:!1,recommended:!1}}),a=bm(t);return e(It,{form:t,onSubmit:s=>{a.mutate(s)},title:e(n,{message:"Create new plan"}),isLoading:a.isLoading,children:e(Bn,{})})}function xm(){return c(ye,{title:e(n,{message:"GDPR"}),description:e(n,{message:"Configure settings related to EU General Data Protection Regulation."}),children:[e(wm,{}),e(Re,{}),e(Sm,{})]})}function wm(){const{watch:t}=z(),a=t("client.cookie_notice.enable");return c("div",{children:[e(T,{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(ot,{hideRoleAndPermissionFields:!0,formPathPrefix:"client.cookie_notice.button"})]}),c(G,{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 Sm(){const{fields:t,append:a,remove:s}=Ce({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(je,{className:"mt-16",variant:"outline",children:t.map((r,i)=>e(Se,{label:r.label,chevronPosition:"left",endAppend:e(M,{radius:"rounded",variant:"text",color:"danger",size:"sm",onClick:()=>{s(i)},children:e(He,{})}),children:e(ot,{hideRoleAndPermissionFields:!0,formPathPrefix:`client.register_policies.${i}`})},r.id))}),c(D,{type:"modal",onClose:r=>{r&&a(r)},children:[e(y,{className:"mt-12",variant:"link",color:"primary",startIcon:e(ke,{}),size:"xs",children:e(n,{message:"Add another policy"})}),e(Nn,{title:e(n,{message:"Add policy"})})]})]})}const km=[],Nm=W.lazy(()=>Ot(()=>import("./admin-report-page.85e8c7b3.js"),["./admin-report-page.85e8c7b3.js","./main.fcd554a6.js","./main.e8a562e5.css","./TrendingUp.90fad761.js","./file-entry-index-filters.398da9db.js","./Edit.5be662f9.js","./ArrowBack.953d9159.js","./use-resume-subscription.c9b7d602.js"],import.meta.url)),Cm=[{path:"appearance",element:e(ee,{permission:"appearance.update",children:e(Yl,{})}),children:[{index:!0,element:e(Wd,{})},{path:"general",element:e(So,{})},{path:"seo-settings",element:e($o,{})},{path:"custom-code",element:e(Io,{})},{path:"themes",element:e(_o,{})},{path:"themes/:themeIndex",element:e(cc,{})},{path:"menus",element:e(so,{})},{path:"menus/:menuIndex",element:e(po,{})},{path:"menus/:menuIndex/items/:menuItemIndex",element:e(yo,{})},...Object.values(Sn.sections).flatMap(t=>t.routes||[])]},{path:"/",element:e(ri,{}),children:[...km,{path:"/",element:e(W.Suspense,{fallback:e(dt,{}),children:e(Nm,{})})},{path:"users",element:e(ee,{permission:"users.update",children:e(Ai,{})})},{path:"users/new",element:e(ee,{permission:"users.update",children:e(kd,{})})},{path:"users/:userId/edit",element:e(ee,{permission:"users.update",children:e(yd,{})})},{path:"roles",element:e(ee,{permission:"roles.update",children:e(Kd,{})})},{path:"roles/new",element:e(ee,{permission:"roles.update",children:e(fu,{})})},{path:"roles/:roleId/edit",element:e(ee,{permission:"roles.update",children:e(uu,{})})},{path:"subscriptions",element:e(ee,{permission:"subscriptions.update",children:e(Ou,{})})},{path:"plans",element:e(ee,{permission:"plans.update",children:e(sm,{})})},{path:"plans/new",element:e(ee,{permission:"plans.update",children:e(ym,{})})},{path:"plans/:productId/edit",element:e(ee,{permission:"plans.update",children:e(gm,{})})},{path:"custom-pages",element:e(ee,{permission:"custom_pages.update",children:e(Lo,{})})},{path:"custom-pages/new",element:e(ee,{permission:"custom_pages.update",children:e(ns,{})})},{path:"custom-pages/:pageId/edit",element:e(ee,{permission:"custom_pages.update",children:e(ns,{})})},{path:"tags",element:e(ee,{permission:"tags.update",children:e(Cu,{})})},{path:"localizations",element:e(ee,{permission:"localizations.update",children:e(Ed,{})})},{path:"localizations/:localeId/translate",element:e(Dd,{})},{path:"files",element:e(ee,{permission:"files.update",children:e(Iu,{})})},{path:"ads",element:e(ee,{permission:"settings.update",children:e(Bd,{})})},{path:"settings",element:e(ee,{permission:"settings.update",children:e(qo,{})}),children:[{index:!0,element:e(xs,{to:"general",replace:!0})},{path:"general",element:e(Zo,{})},{path:"subscriptions",element:e(gc,{})},{path:"localization",element:e(vc,{})},{path:"authentication",element:e(yc,{})},{path:"uploading",element:e(Mc,{})},{path:"mail",element:e(Xc,{})},{path:"cache",element:e(ad,{})},{path:"analytics",element:e(pd,{})},{path:"logging",element:e(rd,{})},{path:"queue",element:e(ld,{})},{path:"recaptcha",element:e(dd,{})},{path:"gdpr",element:e(xm,{})},...mc]}]},{path:"*",element:e(_r,{})}];function _m(){return Cr(Cm)}const Im=Object.freeze(Object.defineProperty({__proto__:null,default:_m},Symbol.toStringTag,{value:"Module"}));export{Fo as A,vn as C,te as D,$u as F,Uu as P,lc as R,Qu as S,Nd as T,Pu as V,ro as a,hi as b,zs as c,qu as d,nc as e,Im as f,aa as i,sc as t,vd as u}; //# sourceMappingURL=admin-routes.80e2a08a.js.map