diff --git a/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs b/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs index f8ce0f9..b32389c 100644 --- a/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs +++ b/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs @@ -1,4 +1,4 @@ -var ho=Object.defineProperty,go=(e,l,t)=>l in e?ho(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Le=(e,l,t)=>(go(e,"symbol"!=typeof l?l+"":l,t),t);import{defineComponent as de,computed as v,openBlock as o,createElementBlock as i,normalizeClass as h,createElementVNode as l,createCommentVNode as x,renderSlot as U,ref as D,toDisplayString as O,inject as Qe,nextTick as St,isRef as nn,unref as W,mergeProps as Te,withModifiers as Ue,h as $t,resolveComponent as K,createBlock as ae,withCtx as xe,useAttrs as yo,createVNode as ye,createTextVNode as ke,watchEffect as ws,normalizeStyle as ol,Fragment as Me,renderList as je,withDirectives as Mt,vModelCheckbox as al,withKeys as on,createStaticVNode as xs,vModelSelect as bo,useSlots as Ls,getCurrentInstance as Be,onMounted as Ye,createSlots as rl,normalizeProps as Et,guardReactiveProps as ks,vModelDynamic as wo,onUnmounted as Ft,watch as bt,vModelText as ko,resolveDynamicComponent as an,provide as ss,resolveDirective as _o}from"vue";import{errorResponseExcept as $o,toDate as pt,toTime as Co,omit as ft,enc as Zs,appendQueryString as zt,lastLeftPart as rn,setQueryString as xo,nameOf as Lo,ApiResult as Xe,lastRightPart as At,leftPart as Vs,map as Ze,toDateTime as Vo,toCamelCase as So,mapGet as _e,chop as Mo,fromXsdDuration as un,isDate as Ss,timeFmt12 as Ao,dateFmt as To,apiValue as Fo,indexOfAny as Io,createBus as jo,toKebabCase as Wl,sanitize as Oo,humanize as Pe,delaySet as dn,rightPart as ms,queryString as Ws,combinePaths as Do,toPascalCase as at,errorResponse as mt,trimEnd as Po,$1 as _s,ResponseStatus as qs,ResponseError as Gl,HttpMethods as il,omitEmpty as Bo,uniqueKeys as Gs,humanify as cn,each as Ho}from"@servicestack/client";let Ro={class:"flex items-center"},Eo={key:0,class:"flex-shrink-0 mr-3"},zo={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},No=l("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),Uo=[No],qo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Qo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1),Ko=[Qo],Zo={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Wo=l("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1),Go=[Wo],Jo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Xo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1),Yo=[Xo],ea=de({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(e){let t=e,a=v(()=>"info"==t.type?"bg-blue-50 dark:bg-blue-200":"error"==t.type?"bg-red-50 dark:bg-red-200":"success"==t.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),n=v(()=>"info"==t.type?"border-blue-400":"error"==t.type?"border-red-400":"success"==t.type?"border-green-400":"border-yellow-400"),r=v(()=>"info"==t.type?"text-blue-700":"error"==t.type?"text-red-700":"success"==t.type?"text-green-700":"text-yellow-700");return(e,t)=>(o(),i("div",{class:h([a.value,n.value,"border-l-4 p-4"])},[l("div",Ro,[e.hideIcon?x("",!0):(o(),i("div",Eo,["warn"==e.type?(o(),i("svg",zo,Uo)):"error"==e.type?(o(),i("svg",qo,Ko)):"info"==e.type?(o(),i("svg",Zo,Go)):"success"==e.type?(o(),i("svg",Jo,Yo)):x("",!0)])),l("div",null,[l("p",{class:h([r.value,"text-sm"])},[U(e.$slots,"default")],2)])])],2))}}),ta={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},sa={class:"flex"},la=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),na={class:"ml-3"},oa={class:"text-sm font-medium text-green-800"},aa={key:0},ra={class:"ml-auto pl-3"},ia={class:"-mx-1.5 -my-1.5"},ua=l("span",{class:"sr-only"},"Dismiss",-1),da=l("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),ca=[ua,da],fa=de({__name:"AlertSuccess",props:{message:{}},setup(e){let a=D(!1);return(e,t)=>a.value?x("",!0):(o(),i("div",ta,[l("div",sa,[la,l("div",na,[l("h3",oa,[e.message?(o(),i("span",aa,O(e.message),1)):U(e.$slots,"default",{key:1})])]),l("div",ra,[l("div",ia,[l("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>a.value=!0)},ca)])])])]))}}),va={class:"flex"},pa=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),ma={class:"ml-3"},ha={class:"text-sm text-red-700 dark:text-red-200"},ga=de({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,a=Qe("ApiState",void 0),n=v(()=>t.status||null!=a&&a.error.value?$o.call({responseStatus:t.status??(null==a?void 0:a.error.value)},t.except??[]):null);return(e,t)=>n.value?(o(),i("div",{key:0,class:h("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[l("div",va,[pa,l("div",ma,[l("p",ha,O(n.value),1)])])],2)):x("",!0)}}),ya=["id","aria-describedby"],ba=de({__name:"InputDescription",props:{id:{},description:{}},setup(e){return(e,t)=>e.description?(o(),i("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:e.id+"-description","aria-describedby":e.id+"-description"},[l("div",null,O(e.description),1)],8,ya)):x("",!0)}});function Ms(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,10)??""}function fn(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,19)??""}function vn(e){return null==e?"":Co(e)}function pn(e,l){var t,a;return G.config.inputValue?G.config.inputValue(e,l):(t=typeof(a="date"===e?Ms(l):"datetime-local"===e?fn(l):"time"===e?vn(l):l),null==a?"":"boolean"==t||"number"==t?""+a:a)}function mn(e,l){e.value=null,St(()=>e.value=l)}function Dt(t){return Object.keys(t).forEach(e=>{var l=t[e];t[e]=nn(l)?W(l):l}),t}function yt(e,l,t){t?(l.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>l.value=e.entering.cls+" "+e.entering.to,0)):(l.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>l.value=e.leaving.cls+" "+e.leaving.to,0))}function hs(t){if(!("u"0":"<"+e+Js(t)+`>${l||""}`}function Js(t){return Object.keys(t).reduce((e,l)=>`${e} ${l}="${Zs(t[l])}"`,"")}function As(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Ht(e){return Vl(e)}let wa=["string","number","boolean","null","undefined"];function Tt(e){return 0<=wa.indexOf(typeof e)||e instanceof Date}function Rt(e){return!Tt(e)}class hn{get length(){return"u"",";"].some(e=>l.includes(e)))throw new Error(`Unsafe script: '${l}'`);var t=Object.assign(Object.keys(globalThis).reduce((e,l)=>(e[l]=void 0,e),{}),e);return new Function("with(this) { return ("+l+") }").call(t)}function Xs(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function cl(e){var l=G.config.storage.getItem(e);return l?JSON.parse(l):null}function Ts(e,l){return zt("swr."+Lo(e),l?Object.assign({},e,l):e)}function ka(e){var l;e.request&&(l=Ts(e.request,e.args),G.config.storage.removeItem(l))}async function gn(e,l,t,a,n){var r,s=Ts(l,a),o=(t(new Xe({response:cl(s)})),await e.api(l,a,n));return o.succeeded&&o.response&&(o.response._date=(new Date).valueOf(),r=JSON.stringify(o.response),G.config.storage.setItem(s,r),t(o)),o}function yn(l,t){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{l(...e)},t||100)}}function Ct(e){return"string"==typeof e?e.split(","):e||[]}function Vt(e,l){let t=Ct(l);return e.reduce((e,l)=>(e[l]=!t.includes(l),e),{})}function bn(){return{LocalStore:hn,dateInputFormat:Ms,dateTimeInputFormat:fn,timeInputFormat:vn,textInputValue:pn,setRef:mn,unRefs:Dt,transition:yt,focusNextElement:hs,getTypeName:Qt,htmlTag:dt,htmlAttrs:Js,linkAttrs:As,toAppUrl:Ht,isPrimitive:Tt,isComplexType:Rt,pushState:ul,scopedExpr:dl,copyText:Xs,fromCache:cl,swrCacheKey:Ts,swrClear:ka,swrApi:gn,asStrings:Ct,asOptions:Vt,createDebounce:yn}}let wn="png,jpg,jpeg,jfif,gif,svg,webp".split(","),kn={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},Jl=Object.keys(kn),vt=(e,l)=>``,gs={img:vt("4 4 16 16",""),vid:vt("0 0 24 24",""),aud:vt("0 0 24 24",""),ppt:vt("0 0 48 48",""),xls:vt("0 0 256 256",""),doc:vt("0 0 32 32",""),zip:vt("0 0 16 16",""),exe:vt("0 0 16 16",""),att:vt("0 0 24 24","")},_a=/[\r\n%#()<>?[\\\]^`{|}]/g,Xl=1024,$a=["Bytes","KB","MB","GB","TB"],Ca=(()=>{let l="application/",e=l+"vnd.openxmlformats-officedocument.",t="image/",a="text/",n="video/",r={jpg:t+"jpeg",tif:t+"tiff",svg:t+"svg+xml",ico:t+"x-icon",ts:a+"typescript",py:a+"x-python",sh:a+"x-sh",mp3:"audio/mpeg3",mpg:n+"mpeg",ogv:n+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:l+"vnd.ms-access"};function s(e,l){e.split(",").forEach(e=>r[e]=l)}function o(e,l){e.split(",").forEach(e=>r[e]=l(e))}return o("jpeg,gif,png,tiff,bmp,webp",e=>t+e),o("jsx,csv,css",e=>a+e),o("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>"audio/"+e),o("3gpp,avi,dv,divx,ogg,mp4,webm",e=>n+e),o("rtf,pdf",e=>l+e),s("htm,html,shtm",a+"html"),s("js,mjs,cjs",a+"javascript"),s("yml,yaml",l+"yaml"),s("bat,cmd",l+"bat"),s("xml,csproj,fsproj,vbproj",a+"xml"),s("txt,ps1",a+"plain"),s("qt,mov",n+"quicktime"),s("doc,dot",l+"msword"),s("xls,xlt,xla",l+"excel"),s("ppt,oit,pps,ppa",l+"vnd.ms-powerpoint"),s("cer,crt,der",l+"x-x509-ca-cert"),s("gz,tgz,zip,rar,lzh,z",l+"x-compressed"),s("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",l+"octet-stream"),r})(),Ys=[];function _n(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+<")).replace(/\s{2,}/g," ")).replace(_a,encodeURIComponent)}function fl(e){return"data:image/svg+xml;utf8,"+_n(e)}function $n(e){var l=URL.createObjectURL(e);return Ys.push(l),l}function Cn(){Ys.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Ys=[]}function vl(e){var l;return e?(l=Vs(e,"?"),At(l,"/")):null}function ls(e){var l=vl(e);return null==l||-1===l.indexOf(".")?null:At(l,".").toLowerCase()}function pl(e){var l=ls(e.name);return l&&0<=wn.indexOf(l)?$n(e):xt(e.name)}function ml(e){var l;return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(l=ls(e))&&0<=wn.indexOf(l))||!1}function xt(e){var l;return e?null==(l=ls(e))||ml(e)?e:Xt(l)||fl(gs.doc):null}function Xt(e){var l=xn(e);return l&&fl(l)||null}function xn(e){if(gs[e])return gs[e];for(let t=0;t({fileName:e.name,contentLength:e.size,filePath:pl(e)}))}function Fs(e,l){e.onerror=null,e.src=gl(e.src,l)||""}function gl(e,l){return Xt(At(e,".").toLowerCase())||(l?Xt(l)||l:null)||Xt("doc")}function el(e){var l;if(e)return l=At(e,".").toLowerCase(),Ca[l]||"application/"+l;throw new Error("fileNameOrExt required")}function La(){return{extSvg:xn,extSrc:Xt,getExt:ls,encodeSvg:_n,canPreview:ml,getFileName:vl,getMimeType:el,formatBytes:hl,filePathUri:xt,svgToDataUri:fl,fileImageUri:pl,objectUrl:$n,flush:Cn,inputFiles:xa,iconOnError:Fs,iconFallbackSrc:gl}}class Va{constructor(e){Le(this,"view"),Le(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}let Nt="/metadata/app.json",Sa={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},Ma={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},tl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},Aa=([...Object.keys(tl),...Object.values(tl)],{String:"string",Boolean:"bool",...tl});function fs(e){return Aa[e]||e}function Ln(e,l){return e?(l=l||[],"Nullable`1"===e?fs(l[0])+"?":e.endsWith("[]")?`List<${fs(e.substring(0,e.length-2))}>`:0===l.length?fs(e):Vs(fs(e),"`")+"<"+l.join(",")+">"):""}function Ta(e){return e&&Ln(e.name,e.genericArgs)}class Ut{constructor(){Le(this,"Query"),Le(this,"QueryInto"),Le(this,"Create"),Le(this,"Update"),Le(this,"Patch"),Le(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}get dataModel(){var e;return null==(e=this.AnyQuery)?void 0:e.dataModel}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){qe.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:qe.isQuery(e)&&!this.Query?this.Query=e:qe.isCreate(e)&&!this.Create?this.Create=e:qe.isUpdate(e)&&!this.Update?this.Update=e:qe.isPatch(e)&&!this.Patch?this.Patch=e:qe.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){let l=new Ut;return e.forEach(e=>{l.add(e)}),l}static forType(t,e){let l,a=new Ut;var n;return G.config.apisResolver&&t&&(n=G.config.apisResolver(t,e))&&(a.Query=n.Query,a.QueryInto=n.QueryInto,a.Create=n.Create,a.Update=n.Update,a.Patch=n.Patch,a.Delete=n.Delete),t&&(null!=(e=e??(null==(l=G.metadata.value)?void 0:l.api))&&e.operations.forEach(e=>{var l;(null==(l=e.dataModel)?void 0:l.name)==t&&a.add(e)})),a}}let qe={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>Ze(e.request.inherits,e=>0<=qe.AnyRead.indexOf(e.name)),isQuery:e=>Ze(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>Ze(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{var l;return null==(l=e.request.implements)?void 0:l.some(e=>0<=qe.AnyWrite.indexOf(e.name))},isCreate:e=>vs(e,qe.Create),isUpdate:e=>vs(e,qe.Update),isPatch:e=>vs(e,qe.Patch),isDelete:e=>vs(e,qe.Delete),model:e=>{var l;return e?Ze(e.inherits,e=>0<=qe.AnyRead.indexOf(e.name))?null==(l=e.inherits)?void 0:l.genericArgs[0]:null==(l=null==(l=e.implements)?void 0:l.find(e=>0<=qe.AnyWrite.indexOf(e.name)))?void 0:l.genericArgs[0]:null}};function Fa(e){var l;return(null==(l=e.input)?void 0:l.type)||Is(yl(e))}function Vn(e){return e.endsWith("?")?Mo(e,1):e}function Is(e){return Sa[Vn(e)]}function Ia(e){return e&&Ma[e]||"String"}function yl(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function sl(e){return e&&"number"==Is(e)||!1}function Sn(e){return e&&"string"==e.toLowerCase()||!1}function ja(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function Mn(e){var l;return!(null==e||!e.type||(l=yl(e),e.isValueType&&-1==l.indexOf("`"))||e.isEnum||null!=Is(e.type))}function An(e){var l;return!!(null!=e&&e.type&&(l=yl(e),e.isValueType&&-1==l.indexOf("`")||e.isEnum||"hidden"==(null==(l=e.input)?void 0:l.type)||"file"==(null==(l=e.input)?void 0:l.type)||"tag"==(null==(l=e.input)?void 0:l.type)||"combobox"==(null==(l=e.input)?void 0:l.type)||null!=Is(e.type)))}function Yt(e,l){let t="string"==typeof e?js(e):e,a=(t||(console.warn("Metadata not found for: "+e),t={request:{name:e}}),function(e){Object.assign(this,e)}),n=(r.prototype.createResponse=function(){return t.returnsVoid?void 0:new a},r.prototype.getTypeName=function(){return t.request.name},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function Oa(e,l,t={}){let a=function(e){Object.assign(this,e)},n=(r.prototype.createResponse=function(){return"function"==typeof t.createResponse?t.createResponse():new a},r.prototype.getTypeName=function(){return e},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function ys(t,e){return t?(Object.keys(t).forEach(e=>{var l=t[e];"string"==typeof l?l.startsWith("/Date")&&(t[e]=Ms(pt(l))):null!=l&&"object"==typeof l&&(Array.isArray(l)?t[e]=Array.from(l):t[e]=Object.assign({},l))}),t):{}}function Da(e,o){let i={};return Array.from(e.elements).forEach(e=>{var r,s=e;if(s.id&&null!=s.value&&""!==s.value){let l=s.id.toLowerCase(),e=o&&o.find(e=>e.name.toLowerCase()==l),t=null==e?void 0:e.type,a=null==(r=null==e?void 0:e.genericArgs)?void 0:r[0],n="checkbox"===s.type?s.checked:s.value;sl(t)?n=Number(n):"List`1"===t&&"string"==typeof n&&(n=n.split(",").map(e=>sl(a)?Number(e):e)),i[s.id]=n}}),i}function bl(e){var l;return(null==(l=null==e?void 0:e.api)?void 0:l.operations)&&0l)?!1:n)){if((t||a)&&(await Yl(t||Nt,a),null!=G.metadata.value))return;var r=Qe("client");if(null!=r&&(l=await r.api(new Va)).succeeded&&es(l.response),null!=G.metadata.value)return;await Yl(Nt)}return G.metadata.value}function rt(l,t){if(G.config.typeResolver){var e=G.config.typeResolver(l,t);if(e)return e}var a,e=null==(e=G.metadata.value)?void 0:e.api;return e&&l?e.types.find(e=>e.name.toLowerCase()===l.toLowerCase()&&(!t||e.namespace==t))||((a=js(l))?a.request:(a=e.operations.find(e=>e.response&&e.response.name.toLowerCase()===l.toLowerCase()&&(!t||e.response.namespace==t)))?a.response:null):null}function js(l){if(G.config.apiResolver){var e=G.config.apiResolver(l);if(e)return e}e=null==(e=G.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===l.toLowerCase()):null}function Ra({dataModel:e}){var l=null==(l=G.metadata.value)?void 0:l.api;if(!l)return[];let t=l.operations;if(e){let l="string"==typeof e?rt(e):e;t=t.filter(e=>Tn(e.dataModel,l))}return t}function kl(e){return e?rt(e.name,e.namespace):null}function Tn(e,l){return e&&l&&e.name===l.name&&(!e.namespace||!l.namespace||e.namespace===l.namespace)}function Ea(e,l){var t=rt(e);return t&&t.properties&&t.properties.find(e=>e.name.toLowerCase()===l.toLowerCase())}function Fn(e){return In(rt(e))}function In(l){if(l&&l.isEnum&&null!=l.enumNames){var t={};for(let e=0;el.push({key:e,value:t[e]})),l}}function za(e,l){t=e.name,a=(null==l?void 0:l.type)||Fa(e)||"text";var t,a,n=Object.assign({id:t,name:t,type:a},l);return e.isEnum&&(n.type="select",n.allowableEntries=_l(jn(e))),n}function Na(l){let r=[];if(l){let a=st(l),e=js(l.name),n=kl(null==e?void 0:e.dataModel);a.forEach(l=>{var e;if(An(l)){let t=za(l,l.input);if(t.id=So(t.id),"file"==t.type&&l.uploadTo&&!t.accept&&(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins.filesUpload)?void 0:e.locations.find(e=>e.name==l.uploadTo))&&!t.accept&&e.allowExtensions&&(t.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),n&&(e=null==(e=n.properties)?void 0:e.find(e=>e.name==l.name),l.ref||(l.ref=null==e?void 0:e.ref)),t.options)try{let e={input:t,$typeFields:a.map(e=>e.name),$dataModelFields:n?st(n).map(e=>e.name):[],...G.config.scopeWhitelist},l=dl(t.options,e);Object.keys(l).forEach(e=>{t[e]=l[e]})}catch{console.error(`failed to evaluate '${t.options}'`)}r.push(t)}})}return r}function $l(e,l){if(!l.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+e];var t=rt(l.type);if(null==t||!t.enumValues)return console.error("Could not find metadata for "+l.type),[""+e];var a=[];for(let r=0;r"number"==typeof e?$l(e,{type:l}):e}function st(e){if(!e)return[];let l=[],t={};for(;e;)e.properties&&e.properties.forEach(e=>{t[e.name]||(t[e.name]=1,l.push(e))}),e=e.inherits?kl(e.inherits):null;return l.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function vs(e,l){var t;return(null==(t=e.request.implements)?void 0:t.some(e=>e.name===l))||!1}function ns(e){return e?Dn(e,st(e)):null}function Dn(e,l){var t=l.find(e=>"id"===e.name.toLowerCase());if(t&&t.isPrimaryKey)return t;t=l.find(e=>e.isPrimaryKey)||t;if(!t){var a=qe.model(e);if(a)return Ze(rt(a),e=>ns(e));console.error("Primary Key not found in "+e.name)}return t||null}function Ua(e,l){return Ze(ns(e),e=>_e(l,e.name))}function Pn(e,l,t){return e&&"none"===e.valueType?"":"%In"===t.key||"%Between"===t.key?`(${t.value})`:qa(l,t.value)}function qa(e,l){return!e||sl(e=Vn(e))||"Boolean"===e?l:ja(e)?`[${l}]`:`'${l}'`}function gt(e,l){return{name:e,value:l}}let Qa=[gt("=","%"),gt("!=","%!"),gt(">=",">%"),gt(">","%>"),gt("<=","%<"),gt("<","<%"),gt("In","%In"),gt("Between","%Between"),{name:"Starts With",value:"%StartsWith",types:"string"},{name:"Contains",value:"%Contains",types:"string"},{name:"Ends With",value:"%EndsWith",types:"string"},{name:"Exists",value:"%IsNotNull",valueType:"none"},{name:"Not Exists",value:"%IsNull",valueType:"none"}];function lt(){var e=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.app)||null}),l=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.api)||null}),t=v(()=>{var e;return(null==(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins)?void 0:e.autoQuery)?void 0:e.viewerConventions)||Qa});return wl(),{loadMetadata:Ha,getMetadata:Pa,setMetadata:es,clearMetadata:Ba,metadataApp:e,metadataApi:l,filterDefinitions:t,typeOf:rt,typeOfRef:kl,typeEquals:Tn,apiOf:js,findApis:Ra,typeName:Ta,typeName2:Ln,property:Ea,enumOptions:Fn,propertyOptions:jn,createFormLayout:Na,typeProperties:st,supportsProp:An,Crud:qe,Apis:Ut,getPrimaryKey:ns,getPrimaryKeyByProps:Dn,getId:Ua,createDto:Yt,makeDto:Oa,toFormValues:ys,formValues:Da,isComplexProp:Mn,asKvps:_l,expandEnumFlags:$l,enumFlagsConverter:On}}let et=class et{static async getOrFetchValue(e,l,t,a,n,r,s){return et.getValue(t,s,n)??(await et.fetchLookupIds(e,l,t,a,n,r,[s]),et.getValue(t,s,n))}static getValue(e,l,t){var a=et.Lookup[e];if(a){a=a[l];if(a)return a[t=t.toLowerCase()]}}static setValue(e,l,t,a){var n=et.Lookup[e]??(et.Lookup[e]={});(n[l]??(n[l]={}))[t=t.toLowerCase()]=a}static setRefValue(e,l){var t,a=_e(l,e.refId);return null==a||null==e.refLabel?null:(t=_e(l,e.refLabel),et.setValue(e.model,a,e.refLabel,t),t)}static async fetchLookupIds(e,l,n,r,s,o,i){var u=l.operations.find(e=>{var l;return qe.isAnyQuery(e)&&(null==(l=e.dataModel)?void 0:l.name)==n});if(u){let a=et.Lookup[n]??(et.Lookup[n]={}),t=[];Object.keys(a).forEach(e=>{var l=a[e];_e(l,s)&&t.push(e)});var d,v=i.filter(e=>!t.includes(e));0!=v.length&&(d=o?null:r+","+s,v={[r+"In"]:v.join(",")},d&&(v.fields=d),d=Yt(u,v),(v=await e.api(d,{jsconfig:"edv,eccn"})).succeeded?(_e(v.response,"results")||[]).forEach(e=>{var l,t;_e(e,r)?(l=""+_e(e,r),t=_e(e,s),s=s.toLowerCase(),(a[l]??(a[l]={}))[s]=""+t):console.error(`result[${r}] == null`,e)}):console.error("Failed to call "+u.request.name))}}},Pt=(Le(et,"Lookup",{}),et),ll=()=>(new Date).getTime(),Ka=["/","T",":","-"],ct={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Za=new Intl.RelativeTimeFormat(ct.locale,{}),en=31536e6,Qs={year:en,month:en/12,day:864e5,hour:36e5,minute:6e4,second:1e3},Lt={currency:Hn,bytes:Rn,link:En,linkTel:zn,linkMailTo:Nn,icon:Un,iconRounded:qn,attachment:Qn,hidden:Kn,time:Zn,relativeTime:xl,relativeTimeFromMs:Os,enumFlags:Gn,formatDate:Kt,formatNumber:Cl};"iconOnError"in globalThis||(globalThis.iconOnError=Fs);class Ke{}function Wa(e){ct=Object.assign({},ct,e)}function Ga(l){Object.keys(l||{}).forEach(e=>{"function"==typeof l[e]&&(Lt[e]=l[e])})}function Bn(){return Lt}function os(e,l){return l?dt("span",e,l):e}function Hn(e,l){var t=ft(l,["currency"]);return os(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==l?void 0:l.currency)||"USD"}).format(e),t)}function Rn(e,l){return os(hl(e),l)}function En(e,l){return dt("a",e,As({...l,href:e}))}function zn(e,l){return dt("a",e,As({...l,href:"tel:"+e}))}function Nn(e,l){var{subject:t,body:a}=l=l||{},n=ft(l,["subject","body"]),r={};return t&&(r.subject=t),a&&(r.body=a),dt("a",e,As({...n,href:"mailto:"+zt(e,r)}))}function Un(e,l){return dt("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function qn(e,l){return dt("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function Qn(e,l){var t=vl(e),a=(null==ls(t)||ml(e)?Ht:gl)(e),a=Ht(a),n=l&&(l["icon-class"]||l.iconClass),a=dt("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},n?{class:n}:null));return dt("a",a+`${t}`,Object.assign({class:"flex",href:Ht(e),title:e},l?ft(l,["icon-class","iconClass"]):null))}function Kn(e){return""}function Zn(e,l){var t="string"==typeof e?new Date(1e3*un(e)):Ss(e)?pt(e):null;return os(t?Ao(t):e,l)}function Kt(e,l){var t,a;return null==e?"":(t="number"==typeof e?new Date(e):"string"==typeof e?pt(e):e,Ss(t)?os(("function"==typeof(a=ct.date?Ds(ct.date):null)?a:To)(t),l):(console.warn(t+" is not a Date value"),null==e?"":""+e))}function Cl(e,l){if("number"!=typeof e)return e;let t=ct.number?Ds(ct.number):null,a="function"==typeof t?t(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,t),a=""+e),os(a,l)}function Wn(l,t,a){var e=Fo(l),n=t?Ds(t):null;if("function"!=typeof n)return(null!=e?Ss(e)?Kt(e,a):"number"==typeof e?Cl(e,a):e:null)??"";{let e=a;if(null!=t&&t.options)try{e=dl(t.options,a)}catch(e){console.error(`Could not evaluate '${t.options}'`,e,", with scope:",a)}return n(l,e)}}function ts(e,l,t){return(Tt(e)?Wn:tr)(e,l,t)}function Ja(e){if(null!=e){if("number"==typeof e)return e;if(Ss(e))return e.getTime()-ll();if("string"==typeof e){var l=Number(e);if(!isNaN(l))return l;if("P"===e[0]||e.startsWith("-P"))return 1e3*un(e)*-1;if(0<=Io(e,Ka))return pt(e).getTime()-ll()}}return NaN}function Os(e,l){for(var t in Qs)if(Math.abs(e)>Qs[t]||"second"===t)return(l||Za).format(Math.round(e/Qs[t]),t)}function xl(e,l){var t=Ja(e);return isNaN(t)?"":Os(t,l)}function Xa(e,l){return Os(e.getTime()-(l?l.getTime():ll()))}function Gn(e,l){return $l(e,l).join(", ")}function Ds(l){if(l){let{method:e,options:a}=l,n=e+`(${a})`,r=Lt[n]||Lt[e];if("function"==typeof r)return r;let s=l.locale||ct.locale;if(e.startsWith("Intl.")){var t=s?`'${s}'`:"undefined",t=`return new ${e}(${t},${a||"undefined"})`;try{let l=Function(t)();return r="Intl.DateTimeFormat"===e?e=>l.format(pt(e)):"Intl.NumberFormat"===e?e=>l.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>xl(e,l):e=>l.format(e),Lt[n]=r}catch(e){console.error("Invalid format: "+t,e)}}else{let t=globalThis[e];if("function"==typeof t){let l=null!=a?Function("return "+a)():void 0;return r=e=>t(e,l,s),Lt[n]=r}console.error(`No '${e}' function exists`,Object.keys(Lt))}}return null}function Jn(e,l){return e?e.length>l?e.substring(0,l)+"...":e:""}function Xn(e){return"/Date("===e.substring(0,6)?Kt(pt(e)):e}function Ya(e){return Ll(qt(e)).replace(/"/g,"")}function Yn(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function Ll(e,l=4){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,l)}function er(e){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:Ll(e=qt(e=Object.assign({},e)))}function qt(t){if(null==t)return null;if("string"==typeof t)return Xn(t);if(Tt(t))return t;if(t instanceof Date)return Kt(t);if(Array.isArray(t))return t.map(qt);if("object"!=typeof t)return t;{let l={};return Object.keys(t).forEach(e=>{"__type"!=e&&(l[e]=qt(t[e]))}),l}}function tr(e,l,t){let a=e;if(Array.isArray(e)){if(Tt(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return Kt(a,t);var n=Object.keys(a),r=[];for(let i=0;i${s}: `+Zs(Jn(Xn(o),ct.maxNestedFieldLength)))}return 2t.value.navigate(l.to??"/");return(e,l)=>(o(),i("a",Te({onClick:Ue(a,["prevent"]),title:e.to,href:"javascript:void(0)"},e.$attrs),[U(e.$slots,"default")],16,sr))}});class nr{constructor(){Le(this,"callbacks",{})}register(e,l){this.callbacks[e]=l}has(e){return!!this.callbacks[e]}invoke(e,l){var t=this.callbacks[e];"function"==typeof t&&t(e,l)}}let tt=class tt{static component(e){var l=tt.components[e];if(l)return l;let t=Wl(e),a=Object.keys(tt.components).find(e=>Wl(e)===t);return a&&tt.components[a]||null}},G=(Le(tt,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new hn,tableIcon:{svg:""},scopeWhitelist:{enumFlagsConverter:On,...Bn()}}),Le(tt,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Le(tt,"events",jo()),Le(tt,"user",D(null)),Le(tt,"metadata",D(null)),Le(tt,"components",{RouterLink:lr}),Le(tt,"interceptors",new nr),tt);function or(e){G.config=Object.assign(G.config,e)}function ar(e){G.autoQueryGridDefaults=Object.assign(G.autoQueryGridDefaults,e)}function Vl(e){return e&&G.config.assetsPathResolver?G.config.assetsPathResolver(e):e}function rr(e){return e&&G.config.fallbackPathResolver?G.config.fallbackPathResolver(e):e}function ir(e,l){G.interceptors.register(e,l)}function It(){var e=v(()=>G.config),l=v(()=>G.autoQueryGridDefaults);return{config:e,setConfig:or,events:G.events,autoQueryGridDefaults:l,setAutoQueryGridDefaults:ar,assetsPathResolver:Vl,fallbackPathResolver:rr,registerInterceptor:ir}}let eo=de({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(n,{attrs:r}){return()=>{let e=n.image;var l,t;n.type&&(t=lt().typeOf,(t=t(n.type))||console.warn(`Type ${n.type} does not exist`),null!=t&&t.icon?e=null==t?void 0:t.icon:console.warn(`Type ${n.type} does not have a [Svg] icon`));let a=n.svg||(null==e?void 0:e.svg)||"";return a.startsWith("").indexOf("class="),l=`${(null==e?void 0:e.cls)||""} `+(r.class||""),a=-1==t?`Fs(e.target)})}}}),ur={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},dr={class:"flex"},cr=l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),fr=l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),vr=[cr,fr],pr=de({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(e){return(e,t)=>(o(),i("div",ur,[l("div",dr,[(o(),i("svg",{class:h(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",e.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vr,2)),l("span",null,[U(e.$slots,"default")])])]))}}),mr=["href","onClick"],hr=["type"],tn="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",gr=de({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(tn),href:t.href,onClick:e},[U(t.$slots,"default")],8,mr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:tn},t.$attrs),[U(t.$slots,"default")],16,hr))}}}),yr=["href","onClick"],br=["type"],wr=de({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(e){let t=e,a={blue:"focus:ring-indigo-500 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"focus:ring-indigo-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-500 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-500 bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-500 bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-indigo-500 bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},n=v(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black text-white "+(a[t.color]||a.indigo));return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(n.value),href:t.href,onClick:e},[U(t.$slots,"default")],10,yr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:n.value},t.$attrs),[U(t.$slots,"default")],16,br))}}}),kr=["type","href","onClick"],_r=["type"],sn="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black",$r=de({__name:"SecondaryButton",props:{type:{},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{type:t.type??"button",class:h(sn),href:t.href,onClick:e},[U(t.$slots,"default")],8,kr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type??"button",class:sn},t.$attrs),[U(t.$slots,"default")],16,_r))}}});function Ge(e,l){return Array.isArray(e)?0<=e.indexOf(l):e==l||e.includes(l)}let Cs={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},ot={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},Jt={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},Bt={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},nl={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ee={panelClass(e="slideOver"){return("card"==e?Jt:Bt).panelClass},formClass(e="slideOver"){return("card"==e?Jt:Bt).formClass},headingClass(e="slideOver"){return("card"==e?Jt:Bt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?Jt:Bt).subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},he={getGridClass(e=0){return he.gridClass},getGrid2Class(e="stripedRows"){return Ge(e,"fullWidth")?"overflow-x-auto":he.grid2Class},getGrid3Class(e="stripedRows"){return Ge(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":he.grid3Class},getGrid4Class(e="stripedRows"){return Ge(e,"whiteBackground")?"":Ge(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":he.grid4Class},getTableClass(e="stripedRows"){return Ge(e,"fullWidth")||Ge(e,"verticalLines")?"min-w-full divide-y divide-gray-300":he.tableClass},getTheadClass(e="stripedRows"){return Ge(e,"whiteBackground")?"":he.theadClass},getTheadRowClass(e="stripedRows"){return he.theadRowClass+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return he.theadCellClass+(Ge(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(Ge(e,"whiteBackground")||Ge(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":he.tableClass)+(Ge(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",l,t,a){return(a?"cursor-pointer ":"")+(t?"bg-indigo-100 dark:bg-blue-800":(a?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!Ge(e,"stripedRows")||l%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},Cr={colspans:"col-span-3 sm:col-span-3"},fh=Object.freeze(Object.defineProperty({__proto__:null,a:Cs,card:Jt,dummy:Cr,form:Ee,grid:he,input:ot,modal:nl,slideOver:Bt},Symbol.toStringTag,{value:"Module"})),xr=de({__name:"TextLink",props:{color:{default:"blue"}},setup(e){let l=yo(),t=e,a=v(()=>(Cs[t.color]||Cs.blue)+(l.href?"":" cursor-pointer"));return(e,l)=>(o(),i("a",{class:h(a.value)},[U(e.$slots,"default")],2))}}),Lr={class:"flex","aria-label":"Breadcrumb"},Vr={role:"list",class:"flex items-center space-x-4"},Sr=["href","title"],Mr=l("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),Ar={class:"sr-only"},Tr=de({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(e){return(e,t)=>(o(),i("nav",Lr,[l("ol",Vr,[l("li",null,[l("div",null,[l("a",{href:e.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:e.homeLabel},[Mr,l("span",Ar,O(e.homeLabel),1)],8,Sr)])]),U(e.$slots,"default")])]))}}),Fr={class:"flex items-center"},Ir=l("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),jr=["href","title"],Or=["title"],Dr=de({__name:"Breadcrumb",props:{href:{},title:{}},setup(e){return(e,t)=>(o(),i("li",null,[l("div",Fr,[Ir,e.href?(o(),i("a",{key:0,href:e.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:e.title},[U(e.$slots,"default")],8,jr)):(o(),i("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:e.title},[U(e.$slots,"default")],8,Or))])]))}}),Pr={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},Br={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Hr=de({__name:"NavList",props:{title:{}},setup(e){return(e,t)=>(o(),i("div",null,[e.title?(o(),i("h2",Pr,O(e.title),1)):x("",!0),l("ul",Br,[U(e.$slots,"default")])]))}}),Rr={class:"relative flex items-start space-x-4 py-6"},Er={class:"flex-shrink-0"},zr={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Nr={class:"min-w-0 flex-1"},Ur={class:"text-base font-medium text-gray-900 dark:text-gray-100"},qr={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Qr=["href"],Kr=l("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Zr={class:"text-base text-gray-500"},Wr=l("div",{class:"flex-shrink-0 self-center"},[l("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),Gr=de({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(e){return(e,t)=>{var a=K("Icon");return o(),i("li",Rr,[l("div",Er,[l("span",zr,[ye(a,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:e.icon,src:e.iconSrc,svg:e.iconSvg,alt:e.iconAlt},null,8,["image","src","svg","alt"])])]),l("div",Nr,[l("h3",Ur,[l("span",qr,[l("a",{href:e.href,class:"focus:outline-none"},[Kr,ke(" "+O(e.title),1)],8,Qr)])]),l("p",Zr,[U(e.$slots,"default")])]),Wr])}}});function to(e){return e&&e.SessionId?Oo(e):e}function Jr(e){G.user.value=to(e),G.events.publish("signIn",e)}function Xr(){G.user.value=null,G.events.publish("signOut",null)}let Sl=e=>(null==e?void 0:e.roles)||[],Ml=e=>(null==e?void 0:e.permissions)||[];function so(e){return 0<=Sl(G.user.value).indexOf(e)}function Yr(e){return 0<=Ml(G.user.value).indexOf(e)}function Al(){return so("Admin")}function bs(e){if(!e)return!1;if(!e.requiresAuth)return!0;var l=G.user.value;if(!l)return!1;if(Al())return!0;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!n.every(e=>0<=t.indexOf(e))||00<=t.indexOf(e))||!r.every(e=>0<=a.indexOf(e))||00<=a.indexOf(e)))}function ei(e){if(!e||!e.requiresAuth)return null;var l=G.user.value;if(!l)return`${e.request.name} requires Authentication`;if(Al())return null;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=n.filter(e=>t.indexOf(e)<0);return 0""+e+"").join(", ")} Role`+(1a.indexOf(e)<0)).length?`Requires ${l.map(e=>""+e+"").join(", ")} Permission`+(10<=t.indexOf(e))?`Requires any ${s.filter(e=>t.indexOf(e)<0).map(e=>""+e+"").join(", ")} Role`+(10<=a.indexOf(e))?`Requires any ${o.filter(e=>a.indexOf(e)<0).map(e=>""+e+"").join(", ")} Permission`+(1G.user.value||null),toAuth:to,isAuthenticated:v(()=>null!=G.user.value),hasRole:so,hasPermission:Yr,isAdmin:Al,canAccess:bs,invalidAccessMessage:ei}}let ti={key:0},si={class:"md:p-4"},lo=de({__name:"EnsureAccess",props:{invalidAccess:{},alertClass:{}},emits:["done"],setup(e){let r=Tl().isAuthenticated,t=It().config,s=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},u=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var a=K("Alert"),n=K("SecondaryButton");return e.invalidAccess?(o(),i("div",ti,[ye(a,{class:h(e.alertClass),innerHTML:e.invalidAccess},null,8,["class","innerHTML"]),l("div",si,[W(r)?(o(),ae(n,{key:1,onClick:u},{default:xe(()=>[ke("Sign Out")]),_:1})):(o(),ae(n,{key:0,onClick:s},{default:xe(()=>[ke("Sign In")]),_:1}))])])):x("",!0)}}}),li={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ni={class:"p-4"},oi=l("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),ai={class:"flex w-full justify-center"},ri=l("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[l("g",{fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),l("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),ii=l("span",null,"ASC",-1),ui=[ri,ii],di=xs('DESC',2),ci=[di],fi=l("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),vi={key:0},pi=["id","value"],mi=["for"],hi={key:1},gi={class:"mb-2"},yi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},bi=["onClick"],wi=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ki=[wi],_i={class:"flex"},$i=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1),Ci=[$i],xi={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Fl=de({__name:"FilterColumn",props:{definitions:{},column:{},topLeft:{}},emits:["done","save"],setup(e,{emit:t}){let u=e,a=t,d=D(),c=D(""),p=D(""),f=D([]),m=v(()=>1==u.column.meta.isEnum),s=v(()=>rt("Nullable`1"===u.column.meta.type?u.column.meta.genericArgs[0]:u.column.meta.type)),g=v(()=>1==u.column.meta.isEnum?_l(Fn(s.value.name)):[]),y=v(()=>{var e;return(null==(e=n(u.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),b=D({filters:[]}),w=v(()=>b.value.filters);function n(e){let l=u.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)}function k(e,l){return n(e).find(e=>e.value===l)}function C(){var e;c.value&&(e=null==(e=k(u.column.type,c.value))?void 0:e.name)&&(b.value.filters.push({key:c.value,name:e,value:p.value}),c.value=p.value="")}function L(){a("done")}function M(){var e;c.value="%",null!=(e=d.value)&&e.focus()}function V(){var e,l;p.value&&C(),m.value&&(l=Object.values(f.value).filter(e=>e),b.value.filters=0parseInt(e)).reduce((e,l)=>e+l,0).toString()}]:[{key:"%In",name:"In",value:l.join(",")}]:[]),a("save",b.value),a("done")}function S(e){b.value.sort=e===b.value.sort?void 0:e,St(V)}return ws(()=>b.value=Object.assign({},u.column.settings,{filters:Array.from(u.column.settings.filters)})),ws(()=>{let e,l,t,a,n,r=(null==(t=null==(l=null==(e=u.column.settings.filters)?void 0:e[0])?void 0:l.value)?void 0:t.split(","))||[];if(00<(l&parseInt(e))))||[]}f.value=r}),(a,t)=>{var e=K("SelectInput"),n=K("TextInput"),r=K("PrimaryButton"),s=K("SecondaryButton");return o(),i("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:L,onVnodeMounted:M},[l("div",{class:"absolute",style:ol(`top:${a.topLeft.y}px;left:${a.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[l("div",li,[l("div",ni,[oi,l("div",ai,[l("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>S("ASC")),class:h(`${"ASC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ui,2),l("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>S("DESC")),class:h(`${"DESC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ci,2)]),fi,m.value?(o(),i("div",vi,[(o(!0),i(Me,null,je(g.value,e=>(o(),i("div",{key:e.key,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>f.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,pi),[[al,f.value]]),l("label",{for:e.key,class:"ml-3"},O(e.value),9,mi)]))),128))])):(o(),i("div",hi,[(o(!0),i(Me,null,je(w.value,(e,t)=>(o(),i("div",gi,[l("span",yi,[ke(O(a.column.name)+" "+O(e.name)+" "+O((e=e,Pn(k(u.column.type,e.key),u.column.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;l=t,b.value.filters.splice(l,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},ki,8,bi)])]))),256)),l("div",_i,[ye(e,{id:"filterRule",class:"w-32 mr-1",modelValue:c.value,"onUpdate:modelValue":t[3]||(t[3]=e=>c.value=e),entries:y.value,label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(e=k(a.column.type,c.value))?void 0:e.valueType)?(o(),ae(n,{key:0,ref_key:"txtFilter",ref:d,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:p.value,"onUpdate:modelValue":t[4]||(t[4]=e=>p.value=e),onKeyup:on(C,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):x("",!0),l("div",{class:"pt-1"},[l("button",{type:"button",onClick:C,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ci)])])]))]),l("div",xi,[ye(r,{onClick:V,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(s,{onClick:L},{default:xe(()=>[ke(" Cancel ")]),_:1})])])],4)],512)}}}),Li={class:"px-4 sm:px-6 lg:px-8 text-sm"},Vi={class:"flex flex-wrap"},Si={class:"group pr-4 sm:pr-6 lg:pr-8"},Mi={class:"flex justify-between w-full font-medium"},Ai={class:"w-6 flex justify-end"},Ti={class:"hidden group-hover:inline"},Fi=["onClick","title"],Ii=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ji=[Ii],Oi={key:0,class:"pt-2"},Di={class:"ml-2"},Pi={key:1},Bi={class:"pt-2"},Hi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Ri=["onClick"],Ei=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),zi=[Ei],Ni=l("span",null,"Clear All",-1),Ui=[Ni],Il=de({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let a=e,r=t,n=v(()=>a.columns.filter(e=>0{let l=a.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)})(e).find(e=>e.value===l)}function u(){a.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(o(),i("div",Li,[l("div",Vi,[(o(!0),i(Me,null,je(n.value,n=>{return o(),i("fieldset",Si,[l("legend",Mi,[l("span",null,O(W(Pe)(n.name)),1),l("span",Ai,[l("span",Ti,[l("button",{onClick:e=>{var l;(l=n).settings.filters=[],r("change",l)},title:`Clear all ${W(Pe)(n.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},ji,8,Fi)])])]),n.meta.isEnum?(o(),i("div",Oi,[(o(!0),i(Me,null,je((e=n.settings.filters,null==(t=null==(t=null==e?void 0:e[0])?void 0:t.value)?void 0:t.split(",")),e=>(o(),i("div",{key:e,class:"flex items-center"},[l("label",Di,O(e),1)]))),128))])):(o(),i("div",Pi,[(o(!0),i(Me,null,je(n.settings.filters,(e,t)=>{return o(),i("div",Bi,[l("span",Hi,[ke(O(n.name)+" "+O(e.name)+" "+O((e=e,Pn(s((a=n).type,e.value),a.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;(l=n).settings.filters.splice(t,1),r("change",l)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},zi,8,Ri)])]);var a}),256))]))]);var e,t}),256))]),l("div",{class:"flex justify-center pt-4"},[l("button",{type:"button",onClick:u,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ui)])]))}}),qi={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qi={class:""},Ki={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Zi=l("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Wi={class:"mt-4"},Gi=["for"],Ji=["id"],Xi=["value","selected"],Yi={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},eu=["id","checked"],tu=["for"],su={class:"mt-4"},lu={class:"pb-2 px-4"},nu={class:""},ou=["id","value"],au=["for"],ru={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},jl=de({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:{},prefs:{},maxLimit:{}},emits:["done","save"],setup(e,{emit:t}){let a=It().autoQueryGridDefaults,s=e,n=t,u=D({}),d=(ws(()=>u.value=Object.assign({take:a.value.take,selectedColumns:[]},s.prefs)),[10,25,50,100,250,500,1e3]);function v(){n("done")}function c(){n("save",u.value)}return(e,t)=>{let a=K("PrimaryButton"),n=K("SecondaryButton"),r=K("ModalDialog");return o(),ae(r,{id:e.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:xe(()=>[l("div",qi,[l("div",Qi,[l("div",Ki,[Zi,l("div",Wi,[l("label",{for:e.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,Gi),Mt(l("select",{id:e.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>u.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(o(!0),i(Me,null,je(d.filter(e=>null==s.maxLimit||e<=s.maxLimit),e=>(o(),i("option",{value:e,selected:e===u.value.take},O(e),9,Xi))),256))],8,Ji),[[bo,u.value.take]])]),l("div",Yi,[l("input",{type:"radio",id:e.id+"-allColumns",onClick:t[1]||(t[1]=e=>u.value.selectedColumns=[]),checked:0===u.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,eu),l("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:e.id+"-allColumns"},"View all columns",8,tu)]),l("div",su,[l("div",lu,[l("div",nu,[(o(!0),i(Me,null,je(e.columns,e=>(o(),i("div",{key:e.name,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,ou),[[al,u.value.selectedColumns]]),l("label",{for:e.name,class:"ml-3"},O(e.name),9,au)]))),128))])])])])])]),l("div",ru,[ye(a,{onClick:c,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(n,{onClick:v},{default:xe(()=>[ke(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),iu={key:0},uu={key:1},du={key:2,class:"pt-1"},cu={key:0},fu={key:1},vu={key:2},pu={key:4},mu={class:"pl-1 pt-1 flex flex-wrap"},hu={class:"flex mt-1"},gu=["title"],yu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),bu=[yu],wu=["disabled"],ku=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),_u=[ku],$u=["disabled"],Cu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),xu=[Cu],Lu=["disabled"],Vu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Su=[Vu],Mu=["disabled"],Au=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Tu=[Au],Fu={key:0,class:"flex mt-1"},Iu={class:"px-4 text-lg text-black dark:text-white"},ju={key:0},Ou={key:1},Du=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Pu={key:2},Bu={class:"flex flex-wrap"},Hu={key:0,class:"pl-2 mt-1"},Ru=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001 0 0 0 14.868 3"})],-1),Eu=[Ru],zu={key:1,class:"pl-2 mt-1"},Nu=xs('Excel',2),Uu=[Nu],qu={key:2,class:"pl-2 mt-1"},Qu={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Ku=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Zu=[Ku],Wu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Gu=l("g",{fill:"none"},[l("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Ju=[Gu],Xu=l("span",{class:"whitespace-nowrap"},"Copy URL",-1),Yu={key:3,class:"pl-2 mt-1"},ed=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),td=[ed],sd={key:4,class:"pl-2 mt-1"},ld=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),nd={class:"mr-1"},od={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ad=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),rd=[ad],id={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ud=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),dd=[ud],cd={key:5,class:"pl-2 mt-1"},fd=["title"],vd=l("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),pd={class:"whitespace-nowrap"},md={key:8},hd={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gd={class:"mr-1 select-none"},yd={key:1,class:"flex justify-between items-center"},bd={class:"mr-1 select-none"},ps=25,wd=de({__name:"AutoQueryGrid",props:{filterDefinitions:{},id:{default:"AutoQueryGrid"},apis:{},type:{},prefs:{},deny:{},hide:{},selectedColumns:{},toolbarButtonClass:{},tableStyle:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{},modelTitle:{},newButtonLabel:{},apiPrefs:{},canFilter:{},disableKeyBindings:{},configureField:{},skip:{default:0},create:{type:Boolean},edit:{},filters:{}},emits:["headerSelected","rowSelected","nav"],setup(e,{expose:d,emit:c}){let{config:p,autoQueryGridDefaults:X}=It(),Y=X,t=p.value.storage,n=e,ee=c,le=Qe("client"),te="filtering,queryString,queryFilters".split(","),ne="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","),re=v(()=>n.deny?Vt(te,n.deny):Vt(te,Y.value.deny)),se=v(()=>n.hide?Vt(ne,n.hide):Vt(ne,Y.value.hide));function f(e){return re.value[e]}function m(e){return se.value[e]}let g=v(()=>n.tableStyle??Y.value.tableStyle),oe=v(()=>n.gridClass??he.getGridClass(g.value)),ie=v(()=>n.grid2Class??he.getGrid2Class(g.value)),ue=v(()=>n.grid3Class??he.getGrid3Class(g.value)),de=v(()=>n.grid4Class??he.getGrid4Class(g.value)),ve=v(()=>n.tableClass??he.getTableClass(g.value)),ce=v(()=>n.theadClass??he.getTheadClass(g.value)),pe=v(()=>n.theadRowClass??he.getTheadRowClass(g.value)),fe=v(()=>n.theadCellClass??he.getTheadCellClass(g.value)),y=v(()=>n.toolbarButtonClass??he.toolbarButtonClass);function me(e,l){var t,a;return n.rowClass?n.rowClass(e,l):(t=!!Q.value.AnyUpdate,a=(null!=(a=s.value)&&a.name?_e(e,s.value.name):null)==V.value,he.getTableRowClass(n.tableStyle,l,a,t))}let b=Ls(),ge=v(()=>{var e;return il((null==(e=Q.value.AnyQuery.viewModel)?void 0:e.name)||Q.value.AnyQuery.dataModel.name)}),be=v(()=>{let l=Object.keys(b).map(e=>e.toLowerCase());return st(ge.value).filter(e=>l.includes(e.name.toLowerCase())||l.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});let w=v(()=>{var e=(0<(e=Ct(n.selectedColumns)).length?e:0e.toLowerCase());let t=st(ge.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),we=v(()=>{let e=w.value.map(e=>e.name),l=Ct(j.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),k=D([]),C=D(new Xe),Ce=D(new Xe),L=D(),M=D(!1),V=D(),S=D(),T=D(!1),A=D(),F=D(n.skip),I=D(!1),j=D({take:ps}),$=D(!1),Le=v(()=>k.value.some(e=>0k.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Ve=v(()=>{var e;return st(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),s=v(()=>{var e;return ns(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),B=v(()=>j.value.take??ps),E=v(()=>C.value.response?_e(C.value.response,"results"):[]),_=v(()=>{var e;return((null==(e=C.value.response)?void 0:e.total)||E.value.length)??0}),Se=v(()=>00E.value.length>=B.value),De=v(()=>E.value.length>=B.value),P=D(),H=D(),Ae={NoQuery:"No Query API was found"};function Fe(l){if(l){if(n.canFilter)return n.canFilter(l);var e=Ve.value.find(e=>e.name.toLowerCase()==l.toLowerCase());if(e)return!Mn(e)}}function r(e){ee("nav",e),f("queryString")&&ul(e)}async function R(e){F.value+=e,F.value<0&&(F.value=0);var l=Math.floor(_.value/B.value)*B.value;F.value>l&&(F.value=l),r({skip:F.value||void 0}),await z()}async function Ie(e,l){var t,a;S.value=null,V.value=l,e&&l&&(a=Yt(Q.value.AnyQuery,{[e]:l}),(a=await le.api(a)).succeeded)&&((a=null==(a=_e(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(t=Q.value.AnyQuery)?void 0:t.request.name}(${e}:${l}) returned no results`),S.value=a)}async function $e(e,l){ee("rowSelected",e,l);var t=null==(t=s.value)?void 0:t.name,a=t?_e(e,t):null;t&&a&&(r({edit:a}),Ie(t,a))}function Ue(l,e){var t,a,n;f("filtering")&&(t=e.target,Fe(l)&&"TD"!==(null==t?void 0:t.tagName)&&(t=null==(t=null==t?void 0:t.closest("TABLE"))?void 0:t.getBoundingClientRect(),a=k.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&t&&(n=t.x+318+10,A.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),n),y:t.y+45}}),ee("headerSelected",l,e))}function Ee(){A.value=null}async function Pe(e){var l=null==(l=A.value)?void 0:l.column;l&&(l.settings=e,t.setItem(u(l.name),JSON.stringify(l.settings)),await z()),A.value=null}async function He(e){t.setItem(u(e.name),JSON.stringify(e.settings)),await z()}async function Re(e){T.value=!1,j.value=e,t.setItem(sl(),JSON.stringify(e)),await z()}function ze(e){var l;P.value&&(Object.assign(null==(l=P.value)?void 0:l.model,e),Ke())}function Ne(e){Object.assign(S.value,e),Ke()}function Ke(){null!=(e=P.value)&&e.forceUpdate(),null!=(e=H.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function z(){await qe(Ze())}async function Ge(){await z()}d({update:z,search:qe,createRequestArgs:Ze,reset:Cl,createDone:J,createSave:kl,editDone:Z,editSave:wl,forceUpdate:Ke,setEdit:Ne,edit:S,createForm:P,editForm:H,apiPrefs:j,results:E,skip:F,take:B,total:_}),G.interceptors.has("AutoQueryGrid.new")&&G.interceptors.invoke("AutoQueryGrid.new",{props:n});let We=/iPad|iPhone|iPod/.test(navigator.userAgent);async function qe(t){var a=Q.value.AnyQuery;if(a){let e=Yt(a,t),l=await le.api(e);dn(e=>{C.value.response=C.value.error=void 0,$.value=e,We?St(()=>C.value=l):C.value=l})();a=_e(l.response,"results")||[];l.succeeded&&a.label}else console.error(Ae.NoQuery)}function Ze(){let r={include:"total",take:B.value},l=Ct(j.value.selectedColumns||n.selectedColumns);if(0{var e,l=a.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&n.push(l.ref.selfId),_e(b,t)&&n.push(...a.filter(e=>{var l;return(null==(l=null==(l=e.ref)?void 0:l.selfId)?void 0:l.toLowerCase())==t.toLowerCase()}).map(e=>e.name))}),n.forEach(e=>{l.includes(e)||l.push(e)}),r.fields=l.join(",")}let e=[];if(k.value.forEach(t=>{t.settings.sort&&e.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);r[l]=e.value})}),n.filters&&Object.keys(n.filters).forEach(e=>{r[e]=n.filters[e]}),f("queryString")&&f("queryFilters")){var t=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):"");let e=Ws(t);Object.keys(e).forEach(l=>{w.value.find(e=>e.name.toLowerCase()===l.toLowerCase())&&(r[l]=e[l])}),typeof e.skip<"u"&&(t=parseInt(e.skip),isNaN(t)||(F.value=r.skip=t))}return"u"I.value=!1,3e3)}function ll(e="json"){var l=Ze(),t="/api/"+(null==(t=Q.value.AnyQuery)?void 0:t.request.name),t=Do(le.baseUrl,zt(t,{...l,jsconfig:"edv"}));return 0<=t.indexOf("?")?Vs(t,"?")+"."+e+"?"+ms(t,"?"):t+".json"}async function tl(){k.value.forEach(e=>{e.settings={filters:[]},t.removeItem(u(e.name))}),j.value={take:ps},t.removeItem(sl()),await z()}function al(){M.value=!0,r({create:null})}let a=v(()=>Qt(n.type)),N=v(()=>{var e;return a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)}),q=v(()=>n.modelTitle||N.value),nl=v(()=>n.newButtonLabel||"New "+q.value),sl=()=>{var e;return n.id+"/ApiPrefs/"+(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name))},u=e=>{var l;return`Column/${n.id}:${a.value||(null==(l=Q.value.AnyQuery)?void 0:l.dataModel.name)}.`+e},{metadataApi:ol,typeOf:il,apiOf:dl,filterDefinitions:vl}=lt(),cl=Tl().invalidAccessMessage,pl=v(()=>n.filterDefinitions||vl.value),Q=v(()=>{var e=Ct(n.apis);return 0dl(e)).filter(e=>null!=e).map(e=>e)):Ut.forType(a.value,ol.value)}),fl=e=>`${e}`,ml=v(()=>{var e;return ol.value?0<(e=Ct(n.apis).map(e=>null==dl(e)?e:null).filter(e=>null!=e)).length?fl(`Unknown API${1useMetadata()`)}),gl=v(()=>Q.value.AnyQuery&&cl(Q.value.AnyQuery)),hl=v(()=>Q.value.Create&&cl(Q.value.Create)),yl=v(()=>Q.value.AnyUpdate&&cl(Q.value.AnyUpdate)),bl=v(()=>bs(Q.value.Create)),xl=(v(()=>bs(Q.value.AnyUpdate)),v(()=>bs(Q.value.Delete)));function Z(){S.value=null,V.value=null,r({edit:void 0})}function J(){M.value=!1,r({create:void 0})}async function wl(){await z(),Z()}async function kl(){await z(),J()}function Cl(){C.value=new Xe,Ce.value=new Xe,M.value=!1,V.value=null,S.value=null,T.value=!1,A.value=null,F.value=n.skip,I.value=!1,j.value={take:ps},$.value=!1;var e,l=n.prefs||$s(t.getItem(sl())),l=(l&&(j.value=l),k.value=w.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(t.getItem(u(e.name))))})),isNaN(n.skip)||(F.value=n.skip),null==(l=s.value)?void 0:l.name);f("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),typeof(e=Ws(e)).create<"u"?M.value=typeof e.create<"u":!l||"string"!=typeof e.edit&&"number"!=typeof e.edit||Ie(l,e.edit)),!0===n.create&&(M.value=!0),l&&null!=n.edit&&Ie(l,n.edit)}return Ye(async()=>{Cl(),await z()}),(t,e)=>{let a=K("Alert"),n=K("EnsureAccessDialog"),r=K("AutoCreateForm"),s=K("AutoEditForm"),u=K("AutoViewForm"),d=K("ErrorSummary"),v=K("Loading"),c=K("SettingsIcons"),p=K("DataGrid");return ml.value?(o(),i("div",iu,[ye(a,{innerHTML:ml.value},null,8,["innerHTML"])])):gl.value?(o(),i("div",uu,[ye(lo,{"invalid-access":gl.value},null,8,["invalid-access"])])):(o(),i("div",du,[m("forms")&&M.value&&Q.value.Create?(o(),i("div",cu,[hl.value?(o(),ae(n,{key:0,title:"Create "+q.value,"invalid-access":hl.value,"alert-class":"text-yellow-700",onDone:J},null,8,["title","invalid-access"])):W(b).createform?U(t.$slots,"createform",{key:1,type:Q.value.Create.request.name,configure:t.configureField,done:J,save:kl}):(o(),ae(r,{key:2,ref_key:"createForm",ref:P,type:Q.value.Create.request.name,configure:t.configureField,onDone:J,onSave:kl},{header:xe(()=>[U(t.$slots,"formheader",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),_:3},8,["type","configure"]))])):m("forms")&&S.value&&Q.value.AnyUpdate?(o(),i("div",fu,[yl.value?(o(),ae(n,{key:0,title:"Update "+q.value,"invalid-access":yl.value,"alert-class":"text-yellow-700",onDone:Z},null,8,["title","invalid-access"])):W(b).editform?U(t.$slots,"editform",{key:1,model:S.value,type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,done:Z,save:wl}):(o(),ae(s,{key:2,ref_key:"editForm",ref:H,modelValue:S.value,"onUpdate:modelValue":e[0]||(e[0]=e=>S.value=e),type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,onDone:Z,onSave:wl,onDelete:wl},{header:xe(()=>[U(t.$slots,"formheader",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),_:3},8,["modelValue","type","deleteType","configure"]))])):m("forms")&&S.value?(o(),i("div",vu,[W(b).viewform?U(t.$slots,"viewform",{key:0,model:S.value,apis:Q.value,done:Z}):(o(),ae(u,{key:1,model:S.value,apis:Q.value,done:Z},null,8,["model","apis"]))])):x("",!0),W(b).toolbar?U(t.$slots,"toolbar",{key:3}):m("toolbar")?(o(),i("div",pu,[T.value?(o(),ae(jl,{key:0,columns:w.value,prefs:j.value,onDone:e[1]||(e[1]=e=>T.value=!1),onSave:Re},null,8,["columns","prefs"])):x("",!0),l("div",mu,[l("div",hu,[m("preferences")?(o(),i("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:q.value+" Preferences",onClick:e[2]||(e[2]=e=>T.value=!T.value)},bu,8,gu)):x("",!0),m("pagingNav")?(o(),i("button",{key:1,type:"button",class:h(["pl-2",Se.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!Se.value,onClick:e[3]||(e[3]=e=>R(-_.value))},_u,10,wu)):x("",!0),m("pagingNav")?(o(),i("button",{key:2,type:"button",class:h(["pl-2",Oe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!Oe.value,onClick:e[4]||(e[4]=e=>R(-B.value))},xu,10,$u)):x("",!0),m("pagingNav")?(o(),i("button",{key:3,type:"button",class:h(["pl-2",Te.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!Te.value,onClick:e[5]||(e[5]=e=>R(B.value))},Su,10,Lu)):x("",!0),m("pagingNav")?(o(),i("button",{key:4,type:"button",class:h(["pl-2",De.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!De.value,onClick:e[6]||(e[6]=e=>R(_.value))},Tu,10,Mu)):x("",!0)]),m("pagingInfo")?(o(),i("div",Fu,[l("div",Iu,[$.value?(o(),i("span",ju,"Querying...")):x("",!0),E.value.length?(o(),i("span",Ou,[Du,ke(" "+O(F.value+1)+" - "+O(Math.min(F.value+E.value.length,_.value))+" ",1),l("span",null," of "+O(_.value),1)])):C.value.completed?(o(),i("span",Pu,"No Results")):x("",!0)])])):x("",!0),l("div",Bu,[m("refresh")?(o(),i("div",Hu,[l("button",{type:"button",onClick:Ge,title:"Refresh",class:h(y.value)},Eu,2)])):x("",!0),m("downloadCsv")?(o(),i("div",zu,[l("button",{type:"button",onClick:Je,title:"Download CSV",class:h(y.value)},Uu,2)])):x("",!0),m("copyApiUrl")?(o(),i("div",qu,[l("button",{type:"button",onClick:el,title:"Copy API URL",class:h(y.value)},[I.value?(o(),i("svg",Qu,Zu)):(o(),i("svg",Wu,Ju)),Xu],2)])):x("",!0),Le.value&&m("resetPreferences")?(o(),i("div",Yu,[l("button",{type:"button",onClick:tl,title:"Reset Preferences & Filters",class:h(y.value)},td,2)])):x("",!0),m("filtersView")&&0L.value="filters"==L.value?null:"filters"),class:h(y.value),"aria-expanded":"false"},[ld,l("span",nd,O(Me.value)+" "+O(1==Me.value?"Filter":"Filters"),1),"filters"!=L.value?(o(),i("svg",od,rd)):(o(),i("svg",id,dd))],2)])):x("",!0),m("newItem")&&Q.value.Create&&bl.value?(o(),i("div",cd,[l("button",{type:"button",onClick:al,title:q.value,class:h(y.value)},[vd,l("span",pd,O(nl.value),1)],10,fd)])):x("",!0),W(b).toolbarbuttons?U(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:y.value}):x("",!0)])])])):x("",!0),"filters"==L.value?(o(),ae(Il,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:pl.value,columns:k.value,onDone:e[8]||(e[8]=e=>L.value=null),onChange:He},null,8,["definitions","columns"])):x("",!0),Ce.value.error??C.value.error?(o(),ae(d,{key:6,status:Ce.value.error??C.value.error},null,8,["status"])):$.value?(o(),ae(v,{key:7,class:"p-2"})):x("",!0),A.value?(o(),i("div",md,[ye(Fl,{definitions:pl.value,column:A.value.column,"top-left":A.value.topLeft,onDone:Ee,onSave:Pe},null,8,["definitions","column","top-left"])])):x("",!0),E.value.length?(o(),ae(p,{key:9,id:t.id,items:E.value,type:t.type,"selected-columns":we.value,class:"mt-1",onFiltersChanged:z,tableStyle:g.value,gridClass:oe.value,grid2Class:ie.value,grid3Class:ue.value,grid4Class:de.value,tableClass:ve.value,theadClass:ce.value,theadRowClass:pe.value,theadCellClass:fe.value,tbodyClass:t.tbodyClass,rowClass:me,onRowSelected:$e,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:Ue},rl({header:xe(({column:t,label:e})=>{var a;return[f("filtering")&&Fe(t)?(o(),i("div",hd,[l("span",gd,O(e),1),ye(c,{column:k.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=A.value)?void 0:a.column.name)===t},null,8,["column","is-open"])])):(o(),i("div",yd,[l("span",bd,O(e),1)]))]}),_:2},[je(Object.keys(W(b)),l=>({name:l,fn:xe(e=>[U(t.$slots,l,Et(ks(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):x("",!0)]))}}}),kd={class:"flex"},_d={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},$d=l("g",{fill:"none"},[l("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Cd=[$d],xd=l("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),Ld=l("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1),Vd=[xd,Ld],Sd={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Md=l("g",{fill:"none"},[l("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1),Ad=[Md],Td={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Fd=l("g",{fill:"none"},[l("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1),Id=[Fd],jd=de({__name:"SettingsIcons",props:{column:{},isOpen:{type:Boolean}},setup(e){return(e,l)=>{var t;return o(),i("div",kd,[null!=(t=null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.filters)&&t.length?(o(),i("svg",_d,Cd)):(o(),i("svg",{key:1,class:h(["w-4 h-4 transition-transform",e.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Vd,2)),"ASC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Sd,Ad)):"DESC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Td,Id)):x("",!0)])}}}),Od=de({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(e){return(l,e)=>{let t=K("EnsureAccess"),a=K("SlideOver");return l.invalidAccess?(o(),ae(a,{key:0,title:l.title,onDone:e[0]||(e[0]=e=>l.$emit("done")),"content-class":"relative flex-1"},rl({default:xe(()=>[ye(t,{alertClass:l.alertClass,invalidAccess:l.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[l.subtitle?{name:"subtitle",fn:xe(()=>[ke(O(l.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):x("",!0)}}}),Dd=["for"],Pd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Bd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Hd=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Rd=[Hd],Ed=["id"],zd=["id"],Nd={inheritAttrs:!1},Ud=de({...Nd,__name:"TextInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e,{expose:t}){let a=e,n=(t({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),D());let r=v(()=>a.type||"text"),s=v(()=>a.label??Pe(at(a.id))),u=v(()=>a.placeholder??s.value);function d(e){return"range"===a.type?e.replace("shadow-sm ",""):e}let c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:a.status??(null==c?void 0:c.error.value)},a.id)),f=v(()=>[ot.base,p.value?ot.invalid:d(ot.valid),a.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[U(t.$slots,"header",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs)),s.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(s.value),11,Dd)):x("",!0),l("div",{class:h(d("mt-1 relative shadow-sm rounded-md"))},[l("input",Te({ref_key:"inputElement",ref:n,type:r.value,name:t.id,id:t.id,class:f.value,placeholder:u.value,value:W(pn)(r.value,t.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=p.value,"aria-describedby":t.id+"-error",step:"any"},W(ft)(t.$attrs,["class","value"])),null,16,Pd),p.value?(o(),i("div",Bd,Rd)):x("",!0)],2),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(p.value),9,Ed)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,zd)):x("",!0),U(t.$slots,"footer",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),qd=["for"],Qd={class:"mt-1 relative rounded-md shadow-sm"},Kd=["name","id","placeholder","aria-invalid","aria-describedby"],Zd=["id"],Wd=["id"],Gd={inheritAttrs:!1},Jd=de({...Gd,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=v(()=>t.placeholder??a.value),r=Qe("ApiState",void 0),s=v(()=>mt.call({responseStatus:t.status??(null==r?void 0:r.error.value)},t.id)),u=v(()=>["shadow-sm "+ot.base,s.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,t.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,qd)):x("",!0),l("div",Qd,[l("textarea",Te({name:t.id,id:t.id,class:u.value,placeholder:n.value,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=s.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),O(t.modelValue),17,Kd)]),s.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(s.value),9,Zd)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,Wd)):x("",!0)],2))}}),Xd=["for"],Yd=["id","name","value","aria-invalid","aria-describedby"],ec=["value"],tc=["id"],sc={inheritAttrs:!1},lc=de({...sc,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},label:{},labelClass:{},options:{},values:{},entries:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id)),s=v(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Xd)):x("",!0),l("select",Te({id:t.id,name:t.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",r.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],value:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=r.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),[(o(!0),i(Me,null,je(s.value,e=>(o(),i("option",{value:e.key},O(e.value),9,ec))),256))],16,Yd),r.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(r.value),9,tc)):x("",!0)],2))}}),nc={class:"flex items-center h-5"},oc=["id","name","checked"],ac={class:"ml-3 text-sm"},rc=["for"],ic={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},uc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},dc={inheritAttrs:!1},cc=de({...dc,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{}){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id));return(t,e)=>(o(),i("div",{class:h(["relative flex items-start",t.$attrs.class])},[l("div",nc,[l("input",Te({id:t.id,name:t.id,type:"checkbox",checked:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",t.inputClass]},W(ft)(t.$attrs,["class"])),null,16,oc)]),l("div",ac,[l("label",{for:t.id,class:h("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,rc),r.value?(o(),i("p",ic,O(r.value),1)):t.help?(o(),i("p",uc,O(t.help),1)):x("",!0)])],2))}}),fc=["id"],vc=["for"],pc={class:"mt-1 relative rounded-md shadow-sm"},mc=["id","name","value"],hc={class:"flex flex-wrap pb-1.5"},gc={class:"pt-1.5 pl-1"},yc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},bc=["onClick"],wc=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),kc=[wc],_c={class:"pt-1.5 pl-1 shrink"},$c=["type","name","id","aria-invalid","aria-describedby"],Cc=["id"],xc=["onMouseover","onClick"],Lc={class:"block truncate"},Vc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Sc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Mc=[Sc],Ac=["id"],Tc=["id"],Fc={inheritAttrs:!1},Ic=de({...Fc,__name:"TagInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:{},string:{type:Boolean},maxVisibleItems:{default:300},converter:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=e,n=t;let r=v(()=>{return Ze((e=a.modelValue,a.converter?a.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),s=D(),u=D(!1),d=v(()=>{let l=p.value.toLowerCase();return a.allowableValues&&0!=a.allowableValues.length?a.allowableValues.length<1e3?a.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(l)):a.allowableValues.filter(e=>!r.value.includes(e)&&e.startsWith(l)):[]});let c=D(null),p=D(""),f=v(()=>a.type||"text"),m=v(()=>a.label??Pe(at(a.id))),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",a.inputClass]),w=l=>V(r.value.filter(e=>e!=l));function k(e){var l;document.activeElement===e.target&&null!=(l=c.value)&&l.focus()}let C=D();function L(){u.value=!0,C.value=!0}function M(){$(T()),C.value=!1,setTimeout(()=>{C.value||(u.value=!1)},200)}function V(e){var l=a.string?e.join(","):e;n("update:modelValue",l)}function S(e){var l;"Backspace"==e.key&&0==p.value.length&&0e==l.key))&&l.preventDefault(),"Enter"==l.key||"NumpadEnter"==l.key||1==l.key.length&&e)&&$(t)}let F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function I(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function $(e){var l;0!==e.length&&(-1==(l=Array.from(r.value)).indexOf(e)&&l.push(e),V(l),p.value="",u.value=!1)}function B(t){var e,t=null==(e=t.clipboardData)?void 0:e.getData("Text");if(t){let e=new RegExp("\\n|\\t|"+a.delimiters.join("|")),l=Array.from(r.value);t.split(e).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),V(l),p.value=""}}return(e,t)=>(o(),i("div",{class:h([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(m.value),11,vc)):x("",!0),l("div",pc,[l("input",{type:"hidden",id:e.id,name:e.id,value:r.value.join(",")},null,8,mc),l("button",{class:h(b.value),onClick:Ue(k,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",hc,[(o(!0),i(Me,null,je(r.value,t=>(o(),i("div",gc,[l("span",yc,[ke(O(t)+" ",1),l("button",{type:"button",onClick:e=>w(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},kc,8,bc)])]))),256)),l("div",_c,[Mt(l("input",Te({ref_key:"txtInput",ref:c,type:f.value,role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:e.id+"-txt",id:e.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error",onKeydown:S,onKeypress:A,onPaste:Ue(B,["prevent","stop"]),onFocus:L,onBlur:M,onClick:t[1]||(t[1]=e=>u.value=!0)},W(ft)(e.$attrs,["class","required"])),null,16,$c),[[wo,p.value]])])])],34),u.value&&d.value.length?(o(),i("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(d.value.slice(0,e.maxVisibleItems),t=>(o(),i("li",{class:h([t===s.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var l;l=t,s.value=l},onClick:e=>$(t),role:"option",tabindex:"-1"},[l("span",Lc,O(t),1)],42,xc))),256))],40,Cc)):x("",!0),y.value?(o(),i("div",Vc,Mc)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,Ac)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Tc)):x("",!0)],10,fc))}}),jc={class:"relative flex-grow mr-2 sm:mr-4"},Oc=["for"],Dc={class:"block mt-2"},Pc={class:"sr-only"},Bc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Hc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Rc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Ec=[Rc],zc=["id"],Nc=["id"],Uc={key:0},qc=["title"],Qc=["alt","src"],Kc={key:1,class:"mt-3"},Zc={class:"w-full"},Wc={class:"pr-6 align-bottom pb-2"},Gc=["title"],Jc=["src","onError"],Xc=["href"],Yc={key:1,class:"overflow-hidden"},e0={class:"align-top pb-2 whitespace-nowrap"},t0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},s0=de({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(e){let t,a=e,n=D(null),{assetsPathResolver:r,fallbackPathResolver:s}=It(),u={},d=D(),c=D((null==(t=a.files)?void 0:t.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}a.values&&0{var l=e.replace(/\\/g,"/");return{fileName:rn(At(l,"/"),"."),filePath:l,contentType:el(l)}}).map(p));let f=v(()=>a.label??Pe(at(a.id))),m=v(()=>a.placeholder??f.value),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",a.inputClass]),w=e=>{var l=e.target;d.value="",c.value=Array.from(l.files||[]).map(e=>({fileName:e.name,filePath:pl(e),contentLength:e.size,contentType:e.type||el(e.name)}))},k=()=>{var e;return null==(e=n.value)?void 0:e.click()},C=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),L=v(()=>{var e;return 0!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function V(e){d.value=s(L.value)}return Ft(Cn),(e,t)=>(o(),i("div",{class:h(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",jc,[f.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(f.value),11,Oc)):x("",!0),l("div",Dc,[l("span",Pc,O(e.help??f.value),1),l("input",Te({ref_key:"input",ref:n,type:"file",multiple:e.multiple,name:e.id,id:e.id,class:b.value,placeholder:m.value,"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error"},e.$attrs,{onChange:w}),null,16,Bc),y.value?(o(),i("div",Hc,Ec)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,zc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Nc)):x("",!0)]),e.multiple?(o(),i("div",Kc,[l("table",Zc,[(o(!0),i(Me,null,je(c.value,t=>(o(),i("tr",null,[l("td",Wc,[l("div",{class:"flex w-full",title:C(t.filePath)?"":t.filePath},[l("img",{src:u[W(xt)(t.filePath)]||W(r)(W(xt)(t.filePath)),class:h(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[W(xt)(t.filePath)]=W(s)(W(xt)(t.filePath))},null,42,Jc),C(t.filePath)?(o(),i("span",Yc,O(t.fileName),1)):(o(),i("a",{key:0,href:W(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},O(t.fileName),9,Xc))],8,Gc)]),l("td",e0,[t.contentLength&&0[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=D(!1),r=e,s=a;function u(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}t({toggle:I});let d=v(()=>r.label??Pe(at(r.id))),c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:r.status??(null==c?void 0:c.error.value)},r.id)),f=v(()=>[ot.base,p.value?ot.invalid:ot.valid]),m=D(null),g=D(""),y=D(null),b=D(r.viewCount),w=D([]),k=v(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,b.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let L=[",",` +var ho=Object.defineProperty,go=(e,l,t)=>l in e?ho(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Le=(e,l,t)=>(go(e,"symbol"!=typeof l?l+"":l,t),t);import{defineComponent as de,computed as v,openBlock as o,createElementBlock as i,normalizeClass as h,createElementVNode as l,createCommentVNode as x,renderSlot as U,ref as D,toDisplayString as O,inject as Qe,nextTick as St,isRef as nn,unref as W,mergeProps as Te,withModifiers as Ue,h as $t,resolveComponent as K,createBlock as ae,withCtx as xe,useAttrs as yo,createVNode as ye,createTextVNode as ke,watchEffect as ws,normalizeStyle as ol,Fragment as Me,renderList as je,withDirectives as Mt,vModelCheckbox as al,withKeys as on,createStaticVNode as xs,vModelSelect as bo,useSlots as Ls,getCurrentInstance as Be,onMounted as Ye,createSlots as rl,normalizeProps as Et,guardReactiveProps as ks,vModelDynamic as wo,onUnmounted as Ft,watch as bt,vModelText as ko,resolveDynamicComponent as an,provide as ss,resolveDirective as _o}from"vue";import{errorResponseExcept as $o,toDate as pt,toTime as Co,omit as ft,enc as Zs,appendQueryString as zt,lastLeftPart as rn,setQueryString as xo,nameOf as Lo,ApiResult as Xe,lastRightPart as At,leftPart as Vs,map as Ze,toDateTime as Vo,toCamelCase as So,mapGet as _e,chop as Mo,fromXsdDuration as un,isDate as Ss,timeFmt12 as Ao,dateFmt as To,apiValue as Fo,indexOfAny as Io,createBus as jo,toKebabCase as Wl,sanitize as Oo,humanize as Pe,delaySet as dn,rightPart as ms,queryString as Ws,combinePaths as Do,toPascalCase as at,errorResponse as mt,trimEnd as Po,$1 as _s,ResponseStatus as qs,ResponseError as Gl,HttpMethods as il,omitEmpty as Bo,uniqueKeys as Gs,humanify as cn,each as Ho}from"@servicestack/client";let Ro={class:"flex items-center"},Eo={key:0,class:"flex-shrink-0 mr-3"},zo={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},No=l("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),Uo=[No],qo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Qo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1),Ko=[Qo],Zo={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Wo=l("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1),Go=[Wo],Jo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Xo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1),Yo=[Xo],ea=de({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(e){let t=e,a=v(()=>"info"==t.type?"bg-blue-50 dark:bg-blue-200":"error"==t.type?"bg-red-50 dark:bg-red-200":"success"==t.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),n=v(()=>"info"==t.type?"border-blue-400":"error"==t.type?"border-red-400":"success"==t.type?"border-green-400":"border-yellow-400"),r=v(()=>"info"==t.type?"text-blue-700":"error"==t.type?"text-red-700":"success"==t.type?"text-green-700":"text-yellow-700");return(e,t)=>(o(),i("div",{class:h([a.value,n.value,"border-l-4 p-4"])},[l("div",Ro,[e.hideIcon?x("",!0):(o(),i("div",Eo,["warn"==e.type?(o(),i("svg",zo,Uo)):"error"==e.type?(o(),i("svg",qo,Ko)):"info"==e.type?(o(),i("svg",Zo,Go)):"success"==e.type?(o(),i("svg",Jo,Yo)):x("",!0)])),l("div",null,[l("p",{class:h([r.value,"text-sm"])},[U(e.$slots,"default")],2)])])],2))}}),ta={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},sa={class:"flex"},la=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),na={class:"ml-3"},oa={class:"text-sm font-medium text-green-800"},aa={key:0},ra={class:"ml-auto pl-3"},ia={class:"-mx-1.5 -my-1.5"},ua=l("span",{class:"sr-only"},"Dismiss",-1),da=l("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),ca=[ua,da],fa=de({__name:"AlertSuccess",props:{message:{}},setup(e){let a=D(!1);return(e,t)=>a.value?x("",!0):(o(),i("div",ta,[l("div",sa,[la,l("div",na,[l("h3",oa,[e.message?(o(),i("span",aa,O(e.message),1)):U(e.$slots,"default",{key:1})])]),l("div",ra,[l("div",ia,[l("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>a.value=!0)},ca)])])])]))}}),va={class:"flex"},pa=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),ma={class:"ml-3"},ha={class:"text-sm text-red-700 dark:text-red-200"},ga=de({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,a=Qe("ApiState",void 0),n=v(()=>t.status||null!=a&&a.error.value?$o.call({responseStatus:t.status??(null==a?void 0:a.error.value)},t.except??[]):null);return(e,t)=>n.value?(o(),i("div",{key:0,class:h("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[l("div",va,[pa,l("div",ma,[l("p",ha,O(n.value),1)])])],2)):x("",!0)}}),ya=["id","aria-describedby"],ba=de({__name:"InputDescription",props:{id:{},description:{}},setup(e){return(e,t)=>e.description?(o(),i("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:e.id+"-description","aria-describedby":e.id+"-description"},[l("div",null,O(e.description),1)],8,ya)):x("",!0)}});function Ms(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,10)??""}function fn(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,19)??""}function vn(e){return null==e?"":Co(e)}function pn(e,l){var t,a;return G.config.inputValue?G.config.inputValue(e,l):(t=typeof(a="date"===e?Ms(l):"datetime-local"===e?fn(l):"time"===e?vn(l):l),null==a?"":"boolean"==t||"number"==t?""+a:a)}function mn(e,l){e.value=null,St(()=>e.value=l)}function Dt(t){return Object.keys(t).forEach(e=>{var l=t[e];t[e]=nn(l)?W(l):l}),t}function yt(e,l,t){t?(l.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>l.value=e.entering.cls+" "+e.entering.to,0)):(l.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>l.value=e.leaving.cls+" "+e.leaving.to,0))}function hs(t){if(!("u"0":"<"+e+Js(t)+`>${l||""}`}function Js(t){return Object.keys(t).reduce((e,l)=>`${e} ${l}="${Zs(t[l])}"`,"")}function As(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Ht(e){return Vl(e)}let wa=["string","number","boolean","null","undefined"];function Tt(e){return 0<=wa.indexOf(typeof e)||e instanceof Date}function Rt(e){return!Tt(e)}class hn{get length(){return"u"",";"].some(e=>l.includes(e)))throw new Error(`Unsafe script: '${l}'`);var t=Object.assign(Object.keys(globalThis).reduce((e,l)=>(e[l]=void 0,e),{}),e);return new Function("with(this) { return ("+l+") }").call(t)}function Xs(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function cl(e){var l=G.config.storage.getItem(e);return l?JSON.parse(l):null}function Ts(e,l){return zt("swr."+Lo(e),l?Object.assign({},e,l):e)}function ka(e){var l;e.request&&(l=Ts(e.request,e.args),G.config.storage.removeItem(l))}async function gn(e,l,t,a,n){var r,s=Ts(l,a),o=(t(new Xe({response:cl(s)})),await e.api(l,a,n));return o.succeeded&&o.response&&(o.response._date=(new Date).valueOf(),r=JSON.stringify(o.response),G.config.storage.setItem(s,r),t(o)),o}function yn(l,t){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{l(...e)},t||100)}}function Ct(e){return"string"==typeof e?e.split(","):e||[]}function Vt(e,l){let t=Ct(l);return e.reduce((e,l)=>(e[l]=!t.includes(l),e),{})}function bn(){return{LocalStore:hn,dateInputFormat:Ms,dateTimeInputFormat:fn,timeInputFormat:vn,textInputValue:pn,setRef:mn,unRefs:Dt,transition:yt,focusNextElement:hs,getTypeName:Qt,htmlTag:dt,htmlAttrs:Js,linkAttrs:As,toAppUrl:Ht,isPrimitive:Tt,isComplexType:Rt,pushState:ul,scopedExpr:dl,copyText:Xs,fromCache:cl,swrCacheKey:Ts,swrClear:ka,swrApi:gn,asStrings:Ct,asOptions:Vt,createDebounce:yn}}let wn="png,jpg,jpeg,jfif,gif,svg,webp".split(","),kn={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},Jl=Object.keys(kn),vt=(e,l)=>``,gs={img:vt("4 4 16 16",""),vid:vt("0 0 24 24",""),aud:vt("0 0 24 24",""),ppt:vt("0 0 48 48",""),xls:vt("0 0 256 256",""),doc:vt("0 0 32 32",""),zip:vt("0 0 16 16",""),exe:vt("0 0 16 16",""),att:vt("0 0 24 24","")},_a=/[\r\n%#()<>?[\\\]^`{|}]/g,Xl=1024,$a=["Bytes","KB","MB","GB","TB"],Ca=(()=>{let l="application/",e=l+"vnd.openxmlformats-officedocument.",t="image/",a="text/",n="video/",r={jpg:t+"jpeg",tif:t+"tiff",svg:t+"svg+xml",ico:t+"x-icon",ts:a+"typescript",py:a+"x-python",sh:a+"x-sh",mp3:"audio/mpeg3",mpg:n+"mpeg",ogv:n+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:l+"vnd.ms-access"};function s(e,l){e.split(",").forEach(e=>r[e]=l)}function o(e,l){e.split(",").forEach(e=>r[e]=l(e))}return o("jpeg,gif,png,tiff,bmp,webp",e=>t+e),o("jsx,csv,css",e=>a+e),o("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>"audio/"+e),o("3gpp,avi,dv,divx,ogg,mp4,webm",e=>n+e),o("rtf,pdf",e=>l+e),s("htm,html,shtm",a+"html"),s("js,mjs,cjs",a+"javascript"),s("yml,yaml",l+"yaml"),s("bat,cmd",l+"bat"),s("xml,csproj,fsproj,vbproj",a+"xml"),s("txt,ps1",a+"plain"),s("qt,mov",n+"quicktime"),s("doc,dot",l+"msword"),s("xls,xlt,xla",l+"excel"),s("ppt,oit,pps,ppa",l+"vnd.ms-powerpoint"),s("cer,crt,der",l+"x-x509-ca-cert"),s("gz,tgz,zip,rar,lzh,z",l+"x-compressed"),s("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",l+"octet-stream"),r})(),Ys=[];function _n(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+<")).replace(/\s{2,}/g," ")).replace(_a,encodeURIComponent)}function fl(e){return"data:image/svg+xml;utf8,"+_n(e)}function $n(e){var l=URL.createObjectURL(e);return Ys.push(l),l}function Cn(){Ys.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Ys=[]}function vl(e){var l;return e?(l=Vs(e,"?"),At(l,"/")):null}function ls(e){var l=vl(e);return null==l||-1===l.indexOf(".")?null:At(l,".").toLowerCase()}function pl(e){var l=ls(e.name);return l&&0<=wn.indexOf(l)?$n(e):xt(e.name)}function ml(e){var l;return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(l=ls(e))&&0<=wn.indexOf(l))||!1}function xt(e){var l;return e?null==(l=ls(e))||ml(e)?e:Xt(l)||fl(gs.doc):null}function Xt(e){var l=xn(e);return l&&fl(l)||null}function xn(e){if(gs[e])return gs[e];for(let t=0;t({fileName:e.name,contentLength:e.size,filePath:pl(e)}))}function Fs(e,l){e.onerror=null,e.src=gl(e.src,l)||""}function gl(e,l){return Xt(At(e,".").toLowerCase())||(l?Xt(l)||l:null)||Xt("doc")}function el(e){var l;if(e)return l=At(e,".").toLowerCase(),Ca[l]||"application/"+l;throw new Error("fileNameOrExt required")}function La(){return{extSvg:xn,extSrc:Xt,getExt:ls,encodeSvg:_n,canPreview:ml,getFileName:vl,getMimeType:el,formatBytes:hl,filePathUri:xt,svgToDataUri:fl,fileImageUri:pl,objectUrl:$n,flush:Cn,inputFiles:xa,iconOnError:Fs,iconFallbackSrc:gl}}class Va{constructor(e){Le(this,"view"),Le(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}let Nt="/metadata/app.json",Sa={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},Ma={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},tl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},Aa=([...Object.keys(tl),...Object.values(tl)],{String:"string",Boolean:"bool",...tl});function fs(e){return Aa[e]||e}function Ln(e,l){return e?(l=l||[],"Nullable`1"===e?fs(l[0])+"?":e.endsWith("[]")?`List<${fs(e.substring(0,e.length-2))}>`:0===l.length?fs(e):Vs(fs(e),"`")+"<"+l.join(",")+">"):""}function Ta(e){return e&&Ln(e.name,e.genericArgs)}class Ut{constructor(){Le(this,"Query"),Le(this,"QueryInto"),Le(this,"Create"),Le(this,"Update"),Le(this,"Patch"),Le(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}get dataModel(){var e;return null==(e=this.AnyQuery)?void 0:e.dataModel}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){qe.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:qe.isQuery(e)&&!this.Query?this.Query=e:qe.isCreate(e)&&!this.Create?this.Create=e:qe.isUpdate(e)&&!this.Update?this.Update=e:qe.isPatch(e)&&!this.Patch?this.Patch=e:qe.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){let l=new Ut;return e.forEach(e=>{l.add(e)}),l}static forType(t,e){let l,a=new Ut;var n;return G.config.apisResolver&&t&&(n=G.config.apisResolver(t,e))&&(a.Query=n.Query,a.QueryInto=n.QueryInto,a.Create=n.Create,a.Update=n.Update,a.Patch=n.Patch,a.Delete=n.Delete),t&&(null!=(e=e??(null==(l=G.metadata.value)?void 0:l.api))&&e.operations.forEach(e=>{var l;(null==(l=e.dataModel)?void 0:l.name)==t&&a.add(e)})),a}}let qe={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>Ze(e.request.inherits,e=>0<=qe.AnyRead.indexOf(e.name)),isQuery:e=>Ze(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>Ze(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{var l;return null==(l=e.request.implements)?void 0:l.some(e=>0<=qe.AnyWrite.indexOf(e.name))},isCreate:e=>vs(e,qe.Create),isUpdate:e=>vs(e,qe.Update),isPatch:e=>vs(e,qe.Patch),isDelete:e=>vs(e,qe.Delete),model:e=>{var l;return e?Ze(e.inherits,e=>0<=qe.AnyRead.indexOf(e.name))?null==(l=e.inherits)?void 0:l.genericArgs[0]:null==(l=null==(l=e.implements)?void 0:l.find(e=>0<=qe.AnyWrite.indexOf(e.name)))?void 0:l.genericArgs[0]:null}};function Fa(e){var l;return(null==(l=e.input)?void 0:l.type)||Is(yl(e))}function Vn(e){return e.endsWith("?")?Mo(e,1):e}function Is(e){return Sa[Vn(e)]}function Ia(e){return e&&Ma[e]||"String"}function yl(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function sl(e){return e&&"number"==Is(e)||!1}function Sn(e){return e&&"string"==e.toLowerCase()||!1}function ja(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function Mn(e){var l;return!(null==e||!e.type||(l=yl(e),e.isValueType&&-1==l.indexOf("`"))||e.isEnum||null!=Is(e.type))}function An(e){var l;return!!(null!=e&&e.type&&(l=yl(e),e.isValueType&&-1==l.indexOf("`")||e.isEnum||"hidden"==(null==(l=e.input)?void 0:l.type)||"file"==(null==(l=e.input)?void 0:l.type)||"tag"==(null==(l=e.input)?void 0:l.type)||"combobox"==(null==(l=e.input)?void 0:l.type)||null!=Is(e.type)))}function Yt(e,l){let t="string"==typeof e?js(e):e,a=(t||(console.warn("Metadata not found for: "+e),t={request:{name:e}}),function(e){Object.assign(this,e)}),n=(r.prototype.createResponse=function(){return t.returnsVoid?void 0:new a},r.prototype.getTypeName=function(){return t.request.name},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function Oa(e,l,t={}){let a=function(e){Object.assign(this,e)},n=(r.prototype.createResponse=function(){return"function"==typeof t.createResponse?t.createResponse():new a},r.prototype.getTypeName=function(){return e},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function ys(t,e){return t?(Object.keys(t).forEach(e=>{var l=t[e];"string"==typeof l?l.startsWith("/Date")&&(t[e]=Ms(pt(l))):null!=l&&"object"==typeof l&&(Array.isArray(l)?t[e]=Array.from(l):t[e]=Object.assign({},l))}),t):{}}function Da(e,o){let i={};return Array.from(e.elements).forEach(e=>{var r,s=e;if(s.id&&null!=s.value&&""!==s.value){let l=s.id.toLowerCase(),e=o&&o.find(e=>e.name.toLowerCase()==l),t=null==e?void 0:e.type,a=null==(r=null==e?void 0:e.genericArgs)?void 0:r[0],n="checkbox"===s.type?s.checked:s.value;sl(t)?n=Number(n):"List`1"===t&&"string"==typeof n&&(n=n.split(",").map(e=>sl(a)?Number(e):e)),i[s.id]=n}}),i}function bl(e){var l;return(null==(l=null==e?void 0:e.api)?void 0:l.operations)&&0l)?!1:n)){if((t||a)&&(await Yl(t||Nt,a),null!=G.metadata.value))return;var r=Qe("client");if(null!=r&&(l=await r.api(new Va)).succeeded&&es(l.response),null!=G.metadata.value)return;await Yl(Nt)}return G.metadata.value}function rt(l,t){if(G.config.typeResolver){var e=G.config.typeResolver(l,t);if(e)return e}var a,e=null==(e=G.metadata.value)?void 0:e.api;return e&&l?e.types.find(e=>e.name.toLowerCase()===l.toLowerCase()&&(!t||e.namespace==t))||((a=js(l))?a.request:(a=e.operations.find(e=>e.response&&e.response.name.toLowerCase()===l.toLowerCase()&&(!t||e.response.namespace==t)))?a.response:null):null}function js(l){if(G.config.apiResolver){var e=G.config.apiResolver(l);if(e)return e}e=null==(e=G.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===l.toLowerCase()):null}function Ra({dataModel:e}){var l=null==(l=G.metadata.value)?void 0:l.api;if(!l)return[];let t=l.operations;if(e){let l="string"==typeof e?rt(e):e;t=t.filter(e=>Tn(e.dataModel,l))}return t}function kl(e){return e?rt(e.name,e.namespace):null}function Tn(e,l){return e&&l&&e.name===l.name&&(!e.namespace||!l.namespace||e.namespace===l.namespace)}function Ea(e,l){var t=rt(e);return t&&t.properties&&t.properties.find(e=>e.name.toLowerCase()===l.toLowerCase())}function Fn(e){return In(rt(e))}function In(l){if(l&&l.isEnum&&null!=l.enumNames){var t={};for(let e=0;el.push({key:e,value:t[e]})),l}}function za(e,l){t=e.name,a=(null==l?void 0:l.type)||Fa(e)||"text";var t,a,n=Object.assign({id:t,name:t,type:a},l);return e.isEnum&&(n.type="select",n.allowableEntries=_l(jn(e))),n}function Na(l){let r=[];if(l){let a=st(l),e=js(l.name),n=kl(null==e?void 0:e.dataModel);a.forEach(l=>{var e;if(An(l)){let t=za(l,l.input);if(t.id=So(t.id),"file"==t.type&&l.uploadTo&&!t.accept&&(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins.filesUpload)?void 0:e.locations.find(e=>e.name==l.uploadTo))&&!t.accept&&e.allowExtensions&&(t.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),n&&(e=null==(e=n.properties)?void 0:e.find(e=>e.name==l.name),l.ref||(l.ref=null==e?void 0:e.ref)),t.options)try{let e={input:t,$typeFields:a.map(e=>e.name),$dataModelFields:n?st(n).map(e=>e.name):[],...G.config.scopeWhitelist},l=dl(t.options,e);Object.keys(l).forEach(e=>{t[e]=l[e]})}catch{console.error(`failed to evaluate '${t.options}'`)}r.push(t)}})}return r}function $l(e,l){if(!l.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+e];var t=rt(l.type);if(null==t||!t.enumValues)return console.error("Could not find metadata for "+l.type),[""+e];var a=[];for(let r=0;r"number"==typeof e?$l(e,{type:l}):e}function st(e){if(!e)return[];let l=[],t={};for(;e;)e.properties&&e.properties.forEach(e=>{t[e.name]||(t[e.name]=1,l.push(e))}),e=e.inherits?kl(e.inherits):null;return l.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function vs(e,l){var t;return(null==(t=e.request.implements)?void 0:t.some(e=>e.name===l))||!1}function ns(e){return e?Dn(e,st(e)):null}function Dn(e,l){var t=l.find(e=>"id"===e.name.toLowerCase());if(t&&t.isPrimaryKey)return t;t=l.find(e=>e.isPrimaryKey)||t;if(!t){var a=qe.model(e);if(a)return Ze(rt(a),e=>ns(e));console.error("Primary Key not found in "+e.name)}return t||null}function Ua(e,l){return Ze(ns(e),e=>_e(l,e.name))}function Pn(e,l,t){return e&&"none"===e.valueType?"":"%In"===t.key||"%Between"===t.key?`(${t.value})`:qa(l,t.value)}function qa(e,l){return!e||sl(e=Vn(e))||"Boolean"===e?l:ja(e)?`[${l}]`:`'${l}'`}function gt(e,l){return{name:e,value:l}}let Qa=[gt("=","%"),gt("!=","%!"),gt(">=",">%"),gt(">","%>"),gt("<=","%<"),gt("<","<%"),gt("In","%In"),gt("Between","%Between"),{name:"Starts With",value:"%StartsWith",types:"string"},{name:"Contains",value:"%Contains",types:"string"},{name:"Ends With",value:"%EndsWith",types:"string"},{name:"Exists",value:"%IsNotNull",valueType:"none"},{name:"Not Exists",value:"%IsNull",valueType:"none"}];function lt(){var e=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.app)||null}),l=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.api)||null}),t=v(()=>{var e;return(null==(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins)?void 0:e.autoQuery)?void 0:e.viewerConventions)||Qa});return wl(),{loadMetadata:Ha,getMetadata:Pa,setMetadata:es,clearMetadata:Ba,metadataApp:e,metadataApi:l,filterDefinitions:t,typeOf:rt,typeOfRef:kl,typeEquals:Tn,apiOf:js,findApis:Ra,typeName:Ta,typeName2:Ln,property:Ea,enumOptions:Fn,propertyOptions:jn,createFormLayout:Na,typeProperties:st,supportsProp:An,Crud:qe,Apis:Ut,getPrimaryKey:ns,getPrimaryKeyByProps:Dn,getId:Ua,createDto:Yt,makeDto:Oa,toFormValues:ys,formValues:Da,isComplexProp:Mn,asKvps:_l,expandEnumFlags:$l,enumFlagsConverter:On}}let et=class et{static async getOrFetchValue(e,l,t,a,n,r,s){return et.getValue(t,s,n)??(await et.fetchLookupIds(e,l,t,a,n,r,[s]),et.getValue(t,s,n))}static getValue(e,l,t){var a=et.Lookup[e];if(a){a=a[l];if(a)return a[t=t.toLowerCase()]}}static setValue(e,l,t,a){var n=et.Lookup[e]??(et.Lookup[e]={});(n[l]??(n[l]={}))[t=t.toLowerCase()]=a}static setRefValue(e,l){var t,a=_e(l,e.refId);return null==a||null==e.refLabel?null:(t=_e(l,e.refLabel),et.setValue(e.model,a,e.refLabel,t),t)}static async fetchLookupIds(e,l,n,r,s,o,i){var u=l.operations.find(e=>{var l;return qe.isAnyQuery(e)&&(null==(l=e.dataModel)?void 0:l.name)==n});if(u){let a=et.Lookup[n]??(et.Lookup[n]={}),t=[];Object.keys(a).forEach(e=>{var l=a[e];_e(l,s)&&t.push(e)});var d,v=i.filter(e=>!t.includes(e));0!=v.length&&(d=o?null:r+","+s,v={[r+"In"]:v.join(",")},d&&(v.fields=d),d=Yt(u,v),(v=await e.api(d,{jsconfig:"edv,eccn"})).succeeded?(_e(v.response,"results")||[]).forEach(e=>{var l,t;_e(e,r)?(l=""+_e(e,r),t=_e(e,s),s=s.toLowerCase(),(a[l]??(a[l]={}))[s]=""+t):console.error(`result[${r}] == null`,e)}):console.error("Failed to call "+u.request.name))}}},Pt=(Le(et,"Lookup",{}),et),ll=()=>(new Date).getTime(),Ka=["/","T",":","-"],ct={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Za=new Intl.RelativeTimeFormat(ct.locale,{}),en=31536e6,Qs={year:en,month:en/12,day:864e5,hour:36e5,minute:6e4,second:1e3},Lt={currency:Hn,bytes:Rn,link:En,linkTel:zn,linkMailTo:Nn,icon:Un,iconRounded:qn,attachment:Qn,hidden:Kn,time:Zn,relativeTime:xl,relativeTimeFromMs:Os,enumFlags:Gn,formatDate:Kt,formatNumber:Cl};"iconOnError"in globalThis||(globalThis.iconOnError=Fs);class Ke{}function Wa(e){ct=Object.assign({},ct,e)}function Ga(l){Object.keys(l||{}).forEach(e=>{"function"==typeof l[e]&&(Lt[e]=l[e])})}function Bn(){return Lt}function os(e,l){return l?dt("span",e,l):e}function Hn(e,l){var t=ft(l,["currency"]);return os(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==l?void 0:l.currency)||"USD"}).format(e),t)}function Rn(e,l){return os(hl(e),l)}function En(e,l){return dt("a",e,As({...l,href:e}))}function zn(e,l){return dt("a",e,As({...l,href:"tel:"+e}))}function Nn(e,l){var{subject:t,body:a}=l=l||{},n=ft(l,["subject","body"]),r={};return t&&(r.subject=t),a&&(r.body=a),dt("a",e,As({...n,href:"mailto:"+zt(e,r)}))}function Un(e,l){return dt("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function qn(e,l){return dt("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function Qn(e,l){var t=vl(e),a=(null==ls(t)||ml(e)?Ht:gl)(e),a=Ht(a),n=l&&(l["icon-class"]||l.iconClass),a=dt("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},n?{class:n}:null));return dt("a",a+`${t}`,Object.assign({class:"flex",href:Ht(e),title:e},l?ft(l,["icon-class","iconClass"]):null))}function Kn(e){return""}function Zn(e,l){var t="string"==typeof e?new Date(1e3*un(e)):Ss(e)?pt(e):null;return os(t?Ao(t):e,l)}function Kt(e,l){var t,a;return null==e?"":(t="number"==typeof e?new Date(e):"string"==typeof e?pt(e):e,Ss(t)?os(("function"==typeof(a=ct.date?Ds(ct.date):null)?a:To)(t),l):(console.warn(t+" is not a Date value"),null==e?"":""+e))}function Cl(e,l){if("number"!=typeof e)return e;let t=ct.number?Ds(ct.number):null,a="function"==typeof t?t(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,t),a=""+e),os(a,l)}function Wn(l,t,a){var e=Fo(l),n=t?Ds(t):null;if("function"!=typeof n)return(null!=e?Ss(e)?Kt(e,a):"number"==typeof e?Cl(e,a):e:null)??"";{let e=a;if(null!=t&&t.options)try{e=dl(t.options,a)}catch(e){console.error(`Could not evaluate '${t.options}'`,e,", with scope:",a)}return n(l,e)}}function ts(e,l,t){return(Tt(e)?Wn:tr)(e,l,t)}function Ja(e){if(null!=e){if("number"==typeof e)return e;if(Ss(e))return e.getTime()-ll();if("string"==typeof e){var l=Number(e);if(!isNaN(l))return l;if("P"===e[0]||e.startsWith("-P"))return 1e3*un(e)*-1;if(0<=Io(e,Ka))return pt(e).getTime()-ll()}}return NaN}function Os(e,l){for(var t in Qs)if(Math.abs(e)>Qs[t]||"second"===t)return(l||Za).format(Math.round(e/Qs[t]),t)}function xl(e,l){var t=Ja(e);return isNaN(t)?"":Os(t,l)}function Xa(e,l){return Os(e.getTime()-(l?l.getTime():ll()))}function Gn(e,l){return $l(e,l).join(", ")}function Ds(l){if(l){let{method:e,options:a}=l,n=e+`(${a})`,r=Lt[n]||Lt[e];if("function"==typeof r)return r;let s=l.locale||ct.locale;if(e.startsWith("Intl.")){var t=s?`'${s}'`:"undefined",t=`return new ${e}(${t},${a||"undefined"})`;try{let l=Function(t)();return r="Intl.DateTimeFormat"===e?e=>l.format(pt(e)):"Intl.NumberFormat"===e?e=>l.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>xl(e,l):e=>l.format(e),Lt[n]=r}catch(e){console.error("Invalid format: "+t,e)}}else{let t=globalThis[e];if("function"==typeof t){let l=null!=a?Function("return "+a)():void 0;return r=e=>t(e,l,s),Lt[n]=r}console.error(`No '${e}' function exists`,Object.keys(Lt))}}return null}function Jn(e,l){return e?e.length>l?e.substring(0,l)+"...":e:""}function Xn(e){return"/Date("===e.substring(0,6)?Kt(pt(e)):e}function Ya(e){return Ll(qt(e)).replace(/"/g,"")}function Yn(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function Ll(e,l=4){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,l)}function er(e){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:Ll(e=qt(e=Object.assign({},e)))}function qt(t){if(null==t)return null;if("string"==typeof t)return Xn(t);if(Tt(t))return t;if(t instanceof Date)return Kt(t);if(Array.isArray(t))return t.map(qt);if("object"!=typeof t)return t;{let l={};return Object.keys(t).forEach(e=>{"__type"!=e&&(l[e]=qt(t[e]))}),l}}function tr(e,l,t){let a=e;if(Array.isArray(e)){if(Tt(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return Kt(a,t);var n=Object.keys(a),r=[];for(let i=0;i${s}: `+Zs(Jn(Xn(o),ct.maxNestedFieldLength)))}return 2t.value.navigate(l.to??"/");return(e,l)=>(o(),i("a",Te({onClick:Ue(a,["prevent"]),title:e.to,href:"javascript:void(0)"},e.$attrs),[U(e.$slots,"default")],16,sr))}});class nr{constructor(){Le(this,"callbacks",{})}register(e,l){this.callbacks[e]=l}has(e){return!!this.callbacks[e]}invoke(e,l){var t=this.callbacks[e];"function"==typeof t&&t(e,l)}}let tt=class tt{static component(e){var l=tt.components[e];if(l)return l;let t=Wl(e),a=Object.keys(tt.components).find(e=>Wl(e)===t);return a&&tt.components[a]||null}},G=(Le(tt,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new hn,tableIcon:{svg:""},scopeWhitelist:{enumFlagsConverter:On,...Bn()}}),Le(tt,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Le(tt,"events",jo()),Le(tt,"user",D(null)),Le(tt,"metadata",D(null)),Le(tt,"components",{RouterLink:lr}),Le(tt,"interceptors",new nr),tt);function or(e){G.config=Object.assign(G.config,e)}function ar(e){G.autoQueryGridDefaults=Object.assign(G.autoQueryGridDefaults,e)}function Vl(e){return e&&G.config.assetsPathResolver?G.config.assetsPathResolver(e):e}function rr(e){return e&&G.config.fallbackPathResolver?G.config.fallbackPathResolver(e):e}function ir(e,l){G.interceptors.register(e,l)}function It(){var e=v(()=>G.config),l=v(()=>G.autoQueryGridDefaults);return{config:e,setConfig:or,events:G.events,autoQueryGridDefaults:l,setAutoQueryGridDefaults:ar,assetsPathResolver:Vl,fallbackPathResolver:rr,registerInterceptor:ir}}let eo=de({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(n,{attrs:r}){return()=>{let e=n.image;var l,t;n.type&&(t=lt().typeOf,(t=t(n.type))||console.warn(`Type ${n.type} does not exist`),null!=t&&t.icon?e=null==t?void 0:t.icon:console.warn(`Type ${n.type} does not have a [Svg] icon`));let a=n.svg||(null==e?void 0:e.svg)||"";return a.startsWith("").indexOf("class="),l=`${(null==e?void 0:e.cls)||""} `+(r.class||""),a=-1==t?`Fs(e.target)})}}}),ur={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},dr={class:"flex"},cr=l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),fr=l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),vr=[cr,fr],pr=de({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(e){return(e,t)=>(o(),i("div",ur,[l("div",dr,[(o(),i("svg",{class:h(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",e.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vr,2)),l("span",null,[U(e.$slots,"default")])])]))}}),mr=["href","onClick"],hr=["type"],tn="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",gr=de({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(tn),href:t.href,onClick:e},[U(t.$slots,"default")],8,mr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:tn},t.$attrs),[U(t.$slots,"default")],16,hr))}}}),yr=["href","onClick"],br=["type"],wr=de({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(e){let t=e,a={blue:"focus:ring-indigo-500 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"focus:ring-indigo-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-500 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-500 bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-500 bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-indigo-500 bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},n=v(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black text-white "+(a[t.color]||a.indigo));return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(n.value),href:t.href,onClick:e},[U(t.$slots,"default")],10,yr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:n.value},t.$attrs),[U(t.$slots,"default")],16,br))}}}),kr=["type","href","onClick"],_r=["type"],sn="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black",$r=de({__name:"SecondaryButton",props:{type:{},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{type:t.type??"button",class:h(sn),href:t.href,onClick:e},[U(t.$slots,"default")],8,kr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type??"button",class:sn},t.$attrs),[U(t.$slots,"default")],16,_r))}}});function Ge(e,l){return Array.isArray(e)?0<=e.indexOf(l):e==l||e.includes(l)}let Cs={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},ot={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},Jt={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},Bt={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},nl={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ee={panelClass(e="slideOver"){return("card"==e?Jt:Bt).panelClass},formClass(e="slideOver"){return("card"==e?Jt:Bt).formClass},headingClass(e="slideOver"){return("card"==e?Jt:Bt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?Jt:Bt).subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},he={getGridClass(e=0){return he.gridClass},getGrid2Class(e="stripedRows"){return Ge(e,"fullWidth")?"overflow-x-auto":he.grid2Class},getGrid3Class(e="stripedRows"){return Ge(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":he.grid3Class},getGrid4Class(e="stripedRows"){return Ge(e,"whiteBackground")?"":Ge(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":he.grid4Class},getTableClass(e="stripedRows"){return Ge(e,"fullWidth")||Ge(e,"verticalLines")?"min-w-full divide-y divide-gray-300":he.tableClass},getTheadClass(e="stripedRows"){return Ge(e,"whiteBackground")?"":he.theadClass},getTheadRowClass(e="stripedRows"){return he.theadRowClass+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return he.theadCellClass+(Ge(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(Ge(e,"whiteBackground")||Ge(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":he.tableClass)+(Ge(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",l,t,a){return(a?"cursor-pointer ":"")+(t?"bg-indigo-100 dark:bg-blue-800":(a?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!Ge(e,"stripedRows")||l%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},Cr={colspans:"col-span-3 sm:col-span-3"},fh=Object.freeze(Object.defineProperty({__proto__:null,a:Cs,card:Jt,dummy:Cr,form:Ee,grid:he,input:ot,modal:nl,slideOver:Bt},Symbol.toStringTag,{value:"Module"})),xr=de({__name:"TextLink",props:{color:{default:"blue"}},setup(e){let l=yo(),t=e,a=v(()=>(Cs[t.color]||Cs.blue)+(l.href?"":" cursor-pointer"));return(e,l)=>(o(),i("a",{class:h(a.value)},[U(e.$slots,"default")],2))}}),Lr={class:"flex","aria-label":"Breadcrumb"},Vr={role:"list",class:"flex items-center space-x-4"},Sr=["href","title"],Mr=l("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),Ar={class:"sr-only"},Tr=de({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(e){return(e,t)=>(o(),i("nav",Lr,[l("ol",Vr,[l("li",null,[l("div",null,[l("a",{href:e.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:e.homeLabel},[Mr,l("span",Ar,O(e.homeLabel),1)],8,Sr)])]),U(e.$slots,"default")])]))}}),Fr={class:"flex items-center"},Ir=l("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),jr=["href","title"],Or=["title"],Dr=de({__name:"Breadcrumb",props:{href:{},title:{}},setup(e){return(e,t)=>(o(),i("li",null,[l("div",Fr,[Ir,e.href?(o(),i("a",{key:0,href:e.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:e.title},[U(e.$slots,"default")],8,jr)):(o(),i("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:e.title},[U(e.$slots,"default")],8,Or))])]))}}),Pr={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},Br={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Hr=de({__name:"NavList",props:{title:{}},setup(e){return(e,t)=>(o(),i("div",null,[e.title?(o(),i("h2",Pr,O(e.title),1)):x("",!0),l("ul",Br,[U(e.$slots,"default")])]))}}),Rr={class:"relative flex items-start space-x-4 py-6"},Er={class:"flex-shrink-0"},zr={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Nr={class:"min-w-0 flex-1"},Ur={class:"text-base font-medium text-gray-900 dark:text-gray-100"},qr={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Qr=["href"],Kr=l("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Zr={class:"text-base text-gray-500"},Wr=l("div",{class:"flex-shrink-0 self-center"},[l("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),Gr=de({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(e){return(e,t)=>{var a=K("Icon");return o(),i("li",Rr,[l("div",Er,[l("span",zr,[ye(a,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:e.icon,src:e.iconSrc,svg:e.iconSvg,alt:e.iconAlt},null,8,["image","src","svg","alt"])])]),l("div",Nr,[l("h3",Ur,[l("span",qr,[l("a",{href:e.href,class:"focus:outline-none"},[Kr,ke(" "+O(e.title),1)],8,Qr)])]),l("p",Zr,[U(e.$slots,"default")])]),Wr])}}});function to(e){return e&&e.SessionId?Oo(e):e}function Jr(e){G.user.value=to(e),G.events.publish("signIn",e)}function Xr(){G.user.value=null,G.events.publish("signOut",null)}let Sl=e=>(null==e?void 0:e.roles)||[],Ml=e=>(null==e?void 0:e.permissions)||[];function so(e){return 0<=Sl(G.user.value).indexOf(e)}function Yr(e){return 0<=Ml(G.user.value).indexOf(e)}function Al(){return so("Admin")}function bs(e){if(!e)return!1;if(!e.requiresAuth)return!0;var l=G.user.value;if(!l)return!1;if(Al())return!0;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!n.every(e=>0<=t.indexOf(e))||00<=t.indexOf(e))||!r.every(e=>0<=a.indexOf(e))||00<=a.indexOf(e)))}function ei(e){if(!e||!e.requiresAuth)return null;var l=G.user.value;if(!l)return`${e.request.name} requires Authentication`;if(Al())return null;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=n.filter(e=>t.indexOf(e)<0);return 0""+e+"").join(", ")} Role`+(1a.indexOf(e)<0)).length?`Requires ${l.map(e=>""+e+"").join(", ")} Permission`+(10<=t.indexOf(e))?`Requires any ${s.filter(e=>t.indexOf(e)<0).map(e=>""+e+"").join(", ")} Role`+(10<=a.indexOf(e))?`Requires any ${o.filter(e=>a.indexOf(e)<0).map(e=>""+e+"").join(", ")} Permission`+(1G.user.value||null),toAuth:to,isAuthenticated:v(()=>null!=G.user.value),hasRole:so,hasPermission:Yr,isAdmin:Al,canAccess:bs,invalidAccessMessage:ei}}let ti={key:0},si={class:"md:p-4"},lo=de({__name:"EnsureAccess",props:{invalidAccess:{},alertClass:{}},emits:["done"],setup(e){let r=Tl().isAuthenticated,t=It().config,s=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},u=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var a=K("Alert"),n=K("SecondaryButton");return e.invalidAccess?(o(),i("div",ti,[ye(a,{class:h(e.alertClass),innerHTML:e.invalidAccess},null,8,["class","innerHTML"]),l("div",si,[W(r)?(o(),ae(n,{key:1,onClick:u},{default:xe(()=>[ke("Sign Out")]),_:1})):(o(),ae(n,{key:0,onClick:s},{default:xe(()=>[ke("Sign In")]),_:1}))])])):x("",!0)}}}),li={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ni={class:"p-4"},oi=l("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),ai={class:"flex w-full justify-center"},ri=l("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[l("g",{fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),l("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),ii=l("span",null,"ASC",-1),ui=[ri,ii],di=xs('DESC',2),ci=[di],fi=l("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),vi={key:0},pi=["id","value"],mi=["for"],hi={key:1},gi={class:"mb-2"},yi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},bi=["onClick"],wi=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ki=[wi],_i={class:"flex"},$i=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1),Ci=[$i],xi={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Fl=de({__name:"FilterColumn",props:{definitions:{},column:{},topLeft:{}},emits:["done","save"],setup(e,{emit:t}){let u=e,a=t,d=D(),c=D(""),p=D(""),f=D([]),m=v(()=>1==u.column.meta.isEnum),s=v(()=>rt("Nullable`1"===u.column.meta.type?u.column.meta.genericArgs[0]:u.column.meta.type)),g=v(()=>1==u.column.meta.isEnum?_l(Fn(s.value.name)):[]),y=v(()=>{var e;return(null==(e=n(u.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),b=D({filters:[]}),w=v(()=>b.value.filters);function n(e){let l=u.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)}function k(e,l){return n(e).find(e=>e.value===l)}function C(){var e;c.value&&(e=null==(e=k(u.column.type,c.value))?void 0:e.name)&&(b.value.filters.push({key:c.value,name:e,value:p.value}),c.value=p.value="")}function L(){a("done")}function M(){var e;c.value="%",null!=(e=d.value)&&e.focus()}function V(){var e,l;p.value&&C(),m.value&&(l=Object.values(f.value).filter(e=>e),b.value.filters=0parseInt(e)).reduce((e,l)=>e+l,0).toString()}]:[{key:"%In",name:"In",value:l.join(",")}]:[]),a("save",b.value),a("done")}function S(e){b.value.sort=e===b.value.sort?void 0:e,St(V)}return ws(()=>b.value=Object.assign({},u.column.settings,{filters:Array.from(u.column.settings.filters)})),ws(()=>{let e,l,t,a,n,r=(null==(t=null==(l=null==(e=u.column.settings.filters)?void 0:e[0])?void 0:l.value)?void 0:t.split(","))||[];if(00<(l&parseInt(e))))||[]}f.value=r}),(a,t)=>{var e=K("SelectInput"),n=K("TextInput"),r=K("PrimaryButton"),s=K("SecondaryButton");return o(),i("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:L,onVnodeMounted:M},[l("div",{class:"absolute",style:ol(`top:${a.topLeft.y}px;left:${a.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[l("div",li,[l("div",ni,[oi,l("div",ai,[l("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>S("ASC")),class:h(`${"ASC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ui,2),l("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>S("DESC")),class:h(`${"DESC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ci,2)]),fi,m.value?(o(),i("div",vi,[(o(!0),i(Me,null,je(g.value,e=>(o(),i("div",{key:e.key,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>f.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,pi),[[al,f.value]]),l("label",{for:e.key,class:"ml-3"},O(e.value),9,mi)]))),128))])):(o(),i("div",hi,[(o(!0),i(Me,null,je(w.value,(e,t)=>(o(),i("div",gi,[l("span",yi,[ke(O(a.column.name)+" "+O(e.name)+" "+O((e=e,Pn(k(u.column.type,e.key),u.column.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;l=t,b.value.filters.splice(l,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},ki,8,bi)])]))),256)),l("div",_i,[ye(e,{id:"filterRule",class:"w-32 mr-1",modelValue:c.value,"onUpdate:modelValue":t[3]||(t[3]=e=>c.value=e),entries:y.value,label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(e=k(a.column.type,c.value))?void 0:e.valueType)?(o(),ae(n,{key:0,ref_key:"txtFilter",ref:d,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:p.value,"onUpdate:modelValue":t[4]||(t[4]=e=>p.value=e),onKeyup:on(C,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):x("",!0),l("div",{class:"pt-1"},[l("button",{type:"button",onClick:C,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ci)])])]))]),l("div",xi,[ye(r,{onClick:V,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(s,{onClick:L},{default:xe(()=>[ke(" Cancel ")]),_:1})])])],4)],512)}}}),Li={class:"px-4 sm:px-6 lg:px-8 text-sm"},Vi={class:"flex flex-wrap"},Si={class:"group pr-4 sm:pr-6 lg:pr-8"},Mi={class:"flex justify-between w-full font-medium"},Ai={class:"w-6 flex justify-end"},Ti={class:"hidden group-hover:inline"},Fi=["onClick","title"],Ii=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ji=[Ii],Oi={key:0,class:"pt-2"},Di={class:"ml-2"},Pi={key:1},Bi={class:"pt-2"},Hi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Ri=["onClick"],Ei=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),zi=[Ei],Ni=l("span",null,"Clear All",-1),Ui=[Ni],Il=de({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let a=e,r=t,n=v(()=>a.columns.filter(e=>0{let l=a.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)})(e).find(e=>e.value===l)}function u(){a.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(o(),i("div",Li,[l("div",Vi,[(o(!0),i(Me,null,je(n.value,n=>{return o(),i("fieldset",Si,[l("legend",Mi,[l("span",null,O(W(Pe)(n.name)),1),l("span",Ai,[l("span",Ti,[l("button",{onClick:e=>{var l;(l=n).settings.filters=[],r("change",l)},title:`Clear all ${W(Pe)(n.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},ji,8,Fi)])])]),n.meta.isEnum?(o(),i("div",Oi,[(o(!0),i(Me,null,je((e=n.settings.filters,null==(t=null==(t=null==e?void 0:e[0])?void 0:t.value)?void 0:t.split(",")),e=>(o(),i("div",{key:e,class:"flex items-center"},[l("label",Di,O(e),1)]))),128))])):(o(),i("div",Pi,[(o(!0),i(Me,null,je(n.settings.filters,(e,t)=>{return o(),i("div",Bi,[l("span",Hi,[ke(O(n.name)+" "+O(e.name)+" "+O((e=e,Pn(s((a=n).type,e.value),a.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;(l=n).settings.filters.splice(t,1),r("change",l)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},zi,8,Ri)])]);var a}),256))]))]);var e,t}),256))]),l("div",{class:"flex justify-center pt-4"},[l("button",{type:"button",onClick:u,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ui)])]))}}),qi={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qi={class:""},Ki={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Zi=l("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Wi={class:"mt-4"},Gi=["for"],Ji=["id"],Xi=["value","selected"],Yi={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},eu=["id","checked"],tu=["for"],su={class:"mt-4"},lu={class:"pb-2 px-4"},nu={class:""},ou=["id","value"],au=["for"],ru={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},jl=de({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:{},prefs:{},maxLimit:{}},emits:["done","save"],setup(e,{emit:t}){let a=It().autoQueryGridDefaults,s=e,n=t,u=D({}),d=(ws(()=>u.value=Object.assign({take:a.value.take,selectedColumns:[]},s.prefs)),[10,25,50,100,250,500,1e3]);function v(){n("done")}function c(){n("save",u.value)}return(e,t)=>{let a=K("PrimaryButton"),n=K("SecondaryButton"),r=K("ModalDialog");return o(),ae(r,{id:e.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:xe(()=>[l("div",qi,[l("div",Qi,[l("div",Ki,[Zi,l("div",Wi,[l("label",{for:e.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,Gi),Mt(l("select",{id:e.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>u.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(o(!0),i(Me,null,je(d.filter(e=>null==s.maxLimit||e<=s.maxLimit),e=>(o(),i("option",{value:e,selected:e===u.value.take},O(e),9,Xi))),256))],8,Ji),[[bo,u.value.take]])]),l("div",Yi,[l("input",{type:"radio",id:e.id+"-allColumns",onClick:t[1]||(t[1]=e=>u.value.selectedColumns=[]),checked:0===u.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,eu),l("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:e.id+"-allColumns"},"View all columns",8,tu)]),l("div",su,[l("div",lu,[l("div",nu,[(o(!0),i(Me,null,je(e.columns,e=>(o(),i("div",{key:e.name,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,ou),[[al,u.value.selectedColumns]]),l("label",{for:e.name,class:"ml-3"},O(e.name),9,au)]))),128))])])])])])]),l("div",ru,[ye(a,{onClick:c,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(n,{onClick:v},{default:xe(()=>[ke(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),iu={key:0},uu={key:1},du={key:2,class:"pt-1"},cu={key:0},fu={key:1},vu={key:2},pu={key:4},mu={class:"pl-1 pt-1 flex flex-wrap"},hu={class:"flex mt-1"},gu=["title"],yu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),bu=[yu],wu=["disabled"],ku=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),_u=[ku],$u=["disabled"],Cu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),xu=[Cu],Lu=["disabled"],Vu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Su=[Vu],Mu=["disabled"],Au=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Tu=[Au],Fu={key:0,class:"flex mt-1"},Iu={class:"px-4 text-lg text-black dark:text-white"},ju={key:0},Ou={key:1},Du=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Pu={key:2},Bu={class:"flex flex-wrap"},Hu={key:0,class:"pl-2 mt-1"},Ru=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001 0 0 0 14.868 3"})],-1),Eu=[Ru],zu={key:1,class:"pl-2 mt-1"},Nu=xs('Excel',2),Uu=[Nu],qu={key:2,class:"pl-2 mt-1"},Qu={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Ku=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Zu=[Ku],Wu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Gu=l("g",{fill:"none"},[l("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Ju=[Gu],Xu=l("span",{class:"whitespace-nowrap"},"Copy URL",-1),Yu={key:3,class:"pl-2 mt-1"},ed=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),td=[ed],sd={key:4,class:"pl-2 mt-1"},ld=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),nd={class:"mr-1"},od={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ad=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),rd=[ad],id={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ud=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),dd=[ud],cd={key:5,class:"pl-2 mt-1"},fd=["title"],vd=l("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),pd={class:"whitespace-nowrap"},md={key:8},hd={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gd={class:"mr-1 select-none"},yd={key:1,class:"flex justify-between items-center"},bd={class:"mr-1 select-none"},ps=25,wd=de({__name:"AutoQueryGrid",props:{filterDefinitions:{},id:{default:"AutoQueryGrid"},apis:{},type:{},prefs:{},deny:{},hide:{},selectedColumns:{},toolbarButtonClass:{},tableStyle:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{},modelTitle:{},newButtonLabel:{},apiPrefs:{},canFilter:{},disableKeyBindings:{},configureField:{},skip:{default:0},create:{type:Boolean},edit:{},filters:{}},emits:["headerSelected","rowSelected","nav"],setup(e,{expose:d,emit:c}){let{config:p,autoQueryGridDefaults:X}=It(),Y=X,t=p.value.storage,n=e,ee=c,le=Qe("client"),te="filtering,queryString,queryFilters".split(","),ne="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","),re=v(()=>n.deny?Vt(te,n.deny):Vt(te,Y.value.deny)),se=v(()=>n.hide?Vt(ne,n.hide):Vt(ne,Y.value.hide));function f(e){return re.value[e]}function m(e){return se.value[e]}let g=v(()=>n.tableStyle??Y.value.tableStyle),oe=v(()=>n.gridClass??he.getGridClass(g.value)),ie=v(()=>n.grid2Class??he.getGrid2Class(g.value)),ue=v(()=>n.grid3Class??he.getGrid3Class(g.value)),de=v(()=>n.grid4Class??he.getGrid4Class(g.value)),ve=v(()=>n.tableClass??he.getTableClass(g.value)),ce=v(()=>n.theadClass??he.getTheadClass(g.value)),pe=v(()=>n.theadRowClass??he.getTheadRowClass(g.value)),fe=v(()=>n.theadCellClass??he.getTheadCellClass(g.value)),y=v(()=>n.toolbarButtonClass??he.toolbarButtonClass);function me(e,l){var t,a;return n.rowClass?n.rowClass(e,l):(t=!!Q.value.AnyUpdate,a=(null!=(a=s.value)&&a.name?_e(e,s.value.name):null)==V.value,he.getTableRowClass(n.tableStyle,l,a,t))}let b=Ls(),ge=v(()=>{var e;return il((null==(e=Q.value.AnyQuery.viewModel)?void 0:e.name)||Q.value.AnyQuery.dataModel.name)}),be=v(()=>{let l=Object.keys(b).map(e=>e.toLowerCase());return st(ge.value).filter(e=>l.includes(e.name.toLowerCase())||l.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});let w=v(()=>{var e=(0<(e=Ct(n.selectedColumns)).length?e:0e.toLowerCase());let t=st(ge.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),we=v(()=>{let e=w.value.map(e=>e.name),l=Ct(j.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),k=D([]),C=D(new Xe),Ce=D(new Xe),L=D(),M=D(!1),V=D(),S=D(),T=D(!1),A=D(),F=D(n.skip),I=D(!1),j=D({take:ps}),$=D(!1),Le=v(()=>k.value.some(e=>0k.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Ve=v(()=>{var e;return st(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),s=v(()=>{var e;return ns(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),B=v(()=>j.value.take??ps),E=v(()=>C.value.response?_e(C.value.response,"results"):[]),_=v(()=>{var e;return((null==(e=C.value.response)?void 0:e.total)||E.value.length)??0}),Se=v(()=>00E.value.length>=B.value),De=v(()=>E.value.length>=B.value),P=D(),H=D(),Ae={NoQuery:"No Query API was found"};function Fe(l){if(l){if(n.canFilter)return n.canFilter(l);var e=Ve.value.find(e=>e.name.toLowerCase()==l.toLowerCase());if(e)return!Mn(e)}}function r(e){ee("nav",e),f("queryString")&&ul(e)}async function R(e){F.value+=e,F.value<0&&(F.value=0);var l=Math.floor(_.value/B.value)*B.value;F.value>l&&(F.value=l),r({skip:F.value||void 0}),await z()}async function Ie(e,l){var t,a;S.value=null,V.value=l,e&&l&&(a=Yt(Q.value.AnyQuery,{[e]:l}),(a=await le.api(a)).succeeded)&&((a=null==(a=_e(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(t=Q.value.AnyQuery)?void 0:t.request.name}(${e}:${l}) returned no results`),S.value=a)}async function $e(e,l){ee("rowSelected",e,l);var t=null==(t=s.value)?void 0:t.name,a=t?_e(e,t):null;t&&a&&(r({edit:a}),Ie(t,a))}function Ue(l,e){var t,a,n;f("filtering")&&(t=e.target,Fe(l)&&"TD"!==(null==t?void 0:t.tagName)&&(t=null==(t=null==t?void 0:t.closest("TABLE"))?void 0:t.getBoundingClientRect(),a=k.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&t&&(n=t.x+318+10,A.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),n),y:t.y+45}}),ee("headerSelected",l,e))}function Ee(){A.value=null}async function Pe(e){var l=null==(l=A.value)?void 0:l.column;l&&(l.settings=e,t.setItem(u(l.name),JSON.stringify(l.settings)),await z()),A.value=null}async function He(e){t.setItem(u(e.name),JSON.stringify(e.settings)),await z()}async function Re(e){T.value=!1,j.value=e,t.setItem(sl(),JSON.stringify(e)),await z()}function ze(e){var l;P.value&&(Object.assign(null==(l=P.value)?void 0:l.model,e),Ke())}function Ne(e){Object.assign(S.value,e),Ke()}function Ke(){null!=(e=P.value)&&e.forceUpdate(),null!=(e=H.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function z(){await qe(Ze())}async function Ge(){await z()}d({update:z,search:qe,createRequestArgs:Ze,reset:Cl,createDone:J,createSave:kl,editDone:Z,editSave:wl,forceUpdate:Ke,setEdit:Ne,edit:S,createForm:P,editForm:H,apiPrefs:j,results:E,skip:F,take:B,total:_}),G.interceptors.has("AutoQueryGrid.new")&&G.interceptors.invoke("AutoQueryGrid.new",{props:n});let We=/iPad|iPhone|iPod/.test(navigator.userAgent);async function qe(t){var a=Q.value.AnyQuery;if(a){let e=Yt(a,t),l=await le.api(e);dn(e=>{C.value.response=C.value.error=void 0,$.value=e,We?St(()=>C.value=l):C.value=l})();a=_e(l.response,"results")||[];l.succeeded&&a.label}else console.error(Ae.NoQuery)}function Ze(){let r={include:"total",take:B.value},l=Ct(j.value.selectedColumns||n.selectedColumns);if(0{var e,l=a.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&n.push(l.ref.selfId),_e(b,t)&&n.push(...a.filter(e=>{var l;return(null==(l=null==(l=e.ref)?void 0:l.selfId)?void 0:l.toLowerCase())==t.toLowerCase()}).map(e=>e.name))}),n.forEach(e=>{l.includes(e)||l.push(e)}),r.fields=l.join(",")}let e=[];if(k.value.forEach(t=>{t.settings.sort&&e.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);r[l]=e.value})}),n.filters&&Object.keys(n.filters).forEach(e=>{r[e]=n.filters[e]}),f("queryString")&&f("queryFilters")){var t=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):"");let e=Ws(t);Object.keys(e).forEach(l=>{w.value.find(e=>e.name.toLowerCase()===l.toLowerCase())&&(r[l]=e[l])}),typeof e.skip<"u"&&(t=parseInt(e.skip),isNaN(t)||(F.value=r.skip=t))}return"u"I.value=!1,3e3)}function ll(e="json"){var l=Ze(),t="/api/"+(null==(t=Q.value.AnyQuery)?void 0:t.request.name),t=Do(le.baseUrl,zt(t,{...l,jsconfig:"edv"}));return 0<=t.indexOf("?")?Vs(t,"?")+"."+e+"?"+ms(t,"?"):t+".json"}async function tl(){k.value.forEach(e=>{e.settings={filters:[]},t.removeItem(u(e.name))}),j.value={take:ps},t.removeItem(sl()),await z()}function al(){M.value=!0,r({create:null})}let a=v(()=>Qt(n.type)),N=v(()=>{var e;return a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)}),q=v(()=>n.modelTitle||N.value),nl=v(()=>n.newButtonLabel||"New "+q.value),sl=()=>{var e;return n.id+"/ApiPrefs/"+(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name))},u=e=>{var l;return`Column/${n.id}:${a.value||(null==(l=Q.value.AnyQuery)?void 0:l.dataModel.name)}.`+e},{metadataApi:ol,typeOf:il,apiOf:dl,filterDefinitions:vl}=lt(),cl=Tl().invalidAccessMessage,pl=v(()=>n.filterDefinitions||vl.value),Q=v(()=>{var e=Ct(n.apis);return 0dl(e)).filter(e=>null!=e).map(e=>e)):Ut.forType(a.value,ol.value)}),fl=e=>`${e}`,ml=v(()=>{var e;return ol.value?0<(e=Ct(n.apis).map(e=>null==dl(e)?e:null).filter(e=>null!=e)).length?fl(`Unknown API${1useMetadata()`)}),gl=v(()=>Q.value.AnyQuery&&cl(Q.value.AnyQuery)),hl=v(()=>Q.value.Create&&cl(Q.value.Create)),yl=v(()=>Q.value.AnyUpdate&&cl(Q.value.AnyUpdate)),bl=v(()=>bs(Q.value.Create)),xl=(v(()=>bs(Q.value.AnyUpdate)),v(()=>bs(Q.value.Delete)));function Z(){S.value=null,V.value=null,r({edit:void 0})}function J(){M.value=!1,r({create:void 0})}async function wl(){await z(),Z()}async function kl(){await z(),J()}function Cl(){C.value=new Xe,Ce.value=new Xe,M.value=!1,V.value=null,S.value=null,T.value=!1,A.value=null,F.value=n.skip,I.value=!1,j.value={take:ps},$.value=!1;var e,l=n.prefs||$s(t.getItem(sl())),l=(l&&(j.value=l),k.value=w.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(t.getItem(u(e.name))))})),isNaN(n.skip)||(F.value=n.skip),null==(l=s.value)?void 0:l.name);f("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),typeof(e=Ws(e)).create<"u"?M.value=typeof e.create<"u":!l||"string"!=typeof e.edit&&"number"!=typeof e.edit||Ie(l,e.edit)),!0===n.create&&(M.value=!0),l&&null!=n.edit&&Ie(l,n.edit)}return Ye(async()=>{Cl(),await z()}),(t,e)=>{let a=K("Alert"),n=K("EnsureAccessDialog"),r=K("AutoCreateForm"),s=K("AutoEditForm"),u=K("AutoViewForm"),d=K("ErrorSummary"),v=K("Loading"),c=K("SettingsIcons"),p=K("DataGrid");return ml.value?(o(),i("div",iu,[ye(a,{innerHTML:ml.value},null,8,["innerHTML"])])):gl.value?(o(),i("div",uu,[ye(lo,{"invalid-access":gl.value},null,8,["invalid-access"])])):(o(),i("div",du,[m("forms")&&M.value&&Q.value.Create?(o(),i("div",cu,[hl.value?(o(),ae(n,{key:0,title:"Create "+q.value,"invalid-access":hl.value,"alert-class":"text-yellow-700",onDone:J},null,8,["title","invalid-access"])):W(b).createform?U(t.$slots,"createform",{key:1,type:Q.value.Create.request.name,configure:t.configureField,done:J,save:kl}):(o(),ae(r,{key:2,ref_key:"createForm",ref:P,type:Q.value.Create.request.name,configure:t.configureField,onDone:J,onSave:kl},{header:xe(()=>[U(t.$slots,"formheader",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),_:3},8,["type","configure"]))])):m("forms")&&S.value&&Q.value.AnyUpdate?(o(),i("div",fu,[yl.value?(o(),ae(n,{key:0,title:"Update "+q.value,"invalid-access":yl.value,"alert-class":"text-yellow-700",onDone:Z},null,8,["title","invalid-access"])):W(b).editform?U(t.$slots,"editform",{key:1,model:S.value,type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,done:Z,save:wl}):(o(),ae(s,{key:2,ref_key:"editForm",ref:H,modelValue:S.value,"onUpdate:modelValue":e[0]||(e[0]=e=>S.value=e),type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,onDone:Z,onSave:wl,onDelete:wl},{header:xe(()=>[U(t.$slots,"formheader",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),_:3},8,["modelValue","type","deleteType","configure"]))])):m("forms")&&S.value?(o(),i("div",vu,[W(b).viewform?U(t.$slots,"viewform",{key:0,model:S.value,apis:Q.value,done:Z}):(o(),ae(u,{key:1,model:S.value,apis:Q.value,done:Z},null,8,["model","apis"]))])):x("",!0),W(b).toolbar?U(t.$slots,"toolbar",{key:3}):m("toolbar")?(o(),i("div",pu,[T.value?(o(),ae(jl,{key:0,columns:w.value,prefs:j.value,onDone:e[1]||(e[1]=e=>T.value=!1),onSave:Re},null,8,["columns","prefs"])):x("",!0),l("div",mu,[l("div",hu,[m("preferences")?(o(),i("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:q.value+" Preferences",onClick:e[2]||(e[2]=e=>T.value=!T.value)},bu,8,gu)):x("",!0),m("pagingNav")?(o(),i("button",{key:1,type:"button",class:h(["pl-2",Se.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!Se.value,onClick:e[3]||(e[3]=e=>R(-_.value))},_u,10,wu)):x("",!0),m("pagingNav")?(o(),i("button",{key:2,type:"button",class:h(["pl-2",Oe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!Oe.value,onClick:e[4]||(e[4]=e=>R(-B.value))},xu,10,$u)):x("",!0),m("pagingNav")?(o(),i("button",{key:3,type:"button",class:h(["pl-2",Te.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!Te.value,onClick:e[5]||(e[5]=e=>R(B.value))},Su,10,Lu)):x("",!0),m("pagingNav")?(o(),i("button",{key:4,type:"button",class:h(["pl-2",De.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!De.value,onClick:e[6]||(e[6]=e=>R(_.value))},Tu,10,Mu)):x("",!0)]),m("pagingInfo")?(o(),i("div",Fu,[l("div",Iu,[$.value?(o(),i("span",ju,"Querying...")):x("",!0),E.value.length?(o(),i("span",Ou,[Du,ke(" "+O(F.value+1)+" - "+O(Math.min(F.value+E.value.length,_.value))+" ",1),l("span",null," of "+O(_.value),1)])):C.value.completed?(o(),i("span",Pu,"No Results")):x("",!0)])])):x("",!0),l("div",Bu,[m("refresh")?(o(),i("div",Hu,[l("button",{type:"button",onClick:Ge,title:"Refresh",class:h(y.value)},Eu,2)])):x("",!0),m("downloadCsv")?(o(),i("div",zu,[l("button",{type:"button",onClick:Je,title:"Download CSV",class:h(y.value)},Uu,2)])):x("",!0),m("copyApiUrl")?(o(),i("div",qu,[l("button",{type:"button",onClick:el,title:"Copy API URL",class:h(y.value)},[I.value?(o(),i("svg",Qu,Zu)):(o(),i("svg",Wu,Ju)),Xu],2)])):x("",!0),Le.value&&m("resetPreferences")?(o(),i("div",Yu,[l("button",{type:"button",onClick:tl,title:"Reset Preferences & Filters",class:h(y.value)},td,2)])):x("",!0),m("filtersView")&&0L.value="filters"==L.value?null:"filters"),class:h(y.value),"aria-expanded":"false"},[ld,l("span",nd,O(Me.value)+" "+O(1==Me.value?"Filter":"Filters"),1),"filters"!=L.value?(o(),i("svg",od,rd)):(o(),i("svg",id,dd))],2)])):x("",!0),m("newItem")&&Q.value.Create&&bl.value?(o(),i("div",cd,[l("button",{type:"button",onClick:al,title:q.value,class:h(y.value)},[vd,l("span",pd,O(nl.value),1)],10,fd)])):x("",!0),W(b).toolbarbuttons?U(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:y.value}):x("",!0)])])])):x("",!0),"filters"==L.value?(o(),ae(Il,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:pl.value,columns:k.value,onDone:e[8]||(e[8]=e=>L.value=null),onChange:He},null,8,["definitions","columns"])):x("",!0),Ce.value.error??C.value.error?(o(),ae(d,{key:6,status:Ce.value.error??C.value.error},null,8,["status"])):$.value?(o(),ae(v,{key:7,class:"p-2"})):x("",!0),A.value?(o(),i("div",md,[ye(Fl,{definitions:pl.value,column:A.value.column,"top-left":A.value.topLeft,onDone:Ee,onSave:Pe},null,8,["definitions","column","top-left"])])):x("",!0),E.value.length?(o(),ae(p,{key:9,id:t.id,items:E.value,type:t.type,"selected-columns":we.value,class:"mt-1",onFiltersChanged:z,tableStyle:g.value,gridClass:oe.value,grid2Class:ie.value,grid3Class:ue.value,grid4Class:de.value,tableClass:ve.value,theadClass:ce.value,theadRowClass:pe.value,theadCellClass:fe.value,tbodyClass:t.tbodyClass,rowClass:me,onRowSelected:$e,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:Ue},rl({header:xe(({column:t,label:e})=>{var a;return[f("filtering")&&Fe(t)?(o(),i("div",hd,[l("span",gd,O(e),1),ye(c,{column:k.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=A.value)?void 0:a.column.name)===t},null,8,["column","is-open"])])):(o(),i("div",yd,[l("span",bd,O(e),1)]))]}),_:2},[je(Object.keys(W(b)),l=>({name:l,fn:xe(e=>[U(t.$slots,l,Et(ks(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):x("",!0)]))}}}),kd={class:"flex"},_d={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},$d=l("g",{fill:"none"},[l("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Cd=[$d],xd=l("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),Ld=l("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1),Vd=[xd,Ld],Sd={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Md=l("g",{fill:"none"},[l("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1),Ad=[Md],Td={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Fd=l("g",{fill:"none"},[l("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1),Id=[Fd],jd=de({__name:"SettingsIcons",props:{column:{},isOpen:{type:Boolean}},setup(e){return(e,l)=>{var t;return o(),i("div",kd,[null!=(t=null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.filters)&&t.length?(o(),i("svg",_d,Cd)):(o(),i("svg",{key:1,class:h(["w-4 h-4 transition-transform",e.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Vd,2)),"ASC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Sd,Ad)):"DESC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Td,Id)):x("",!0)])}}}),Od=de({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(e){return(l,e)=>{let t=K("EnsureAccess"),a=K("SlideOver");return l.invalidAccess?(o(),ae(a,{key:0,title:l.title,onDone:e[0]||(e[0]=e=>l.$emit("done")),"content-class":"relative flex-1"},rl({default:xe(()=>[ye(t,{alertClass:l.alertClass,invalidAccess:l.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[l.subtitle?{name:"subtitle",fn:xe(()=>[ke(O(l.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):x("",!0)}}}),Dd=["for"],Pd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Bd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Hd=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Rd=[Hd],Ed=["id"],zd=["id"],Nd={inheritAttrs:!1},Ud=de({...Nd,__name:"TextInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e,{expose:t}){let a=e,n=(t({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),D());let r=v(()=>a.type||"text"),s=v(()=>a.label??Pe(at(a.id))),u=v(()=>a.placeholder??s.value);function d(e){return"range"===a.type?e.replace("shadow-sm ",""):e}let c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:a.status??(null==c?void 0:c.error.value)},a.id)),f=v(()=>[ot.base,p.value?ot.invalid:d(ot.valid),a.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[U(t.$slots,"header",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs)),s.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(s.value),11,Dd)):x("",!0),l("div",{class:h(d("mt-1 relative shadow-sm rounded-md"))},[l("input",Te({ref_key:"inputElement",ref:n,type:r.value,name:t.id,id:t.id,class:f.value,placeholder:u.value,value:W(pn)(r.value,t.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=p.value,"aria-describedby":t.id+"-error",step:"any"},W(ft)(t.$attrs,["class","value"])),null,16,Pd),p.value?(o(),i("div",Bd,Rd)):x("",!0)],2),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(p.value),9,Ed)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,zd)):x("",!0),U(t.$slots,"footer",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),qd=["for"],Qd={class:"mt-1 relative rounded-md shadow-sm"},Kd=["name","id","placeholder","aria-invalid","aria-describedby"],Zd=["id"],Wd=["id"],Gd={inheritAttrs:!1},Jd=de({...Gd,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=v(()=>t.placeholder??a.value),r=Qe("ApiState",void 0),s=v(()=>mt.call({responseStatus:t.status??(null==r?void 0:r.error.value)},t.id)),u=v(()=>["shadow-sm "+ot.base,s.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,t.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,qd)):x("",!0),l("div",Qd,[l("textarea",Te({name:t.id,id:t.id,class:u.value,placeholder:n.value,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=s.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),O(t.modelValue),17,Kd)]),s.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(s.value),9,Zd)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,Wd)):x("",!0)],2))}}),Xd=["for"],Yd=["id","name","value","aria-invalid","aria-describedby"],ec=["value"],tc=["id"],sc={inheritAttrs:!1},lc=de({...sc,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},label:{},labelClass:{},options:{},values:{},entries:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id)),s=v(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Xd)):x("",!0),l("select",Te({id:t.id,name:t.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",r.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],value:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=r.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),[(o(!0),i(Me,null,je(s.value,e=>(o(),i("option",{value:e.key},O(e.value),9,ec))),256))],16,Yd),r.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(r.value),9,tc)):x("",!0)],2))}}),nc={class:"flex items-center h-5"},oc=["id","name","checked"],ac={class:"ml-3 text-sm"},rc=["for"],ic={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},uc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},dc={inheritAttrs:!1},cc=de({...dc,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{}){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id));return(t,e)=>(o(),i("div",{class:h(["relative flex items-start",t.$attrs.class])},[l("div",nc,[l("input",Te({id:t.id,name:t.id,type:"checkbox",checked:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",t.inputClass]},W(ft)(t.$attrs,["class"])),null,16,oc)]),l("div",ac,[l("label",{for:t.id,class:h("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,rc),r.value?(o(),i("p",ic,O(r.value),1)):t.help?(o(),i("p",uc,O(t.help),1)):x("",!0)])],2))}}),fc=["id"],vc=["for"],pc={class:"mt-1 relative rounded-md shadow-sm"},mc=["id","name","value"],hc={class:"flex flex-wrap pb-1.5"},gc={class:"pt-1.5 pl-1"},yc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},bc=["onClick"],wc=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),kc=[wc],_c={class:"pt-1.5 pl-1 shrink"},$c=["type","name","id","aria-invalid","aria-describedby"],Cc=["id"],xc=["onMouseover","onClick"],Lc={class:"block truncate"},Vc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Sc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Mc=[Sc],Ac=["id"],Tc=["id"],Fc={inheritAttrs:!1},Ic=de({...Fc,__name:"TagInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:{},string:{type:Boolean},maxVisibleItems:{default:300},converter:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=e,n=t;let r=v(()=>{return Ze((e=a.modelValue,a.converter?a.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),s=D(),u=D(!1),d=v(()=>{let l=p.value.toLowerCase();return a.allowableValues&&0!=a.allowableValues.length?a.allowableValues.length<1e3?a.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(l)):a.allowableValues.filter(e=>!r.value.includes(e)&&e.startsWith(l)):[]});let c=D(null),p=D(""),f=v(()=>a.type||"text"),m=v(()=>a.label??Pe(at(a.id))),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",a.inputClass]),w=l=>V(r.value.filter(e=>e!=l));function k(e){var l;document.activeElement===e.target&&null!=(l=c.value)&&l.focus()}let C=D();function L(){u.value=!0,C.value=!0}function M(){$(T()),C.value=!1,setTimeout(()=>{C.value||(u.value=!1)},200)}function V(e){var l=a.string?e.join(","):e;n("update:modelValue",l)}function S(e){var l;"Backspace"==e.key&&0==p.value.length&&0e==l.key))&&l.preventDefault(),"Enter"==l.key||"NumpadEnter"==l.key||1==l.key.length&&e)&&$(t)}let F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function I(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function $(e){var l;0!==e.length&&(-1==(l=Array.from(r.value)).indexOf(e)&&l.push(e),V(l),p.value="",u.value=!1)}function B(t){var e,t=null==(e=t.clipboardData)?void 0:e.getData("Text");if(t){let e=new RegExp("\\n|\\t|"+a.delimiters.join("|")),l=Array.from(r.value);t.split(e).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),V(l),p.value=""}}return(e,t)=>(o(),i("div",{class:h([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(m.value),11,vc)):x("",!0),l("div",pc,[l("input",{type:"hidden",id:e.id,name:e.id,value:r.value.join(",")},null,8,mc),l("button",{class:h(b.value),onClick:Ue(k,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",hc,[(o(!0),i(Me,null,je(r.value,t=>(o(),i("div",gc,[l("span",yc,[ke(O(t)+" ",1),l("button",{type:"button",onClick:e=>w(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},kc,8,bc)])]))),256)),l("div",_c,[Mt(l("input",Te({ref_key:"txtInput",ref:c,type:f.value,role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:e.id+"-txt",id:e.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error",onKeydown:S,onKeypress:A,onPaste:Ue(B,["prevent","stop"]),onFocus:L,onBlur:M,onClick:t[1]||(t[1]=e=>u.value=!0)},W(ft)(e.$attrs,["class","required"])),null,16,$c),[[wo,p.value]])])])],34),u.value&&d.value.length?(o(),i("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(d.value.slice(0,e.maxVisibleItems),t=>(o(),i("li",{class:h([t===s.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var l;l=t,s.value=l},onClick:e=>$(t),role:"option",tabindex:"-1"},[l("span",Lc,O(t),1)],42,xc))),256))],40,Cc)):x("",!0),y.value?(o(),i("div",Vc,Mc)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,Ac)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Tc)):x("",!0)],10,fc))}}),jc={class:"relative flex-grow mr-2 sm:mr-4"},Oc=["for"],Dc={class:"block mt-2"},Pc={class:"sr-only"},Bc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Hc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Rc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Ec=[Rc],zc=["id"],Nc=["id"],Uc={key:0},qc=["title"],Qc=["alt","src"],Kc={key:1,class:"mt-3"},Zc={class:"w-full"},Wc={class:"pr-6 align-bottom pb-2"},Gc=["title"],Jc=["src","onError"],Xc=["href"],Yc={key:1,class:"overflow-hidden"},e0={class:"align-top pb-2 whitespace-nowrap"},t0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},s0=de({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(e){let t,a=e,n=D(null),{assetsPathResolver:r,fallbackPathResolver:s}=It(),u={},d=D(),c=D((null==(t=a.files)?void 0:t.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}a.values&&0{var l=e.replace(/\\/g,"/");return{fileName:rn(At(l,"/"),"."),filePath:l,contentType:el(l)}}).map(p));let f=v(()=>a.label??Pe(at(a.id))),m=v(()=>a.placeholder??f.value),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",a.inputClass]),w=e=>{var l=e.target;d.value="",c.value=Array.from(l.files||[]).map(e=>({fileName:e.name,filePath:pl(e),contentLength:e.size,contentType:e.type||el(e.name)}))},k=()=>{var e;return null==(e=n.value)?void 0:e.click()},C=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),L=v(()=>{var e;return 0!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function V(e){d.value=s(L.value)}return Ft(Cn),(e,t)=>(o(),i("div",{class:h(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",jc,[f.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(f.value),11,Oc)):x("",!0),l("div",Dc,[l("span",Pc,O(e.help??f.value),1),l("input",Te({ref_key:"input",ref:n,type:"file",multiple:e.multiple,name:e.id,id:e.id,class:b.value,placeholder:m.value,"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error"},e.$attrs,{onChange:w}),null,16,Bc),y.value?(o(),i("div",Hc,Ec)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,zc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Nc)):x("",!0)]),e.multiple?(o(),i("div",Kc,[l("table",Zc,[(o(!0),i(Me,null,je(c.value,t=>(o(),i("tr",null,[l("td",Wc,[l("div",{class:"flex w-full",title:C(t.filePath)?"":t.filePath},[l("img",{src:u[W(xt)(t.filePath)]||W(r)(W(xt)(t.filePath)),class:h(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[W(xt)(t.filePath)]=W(s)(W(xt)(t.filePath))},null,42,Jc),C(t.filePath)?(o(),i("span",Yc,O(t.fileName),1)):(o(),i("a",{key:0,href:W(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},O(t.fileName),9,Xc))],8,Gc)]),l("td",e0,[t.contentLength&&0[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=D(!1),r=e,s=a;function u(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}t({toggle:I});let d=v(()=>r.label??Pe(at(r.id))),c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:r.status??(null==c?void 0:c.error.value)},r.id)),f=v(()=>[ot.base,p.value?ot.invalid:ot.valid]),m=D(null),g=D(""),y=D(null),b=D(r.viewCount),w=D([]),k=v(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,b.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let L=[",",` `,"\t"];function M(e){var l=null==(t=e.clipboardData)?void 0:t.getData("Text");if(l){var t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(l=>r.options.find(e=>r.match(e,l))).filter(e=>!!e);if(0{u(l)?e=e.filter(e=>e!=l):e.push(l)}),s("update:modelValue",e),hs()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&($(t[0]),n.value=!1,hs())}}}function V(e){C.indexOf(e.code)||j()}function S(e){var l;e.shiftKey||e.ctrlKey||e.altKey||(n.value?"Escape"==e.code?n.value&&(e.stopPropagation(),n.value=!1):"Tab"==e.code?n.value=!1:"Home"==e.code?(y.value=w.value[0],A()):"End"==e.code?(y.value=w.value[w.value.length-1],A()):"ArrowDown"==e.code?(y.value?(l=w.value.indexOf(y.value),y.value=l+1{var e=_s(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(T)},0)}function F(){setTimeout(()=>{var e=_s(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(T):e.scrollIntoView(T))},0)}function I(e){var l;(n.value=e)&&(j(),null!=(l=m.value))&&l.focus()}function j(){n.value=!0,B()}function $(l){if(g.value="",n.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),y.value=null,s("update:modelValue",e)}else{let e=l;r.modelValue==l&&(e=null),s("update:modelValue",e)}}function B(){w.value=k.value}return bt(g,B),(e,t)=>(o(),i("div",{id:e.id+"-autocomplete"},[d.value?(o(),i("label",{key:0,for:e.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},O(d.value),9,n0)):x("",!0),l("div",o0,[Mt(l("input",Te({ref_key:"txtInput",ref:m,id:e.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:f.value,placeholder:e.multiple||!e.modelValue?e.placeholder:"",onFocus:j,onKeydown:S,onKeyup:V,onClick:j,onPaste:M,required:!1},e.$attrs),null,16,a0),[[ko,g.value]]),l("button",{type:"button",onClick:t[1]||(t[1]=e=>I(!n.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},i0),n.value?(o(),i("ul",{key:0,class:"absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(w.value,t=>(o(),i("li",{class:h([t===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return l=t,y.value=l,void(w.value.indexOf(l)>Math.floor(.9*b.value)&&(b.value+=r.viewCount,B()));var l},onClick:e=>$(t),role:"option",tabindex:"-1"},[U(e.$slots,"item",Et(ks(t))),u(t)?(o(),i("span",{key:0,class:h(["absolute inset-y-0 right-0 flex items-center pr-4",t===y.value?"text-white":"text-indigo-600"])},f0,2)):x("",!0)],42,d0))),256))],40,u0)):!e.multiple&&e.modelValue?(o(),i("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>I(!n.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[U(e.$slots,"item",Et(ks(e.modelValue)))],32)):x("",!0),p.value?(o(),i("div",v0,m0)):x("",!0)]),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(p.value),9,h0)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,g0)):x("",!0)],8,l0))}}),b0=["id","name","value"],w0={class:"block truncate"},k0=de({__name:"Combobox",props:{id:{},modelValue:{},multiple:{type:Boolean},options:{},values:{},entries:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=e,r=(t({toggle(e){var l;null!=(l=d.value)&&l.toggle(e)}}),a);function s(e){r("update:modelValue",e)}let u=v(()=>null!=n.multiple?n.multiple:Array.isArray(n.modelValue)),d=D();function c(e,l){return!l||e.value.toLowerCase().includes(l.toLowerCase())}let p=v(()=>n.entries||(n.values?n.values.map(e=>({key:e,value:e})):n.options?Object.keys(n.options).map(e=>({key:e,value:n.options[e]})):[])),f=D(u.value?[]:null);Ye(function(){let l=n.modelValue&&"object"==typeof n.modelValue?n.modelValue.key:n.modelValue;null==l||""===l?f.value=u.value?[]:null:"string"==typeof l?f.value=p.value.find(e=>e.key===l)||null:Array.isArray(l)&&(f.value=p.value.filter(e=>l.includes(e.key)))});let m=v(()=>null==f.value?"":Array.isArray(f.value)?f.value.map(e=>encodeURIComponent(e.key)).join(","):f.value.key);return(e,t)=>{var a=K("Autocomplete");return o(),i(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,b0),ye(a,Te({ref_key:"input",ref:d,id:e.id,options:p.value,match:c,multiple:u.value},e.$attrs,{modelValue:f.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>f.value=e),s]}),{item:xe(({value:e})=>[l("span",w0,O(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),_0=de({__name:"DynamicInput",props:{input:{},modelValue:{},api:{}},emits:["update:modelValue"],setup(e,{emit:l}){let t=e,a=l,c=v(()=>t.input.type||"text"),n="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),p=v(()=>ft(t.input,n)),f=D("file"===c.value?null:t.modelValue[t.input.id]),m=(bt(f,()=>{t.modelValue[t.input.id]=f.value,a("update:modelValue",t.modelValue)}),v(()=>{var e=t.modelValue[t.input.id];if("file"!==t.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:At(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){let l=[];return e.forEach(e=>{"string"==typeof e?l.push({filePath:e,fileName:At(e,"/")}):"object"==typeof e&&l.push(e)}),l}}));return(e,l)=>{var t,a=K("SelectInput"),n=K("CheckboxInput"),r=K("TagInput"),s=K("Combobox"),i=K("FileInput"),u=K("TextareaInput"),d=K("MarkdownInput"),v=K("TextInput");return W(G).component(c.value)?(o(),ae(an(W(G).component(c.value)),Te({key:0,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(t=e.input.css)?void 0:t.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"select"==c.value?(o(),ae(a,Te({key:1,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[1]||(l[1]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(a=e.input.css)?void 0:a.input,"label-class":null==(t=e.input.css)?void 0:t.label,entries:e.input.allowableEntries,values:e.input.allowableValues},p.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==c.value?(o(),ae(n,Te({key:2,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==c.value?(o(),ae(r,Te({key:3,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[3]||(l[3]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label,allowableValues:e.input.allowableValues,string:"String"==(null==(r=e.input.prop)?void 0:r.type)},p.value),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==c.value?(o(),ae(s,Te({key:4,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[4]||(l[4]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label,entries:e.input.allowableEntries,values:e.input.allowableValues},p.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==c.value?(o(),ae(i,Te({key:5,id:e.input.id,status:null==(r=e.api)?void 0:r.error,modelValue:f.value,"onUpdate:modelValue":l[5]||(l[5]=e=>f.value=e),"input-class":null==(s=e.input.css)?void 0:s.input,"label-class":null==(a=e.input.css)?void 0:a.label,files:m.value},p.value),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==c.value?(o(),ae(u,Te({key:6,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[6]||(l[6]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(n=e.input.css)?void 0:n.input,"label-class":null==(i=e.input.css)?void 0:i.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==c.value?(o(),ae(d,Te({key:7,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[7]||(l[7]=e=>f.value=e),status:null==(r=e.api)?void 0:r.error,"input-class":null==(s=e.input.css)?void 0:s.input,"label-class":null==(a=e.input.css)?void 0:a.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):(o(),ae(v,Te({key:8,type:c.value,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[8]||(l[8]=e=>f.value=e),status:null==(u=e.api)?void 0:u.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label},p.value),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),$0={class:"lookup-field"},C0=["name","value"],x0={key:0,class:"flex justify-between"},L0=["for"],V0={key:0,class:"flex items-center"},S0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},M0=l("span",{class:"sr-only"},"Clear",-1),A0=l("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),T0=[M0,A0],F0={key:1,class:"mt-1 relative"},I0={class:"w-full inline-flex truncate"},j0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},O0=l("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[l("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),D0=["id"],P0=["id"],B0=de({__name:"LookupInput",props:{id:{},status:{},input:{},metadataType:{},modelValue:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=It().config,r=lt().metadataApi,s=e,u=t,d=v(()=>s.id||s.input.id),c=v(()=>s.label??Pe(at(d.value))),n=Qe("ApiState",void 0),p=Qe("client"),f=v(()=>mt.call({responseStatus:s.status??(null==n?void 0:n.error.value)},d.value)),m=D(""),g=D(""),y=v(()=>_e(s.modelValue,d.value)),b=v(()=>st(s.metadataType).find(e=>e.name.toLowerCase()==d.value.toLowerCase())),w=v(()=>{var e;return(null==(e=rt(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||a.value.tableIcon}),k;function C(){s.modelValue[d.value]=null,m.value=""}return Ye(async()=>{k=Qe("ModalProvider",void 0);let t=s.modelValue,e=(s.modelValue[d.value]||(s.modelValue[d.value]=null),b.value),a=null==e?void 0:e.ref;if(a){m.value="";let l=null==a.selfId?_e(t,e.name):_e(t,a.selfId);var n=Rt(l);console.log("refIdValue",l,Rt(l),t,a),null!=(l=n?_e(t,a.refId):l)&&(n=null==(n=r.value)?void 0:n.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==a.model}),console.debug("LookupInput queryOp",n),null==n||Rt(n=_e(t,e.name))||(m.value=""+n,g.value=e.name,null!=a.refLabel&&((n=st(s.metadataType).filter(e=>e.type==a.model)).length||console.warn(`Could not find ${a.model} Property on `+s.metadataType.name),null!=(n=(n=n.map(e=>_e(t,e.name)).filter(e=>!!e)).length<=1?n[0]:n.find(e=>e[a.refId??"id"]==l))?(n=_e(n,a.refLabel))&&(m.value=""+n,Pt.setValue(a.model,l,a.refLabel,n)):(n=1==(null==(n=e.attributes)?void 0:n.some(e=>"Computed"==e.name)),n=await Pt.getOrFetchValue(p,r.value,a.model,a.refId,a.refLabel,n,l),m.value=n||a.model+": "+m.value))))}else console.warn(`No RefInfo for property '${d.value}'`)}),(e,t)=>{var a,n=K("Icon");return o(),i("div",$0,[l("input",{type:"hidden",name:d.value,value:y.value},null,8,C0),c.value?(o(),i("div",x0,[l("label",{for:d.value,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(c.value),11,L0),y.value?(o(),i("div",V0,[l("span",S0,O(y.value),1),l("button",{onClick:C,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},T0)])):x("",!0)])):x("",!0),null!=(a=b.value)&&a.ref?(o(),i("div",F0,[l("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var a;(a=b.value.ref)&&(null==k?console.warn("No ModalProvider required by LookupInput"):k.openModal({name:"ModalLookup",ref:a},e=>{var l,t;console.debug("openModal",m.value," -> ",e,Pt.setRefValue(a,e),a),e&&(l=_e(e,a.refId),m.value=Pt.setRefValue(a,e)||l,(t=W(s.modelValue))[d.value]=l,u("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",I0,[l("span",j0,[ye(n,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,O(m.value),1)])]),O0])])):x("",!0),f.value?(o(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:d.value+"-error"},O(f.value),9,D0)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},O(e.help),9,P0)):x("",!0)])}}}),H0=de({__name:"AutoFormFields",props:{modelValue:{},type:{},metaType:{},api:{},formLayout:{},configureField:{},configureFormLayout:{},hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let u=e,n=a;function r(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function d(e,l){u.modelValue[e]=l,n("update:modelValue",u.modelValue),r()}t({forceUpdate:r,props:u,updateValue:d});let{metadataApi:s,apiOf:c,typeOf:p,typeOfRef:f,createFormLayout:m}=lt(),g=v(()=>u.type||Qt(u.modelValue)),y=v(()=>u.metaType??p(g.value)),b=v(()=>{var e;return f(null==(e=null==(e=s.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value});function w(){var e,l=y.value;if(!l){if(u.formLayout)return e=u.formLayout.map(e=>{var l={name:e.id,type:Ia(e.type)},l=Object.assign({prop:l},e);return u.configureField&&u.configureField(l),l}),u.configureFormLayout&&u.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}let a=st(l),n=b.value,t=u.formLayout?Array.from(u.formLayout):m(l),r=[],s=c(l.name);return t.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==n?void 0:n.properties)?void 0:e.find(e=>{var l;return e.name.toLowerCase()==(null==(l=t.name)?void 0:l.toLowerCase())}))??l,l=Object.assign({prop:e,op:s},t),u.configureField&&u.configureField(l),r.push(l))}),u.configureFormLayout&&u.configureFormLayout(r),r}return(t,a)=>{let e,n=K("ErrorSummary"),r=K("LookupInput"),s=K("DynamicInput");return o(),i(Me,null,[t.hideSummary?x("",!0):(o(),ae(n,{key:0,status:null==(e=t.api)?void 0:e.error,except:w().filter(e=>"hidden"!=e.type).map(e=>e.id)},null,8,["status","except"])),l("div",{class:h(t.flexClass)},[l("div",{class:h(t.divideClass)},[l("div",{class:h(t.spaceClass)},[l("fieldset",{class:h(t.fieldsetClass)},[(o(!0),i(Me,null,je(w(),l=>{var e;return o(),i("div",{key:l.id,class:h(["w-full",(null==(e=l.css)?void 0:e.field)??("textarea"==l.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==l.type?" flex items-center":"")),"hidden"==l.type?"hidden":""])},[null==(null==(e=l.prop)?void 0:e.ref)||"file"==l.type||l.prop.isPrimaryKey?(o(),ae(s,{key:1,input:l,modelValue:t.modelValue,"onUpdate:modelValue":a[0]||(a[0]=e=>t.$emit("update:modelValue",e)),api:t.api},null,8,["input","modelValue","api"])):(o(),ae(r,{key:0,metadataType:b.value,input:l,modelValue:t.modelValue,"onUpdate:modelValue":e=>{d(l.id,_e(e,l.id))},status:null==(e=t.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Ps(e){let r=D(!1),s=D(),o=D(),i=e??Qe("client");function n({message:e,errorCode:l,fieldName:t,errors:a}){return l=l||"Exception",a=a||[],s.value=new qs(t?{errorCode:l,message:e,errors:[new Gl({fieldName:t,errorCode:l,message:e})]}:{errorCode:l,message:e,errors:a})}var l={setError:n,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",s.value?((a=new qs(s.value)).errors=[...(a.errors||[]).filter(e=>{var l;return(null==(l=e.fieldName)?void 0:l.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Gl({fieldName:t,message:e,errorCode:l})],s.value=a):n({fieldName:t,message:e,errorCode:l})},loading:r,error:s,api:async function(e,l,t){r.value=!0;var a=await i.api(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiVoid:async function(e,l,t){r.value=!0;var a=await i.apiVoid(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiForm:async function(e,l,t,a){r.value=!0;var n=await i.apiForm(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},apiFormVoid:async function(e,l,t,a){r.value=!0;var n=await i.apiFormVoid(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},swr:async function(e,l,t,a){return gn(i,e,l,t,a)},swrEffect:function(t,a){let n=D(new Xe),r=yn(async e=>{n.value=await i.api(e)},null==a?void 0:a.delayMs);return ws(async()=>{var e=t(),l=cl(Ts(e));l&&(n.value=new Xe({response:l})),0===(null==a?void 0:a.delayMs)?n.value=await i.api(e):r(e)}),(async()=>n.value=await i.api(t(),null==a?void 0:a.args,null==a?void 0:a.method))(),n},unRefs:Dt,setRef:mn};return ss("ApiState",l),l}let R0={key:0},E0={class:"text-red-700"},z0=l("b",null,"type",-1),N0={key:0},U0={key:2},q0=["innerHTML"],Q0=l("input",{type:"submit",class:"hidden"},null,-1),K0={class:"flex justify-end"},Z0=l("div",null,null,-1),W0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},G0=l("div",{class:"fixed inset-0"},null,-1),J0={class:"fixed inset-0 overflow-hidden"},X0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Y0={class:"flex-1"},ef={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},tf={class:"flex items-start justify-between space-x-3"},sf={class:"space-y-1"},lf={key:0},nf={key:2},of=["innerHTML"],af={class:"flex h-7 items-center"},rf={class:"flex justify-end"},uf=de({__name:"AutoForm",props:{type:{},modelValue:{},heading:{},subHeading:{},showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},metaType:{},configureField:{},configureFormLayout:{},panelClass:{},bodyClass:{},formClass:{},innerFormClass:{},headerClass:{default:"p-6"},buttonsClass:{},headingClass:{},subHeadingClass:{},submitLabel:{default:"Submit"},allowSubmit:{}},emits:["success","error","update:modelValue","done"],setup(e,{expose:t,emit:a}){let s=e,u=a,L=D(),M=D(1),V=D();function n(){M.value++,P.value=m();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}ss("ModalProvider",{openModal:function(e,l){S.value=e,r.value=l}});let S=D(),r=D();async function T(e){r.value&&r.value(e),S.value=void 0,r.value=void 0}let d=Ps(),c=bn().getTypeName,{typeOf:p,createDto:f}=lt(),A=D(new Xe),F=v(()=>s.panelClass||Ee.panelClass(s.formStyle)),I=v(()=>s.formClass||"card"==s.formStyle?"shadow sm:rounded-md":Bt.formClass),j=v(()=>s.headingClass||Ee.headingClass(s.formStyle)),$=v(()=>s.subHeadingClass||Ee.subHeadingClass(s.formStyle)),B=v(()=>("string"==typeof s.buttonsClass?s:Ee).buttonsClass),E=v(()=>{var e;return s.type?c(s.type):null!=(e=s.modelValue)&&e.getTypeName?s.modelValue.getTypeName():null}),_=v(()=>s.metaType??p(E.value)),m=()=>s.modelValue||g(),P=D(m()),H=v(()=>d.loading.value),R=v(()=>{var e;return null!=s.heading?s.heading:(null==(e=_.value)?void 0:e.description)||Pe(E.value)});function g(){return"string"==typeof s.type?f(s.type):s.type?new s.type:s.modelValue}async function z(e){var l,t,a,n,r;e&&"FORM"==e.tagName?(l=g(),r=Ze(null==l?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==l?void 0:l.createResponse,e=>"function"==typeof e?e():null),a=s.jsconfig,il.hasRequestBody(r)?(r=new l.constructor,n=new FormData(e),A.value=t?await d.apiFormVoid(r,n,{jsconfig:a}):await d.apiForm(r,n,{jsconfig:a})):(r=new l.constructor(Bo(P.value)),console.debug("AutoForm.submit",r),A.value=t?await d.apiVoid(r,{jsconfig:a}):await d.api(r,{jsconfig:a})),A.value.succeeded?(u("success",A.value.response),W()):u("error",A.value.error)):console.error("Not a valid form",e)}function N(e){u("update:modelValue",e)}function y(){u("done")}t({forceUpdate:n,props:s,setModel:async function(e){Object.assign(P.value,e),n(),await St(()=>null)},formFields:L,submit:async function(){z(V.value)},close:W,model:P});let b=D(!1),G=D(""),k={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function W(){"slideOver"==s.formStyle?b.value=!1:y()}bt(b,()=>{yt(k,G,b.value),b.value||setTimeout(y,700)}),b.value=!0;let w=e=>{"Escape"===e.key&&W()};return Ye(()=>window.addEventListener("keydown",w)),Ft(()=>window.removeEventListener("keydown",w)),(t,e)=>{let a,n,r,s,u,d,v,c,p,f,m,g=K("AutoFormFields"),y=K("FormLoading"),b=K("PrimaryButton"),w=K("CloseButton"),k=K("SecondaryButton"),C=K("ModalLookup");return o(),i("div",null,[_.value?"card"==t.formStyle?(o(),i("div",{key:1,class:h(F.value)},[l("form",{ref_key:"elForm",ref:V,onSubmit:e[0]||(e[0]=Ue(e=>z(e.target),["prevent"])),autocomplete:"off",class:h(t.innerFormClass)},[l("div",{class:h(t.bodyClass)},[l("div",{class:h(t.headerClass)},[t.$slots.heading?(o(),i("div",N0,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",U0,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(n=_.value)?void 0:n.notes},null,10,q0)):x("",!0)],2),U(t.$slots,"header",{instance:null==(r=Be())?void 0:r.exposed,model:P.value}),Q0,(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(s=Be())?void 0:s.exposed,model:P.value})],2),U(t.$slots,"buttons",{},()=>{var e;return[l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",K0,[Z0,ye(b,{disabled:!!t.allowSubmit&&!t.allowSubmit(P.value)},{default:xe(()=>[ke(O(t.submitLabel),1)]),_:1},8,["disabled"]),U(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})])],2)]})],34)],2)):(o(),i("div",W0,[G0,l("div",J0,[l("div",{onMousedown:W,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",G.value])},[l("form",{ref_key:"elForm",ref:V,class:h(I.value),onSubmit:e[1]||(e[1]=Ue(e=>z(e.target),["prevent"]))},[l("div",X0,[l("div",Y0,[l("div",ef,[l("div",tf,[l("div",sf,[t.$slots.heading?(o(),i("div",lf,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",nf,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,of)):x("",!0)]),l("div",af,[ye(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:W})])])]),U(t.$slots,"header",{instance:null==(v=Be())?void 0:v.exposed,model:P.value}),(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(c=Be())?void 0:c.exposed,model:P.value})])]),l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(p=Be())?void 0:p.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",rf,[ye(k,{onClick:W,disabled:H.value},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(b,{class:"ml-4",disabled:!!t.allowSubmit&&!t.allowSubmit(P.value)},{default:xe(()=>[ke(O(t.submitLabel),1)]),_:1},8,["disabled"]),U(t.$slots,"rightbuttons",{instance:null==(f=Be())?void 0:f.exposed,model:P.value})])],2)],34)],2)],32)],32)])])):(o(),i("div",R0,[l("p",E0,[ke("Could not create form for unknown "),z0,ke(" "+O(E.value),1)])])),"ModalLookup"==(null==(m=S.value)?void 0:m.name)&&S.value.ref?(o(),ae(C,{key:3,"ref-info":S.value.ref,onDone:T},null,8,["ref-info"])):x("",!0)])}}}),df={key:0},cf={class:"text-red-700"},ff=l("b",null,"type",-1),vf={key:0},pf={key:2},mf=["innerHTML"],hf={class:"flex justify-end"},gf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},yf=l("div",{class:"fixed inset-0"},null,-1),bf={class:"fixed inset-0 overflow-hidden"},wf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},kf={class:"flex-1"},_f={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},$f={class:"flex items-start justify-between space-x-3"},Cf={class:"space-y-1"},xf={key:0},Lf={key:2},Vf=["innerHTML"],Sf={class:"flex h-7 items-center"},Mf={class:"flex justify-end"},Af=de({__name:"AutoCreateForm",props:{type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,c=D(),p=D(1);function n(){p.value++,null!=(e=c.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function f(e){}ss("ModalProvider",{openModal:function(e,l){m.value=e,u.value=l}});let m=D(),u=D();async function g(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:y,Crud:b,createDto:w,formValues:k}=lt(),C=v(()=>Qt(r.type)),L=v(()=>d(C.value)),M=D("string"==typeof r.type?w(r.type):r.type?new r.type:null),V=(t({forceUpdate:n,props:r,setModel:function(e){Object.assign(M.value,e),n()},formFields:c,model:M}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),S=v(()=>r.formClass||Ee.formClass(r.formStyle)),T=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),A=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),F=v(()=>r.buttonsClass||Ee.buttonsClass),I=v(()=>b.model(L.value)),j=v(()=>{var e;return r.heading||(null==(e=d(C.value))?void 0:e.description)||(I.value?"New "+Pe(I.value):Pe(C.value))}),$=D(new Xe),B=Ps(),E=v(()=>B.loading.value);async function _(e){var l,t,a,n=e.target;r.autosave?(t=Ze(null==(t=M.value)?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==Ze(null==(l=M.value)?void 0:l.createResponse,e=>"function"==typeof e?e():null),il.hasRequestBody(t)?(t=new M.value.constructor,a=new FormData(n),$.value=l?await B.apiFormVoid(t,a,{jsconfig:"eccn"}):await B.apiForm(t,a,{jsconfig:"eccn"})):(t=k(n,y(L.value)),a=new M.value.constructor(t),$.value=l?await B.apiVoid(a,{jsconfig:"eccn"}):await B.api(a,{jsconfig:"eccn"})),$.value.succeeded?(n.reset(),s("save",$.value.response)):s("error",$.value.error)):s("save",new M.value.constructor(k(n,y(L.value))))}function P(){s("done")}G.interceptors.has("AutoCreateForm.new")&&G.interceptors.invoke("AutoCreateForm.new",{props:r,model:M});let H=D(!1),R=D(""),q={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function z(){"slideOver"==r.formStyle?H.value=!1:P()}bt(H,()=>{yt(q,R,H.value),H.value||setTimeout(P,700)}),H.value=!0;let N=e=>{"Escape"===e.key&&z()};return Ye(()=>window.addEventListener("keydown",N)),Ft(()=>window.removeEventListener("keydown",N)),(e,t)=>{var a,n=K("AutoFormFields"),r=K("FormLoading"),s=K("SecondaryButton"),u=K("PrimaryButton"),d=K("CloseButton"),v=K("ModalLookup");return o(),i("div",null,[L.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(V.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:h(S.value)},[l("div",null,[e.$slots.heading?(o(),i("div",vf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",pf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,mf)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value})],2),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&W(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",hf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:W(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:W(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",gf,[yf,l("div",bf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(S.value),onSubmit:Ue(_,["prevent"])},[l("div",wf,[l("div",kf,[l("div",_f,[l("div",$f,[l("div",Cf,[e.$slots.heading?(o(),i("div",xf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",Lf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,Vf)):x("",!0)]),l("div",Sf,[ye(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(d=Be())?void 0:d.exposed,model:M.value})])]),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&W(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",Mf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:W(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:W(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",df,[l("p",cf,[ke("Could not create form for unknown "),ff,ke(" "+O(C.value),1)])])),"ModalLookup"==(null==(a=m.value)?void 0:a.name)&&m.value.ref?(o(),ae(v,{key:3,"ref-info":m.value.ref,onDone:g},null,8,["ref-info"])):x("",!0)])}}}),Tf={key:0},Ff={class:"text-red-700"},If=l("b",null,"type",-1),jf={key:0},Of={key:2},Df=["innerHTML"],Pf={class:"flex justify-end"},Bf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Hf=l("div",{class:"fixed inset-0"},null,-1),Rf={class:"fixed inset-0 overflow-hidden"},Ef={class:"flex min-h-0 flex-1 flex-col overflow-auto"},zf={class:"flex-1"},Nf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Uf={class:"flex items-start justify-between space-x-3"},qf={class:"space-y-1"},Qf={key:0},Kf={key:2},Zf=["innerHTML"],Wf={class:"flex h-7 items-center"},Gf={class:"flex justify-end"},Jf=de({__name:"AutoEditForm",props:{modelValue:{},type:{},deleteType:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","delete","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,p=D(),f=D(1);function m(e){}ss("ModalProvider",{openModal:function(e,l){g.value=e,n.value=l}});let g=D(),n=D();async function q(e){n.value&&n.value(e),g.value=void 0,n.value=void 0}let{typeOf:u,apiOf:Q,typeProperties:c,createFormLayout:Z,getPrimaryKey:J,Crud:y,createDto:d,formValues:b}=lt(),w=v(()=>Qt(r.type)),k=v(()=>u(w.value)),C=()=>"string"==typeof r.type?d(r.type,ys(r.modelValue)):r.type?new r.type(ys(r.modelValue)):null,L=D(C()),X=(t({forceUpdate:function(){f.value++,L.value=C();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(L.value,e)},formFields:p,model:L}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),M=v(()=>r.formClass||Ee.formClass(r.formStyle)),V=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),S=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),T=v(()=>y.model(k.value)),A=v(()=>{var e;return r.heading||(null==(e=u(w.value))?void 0:e.description)||(T.value?"Update "+Pe(T.value):Pe(w.value))}),F=D(new Xe),I=Object.assign({},ys(r.modelValue)),j=(G.interceptors.has("AutoEditForm.new")&&G.interceptors.invoke("AutoEditForm.new",{props:r,model:L,origModel:I}),Ps()),$=v(()=>j.loading.value),B=()=>Ze(u(y.model(k.value)),e=>J(e));function Y(e){var{op:l,prop:t}=e;l&&(y.isPatch(l)||y.isUpdate(l))&&(e.disabled=null==t?void 0:t.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(e){var a=e.target;if(r.autosave){let e=Ze(null==(n=L.value)?void 0:n.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==(n=L.value)?void 0:n.createResponse,e=>"function"==typeof e?e():null),d=B();if(il.hasRequestBody(e)){let e=new L.value.constructor,l=_e(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,l),[]);var n=w.value&&Q(w.value);if(n&&y.isPatch(n)){let s=Z(k.value),o={};if(d&&(o[d.name]=l),s.forEach(t=>{var a=t.id,n=_e(I,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var r=i.get(a);G.interceptors.has("AutoEditForm.save.formLayout")&&G.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:n,formLayout:s,input:t,newValue:r});let e=null!=r,l="checkbox"===t.type?e!=!!n:"file"===t.type?e:r!=n;(l=r||n?l:!1)&&(r?o[a]=r:"file"!==t.type&&u.push(a))}}),G.interceptors.has("AutoEditForm.save")&&G.interceptors.invoke("AutoEditForm.save",{origModel:I,formLayout:s,dirtyValues:o}),Array.from(i.keys()).filter(e=>!o[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void z()}n=0"function"==typeof e?e():null)?F.value=await j.apiVoid(t):F.value=await j.api(t),F.value.succeeded?s("delete",F.value.response):s("error",F.value.error)):console.error(`Could not find Primary Key for Type ${w.value} (${T.value})`)}function P(){s("done")}let H=D(!1),R=D(""),ee={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function z(){"slideOver"==r.formStyle?H.value=!1:P()}bt(H,()=>{yt(ee,R,H.value),H.value||setTimeout(P,700)}),H.value=!0;let N=e=>{"Escape"===e.key&&z()};return Ye(()=>window.addEventListener("keydown",N)),Ft(()=>window.removeEventListener("keydown",N)),(e,t)=>{var a,n=K("AutoFormFields"),r=K("ConfirmDelete"),s=K("FormLoading"),u=K("SecondaryButton"),d=K("PrimaryButton"),v=K("CloseButton"),c=K("ModalLookup");return o(),i("div",null,[k.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(X.value)},[l("form",{onSubmit:Ue(E,["prevent"])},[l("div",{class:h(M.value)},[l("div",null,[e.$slots.heading?(o(),i("div",jf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Of,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Df)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value})],2),l("div",{class:h(W(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&W($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Pf,[ye(u,{onClick:z,disabled:W($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:W($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",Bf,[Hf,l("div",Rf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(M.value),onSubmit:Ue(E,["prevent"])},[l("div",Ef,[l("div",zf,[l("div",Nf,[l("div",Uf,[l("div",qf,[e.$slots.heading?(o(),i("div",Qf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Kf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Zf)):x("",!0)]),l("div",Wf,[ye(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:Y,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(v=Be())?void 0:v.exposed,model:L.value})])]),l("div",{class:h(W(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&W($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Gf,[ye(u,{onClick:z,disabled:W($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:W($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",Tf,[l("p",Ff,[ke("Could not create form for unknown "),If,ke(" "+O(w.value),1)])])),"ModalLookup"==(null==(a=g.value)?void 0:a.name)&&g.value.ref?(o(),ae(c,{key:3,"ref-info":g.value.ref,onDone:q},null,8,["ref-info"])):x("",!0)])}}}),Xf={key:0},Yf={class:"text-red-700"},ev=l("b",null,"type",-1),tv={key:0},sv={key:2},lv=["innerHTML"],nv={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},ov=l("div",{class:"fixed inset-0"},null,-1),av={class:"fixed inset-0 overflow-hidden"},rv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},iv={class:"flex-1"},uv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},dv={class:"flex items-start justify-between space-x-3"},cv={class:"space-y-1"},fv={key:0},vv={key:2},pv=["innerHTML"],mv={class:"flex h-7 items-center"},hv=de({__name:"AutoViewForm",props:{model:{},apis:{},typeName:{},done:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{}},emits:["done"],setup(e,{}){let t=e,a=lt().typeOf,s=v(()=>t.typeName??t.apis.dataModel.name),u=v(()=>a(s.value)),d=v(()=>t.panelClass||Ee.panelClass(t.formStyle)),c=v(()=>t.formClass||Ee.formClass(t.formStyle)),p=v(()=>t.headingClass||Ee.headingClass(t.formStyle)),f=v(()=>t.subHeadingClass||Ee.subHeadingClass(t.formStyle)),m=v(()=>{var e;return t.heading||(null==(e=a(s.value))?void 0:e.description)||(null!=(e=t.model)&&e.id?Pe(s.value)+" "+t.model.id:"View "+Pe(s.value))});function n(){t.done&&t.done()}G.interceptors.has("AutoViewForm.new")&&G.interceptors.invoke("AutoViewForm.new",{props:t});let r=D(!1),g=D(""),y={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function b(){"slideOver"==t.formStyle?r.value=!1:n()}bt(r,()=>{yt(y,g,r.value),r.value||setTimeout(n,700)}),r.value=!0;let w=e=>{"Escape"===e.key&&b()};return Ye(()=>window.addEventListener("keydown",w)),Ft(()=>window.removeEventListener("keydown",w)),(e,t)=>{var a,n=K("MarkupModel"),r=K("CloseButton");return o(),i("div",null,[s.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(d.value)},[l("div",{class:h(c.value)},[l("div",null,[e.$slots.heading?(o(),i("div",tv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",sv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,lv)):x("",!0)]),ye(n,{value:e.model},null,8,["value"])],2)],2)):(o(),i("div",nv,[ov,l("div",av,[l("div",{onMousedown:b,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",g.value])},[l("div",{class:h(c.value)},[l("div",rv,[l("div",iv,[l("div",uv,[l("div",dv,[l("div",cv,[e.$slots.heading?(o(),i("div",fv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",vv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,pv)):x("",!0)]),l("div",mv,[ye(r,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:b})])])]),ye(n,{value:e.model},null,8,["value"])])])],2)],2)],32)],32)])])):(o(),i("div",Xf,[l("p",Yf,[ke("Could not create view for unknown "),ev,ke(" "+O(s.value),1)])]))])}}}),gv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),yv=de({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let a=D(!1),n=t,r=()=>{a.value&&n("delete")},s=v(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",a.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(o(),i(Me,null,[Mt(l("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>nn(a)?a.value=e:a=e)},null,512),[[al,W(a)]]),gv,l("span",Te({onClick:Ue(r,["prevent"]),class:s.value},e.$attrs),[U(e.$slots,"default",{},()=>[ke("Delete")])],16)],64))}}),bv={class:"flex",title:"loading..."},wv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},kv=xs('',3),_v=[kv],$v={class:"ml-2 mt-1 text-gray-400"},Cv=de({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Qe("ApiState",void 0),(e,t)=>(o(),i("div",bv,[e.icon?(o(),i("svg",wv,_v)):x("",!0),l("span",$v,O(e.text),1)]))}}),xv=["onClick"],Lv={key:3,class:"flex justify-between items-center"},Vv={class:"mr-1 select-none"},Sv=["onClick"],Mv=de({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:{},tableStyle:{default:"stripedRows"},selectedColumns:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},isSelected:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{}},emits:["headerSelected","rowSelected"],setup(e,{emit:t}){let u=e,d=t,a=D(),c=D(null),p=Ls(),f=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()+"-header"),m=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()),n=v(()=>Gs(u.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:r,typeProperties:s}=lt(),g=v(()=>Qt(u.type)),y=v(()=>r(g.value)),b=v(()=>s(y.value));function w(e){var l=u.headerTitles&&_e(u.headerTitles,e)||e;return u.headerTitle?u.headerTitle(l):cn(l)}function k(e){let l=e.toLowerCase();return b.value.find(e=>e.name.toLowerCase()==l)}let C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){var l=u.visibleFrom&&_e(u.visibleFrom,e);return l&&Ze(C[l],e=>"hidden "+e)}let M=v(()=>u.gridClass??he.getGridClass(u.tableStyle)),V=v(()=>u.grid2Class??he.getGrid2Class(u.tableStyle)),S=v(()=>u.grid3Class??he.getGrid3Class(u.tableStyle)),T=v(()=>u.grid4Class??he.getGrid4Class(u.tableStyle)),A=v(()=>u.tableClass??he.getTableClass(u.tableStyle)),F=v(()=>u.tbodyClass??he.getTbodyClass(u.tbodyClass)),I=v(()=>u.theadClass??he.getTheadClass(u.tableStyle)),j=v(()=>u.theadRowClass??he.getTheadRowClass(u.tableStyle)),$=v(()=>u.theadCellClass??he.getTheadCellClass(u.tableStyle));let B=v(()=>{let e=("string"==typeof u.selectedColumns?u.selectedColumns.split(","):u.selectedColumns)||(0(e[l.name.toLowerCase()]=l.format,e),{});return e.filter(e=>{var l;return"hidden"!=(null==(l=t[e.toLowerCase()])?void 0:l.method)})});return(n,e)=>{let r=K("CellFormat"),s=K("PreviewFormat");return n.items.length?(o(),i("div",{key:0,ref_key:"refResults",ref:a,class:h(M.value)},[l("div",{class:h(V.value)},[l("div",{class:h(S.value)},[l("div",{class:h(T.value)},[l("table",{class:h(A.value)},[l("thead",{class:h(I.value)},[l("tr",{class:h(j.value)},[(o(!0),i(Me,null,je(B.value,t=>{return o(),i("td",{class:h([L(t),$.value,(e=t,c.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[l("div",{onClick:e=>{var l;e=e,l=t,d("headerSelected",l,e)}},[W(p)[t+"-header"]?U(n.$slots,t+"-header",{key:0,column:t}):f(t)?U(n.$slots,f(t),{key:1,column:t}):W(p).header?U(n.$slots,"header",{key:2,column:t,label:w(t)}):(o(),i("div",Lv,[l("span",Vv,O(w(t)),1)]))],8,xv)],2);var e}),256))],2)],2),l("tbody",{class:h(F.value)},[(o(!0),i(Me,null,je(n.items,(t,e)=>{return o(),i("tr",{class:h((l=t,a=e,u.rowClass?u.rowClass(l,a):he.getTableRowClass(u.tableStyle,a,!(!u.isSelected||!u.isSelected(l)),null!=u.isSelected))),style:ol((a=t,l=e,u.rowStyle?u.rowStyle(a,l):void 0)),onClick:e=>{var l;e=e,l=t,d("rowSelected",l,e)}},[(o(!0),i(Me,null,je(B.value,e=>{return o(),i("td",{class:h([L(e),W(he).tableCellClass])},[W(p)[e]?U(n.$slots,e,Et(Te({key:0},t))):m(e)?U(n.$slots,m(e),Et(Te({key:1},t))):k(e)?(o(),ae(r,{key:2,type:y.value,propType:k(e),modelValue:t},null,8,["type","propType","modelValue"])):(o(),ae(s,{key:3,value:W(_e)(t,e),format:null!=(l=k(e))&&l.format?l.format:"TimeSpan"==(null==l?void 0:l.type)||"TimeOnly"==(null==l?void 0:l.type)?{method:"time"}:null},null,8,["value","format"]))],2);var l}),256))],14,Sv);var l,a}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),Av=de({props:{type:Object,propType:Object,modelValue:Object},setup(d,{attrs:v}){let c=lt().typeOf;return()=>{let e,l=null!=(o=d.propType)&&o.format?o.format:"TimeSpan"==(null==o?void 0:o.type)||"TimeOnly"==(null==o?void 0:o.type)?{method:"time"}:null,t=_e(d.modelValue,d.propType.name),a=Object.assign({},d,v),n=$t("span",{innerHTML:ts(t,l,a)}),r=Rt(t)&&Array.isArray(t)?$t("span",{},[$t("span",{class:"mr-2"},""+t.length),n]):n,s=null==(e=d.propType)?void 0:e.ref;var o,i,u;return s&&(i=st(d.type).find(e=>e.type===s.model))&&(i=(i=_e(d.modelValue,i.name))&&s.refLabel&&_e(i,s.refLabel))?(u=(u=null==(u=c(s.model))?void 0:u.icon)?$t(eo,{image:u,class:"w-5 h-5 mr-1"}):null,$t("span",{class:"flex",title:s.model+" "+t},[u,i])):r}}}),Tv={key:0},Fv={key:0,class:"mr-2"},Iv=["innerHTML"],jv=["innerHTML"],Ov={inheritAttrs:!1},Dv=de({...Ov,__name:"PreviewFormat",props:{value:{},format:{},includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(e){let t=e,a=v(()=>Array.isArray(t.value));return(e,t)=>W(Rt)(e.value)?(o(),i("span",Tv,[e.includeCount&&a.value?(o(),i("span",Fv,O(e.value.length),1)):x("",!0),l("span",{innerHTML:W(ts)(e.value,e.format,e.$attrs)},null,8,Iv)])):(o(),i("span",{key:1,innerHTML:W(ts)(e.value,e.format,e.$attrs)},null,8,jv))}}),Pv=["innerHTML"],Bv={key:0},Hv=l("b",null,null,-1),Rv={key:2},Ev=de({__name:"HtmlFormat",props:{value:{},depth:{default:0},fieldAttrs:{},classes:{type:Function,default:(e,l,t,a,n)=>a}},setup(e){let t=e,r=v(()=>Tt(t.value)),s=v(()=>Array.isArray(t.value)),u=e=>cn(e),d=e=>t.fieldAttrs?t.fieldAttrs(e):null,c=v(()=>Gs(t.value));return(t,e)=>{let a=K("HtmlFormat",!0);return o(),i("div",{class:h(0==t.depth?"prose html-format":"")},[r.value?(o(),i("div",{key:0,innerHTML:W(ts)(t.value)},null,8,Pv)):s.value?(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,W(he).gridClass))},[W(Tt)(t.value[0])?(o(),i("div",Bv,"[ "+O(t.value.join(", "))+" ]",1)):(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,W(he).grid2Class))},[l("div",{class:h(t.classes("array","div",t.depth,W(he).grid3Class))},[l("div",{class:h(t.classes("array","div",t.depth,W(he).grid4Class))},[l("table",{class:h(t.classes("object","table",t.depth,W(he).tableClass))},[l("thead",{class:h(t.classes("array","thead",t.depth,W(he).theadClass))},[l("tr",null,[(o(!0),i(Me,null,je(c.value,e=>(o(),i("th",{class:h(t.classes("array","th",t.depth,W(he).theadCellClass+" whitespace-nowrap"))},[Hv,ke(O(u(e)),1)],2))),256))])],2),l("tbody",null,[(o(!0),i(Me,null,je(t.value,(l,e)=>(o(),i("tr",{class:h(t.classes("array","tr",t.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(o(!0),i(Me,null,je(c.value,e=>(o(),i("td",{class:h(t.classes("array","td",t.depth,W(he).tableCellClass))},[ye(a,Te({value:l[e],"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},d(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(o(),i("div",Rv,[l("table",{class:h(t.classes("object","table",t.depth,"table-object"))},[(o(!0),i(Me,null,je((n=t.value)?Object.keys(n).map(e=>({key:u(e),val:n[e]})):[],e=>(o(),i("tr",{class:h(t.classes("object","tr",t.depth,""))},[l("th",{class:h(t.classes("object","th",t.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},O(e.key),3),l("td",{class:h(t.classes("object","td",t.depth,"align-top py-2 px-4 text-sm"))},[ye(a,Te({value:e.val,"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},d(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),zv=["href"],Nv=["href","title"],Uv=de({__name:"MarkupFormat",props:{value:{},imageClass:{default:"w-8 h-8"}},setup(e){var l=e,t=La().getMimeType,a=l.value;let n=typeof l.value;l="string"===n&&a.length?t(a):null;return"string"===n&&a.length&&(((t=a.startsWith("https://")||a.startsWith("http://"))||"/"===a[0])&&null!=l&&l.startsWith("image/")?n="image":t&&(n="link")),(e,l)=>{var t=K("Icon"),a=K("HtmlFormat");return"link"==W(n)?(o(),i("a",{key:0,href:e.value,class:"text-indigo-600"},O(e.value),9,zv)):"image"==W(n)?(o(),i("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[ye(t,{src:e.value,class:h(e.imageClass)},null,8,["src","class"])],8,Nv)):(o(),ae(a,{key:2,value:e.value},null,8,["value"]))}}}),qv={class:"my-2 w-full"},Qv={class:"leading-7"},Kv={class:"px-2 text-left align-top"},Zv={colspan:"align-top"},Wv={class:"my-2 leading-7"},Gv={colspan:"2",class:"px-2 bg-indigo-700 text-white"},Jv={class:"leading-7"},Xv={colspan:"2",class:"px-2 align-top"},Yv=de({__name:"MarkupModel",props:{value:{},imageClass:{}},setup(e){let a=e,t=Object.keys(a.value),n={},r={};return t.forEach(e=>{var l=a.value[e],t=typeof l;null==l||"function"==t||"symbol"==t?n[e]=`(${null==l?"null":"t"})`:"object"==t?r[e]=l:n[e]=l}),(e,t)=>{let a=K("MarkupFormat");return o(),i("table",qv,[(o(),i(Me,null,je(n,(e,t)=>l("tr",Qv,[l("th",Kv,O(W(Pe)(t)),1),l("td",Zv,[ye(a,{value:e},null,8,["value"])])])),64)),(o(),i(Me,null,je(r,(e,t)=>(o(),i(Me,null,[l("tr",Wv,[l("td",Gv,O(W(Pe)(t)),1)]),l("tr",Jv,[l("td",Xv,[ye(a,{value:e},null,8,["value"])])])],64))),64))])}}}),ep={class:"absolute top-0 right-0 pt-4 pr-4"},tp=l("span",{class:"sr-only"},"Close",-1),sp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),lp=[tp,sp],np=de({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),i("div",ep,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:h([t.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},lp,2)]))}}),op=["id","aria-labelledby"],ap=l("div",{class:"fixed inset-0"},null,-1),rp={class:"fixed inset-0 overflow-hidden"},ip={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},up={class:"flex min-h-0 flex-1 flex-col overflow-auto"},dp={class:"flex-1"},cp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},fp={class:"flex items-start justify-between space-x-3"},vp={class:"space-y-1"},pp={key:0},mp=["id"],hp={key:2,class:"text-sm text-gray-500"},gp={class:"flex h-7 items-center"},yp={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},bp=de({__name:"SlideOver",props:{id:{default:"SlideOver"},title:{},contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(e,{emit:t}){let a=t,n=D(!1),r=D(""),s={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},u=(bt(n,()=>{yt(s,r,n.value),n.value||setTimeout(()=>a("done"),700)}),n.value=!0,()=>n.value=!1),d=e=>{"Escape"===e.key&&u()};return Ye(()=>window.addEventListener("keydown",d)),Ft(()=>window.removeEventListener("keydown",d)),(e,t)=>{var a=K("CloseButton");return o(),i("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[ap,l("div",rp,[l("div",{onMousedown:u,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",r.value])},[l("div",ip,[l("div",up,[l("div",dp,[l("div",cp,[l("div",fp,[l("div",vp,[e.$slots.title?(o(),i("div",pp,[U(e.$slots,"title")])):x("",!0),e.title?(o(),i("h2",{key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:e.id+"-title"},O(e.title),9,mp)):x("",!0),e.$slots.subtitle?(o(),i("p",hp,[U(e.$slots,"subtitle")])):x("",!0)]),l("div",gp,[ye(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:h(e.contentClass)},[U(e.$slots,"default")],2)])]),e.$slots.footer?(o(),i("div",yp,[U(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,op)}}}),wp=["id","data-transition-for","aria-labelledby"],kp={class:"fixed inset-0 z-10 overflow-y-auto"},_p={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},$p={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},Cp=l("span",{class:"sr-only"},"Close",-1),xp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),Lp=[Cp,xp],Vp=de({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:nl.modalClass},sizeClass:{default:nl.sizeClass},closeButtonClass:{default:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"}},emits:["done"],setup(e,{emit:t}){let r=Ls(),a=t,n=D(!1),s=D(""),u={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},d=D(""),v={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},c=(bt(n,()=>{yt(u,s,n.value),yt(v,d,n.value),n.value||setTimeout(()=>a("done"),200)}),n.value=!0,()=>n.value=!1),p=(ss("ModalProvider",{openModal:function(e,l){p.value=e,f.value=l}}),D()),f=D();async function m(e){f.value&&f.value(e),p.value=void 0,f.value=void 0}let g=e=>{"Escape"===e.key&&c()};return Ye(()=>window.addEventListener("keydown",g)),Ft(()=>window.removeEventListener("keydown",g)),(e,t)=>{var a,n=K("ModalLookup");return o(),i("div",{id:e.id,"data-transition-for":e.id,onMousedown:c,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[l("div",{class:h(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",s.value])},null,2),l("div",kp,[l("div",_p,[l("div",{class:h([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[W(r).closebutton?U(e.$slots,"createform",{key:0}):(o(),i("div",$p,[l("button",{type:"button",onClick:c,class:h(e.closeButtonClass)},Lp,2)])),U(e.$slots,"default")])],34),U(e.$slots,"bottom")])]),"ModalLookup"==(null==(a=p.value)?void 0:a.name)&&p.value.ref?(o(),ae(n,{key:0,"ref-info":p.value.ref,onDone:m},null,8,["ref-info"])):x("",!0)],40,wp)}}}),Sp={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Mp={class:"mt-3 pl-5 flex flex-wrap items-center"},Ap={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Tp={class:"hidden md:inline"},Fp={class:"flex pb-1 sm:pb-0"},Ip=["title"],jp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),Op=[jp],Dp=["disabled"],Pp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),Bp=[Pp],Hp=["disabled"],Rp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Ep=[Rp],zp=["disabled"],Np=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Up=[Np],qp=["disabled"],Qp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Kp=[Qp],Zp={key:0,class:"flex pb-1 sm:pb-0"},Wp={class:"px-4 text-lg text-black dark:text-white"},Gp={key:0},Jp={key:1},Xp=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Yp={key:2},em={key:1,class:"pl-2"},tm=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),sm=[tm],lm={class:"flex pb-1 sm:pb-0"},nm={key:0,class:"pl-2"},om=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),am={class:"mr-1"},rm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},im=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),um=[im],dm={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},cm=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),fm=[cm],vm={key:1},pm={key:4},mm={key:0},hm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gm={class:"mr-1 select-none"},ym={key:1,class:"flex justify-between items-center"},bm={class:"mr-1 select-none"},ln=25,wm=de({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:{},skip:{default:0},prefs:{},selectedColumns:{},allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:{},canFilter:{}},emits:["done"],setup(e,{emit:t}){let d=e,a=t,c=Ls(),n=It().config,{metadataApi:r,filterDefinitions:s}=lt(),u=Qe("client"),p=n.value.storage,f=v(()=>d.toolbarButtonClass??he.toolbarButtonClass),m=v(()=>s.value),g=D({take:ln}),y=D(new Xe),b=D(d.skip),w=D(!1),k=D(),C=e=>"string"==typeof e?e.split(","):e||[];function L(e,l){return he.getTableRowClass("fullWidth",l,!1,!0)}let M=v(()=>rt(d.refInfo.model)),V=v(()=>{var e=(0<(e=C(d.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());let t=st(M.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),G=v(()=>{let e=V.value.map(e=>e.name),l=C(g.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),S=v(()=>g.value.take??ln),T=v(()=>y.value.response?_e(y.value.response,"results"):[]),A=v(()=>{var e;return(null==(e=y.value.response)?void 0:e.total)??T.value.length??0}),F=v(()=>00T.value.length>=S.value),$=v(()=>T.value.length>=S.value),B=D([]),q=v(()=>B.value.some(e=>0B.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Q=v(()=>ns(M.value)),Z=v(()=>{var e;return null==(e=r.value)?void 0:e.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==d.refInfo.model&&qe.isAnyQuery(e)})}),J=D(),_=D(!1),P=D(),H=()=>d.id+"/ApiPrefs/"+d.refInfo.model,R=e=>`Column/${d.id}:${d.refInfo.model}.`+e;async function z(e){b.value+=e,b.value<0&&(b.value=0);var l=Math.floor(A.value/S.value)*S.value;b.value>l&&(b.value=l),await N()}async function X(e,l){a("done",e)}function Y(){a("done",null)}function ee(l,e){var t,a=e.target;"TD"!==(null==a?void 0:a.tagName)&&(a=null==(a=null==a?void 0:a.closest("TABLE"))?void 0:a.getBoundingClientRect(),t=B.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&a&&(a=("DIV"===(null==(a=e.target)?void 0:a.tagName)?e.target:null==(a=e.target)?void 0:a.closest("DIV")).getBoundingClientRect(),P.value={column:t,topLeft:{x:Math.max(Math.floor(a.x+25),343),y:Math.floor(115)}})}function le(){P.value=null}async function te(e){var l=null==(l=P.value)?void 0:l.column;l&&(l.settings=e,p.setItem(R(l.name),JSON.stringify(l.settings)),await N()),P.value=null}async function ne(e){p.setItem(R(e.name),JSON.stringify(e.settings)),await N()}async function re(e){_.value=!1,g.value=e,p.setItem(H(),JSON.stringify(e)),await N()}async function N(){var a=(()=>{let a={include:"total",take:S.value},e=C(g.value.selectedColumns||d.selectedColumns);var l;0{t.settings.sort&&n.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);a[l]=e.value})}),"u"{y.value.response=y.value.error=void 0,w.value=e}),t=await u.api(e);l(),St(()=>y.value=t);n=_e(t.response,"results")||[];t.succeeded&&n.label}else console.error("No Query API was found for "+d.refInfo.model)}async function se(){B.value.forEach(e=>{e.settings={filters:[]},p.removeItem(R(e.name))}),await N()}return Ye(async()=>{var e=d.prefs||$s(p.getItem(H()));e&&(g.value=e),B.value=V.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(p.getItem(R(e.name))))})),isNaN(d.skip)||(b.value=d.skip),await N()}),(n,e)=>{let t=K("ErrorSummary"),a=K("Loading"),r=K("SettingsIcons"),s=K("DataGrid"),u=K("ModalDialog");return o(),i(Me,null,[n.refInfo?(o(),ae(u,{key:0,ref_key:"modalDialog",ref:J,id:n.id,onDone:Y},{default:xe(()=>[l("div",Sp,[l("div",Mp,[l("h3",Ap,[ke(" Select "),l("span",Tp,O(W(Pe)(n.refInfo.model)),1)]),l("div",Fp,[n.showPreferences?(o(),i("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:n.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>_.value=!_.value)},Op,8,Ip)):x("",!0),n.showPagingNav?(o(),i("button",{key:1,type:"button",class:h(["pl-2",F.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!F.value,onClick:e[1]||(e[1]=e=>z(-A.value))},Bp,10,Dp)):x("",!0),n.showPagingNav?(o(),i("button",{key:2,type:"button",class:h(["pl-2",I.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!I.value,onClick:e[2]||(e[2]=e=>z(-S.value))},Ep,10,Hp)):x("",!0),n.showPagingNav?(o(),i("button",{key:3,type:"button",class:h(["pl-2",j.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!j.value,onClick:e[3]||(e[3]=e=>z(S.value))},Up,10,zp)):x("",!0),n.showPagingNav?(o(),i("button",{key:4,type:"button",class:h(["pl-2",$.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!$.value,onClick:e[4]||(e[4]=e=>z(A.value))},Kp,10,qp)):x("",!0)]),n.showPagingInfo?(o(),i("div",Zp,[l("div",Wp,[w.value?(o(),i("span",Gp,"Querying...")):x("",!0),T.value.length?(o(),i("span",Jp,[Xp,ke(" "+O(b.value+1)+" - "+O(Math.min(b.value+T.value.length,A.value))+" ",1),l("span",null," of "+O(A.value),1)])):y.value.completed?(o(),i("span",Yp,"No Results")):x("",!0)])])):x("",!0),q.value&&n.showResetPreferences?(o(),i("div",em,[l("button",{type:"button",onClick:se,title:"Reset Preferences & Filters",class:h(f.value)},sm,2)])):x("",!0),l("div",lm,[n.showFiltersView&&0k.value="filters"==k.value?null:"filters"),class:h(f.value),"aria-expanded":"false"},[om,l("span",am,O(E.value)+" "+O(1==E.value?"Filter":"Filters"),1),"filters"!=k.value?(o(),i("svg",rm,um)):(o(),i("svg",dm,fm))],2)])):x("",!0)])]),"filters"==k.value?(o(),ae(Il,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:m.value,columns:B.value,onDone:e[6]||(e[6]=e=>k.value=null),onChange:ne},null,8,["definitions","columns"])):x("",!0),P.value?(o(),i("div",vm,[ye(Fl,{definitions:m.value,column:P.value.column,"top-left":P.value.topLeft,onDone:le,onSave:te},null,8,["definitions","column","top-left"])])):x("",!0),y.value.error?(o(),ae(t,{key:2,status:y.value.error},null,8,["status"])):w.value?(o(),ae(a,{key:3})):(o(),i("div",pm,[T.value.length?(o(),i("div",mm,[ye(s,{id:n.id,items:T.value,type:n.refInfo.model,"selected-columns":G.value,onFiltersChanged:N,tableStyle:"fullWidth",rowClass:L,onRowSelected:X,onHeaderSelected:ee},rl({header:xe(({column:t,label:e})=>{var a;return[!n.allowFiltering||d.canFilter&&!d.canFilter(t)?(o(),i("div",ym,[l("span",bm,O(e),1)])):(o(),i("div",hm,[l("span",gm,O(e),1),ye(r,{column:B.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=P.value)?void 0:a.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[je(Object.keys(W(c)),l=>({name:l,fn:xe(e=>[U(n.$slots,l,Et(ks(e)))])}))]),1032,["id","items","type","selected-columns"])])):x("",!0)]))])]),_:3},8,["id"])):x("",!0),_.value?(o(),ae(jl,{key:1,columns:V.value,prefs:g.value,onDone:e[7]||(e[7]=e=>_.value=!1),onSave:re},null,8,["columns","prefs"])):x("",!0)],64)}}}),km={class:"sm:hidden"},_m=["for"],$m=["id","name"],Cm=["value"],xm={class:"hidden sm:block"},Lm={class:"border-b border-gray-200"},Vm={class:"-mb-px flex","aria-label":"Tabs"},Sm=["onClick"],Mm=de({__name:"Tabs",props:{tabs:{},id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>Pe(e)},selected:{},tabClass:{},bodyClass:{default:"p-4"},url:{type:Boolean,default:!0},clearQuery:{type:Boolean,default:!1}},setup(e){let t=e,a=v(()=>Object.keys(t.tabs)),n=e=>t.label?t.label(e):Pe(e),r=v(()=>t.id||"tabs"),s=v(()=>t.param||"tab"),u=D();function d(e){u.value=e,t.url&&ul({tab:e===a.value[0]?void 0:e},t.clearQuery)}let c=v(()=>100/Object.keys(t.tabs).length+"%");return Ye(()=>{var e;u.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),e=Ws(e)[s.value])&&(u.value=e)}),(t,e)=>(o(),i("div",null,[l("div",km,[l("label",{for:r.value,class:"sr-only"},"Select a tab",8,_m),l("select",{id:r.value,name:r.value,class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:e[0]||(e[0]=e=>{var l;return d(null==(l=e.target)?void 0:l.value)})},[(o(!0),i(Me,null,je(a.value,e=>(o(),i("option",{key:e,value:e},O(n(e)),9,Cm))),128))],40,$m)]),l("div",xm,[l("div",Lm,[l("nav",Vm,[(o(!0),i(Me,null,je(a.value,l=>{return o(),i("a",{href:"#",onClick:Ue(e=>d(l),["prevent"]),style:ol({width:c.value}),class:h([(e=l,u.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),t.tabClass])},O(n(l)),15,Sm);var e}),256))])])]),l("div",{class:h(t.bodyClass)},[(o(),ae(an(t.tabs[u.value])))],2)]))}}),Am=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),Tm=[Am],Fm=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),Im=[Fm],jm=de({__name:"DarkModeToggle",setup(e){let a=typeof document<"u"?document.documentElement:null,n=()=>!(null==a||!a.classList.contains("dark")),r=D("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(o(),i("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n()?null!=a&&a.classList.remove("dark"):null!=a&&a.classList.add("dark"),r.value=n(),localStorage.setItem("color-scheme",r.value?"dark":"light")})},[l("span",{class:h(`${r.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[l("span",{class:h(`${r.value?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Tm,2),l("span",{class:h(`${r.value?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Im,2)],2)]))}}),Om={key:0},Dm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Pm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Bm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Hm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Rm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Em=["onClick"],zm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Nm={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},Um={class:"mt-8"},qm={key:1,class:"mt-6"},Qm=xs('
Or continue with
',1),Km={class:"mt-6 grid grid-cols-3 gap-3"},Zm=["href","title"],Wm={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Gm=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),Jm=l("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),Xm=[Gm,Jm],Ym=de({__name:"SignIn",props:{provider:{},title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(e,{emit:t}){let a=e,n=t,{getMetadata:r,createDto:s}=lt(),u=Ps(),d=Qe("client"),c=Tl().signIn,p=r({assert:!0}),f=p.plugins.auth,m=document.baseURI,g=p.app.baseUrl,y=D(s("Authenticate")),b=D(new Xe),w=D(a.provider),k=(Ye(()=>{null!=f&&f.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]="checkbox"!==e.type&&""))}),v(()=>(null==f?void 0:f.authProviders.filter(e=>e.formLayout))||[])),C=v(()=>k.value[0]||{}),L=v(()=>k.value[Math.max(k.value.length-1,0)]||{}),M=v(()=>(w.value?null==f?void 0:f.authProviders.find(e=>e.name===w.value):null)??C.value),V=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}let T=v(()=>{var e;return((null==(e=M.value)?void 0:e.formLayout)||[]).map(e=>{var l;return Object.assign({},e,{type:null==(l=e.type)?void 0:l.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(l=e.type)?void 0:l.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),A=v(()=>!V(a.oauth)&&(null==f?void 0:f.authProviders.filter(e=>"oauth"===e.type))||[]),F=v(()=>{let e=Ho(null==f?void 0:f.authProviders.filter(e=>e.formLayout&&0{e[S(l)||at(l.name)]=l.name===C.value.name?"":l.name});var l=M.value;return e=l&&V(a.tabs)?{[S(l)||at(l.name)]:l}:e}),I=v(()=>{var e=T.value.map(e=>e.id).filter(e=>e);return b.value.summaryMessage(e)});async function j(){var e;y.value.provider=M.value.name,"authsecret"===M.value.name?(d.headers.set("authsecret",y.value.authsecret),y.value=s("Authenticate")):"basic"===M.value.name?(d.setCredentials(y.value.UserName,y.value.Password),y.value=s("Authenticate"),y.value.UserName=null,y.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=y.value.BearerToken,y.value=s("Authenticate")),b.value=await u.api(y.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new Xe,y.value=s("Authenticate"))}return(e,t)=>{let a=K("ErrorSummary"),n=K("AutoFormFields"),r=K("PrimaryButton"),s=K("Icon"),u=_o("href");return W(f)?(o(),i("div",Dm,[l("div",Pm,[l("h2",Bm,O(e.title),1),1Mt((o(),i("a",{onClick:e=>w.value=l,class:h([""===l||l===C.value.name?"rounded-l-md":l===L.value.name?"rounded-r-md -ml-px":"-ml-px",w.value===l?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[ke(O(e),1)],10,Em)),[[u,{provider:l}]])),256))])])):x("",!0)]),l("div",zm,[I.value?(o(),ae(a,{key:0,class:"mb-3",errorSummary:I.value},null,8,["errorSummary"])):x("",!0),l("div",Nm,[T.value.length?(o(),i("form",{key:0,onSubmit:Ue(j,["prevent"])},[ye(n,{modelValue:y.value,formLayout:T.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),l("div",Um,[ye(r,{class:"w-full"},{default:xe(()=>[ke("Sign In")]),_:1})])],32)):x("",!0),A.value.length?(o(),i("div",qm,[Qm,l("div",Km,[(o(!0),i(Me,null,je(A.value,e=>(o(),i("div",null,[l("a",{href:W(g)+e.navItem.href+"?continue="+W(m),title:S(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[e.icon?(o(),ae(s,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(o(),i("svg",Wm,Xm))],8,Zm)]))),256))])])):x("",!0)])])])):(o(),i("div",Om,"No Auth Plugin"))}}}),e1=["for"],t1={key:1,class:"border border-gray-200 flex justify-between"},s1={class:"p-2 flex flex-wrap gap-x-4"},l1=l("title",null,"Bold text (CTRL+B)",-1),n1=l("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),o1=[l1,n1],a1=l("title",null,"Italics (CTRL+I)",-1),r1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),i1=[a1,r1],u1=l("title",null,"Insert Link (CTRL+K)",-1),d1=l("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),c1=[u1,d1],f1=l("title",null,"Blockquote (CTRL+Q)",-1),v1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),p1=[f1,v1],m1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),h1=l("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),g1=[m1,h1],y1=l("title",null,"Insert Code (CTRL+<)",-1),b1=l("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),w1=[y1,b1],k1=l("title",null,"H2 Heading (CTRL+H)",-1),_1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),$1=[k1,_1],C1=l("title",null,"Numbered List (ALT+1)",-1),x1=l("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),L1=[C1,x1],V1=l("title",null,"Bulleted List (ALT+-)",-1),S1=l("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),M1=[V1,S1],A1=l("title",null,"Strike Through (ALT+S)",-1),T1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),F1=[A1,T1],I1=l("title",null,"Undo (CTRL+Z)",-1),j1=l("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),O1=[I1,j1],D1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),P1=l("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),B1=[D1,P1],H1={key:0,class:"p-2 flex flex-wrap gap-x-4"},R1=["href"],E1=l("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),z1=[E1],N1={class:""},U1=["name","id","label","value","rows","disabled"],q1=["id"],Q1=["id"],Je="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",K1=de({__name:"MarkdownInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},counter:{type:Boolean},rows:{},errorMessages:{},lang:{},autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:{}},emits:["update:modelValue","close"],setup(e,{expose:t,emit:a}){let n=e,r=a,y=[],b=[],s=Qe("ApiState",void 0),u=v(()=>mt.call({responseStatus:n.status??(null==s?void 0:s.error.value)},n.id)),d=v(()=>n.label??Pe(at(n.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),p=v(()=>n.hide?Vt(c,n.hide):Vt(c,[]));function f(e){return p.value[e]}let m=v(()=>["shadow-sm font-mono"+ot.base.replace("rounded-md",""),u.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,n.inputClass]),w=D();function k(e){r("update:modelValue",e)}function g(){return w.value.selectionStart!==w.value.selectionEnd}function C(){var e=w.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=w.value,l=e.value,t=e.selectionStart,e=l.substring(t,e.selectionEnd)||"",a=l.substring(0,t),n=a.lastIndexOf(` `);return{value:l,sel:e,selPos:t,beforeSel:a,afterSel:l.substring(t),prevCRPos:n,beforeCR:0<=n?a.substring(0,n+1):"",afterCR:0<=n?a.substring(n+1):""}}function M({value:e,selectionStart:l,selectionEnd:t}){null==t&&(t=l),k(e),St(()=>{w.value.focus(),w.value.setSelectionRange(l,t)})}function V(e,l,t="",{selectionAtEnd:a,offsetStart:n,offsetEnd:r,filterValue:s,filterSelection:o}={}){let i=w.value,u=i.value,d=i.selectionEnd;y.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),b=[];var v,c=i.selectionStart,p=i.selectionEnd,f=u.substring(0,c),m=u.substring(p),g=e&&f.endsWith(e)&&m.startsWith(l);c==p?(g?(u=f.substring(0,f.length-e.length)+m.substring(l.length),d+=-l.length):(u=f+e+t+l+m,d+=e.length,n=0,r=(null==t?void 0:t.length)||0,a&&(d+=r,r=0)),s&&(v={pos:d},u=s(u,v),d=v.pos)):(v=u.substring(c,p),o&&(v=o(v)),g?(u=f.substring(0,f.length-e.length)+v+m.substring(l.length),n=-v.length-e.length,r=v.length):(u=f+e+v+l+m,n?d+=(e+l).length:(d=c,n=e.length,r=v.length))),k(u),St(()=>{i.focus(),n=d+(n||0),r=(n||0)+(r||0),i.setSelectionRange(n,r)})}t({props:n,textarea:w,updateModelValue:k,selection:C,hasSelection:g,selectionInfo:L,insert:V,replace:M});let S=()=>V("**","**","bold"),T=()=>V("_","_","italics"),A=()=>V("~~","~~","strikethrough"),F=()=>V("[","](https://)","",{offsetStart:-9,offsetEnd:8}),I=()=>V(` > `,` diff --git a/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs b/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs index d0fc851..7825292 100644 --- a/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs +++ b/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs @@ -2788,7 +2788,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, emits: ["headerSelected", "rowSelected", "nav"], setup(e, { expose: t, emit: s }) { - const { config: n, autoQueryGridDefaults: a } = It(), r = a, u = n.value.storage, d = e, c = s, f = Qe("client"), m = "filtering,queryString,queryFilters".split(","), _ = "copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","), w = v(() => d.deny ? Vt(m, d.deny) : Vt(m, r.value.deny)), p = v(() => d.hide ? Vt(_, d.hide) : Vt(_, r.value.hide)); + const { config: n, autoQueryGridDefaults: a } = It(), r = a, u = n.value.storage, d = e, c = s, f = Qe("client"), m = "filtering,queryString,queryFilters".split(","), _ = "copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","), w = v(() => d.deny ? Vt(m, d.deny) : Vt(m, r.value.deny)), p = v(() => d.hide ? Vt(_, d.hide) : Vt(_, r.value.hide)); function y($) { return w.value[$]; }