1 line
9.2 KiB
JavaScript
1 line
9.2 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[242],{21147:function(e,l,t){"use strict";t.d(l,{Z:function(){return f}});var s=t(85893),a=t(5606),i=t(67294),r=t(86609),n=t(60705),c=t(94655),o=t(98388),d=t(61258),u=t(94495);function m(e){let{excludeRegexMatch:l,linkProps:t,currentLinkProps:a,dividerProps:m,backButton:x,backButtonProps:p,pageUrl:g,currentTitle:f,skipHome:j,divider:v}=e,[w,b]=i.useState(g?h({url:g,skipHome:j}):null);return(i.useEffect(()=>{if(!w)return b(h({url:window.location.pathname,excludeRegexMatch:l,skipHome:j})),function(){b(null)}},[]),null==w?void 0:w[1])?(0,s.jsx)("nav",{className:(0,o.m6)("overflow-x-auto","twui-current-breadcrumb-wrapper"),"aria-label":"Breadcrumb",children:(0,s.jsxs)(c.Z,{className:(0,o.m6)("gap-4 flex-nowrap whitespace-nowrap overflow-x-auto overflow-y-hidden w-full"),children:[x&&(0,s.jsxs)(i.Fragment,{children:[(0,s.jsx)(u.Z,{variant:"ghost",color:"gray",...p,className:(0,o.m6)("p-1 -my-2 -mx-2","twui-breadcrumbs-back-button",null==p?void 0:p.className),onClick:e=>{var l;window.history.back(),null==p||null===(l=p.onClick)||void 0===l||l.call(p,e)},title:"Breadcrumbs Back Button",beforeIcon:(0,s.jsx)(d.Z,{size:20})}),v||(0,s.jsx)(n.Z,{vertical:!0,className:(0,o.m6)("twui-breadcrumbs-divider",null==m?void 0:m.className)})]}),w.map((e,l,c)=>{let d=c.length-1==l;return l===w.length-1?(0,s.jsx)(r.Z,{href:e.path,...t,...d?a:{},className:(0,o.m6)("text-primary-text/50 dark:text-primary-dark-text/50 text-xs","max-w-[200px] text-ellipsis overflow-hidden",d?"current":"","twui-breadcrumb-link",null==t?void 0:t.className,d&&(null==a?void 0:a.className)),title:(null==a?void 0:a.title)||e.title,children:f||e.title},l):(0,s.jsxs)(i.Fragment,{children:[(0,s.jsx)(r.Z,{href:e.path,...t,...d?a:{},className:(0,o.m6)("text-xs",d?"current":"","twui-breadcrumb-link",null==t?void 0:t.className,d&&(null==a?void 0:a.className)),children:(null==a?void 0:a.title)||e.title}),v||(0,s.jsx)(n.Z,{vertical:!0,...m,className:(0,o.m6)("twui-breadcrumbs-divider",null==m?void 0:m.className)})]},l)})]})}):(0,s.jsx)(i.Fragment,{})}function h(e){let{url:l,excludeRegexMatch:t,skipHome:s}=e,a=l.split("/"),i=[];return s||i.push({title:"Home",path:l.match(/admin/)?"/admin":"/"}),a.forEach((e,l,s)=>{(null==e?void 0:e.match(/./))&&!(t&&t.test(e))&&i.push({title:e.replace(/_|-/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),path:(()=>{let e="";for(let t=0;t<s.length;t++){let a=s[t];!(t>l)&&a.match(/./)&&(e+="/".concat(a))}return e})()})}),i}function x(e){let{...l}=e;return(0,s.jsx)("h1",{...l,className:(0,o.m6)("text-4xl md:text-5xl mb-4","twui-headings twui-heading","twui-h1",l.className),children:l.children})}var p=t(3668),g=t(60);function f(e){let{title:l,ctas:t,description:r}=e,{pageProps:n}=(0,i.useContext)(a.AppContext);return(0,s.jsxs)(c.Z,{className:"w-full grid-cell-content justify-between flex-nowrap items-start",children:[(0,s.jsxs)(g.Z,{className:"gap-2",children:[(0,s.jsx)(x,{className:"admin-h1",children:l}),r?(0,s.jsx)(p.Z,{variant:"faded",children:r}):null,(0,s.jsx)(m,{pageUrl:n.pageUrl||void 0,skipHome:!0,backButton:!0})]}),(0,s.jsx)(c.Z,{children:t})]})}},53151:function(e,l,t){"use strict";t.d(l,{Z:function(){return d}});var s=t(85893),a=t(25808),i=t(96486),r=t.n(i),n=t(67294),c=t(98388);function o(e){let{imgErrSrc:l,imgErrComp:t,imgErrSrcDark:a,imgErrSrcLight:i,...o}=e,d=o.size||o.width,u=o.size||o.height,[m,h]=n.useState(!1),x={...r().omit(o,["size","circle","bgImg","backgroundImage","fallbackImageSrc","srcLight","srcDark"]),width:d,height:u,className:(0,c.m6)("object-cover",o.circle&&"rounded-full",o.bgImg||o.backgroundImage?"absolute top-0 left-0 w-full h-full object-cover z-0":"","twui-img",o.className),onError:e=>{var l;o.fallbackImageSrc&&(e.currentTarget.src=o.fallbackImageSrc),null===(l=o.onError)||void 0===l||l.call(o,e)},style:{...o.size?{width:"".concat(o.size,"px"),minWidth:"".concat(o.size,"px"),height:"".concat(o.size,"px")}:{},...o.style}};return m?t||(0,s.jsx)("img",{loading:"lazy",...x,src:l||"https://static.datasquirel.com/images/user-images/user-2/castcord-image-preset_thumbnail.jpg"}):o.srcDark&&o.srcLight?(0,s.jsxs)(n.Fragment,{children:[(0,s.jsx)("img",{loading:"lazy",...x,className:(0,c.m6)("hidden dark:block",x.className),src:o.srcDark,onError:e=>{var l;h(!0),null===(l=o.onError)||void 0===l||l.call(o,e)}}),(0,s.jsx)("img",{loading:"lazy",...x,className:(0,c.m6)("block dark:hidden",x.className),src:o.srcLight,onError:e=>{var l;h(!0),null===(l=o.onError)||void 0===l||l.call(o,e)}})]}):(0,s.jsx)("img",{...x,onError:e=>{var l;h(!0),null===(l=o.onError)||void 0===l||l.call(o,e)}})}function d(e){let{image_url:l,image_size:t=35,title:i}=e,{loading:r,setLoading:n}=(0,a.Z)();return l?(0,s.jsx)(o,{circle:!0,size:t,src:l,alt:i||"Avatar"}):(0,s.jsx)("div",{className:(0,c.m6)("bg-slate-100 dark:bg-white/10 rounded-full",""),style:{width:"".concat(t,"px"),height:"".concat(t,"px")}})}},89350:function(e,l,t){"use strict";t.d(l,{Z:function(){return y}});var s=t(85893),a=t(67294),i=t(98388),r=t(86609),n=t(94655),c=t(59123);t(6531);var o=t(60),d=t(94495),u=t(60705);function m(e){let{links:l,linkProps:t,buttonProps:c,divider:o,dividerComponent:m,linkType:h,...x}=e,p=a.useRef(null);return a.useEffect(()=>{!function(e){let{selector:l,wrapperEl:t}=e;(t||document).querySelectorAll(l||"a").forEach(e=>{let l=e.dataset.strict,t=e.getAttribute("href");"/"===window.location.pathname&&"/"==t?e.classList.add("active"):l&&e.getAttribute("href")===window.location.pathname?e.classList.add("active"):t&&window.location.pathname.startsWith(t)&&!l&&e.classList.add("active")})}({wrapperEl:p.current||void 0,selector:"a"})},[]),(0,s.jsx)("div",{ref:p,...x,className:(0,i.m6)("flex flex-row items-center gap-1","twui-link-list",x.className),children:l.flat().filter(e=>!!e).map((e,x)=>{var p;if(!e)return null;if(e.divider)return(0,s.jsx)(a.Fragment,{children:e.divider},x);let g=x<l.length-1&&(m||(o?(0,s.jsx)(u.Z,{}):void 0));return"button"==h||"button"==e.linkType?(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(d.Z,{title:e.title||"Link Button",variant:"ghost",...c,...e.buttonProps,className:(0,i.m6)("p-2 cursor-pointer whitespace-nowrap",null==t?void 0:t.className),onClick:l=>{var t,s,a;null===(t=e.onClick)||void 0===t||t.call(e,l),null===(a=e.buttonProps)||void 0===a||null===(s=a.onClick)||void 0===s||s.call(a,l)},children:(0,s.jsxs)(n.Z,{children:[e.icon,e.component||e.title]})}),g]},x):(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(r.Z,{href:e.url,title:e.title,...t,...e.linkProps,className:(0,i.m6)("p-2 cursor-pointer whitespace-nowrap",null==t?void 0:t.className,null===(p=e.linkProps)||void 0===p?void 0:p.className),strict:e.strict,onClick:l=>{var t,s,a;null===(t=e.onClick)||void 0===t||t.call(e,l),null===(a=e.linkProps)||void 0===a||null===(s=a.onClick)||void 0===s||s.call(a,l)},children:(0,s.jsxs)(n.Z,{children:[e.iconPosition&&"before"!=e.iconPosition?null:e.icon,e.component||e.title,"after"==e.iconPosition?e.icon:null]})}),g]},x)})})}var h=t(80600);let x=[{title:"Dashboard",url:"/admin",strict:!0},{title:"Services",url:"/admin/services"},{title:"Users",url:"/admin/users"},{title:"Settings",url:"/admin/settings"}];var p=t(51833),g=t(53151),f=t(5606),j=t(36969),v=t(84681),w=t(3668);function b(){let{pageProps:e}=(0,a.useContext)(f.AppContext),{user:l}=e;return(0,s.jsx)(c.Z,{target:(0,s.jsxs)(n.Z,{className:"-my-2",children:[(0,s.jsx)(g.Z,{image_url:l.image_thumbnail,title:"".concat(l.first_name," Image")}),(0,s.jsx)(w.Z,{children:l.first_name}),(0,s.jsx)(j.Z,{name:"ChevronDown",size:17})]}),position:"bottom-right",children:(0,s.jsx)(v.Z,{className:"mt-3 min-w-[200px]",children:(0,s.jsx)(m,{links:[{title:"Dashboard",url:"/admin"},{title:"Settings",url:"/admin/settings"},{component:(0,s.jsx)(u.Z,{})},{title:"Logout",url:"/auth/logout"}],className:"flex-col items-stretch w-full"})})})}function N(e){let{children:l}=e;return(0,s.jsx)("header",{className:"col-span-6",children:(0,s.jsxs)(n.Z,{className:"w-full grid grid-cols-6 grid-frame nested-grid-frame",children:[(0,s.jsx)(n.Z,{className:"h-full items-stretch grid-cell col-span-3 xl:col-span-1 w-full justify-between",children:(0,s.jsx)(n.Z,{className:"px-4",children:(0,s.jsx)(p.Z,{})})}),(0,s.jsx)(n.Z,{className:"grid-cell col-span-4 hidden xl:block"}),(0,s.jsx)(n.Z,{className:"grid-cell col-span-3 xl:col-span-1",children:(0,s.jsx)(n.Z,{className:"p-4 w-full justify-end",children:(0,s.jsx)(b,{})})})]})})}var k=t(9008),Z=t.n(k);function y(e){let{children:l}=e;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsxs)(Z(),{children:[(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js"}),(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js"})]}),(0,s.jsx)(h.Z,{className:"w-screen h-screen overflow-hidden p-4 lg:p-10",id:"admin-main",children:(0,s.jsxs)("div",{className:"grid-frame grid-cols-6 w-full h-full grid-rows-[64px_47px] xl:grid-rows-[64px_auto]",children:[(0,s.jsx)(N,{}),(0,s.jsx)(o.Z,{className:"grid-cell col-span-6 xl:col-span-1 gap-0",children:(0,s.jsx)(m,{links:x,className:"w-full xl:flex-col",linkProps:{className:"turboci-admin-aside-link"}})}),(0,s.jsxs)(o.Z,{className:(0,i.m6)("grid-cell col-span-6 xl:col-span-5 gap-0","overflow-auto pb-[200px]"),children:[l,(0,s.jsx)("div",{className:"h-[400px] w-full block",style:{height:"400px"}})]})]})})]})}},9008:function(e,l,t){e.exports=t(23867)}}]); |