From 41ea56efb961344f92b8d5c38fbd8f03b8aca3e2 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Tue, 8 Oct 2024 18:30:50 +0800 Subject: [PATCH] update vue lib --- .../wwwroot/lib/mjs/servicestack-vue.min.mjs | 2 +- AiServer/wwwroot/lib/mjs/servicestack-vue.mjs | 355 +++++++++--------- 2 files changed, 179 insertions(+), 178 deletions(-) diff --git a/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs b/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs index 84619a0..84a4ad4 100644 --- a/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs +++ b/AiServer/wwwroot/lib/mjs/servicestack-vue.min.mjs @@ -1,5 +1,5 @@ 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 g,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 G,mergeProps as Te,withModifiers as Ue,h as $t,resolveComponent as Z,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 Rt,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 Et,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:g([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:g([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:g("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 J.config.inputValue?J.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)?G(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 Xt(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=J.config.storage.getItem(e);return l?JSON.parse(l):null}function Ts(e,l){return Et("swr."+Lo(e),l?Object.assign({},e,l):e)}function ka(e){var l;e.request&&(l=Ts(e.request,e.args),J.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),J.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:Xt,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:Jt(l)||fl(gs.doc):null}function Jt(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 Jt(At(e,".").toLowerCase())||(l?Jt(l)||l:null)||Jt("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:Jt,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 zt="/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 Nt{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 Nt;return e.forEach(e=>{l.add(e)}),l}static forType(t,e){let l,a=new Nt;var n;return J.config.apisResolver&&t&&(n=J.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=J.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||zt,a),null!=J.metadata.value))return;var r=Qe("client");if(null!=r&&(l=await r.api(new Va)).succeeded&&es(l.response),null!=J.metadata.value)return;await Yl(zt)}return J.metadata.value}function rt(l,t){if(J.config.typeResolver){var e=J.config.typeResolver(l,t);if(e)return e}var a,e=null==(e=J.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(J.config.apiResolver){var e=J.config.apiResolver(l);if(e)return e}e=null==(e=J.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=J.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=J.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):[],...J.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=J.metadata.value)?void 0:e.app)||null}),l=v(()=>{var e;return(null==(e=J.metadata.value)?void 0:e.api)||null}),t=v(()=>{var e;return(null==(e=null==(e=null==(e=J.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:Nt,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:Qt,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:"+Et(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 Qt(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)?Qt(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)?Qt(pt(e)):e}function Ya(e){return Ll(Ut(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=Ut(e=Object.assign({},e)))}function Ut(t){if(null==t)return null;if("string"==typeof t)return Xn(t);if(Tt(t))return t;if(t instanceof Date)return Qt(t);if(Array.isArray(t))return t.map(Ut);if("object"!=typeof t)return t;{let l={};return Object.keys(t).forEach(e=>{"__type"!=e&&(l[e]=Ut(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 Qt(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}},J=(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){J.config=Object.assign(J.config,e)}function ar(e){J.autoQueryGridDefaults=Object.assign(J.autoQueryGridDefaults,e)}function Vl(e){return e&&J.config.assetsPathResolver?J.config.assetsPathResolver(e):e}function rr(e){return e&&J.config.fallbackPathResolver?J.config.fallbackPathResolver(e):e}function ir(e,l){J.interceptors.register(e,l)}function It(){var e=v(()=>J.config),l=v(()=>J.autoQueryGridDefaults);return{config:e,setConfig:or,events:J.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:g(["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=Z("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:g(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=Z("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:g(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=Z("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{type:t.type??"button",class:g(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"},Gt={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?Gt:Bt).panelClass},formClass(e="slideOver"){return("card"==e?Gt:Bt).formClass},headingClass(e="slideOver"){return("card"==e?Gt:Bt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?Gt: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"},vh=Object.freeze(Object.defineProperty({__proto__:null,a:Cs,card:Gt,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:g(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=Z("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){J.user.value=to(e),J.events.publish("signIn",e)}function Xr(){J.user.value=null,J.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(J.user.value).indexOf(e)}function Yr(e){return 0<=Ml(J.user.value).indexOf(e)}function Al(){return so("Admin")}function bs(e){if(!e)return!1;if(!e.requiresAuth)return!0;var l=J.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=J.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`+(1J.user.value||null),toAuth:to,isAuthenticated:v(()=>null!=J.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=Et(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},u=()=>{var e=location.href.substring(location.origin.length)||"/",e=Et(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var a=Z("Alert"),n=Z("SecondaryButton");return e.invalidAccess?(o(),i("div",ti,[ye(a,{class:g(e.alertClass),innerHTML:e.invalidAccess},null,8,["class","innerHTML"]),l("div",si,[G(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)),y=v(()=>1==u.column.meta.isEnum?_l(Fn(s.value.name)):[]),h=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=Z("SelectInput"),n=Z("TextInput"),r=Z("PrimaryButton"),s=Z("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:g(`${"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:g(`${"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(y.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:h.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(G(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 ${G(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=Z("PrimaryButton"),n=Z("SecondaryButton"),r=Z("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 y=v(()=>n.tableStyle??Y.value.tableStyle),oe=v(()=>n.gridClass??he.getGridClass(y.value)),ie=v(()=>n.grid2Class??he.getGrid2Class(y.value)),ue=v(()=>n.grid3Class??he.getGrid3Class(y.value)),de=v(()=>n.grid4Class??he.getGrid4Class(y.value)),ve=v(()=>n.tableClass??he.getTableClass(y.value)),ce=v(()=>n.theadClass??he.getTheadClass(y.value)),pe=v(()=>n.theadRowClass??he.getTheadRowClass(y.value)),fe=v(()=>n.theadCellClass??he.getTheadCellClass(y.value)),h=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),Ze())}function Ne(e){Object.assign(S.value,e),Ze()}function Ze(){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(Ke())}async function Ge(){await z()}d({update:z,search:qe,createRequestArgs:Ke,reset:Cl,createDone:W,createSave:kl,editDone:K,editSave:wl,forceUpdate:Ze,setEdit:Ne,edit:S,createForm:P,editForm:H,apiPrefs:j,results:E,skip:F,take:B,total:_}),J.interceptors.has("AutoQueryGrid.new")&&J.interceptors.invoke("AutoQueryGrid.new",{props:n});let Je=/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,Je?St(()=>C.value=l):C.value=l})();a=_e(l.response,"results")||[];l.succeeded&&a.label}else console.error(Ae.NoQuery)}function Ke(){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=Ke(),t="/api/"+(null==(t=Q.value.AnyQuery)?void 0:t.request.name),t=Do(le.baseUrl,Et(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)):Nt.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)),yl=v(()=>Q.value.Create&&cl(Q.value.Create)),hl=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 K(){S.value=null,V.value=null,r({edit:void 0})}function W(){M.value=!1,r({create:void 0})}async function wl(){await z(),K()}async function kl(){await z(),W()}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=Z("Alert"),n=Z("EnsureAccessDialog"),r=Z("AutoCreateForm"),s=Z("AutoEditForm"),u=Z("AutoViewForm"),d=Z("ErrorSummary"),v=Z("Loading"),c=Z("SettingsIcons"),p=Z("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.value&&Q.value.Create?(o(),i("div",cu,[yl.value?(o(),ae(n,{key:0,title:"Create "+q.value,"invalid-access":yl.value,"alert-class":"text-yellow-700",onDone:W},null,8,["title","invalid-access"])):G(b).createform?U(t.$slots,"createform",{key:1,type:Q.value.Create.request.name,configure:t.configureField,done:W,save:kl}):(o(),ae(r,{key:2,ref_key:"createForm",ref:P,type:Q.value.Create.request.name,configure:t.configureField,onDone:W,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"]))])):S.value&&Q.value.AnyUpdate?(o(),i("div",fu,[hl.value?(o(),ae(n,{key:0,title:"Update "+q.value,"invalid-access":hl.value,"alert-class":"text-yellow-700",onDone:K},null,8,["title","invalid-access"])):G(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:K,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:K,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"]))])):S.value?(o(),i("div",vu,[G(b).viewform?U(t.$slots,"viewform",{key:0,model:S.value,apis:Q.value,done:K}):(o(),ae(u,{key:1,model:S.value,apis:Q.value,done:K},null,8,["model","apis"]))])):x("",!0),G(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:g(["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:g(["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:"Previous page",disabled:!Te.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:g(["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:"Next page",disabled:!Oe.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:g(["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:g(h.value)},Eu,2)])):x("",!0),m("downloadCsv")?(o(),i("div",zu,[l("button",{type:"button",onClick:We,title:"Download CSV",class:g(h.value)},Uu,2)])):x("",!0),m("copyApiUrl")?(o(),i("div",qu,[l("button",{type:"button",onClick:el,title:"Copy API URL",class:g(h.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:g(h.value)},td,2)])):x("",!0),m("filtersView")&&0L.value="filters"==L.value?null:"filters"),class:g(h.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:g(h.value)},[vd,l("span",pd,O(nl.value),1)],10,fd)])):x("",!0),G(b).toolbarbuttons?U(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:h.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:y.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(G(b)),l=>({name:l,fn:xe(e=>[U(t.$slots,l,Rt(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:g(["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=Z("EnsureAccess"),a=Z("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={class:"mt-1 relative rounded-md shadow-sm"},Bd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Hd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Rd=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),Ed=[Rd],zd=["id"],Nd=["id"],Ud={inheritAttrs:!1},qd=de({...Ud,__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),d=Qe("ApiState",void 0),c=v(()=>mt.call({responseStatus:a.status??(null==d?void 0:d.error.value)},a.id)),p=v(()=>[ot.base,c.value?ot.invalid:ot.valid,a.inputClass]);return(t,e)=>(o(),i("div",{class:g([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:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(s.value),11,Dd)):x("",!0),l("div",Pd,[l("input",Te({ref_key:"inputElement",ref:n,type:r.value,name:t.id,id:t.id,class:p.value,placeholder:u.value,value:G(pn)(r.value,t.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=c.value,"aria-describedby":t.id+"-error",step:"any"},G(ft)(t.$attrs,["class","value"])),null,16,Bd),c.value?(o(),i("div",Hd,Ed)):x("",!0)]),c.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(c.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,Nd)):x("",!0),U(t.$slots,"footer",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),Qd=["for"],Kd={class:"mt-1 relative rounded-md shadow-sm"},Zd=["name","id","placeholder","aria-invalid","aria-describedby"],Wd=["id"],Gd=["id"],Jd={inheritAttrs:!1},Xd=de({...Jd,__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:g([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Qd)):x("",!0),l("div",Kd,[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"},G(ft)(t.$attrs,["class"])),O(t.modelValue),17,Zd)]),s.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(s.value),9,Wd)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,Gd)):x("",!0)],2))}}),Yd=["for"],ec=["id","name","value","aria-invalid","aria-describedby"],tc=["value"],sc=["id"],lc={inheritAttrs:!1},nc=de({...lc,__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:g([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Yd)):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"},G(ft)(t.$attrs,["class"])),[(o(!0),i(Me,null,je(s.value,e=>(o(),i("option",{value:e.key},O(e.value),9,tc))),256))],16,ec),r.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(r.value),9,sc)):x("",!0)],2))}}),oc={class:"flex items-center h-5"},ac=["id","name","checked"],rc={class:"ml-3 text-sm"},ic=["for"],uc={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},dc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},cc={inheritAttrs:!1},fc=de({...cc,__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:g(["relative flex items-start",t.$attrs.class])},[l("div",oc,[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]},G(ft)(t.$attrs,["class"])),null,16,ac)]),l("div",rc,[l("label",{for:t.id,class:g("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,ic),r.value?(o(),i("p",uc,O(r.value),1)):t.help?(o(),i("p",dc,O(t.help),1)):x("",!0)])],2))}}),vc=["id"],pc=["for"],mc={class:"mt-1 relative rounded-md shadow-sm"},hc=["id","name","value"],gc={class:"flex flex-wrap pb-1.5"},yc={class:"pt-1.5 pl-1"},bc={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"},wc=["onClick"],kc=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),_c=[kc],$c={class:"pt-1.5 pl-1 shrink"},Cc=["type","name","id","aria-invalid","aria-describedby"],xc=["id"],Lc=["onMouseover","onClick"],Vc={class:"block truncate"},Sc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Mc=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),Ac=[Mc],Tc=["id"],Fc=["id"],Ic={inheritAttrs:!1},jc=de({...Ic,__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))),y=Qe("ApiState",void 0),h=v(()=>mt.call({responseStatus:a.status??(null==y?void 0:y.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",h.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:g([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),i("label",{key:0,for:e.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(m.value),11,pc)):x("",!0),l("div",mc,[l("input",{type:"hidden",id:e.id,name:e.id,value:r.value.join(",")},null,8,hc),l("button",{class:g(b.value),onClick:Ue(k,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",gc,[(o(!0),i(Me,null,je(r.value,t=>(o(),i("div",yc,[l("span",bc,[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"},_c,8,wc)])]))),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!=h.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)},G(ft)(e.$attrs,["class","required"])),null,16,Cc),[[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:g([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",Vc,O(t),1)],42,Lc))),256))],40,xc)):x("",!0),h.value?(o(),i("div",Sc,Ac)):x("",!0)]),h.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(h.value),9,Tc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Fc)):x("",!0)],10,vc))}}),Oc={class:"relative flex-grow mr-2 sm:mr-4"},Dc=["for"],Pc={class:"block mt-2"},Bc={class:"sr-only"},Hc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Rc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Ec=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),zc=[Ec],Nc=["id"],Uc=["id"],qc={key:0},Qc=["title"],Kc=["alt","src"],Zc={key:1,class:"mt-3"},Wc={class:"w-full"},Gc={class:"pr-6 align-bottom pb-2"},Jc=["title"],Xc=["src","onError"],Yc=["href"],e0={key:1,class:"overflow-hidden"},t0={class:"align-top pb-2 whitespace-nowrap"},s0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},l0=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),y=Qe("ApiState",void 0),h=v(()=>mt.call({responseStatus:a.status??(null==y?void 0:y.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",h.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:g(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",Oc,[f.value?(o(),i("label",{key:0,for:e.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(f.value),11,Dc)):x("",!0),l("div",Pc,[l("span",Bc,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!=h.value,"aria-describedby":e.id+"-error"},e.$attrs,{onChange:w}),null,16,Hc),h.value?(o(),i("div",Rc,zc)):x("",!0)]),h.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(h.value),9,Nc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Uc)):x("",!0)]),e.multiple?(o(),i("div",Zc,[l("table",Wc,[(o(!0),i(Me,null,je(c.value,t=>(o(),i("tr",null,[l("td",Gc,[l("div",{class:"flex w-full",title:C(t.filePath)?"":t.filePath},[l("img",{src:u[G(xt)(t.filePath)]||G(r)(G(xt)(t.filePath)),class:g(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[G(xt)(t.filePath)]=G(s)(G(xt)(t.filePath))},null,42,Xc),C(t.filePath)?(o(),i("span",e0,O(t.fileName),1)):(o(),i("a",{key:0,href:G(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},O(t.fileName),9,Yc))],8,Jc)]),l("td",t0,[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),y=D(""),h=D(null),b=D(r.viewCount),w=D([]),k=v(()=>y.value?r.options.filter(e=>r.match(e,y.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?(h.value=w.value[0],A()):"End"==e.code?(h.value=w.value[w.value.length-1],A()):"ArrowDown"==e.code?(h.value?(l=w.value.indexOf(h.value),h.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(y.value="",n.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),h.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(y,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,o0)):x("",!0),l("div",a0,[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=>y.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,r0),[[ko,y.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"},u0),n.value?(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(w.value,t=>(o(),i("li",{class:g([t===h.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,h.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",Rt(ks(t))),u(t)?(o(),i("span",{key:0,class:g(["absolute inset-y-0 right-0 flex items-center pr-4",t===h.value?"text-white":"text-indigo-600"])},v0,2)):x("",!0)],42,c0))),256))],40,d0)):!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",Rt(ks(e.modelValue)))],32)):x("",!0),p.value?(o(),i("div",p0,h0)):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,g0)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,y0)):x("",!0)],8,n0))}}),w0=["id","name","value"],k0={class:"block truncate"},_0=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=Z("Autocomplete");return o(),i(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,w0),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",k0,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=Z("SelectInput"),n=Z("CheckboxInput"),r=Z("TagInput"),s=Z("Combobox"),i=Z("FileInput"),u=Z("TextareaInput"),d=Z("MarkdownInput"),v=Z("TextInput");return G(J).component(c.value)?(o(),ae(an(G(J).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"]))}}}),C0={class:"lookup-field"},x0=["name","value"],L0={key:0,class:"flex justify-between"},V0=["for"],S0={key:0,class:"flex items-center"},M0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},A0=l("span",{class:"sr-only"},"Clear",-1),T0=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),F0=[A0,T0],I0={key:1,class:"mt-1 relative"},j0={class:"w-full inline-flex truncate"},O0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},D0=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),P0=["id"],B0=["id"],H0=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(""),y=D(""),h=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);var l,t=s.modelValue;s.modelValue[d.value]||(s.modelValue[d.value]=null);let a=b.value,n=null==a?void 0:a.ref;if(n){m.value="";let e=null==n.selfId?_e(t,a.name):_e(t,n.selfId);null==(e=Xt(e)?_e(t,n.refId):e)||null==(null==(l=r.value)?void 0:l.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==n.model}))||Xt(l=_e(t,a.name))||(m.value=""+l,y.value=a.name,null!=n.refLabel&&(null==(l=st(s.metadataType).find(e=>e.type==n.model))&&console.warn(`Could not find ${n.model} Property on `+s.metadataType.name),null!=(t=null!=l?_e(t,l.name):null)?(l=_e(t,n.refLabel))&&(m.value=""+l,Pt.setValue(n.model,e,n.refLabel,l)):(l=1==(null==(t=a.attributes)?void 0:t.some(e=>"Computed"==e.name)),t=await Pt.getOrFetchValue(p,r.value,n.model,n.refId,n.refLabel,l,e),m.value=t||n.model+": "+m.value)))}else console.warn(`No RefInfo for property '${d.value}'`)}),(e,t)=>{var a,n=Z("Icon");return o(),i("div",C0,[l("input",{type:"hidden",name:d.value,value:h.value},null,8,x0),c.value?(o(),i("div",L0,[l("label",{for:d.value,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(c.value),11,V0),h.value?(o(),i("div",S0,[l("span",M0,O(h.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"},F0)])):x("",!0)])):x("",!0),null!=(a=b.value)&&a.ref?(o(),i("div",I0,[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=G(s.modelValue))[d.value]=l,u("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",j0,[l("span",O0,[ye(n,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,O(m.value),1)])]),D0])])):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,P0)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},O(e.help),9,B0)):x("",!0)])}}}),R0=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(),y=v(()=>u.type||qt(u.modelValue)),h=v(()=>u.metaType??p(y.value)),b=v(()=>{var e;return f(null==(e=null==(e=s.value)?void 0:e.operations.find(e=>e.request.name==y.value))?void 0:e.dataModel)||h.value});function w(){var e,l=h.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 ${y.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=Z("ErrorSummary"),r=Z("LookupInput"),s=Z("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:g(t.flexClass)},[l("div",{class:g(t.divideClass)},[l("div",{class:g(t.spaceClass)},[l("fieldset",{class:g(t.fieldsetClass)},[(o(!0),i(Me,null,je(w(),l=>{var e;return o(),i("div",{key:l.id,class:g(["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 E0={key:0},z0={class:"text-red-700"},N0=l("b",null,"type",-1),U0={key:0},q0={key:2},Q0=["innerHTML"],K0=l("input",{type:"submit",class:"hidden"},null,-1),Z0={class:"flex justify-end"},W0=l("div",null,null,-1),G0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},J0=l("div",{class:"fixed inset-0"},null,-1),X0={class:"fixed inset-0 overflow-hidden"},Y0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},ef={class:"flex-1"},tf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},sf={class:"flex items-start justify-between space-x-3"},lf={class:"space-y-1"},nf={key:0},of={key:2},af=["innerHTML"],rf={class:"flex h-7 items-center"},uf={class:"flex justify-end"},df=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||y(),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 y(){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=y(),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),J()):u("error",A.value.error)):console.error("Not a valid form",e)}function N(e){u("update:modelValue",e)}function h(){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:J,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 J(){"slideOver"==s.formStyle?b.value=!1:h()}bt(b,()=>{yt(k,G,b.value),b.value||setTimeout(h,700)}),b.value=!0;let w=e=>{"Escape"===e.key&&J()};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,y=Z("AutoFormFields"),h=Z("FormLoading"),b=Z("PrimaryButton"),w=Z("CloseButton"),k=Z("SecondaryButton"),C=Z("ModalLookup");return o(),i("div",null,[_.value?"card"==t.formStyle?(o(),i("div",{key:1,class:g(F.value)},[l("form",{ref_key:"elForm",ref:V,onSubmit:e[0]||(e[0]=Ue(e=>z(e.target),["prevent"])),autocomplete:"off",class:g(t.innerFormClass)},[l("div",{class:g(t.bodyClass)},[l("div",{class:g(t.headerClass)},[t.$slots.heading?(o(),i("div",U0,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:g(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",q0,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:g($.value)},O(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),i("p",{key:4,class:g(["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}),K0,(o(),ae(y,{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:g(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(h,{key:0})):x("",!0)]),l("div",Z0,[W0,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",G0,[J0,l("div",X0,[l("div",{onMousedown:J,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:g(["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:g(I.value),onSubmit:e[1]||(e[1]=Ue(e=>z(e.target),["prevent"]))},[l("div",Y0,[l("div",ef,[l("div",tf,[l("div",sf,[l("div",lf,[t.$slots.heading?(o(),i("div",nf,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:g(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",of,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:g($.value)},O(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),i("p",{key:4,class:g(["notes",$.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,af)):x("",!0)]),l("div",rf,[ye(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:J})])])]),U(t.$slots,"header",{instance:null==(v=Be())?void 0:v.exposed,model:P.value}),(o(),ae(y,{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:g(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(h,{key:0})):x("",!0)]),l("div",uf,[ye(k,{onClick:J,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",E0,[l("p",z0,[ke("Could not create form for unknown "),N0,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)])}}}),cf={key:0},ff={class:"text-red-700"},vf=l("b",null,"type",-1),pf={key:0},mf={key:2},hf=["innerHTML"],gf={class:"flex justify-end"},yf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},bf=l("div",{class:"fixed inset-0"},null,-1),wf={class:"fixed inset-0 overflow-hidden"},kf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},_f={class:"flex-1"},$f={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Cf={class:"flex items-start justify-between space-x-3"},xf={class:"space-y-1"},Lf={key:0},Vf={key:2},Sf=["innerHTML"],Mf={class:"flex h-7 items-center"},Af={class:"flex justify-end"},Tf=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 y(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:h,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,h(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,h(L.value))))}function P(){s("done")}J.interceptors.has("AutoCreateForm.new")&&J.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=Z("AutoFormFields"),r=Z("FormLoading"),s=Z("SecondaryButton"),u=Z("PrimaryButton"),d=Z("CloseButton"),v=Z("ModalLookup");return o(),i("div",null,[L.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(V.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:g(S.value)},[l("div",null,[e.$slots.heading?(o(),i("div",pf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",mf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,hf)):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:g(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",gf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:G(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:G(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",yf,[bf,l("div",wf,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:g(S.value),onSubmit:Ue(_,["prevent"])},[l("div",kf,[l("div",_f,[l("div",$f,[l("div",Cf,[l("div",xf,[e.$slots.heading?(o(),i("div",Lf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",Vf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,Sf)):x("",!0)]),l("div",Mf,[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:g(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",Af,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:G(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:G(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",cf,[l("p",ff,[ke("Could not create form for unknown "),vf,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:y},null,8,["ref-info"])):x("",!0)])}}}),Ff={key:0},If={class:"text-red-700"},jf=l("b",null,"type",-1),Of={key:0},Df={key:2},Pf=["innerHTML"],Bf={class:"flex justify-end"},Hf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Rf=l("div",{class:"fixed inset-0"},null,-1),Ef={class:"fixed inset-0 overflow-hidden"},zf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Nf={class:"flex-1"},Uf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},qf={class:"flex items-start justify-between space-x-3"},Qf={class:"space-y-1"},Kf={key:0},Zf={key:2},Wf=["innerHTML"],Gf={class:"flex h-7 items-center"},Jf={class:"flex justify-end"},Xf=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){y.value=e,n.value=l}});let y=D(),n=D();async function q(e){n.value&&n.value(e),y.value=void 0,n.value=void 0}let{typeOf:u,apiOf:Q,typeProperties:c,createFormLayout:K,getPrimaryKey:W,Crud:h,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(()=>h.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=(J.interceptors.has("AutoEditForm.new")&&J.interceptors.invoke("AutoEditForm.new",{props:r,model:L,origModel:I}),Ps()),$=v(()=>j.loading.value),B=()=>Ze(u(h.model(k.value)),e=>W(e));function Y(e){var{op:l,prop:t}=e;l&&(h.isPatch(l)||h.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&&h.isPatch(n)){let s=K(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);J.interceptors.has("AutoEditForm.save.formLayout")&&J.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))}}),J.interceptors.has("AutoEditForm.save")&&J.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=Z("AutoFormFields"),r=Z("ConfirmDelete"),s=Z("FormLoading"),u=Z("SecondaryButton"),d=Z("PrimaryButton"),v=Z("CloseButton"),c=Z("ModalLookup");return o(),i("div",null,[k.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(X.value)},[l("form",{onSubmit:Ue(E,["prevent"])},[l("div",{class:g(M.value)},[l("div",null,[e.$slots.heading?(o(),i("div",Of,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Df,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Pf)):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:g(G(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&G($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Bf,[ye(u,{onClick:z,disabled:G($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:G($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",Hf,[Rf,l("div",Ef,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:g(M.value),onSubmit:Ue(E,["prevent"])},[l("div",zf,[l("div",Nf,[l("div",Uf,[l("div",qf,[l("div",Qf,[e.$slots.heading?(o(),i("div",Kf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Zf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Wf)):x("",!0)]),l("div",Gf,[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:g(G(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&G($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Jf,[ye(u,{onClick:z,disabled:G($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:G($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",Ff,[l("p",If,[ke("Could not create form for unknown "),jf,ke(" "+O(w.value),1)])])),"ModalLookup"==(null==(a=y.value)?void 0:a.name)&&y.value.ref?(o(),ae(c,{key:3,"ref-info":y.value.ref,onDone:q},null,8,["ref-info"])):x("",!0)])}}}),Yf={key:0},ev={class:"text-red-700"},tv=l("b",null,"type",-1),sv={key:0},lv={key:2},nv=["innerHTML"],ov={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},av=l("div",{class:"fixed inset-0"},null,-1),rv={class:"fixed inset-0 overflow-hidden"},iv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},uv={class:"flex-1"},dv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},cv={class:"flex items-start justify-between space-x-3"},fv={class:"space-y-1"},vv={key:0},pv={key:2},mv=["innerHTML"],hv={class:"flex h-7 items-center"},gv=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()}J.interceptors.has("AutoViewForm.new")&&J.interceptors.invoke("AutoViewForm.new",{props:t});let r=D(!1),y=D(""),h={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(h,y,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=Z("MarkupModel"),r=Z("CloseButton");return o(),i("div",null,[s.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(d.value)},[l("div",{class:g(c.value)},[l("div",null,[e.$slots.heading?(o(),i("div",sv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",lv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,nv)):x("",!0)]),ye(n,{value:e.model},null,8,["value"])],2)],2)):(o(),i("div",ov,[av,l("div",rv,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",y.value])},[l("div",{class:g(c.value)},[l("div",iv,[l("div",uv,[l("div",dv,[l("div",cv,[l("div",fv,[e.$slots.heading?(o(),i("div",vv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",pv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,mv)):x("",!0)]),l("div",hv,[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",Yf,[l("p",ev,[ke("Could not create view for unknown "),tv,ke(" "+O(s.value),1)])]))])}}}),yv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),bv=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,G(a)]]),yv,l("span",Te({onClick:Ue(r,["prevent"]),class:s.value},e.$attrs),[U(e.$slots,"default",{},()=>[ke("Delete")])],16)],64))}}),wv={class:"flex",title:"loading..."},kv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},_v=xs('',3),$v=[_v],Cv={class:"ml-2 mt-1 text-gray-400"},xv=de({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Qe("ApiState",void 0),(e,t)=>(o(),i("div",wv,[e.icon?(o(),i("svg",kv,$v)):x("",!0),l("span",Cv,O(e.text),1)]))}}),Lv=["onClick"],Vv={key:3,class:"flex justify-between items-center"},Sv={class:"mr-1 select-none"},Mv=["onClick"],Av=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(),y=v(()=>qt(u.type)),h=v(()=>r(y.value)),b=v(()=>s(h.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=Z("CellFormat"),s=Z("PreviewFormat");return n.items.length?(o(),i("div",{key:0,ref_key:"refResults",ref:a,class:g(M.value)},[l("div",{class:g(V.value)},[l("div",{class:g(S.value)},[l("div",{class:g(T.value)},[l("table",{class:g(A.value)},[l("thead",{class:g(I.value)},[l("tr",{class:g(j.value)},[(o(!0),i(Me,null,je(B.value,t=>{return o(),i("td",{class:g([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)}},[G(p)[t+"-header"]?U(n.$slots,t+"-header",{key:0,column:t}):f(t)?U(n.$slots,f(t),{key:1,column:t}):G(p).header?U(n.$slots,"header",{key:2,column:t,label:w(t)}):(o(),i("div",Vv,[l("span",Sv,O(w(t)),1)]))],8,Lv)],2);var e}),256))],2)],2),l("tbody",{class:g(F.value)},[(o(!0),i(Me,null,je(n.items,(t,e)=>{return o(),i("tr",{class:g((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:g([L(e),G(he).tableCellClass])},[G(p)[e]?U(n.$slots,e,Rt(Te({key:0},t))):m(e)?U(n.$slots,m(e),Rt(Te({key:1},t))):k(e)?(o(),ae(r,{key:2,type:h.value,propType:k(e),modelValue:t},null,8,["type","propType","modelValue"])):(o(),ae(s,{key:3,value:G(_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,Mv);var l,a}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),Tv=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=Xt(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}}}),Fv={key:0},Iv={key:0,class:"mr-2"},jv=["innerHTML"],Ov=["innerHTML"],Dv={inheritAttrs:!1},Pv=de({...Dv,__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)=>G(Xt)(e.value)?(o(),i("span",Fv,[e.includeCount&&a.value?(o(),i("span",Iv,O(e.value.length),1)):x("",!0),l("span",{innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,jv)])):(o(),i("span",{key:1,innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,Ov))}}),Bv=["innerHTML"],Hv={key:0},Rv=l("b",null,null,-1),Ev={key:2},zv=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=Z("HtmlFormat",!0);return o(),i("div",{class:g(0==t.depth?"prose html-format":"")},[r.value?(o(),i("div",{key:0,innerHTML:G(ts)(t.value)},null,8,Bv)):s.value?(o(),i("div",{key:1,class:g(t.classes("array","div",t.depth,G(he).gridClass))},[G(Tt)(t.value[0])?(o(),i("div",Hv,"[ "+O(t.value.join(", "))+" ]",1)):(o(),i("div",{key:1,class:g(t.classes("array","div",t.depth,G(he).grid2Class))},[l("div",{class:g(t.classes("array","div",t.depth,G(he).grid3Class))},[l("div",{class:g(t.classes("array","div",t.depth,G(he).grid4Class))},[l("table",{class:g(t.classes("object","table",t.depth,G(he).tableClass))},[l("thead",{class:g(t.classes("array","thead",t.depth,G(he).theadClass))},[l("tr",null,[(o(!0),i(Me,null,je(c.value,e=>(o(),i("th",{class:g(t.classes("array","th",t.depth,G(he).theadCellClass+" whitespace-nowrap"))},[Rv,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:g(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:g(t.classes("array","td",t.depth,G(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",Ev,[l("table",{class:g(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:g(t.classes("object","tr",t.depth,""))},[l("th",{class:g(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:g(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}}}),Nv=["href"],Uv=["href","title"],qv=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=Z("Icon"),a=Z("HtmlFormat");return"link"==G(n)?(o(),i("a",{key:0,href:e.value,class:"text-indigo-600"},O(e.value),9,Nv)):"image"==G(n)?(o(),i("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[ye(t,{src:e.value,class:g(e.imageClass)},null,8,["src","class"])],8,Uv)):(o(),ae(a,{key:2,value:e.value},null,8,["value"]))}}}),Qv={class:"my-2 w-full"},Kv={class:"leading-7"},Zv={class:"px-2 text-left align-top"},Wv={colspan:"align-top"},Gv={class:"my-2 leading-7"},Jv={colspan:"2",class:"px-2 bg-indigo-700 text-white"},Xv={class:"leading-7"},Yv={colspan:"2",class:"px-2 align-top"},ep=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=Z("MarkupFormat");return o(),i("table",Qv,[(o(),i(Me,null,je(n,(e,t)=>l("tr",Kv,[l("th",Zv,O(G(Pe)(t)),1),l("td",Wv,[ye(a,{value:e},null,8,["value"])])])),64)),(o(),i(Me,null,je(r,(e,t)=>(o(),i(Me,null,[l("tr",Gv,[l("td",Jv,O(G(Pe)(t)),1)]),l("tr",Xv,[l("td",Yv,[ye(a,{value:e},null,8,["value"])])])],64))),64))])}}}),tp={class:"absolute top-0 right-0 pt-4 pr-4"},sp=l("span",{class:"sr-only"},"Close",-1),lp=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),np=[sp,lp],op=de({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),i("div",tp,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:g([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"])},np,2)]))}}),ap=["id","aria-labelledby"],rp=l("div",{class:"fixed inset-0"},null,-1),ip={class:"fixed inset-0 overflow-hidden"},up={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},dp={class:"flex min-h-0 flex-1 flex-col overflow-auto"},cp={class:"flex-1"},fp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},vp={class:"flex items-start justify-between space-x-3"},pp={class:"space-y-1"},mp={key:0},hp=["id"],gp={key:2,class:"text-sm text-gray-500"},yp={class:"flex h-7 items-center"},bp={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},wp=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=Z("CloseButton");return o(),i("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[rp,l("div",ip,[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:g(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",r.value])},[l("div",up,[l("div",dp,[l("div",cp,[l("div",fp,[l("div",vp,[l("div",pp,[e.$slots.title?(o(),i("div",mp,[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,hp)):x("",!0),e.$slots.subtitle?(o(),i("p",gp,[U(e.$slots,"subtitle")])):x("",!0)]),l("div",yp,[ye(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:g(e.contentClass)},[U(e.$slots,"default")],2)])]),e.$slots.footer?(o(),i("div",bp,[U(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,ap)}}}),kp=["id","data-transition-for","aria-labelledby"],_p={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"},Cp={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},xp=l("span",{class:"sr-only"},"Close",-1),Lp=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),Vp=[xp,Lp],Sp=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 y=e=>{"Escape"===e.key&&c()};return Ye(()=>window.addEventListener("keydown",y)),Ft(()=>window.removeEventListener("keydown",y)),(e,t)=>{var a,n=Z("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:g(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",s.value])},null,2),l("div",_p,[l("div",$p,[l("div",{class:g([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[G(r).closebutton?U(e.$slots,"createform",{key:0}):(o(),i("div",Cp,[l("button",{type:"button",onClick:c,class:g(e.closeButtonClass)},Vp,2)])),U(e.$slots,"default")])],34)])]),"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,kp)}}}),Mp={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Ap={class:"mt-3 pl-5 flex flex-wrap items-center"},Tp={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Fp={class:"hidden md:inline"},Ip={class:"flex pb-1 sm:pb-0"},jp=["title"],Op=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),Dp=[Op],Pp=["disabled"],Bp=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),Hp=[Bp],Rp=["disabled"],Ep=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),zp=[Ep],Np=["disabled"],Up=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),qp=[Up],Qp=["disabled"],Kp=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),Zp=[Kp],Wp={key:0,class:"flex pb-1 sm:pb-0"},Gp={class:"px-4 text-lg text-black dark:text-white"},Jp={key:0},Xp={key:1},Yp=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),em={key:2},tm={key:1,class:"pl-2"},sm=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),lm=[sm],nm={class:"flex pb-1 sm:pb-0"},om={key:0,class:"pl-2"},am=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),rm={class:"mr-1"},im={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"},um=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),dm=[um],cm={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"},fm=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),vm=[fm],pm={key:1},mm={key:4},hm={key:0},gm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},ym={class:"mr-1 select-none"},bm={key:1,class:"flex justify-between items-center"},wm={class:"mr-1 select-none"},ln=25,km=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),y=D({take:ln}),h=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}),J=v(()=>{let e=V.value.map(e=>e.name),l=C(y.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),S=v(()=>y.value.take??ln),T=v(()=>h.value.response?_e(h.value.response,"results"):[]),A=v(()=>{var e;return(null==(e=h.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)),K=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)})}),W=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,y.value=e,p.setItem(H(),JSON.stringify(e)),await N()}async function N(){var a=(()=>{let a={include:"total",take:S.value},e=C(y.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"{h.value.response=h.value.error=void 0,w.value=e}),t=await u.api(e);l(),St(()=>h.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&&(y.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=Z("ErrorSummary"),a=Z("Loading"),r=Z("SettingsIcons"),s=Z("DataGrid"),u=Z("ModalDialog");return o(),i(Me,null,[n.refInfo?(o(),ae(u,{key:0,ref_key:"modalDialog",ref:W,id:n.id,onDone:Y},{default:xe(()=>[l("div",Mp,[l("div",Ap,[l("h3",Tp,[ke(" Select "),l("span",Fp,O(G(Pe)(n.refInfo.model)),1)]),l("div",Ip,[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)},Dp,8,jp)):x("",!0),n.showPagingNav?(o(),i("button",{key:1,type:"button",class:g(["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))},Hp,10,Pp)):x("",!0),n.showPagingNav?(o(),i("button",{key:2,type:"button",class:g(["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))},zp,10,Rp)):x("",!0),n.showPagingNav?(o(),i("button",{key:3,type:"button",class:g(["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))},qp,10,Np)):x("",!0),n.showPagingNav?(o(),i("button",{key:4,type:"button",class:g(["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))},Zp,10,Qp)):x("",!0)]),n.showPagingInfo?(o(),i("div",Wp,[l("div",Gp,[w.value?(o(),i("span",Jp,"Querying...")):x("",!0),T.value.length?(o(),i("span",Xp,[Yp,ke(" "+O(b.value+1)+" - "+O(Math.min(b.value+T.value.length,A.value))+" ",1),l("span",null," of "+O(A.value),1)])):h.value.completed?(o(),i("span",em,"No Results")):x("",!0)])])):x("",!0),q.value&&n.showResetPreferences?(o(),i("div",tm,[l("button",{type:"button",onClick:se,title:"Reset Preferences & Filters",class:g(f.value)},lm,2)])):x("",!0),l("div",nm,[n.showFiltersView&&0k.value="filters"==k.value?null:"filters"),class:g(f.value),"aria-expanded":"false"},[am,l("span",rm,O(E.value)+" "+O(1==E.value?"Filter":"Filters"),1),"filters"!=k.value?(o(),i("svg",im,dm)):(o(),i("svg",cm,vm))],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",pm,[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),h.value.error?(o(),ae(t,{key:2,status:h.value.error},null,8,["status"])):w.value?(o(),ae(a,{key:3})):(o(),i("div",mm,[T.value.length?(o(),i("div",hm,[ye(s,{id:n.id,items:T.value,type:n.refInfo.model,"selected-columns":J.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",bm,[l("span",wm,O(e),1)])):(o(),i("div",gm,[l("span",ym,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(G(c)),l=>({name:l,fn:xe(e=>[U(n.$slots,l,Rt(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:y.value,onDone:e[7]||(e[7]=e=>_.value=!1),onSave:re},null,8,["columns","prefs"])):x("",!0)],64)}}}),_m={class:"sm:hidden"},$m=["for"],Cm=["id","name"],xm=["value"],Lm={class:"hidden sm:block"},Vm={class:"border-b border-gray-200"},Sm={class:"-mb-px flex","aria-label":"Tabs"},Mm=["onClick"],Am=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",_m,[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,xm))),128))],40,Cm)]),l("div",Lm,[l("div",Vm,[l("nav",Sm,[(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:g([(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,Mm);var e}),256))])])]),l("div",{class:g(t.bodyClass)},[(o(),ae(an(t.tabs[u.value])))],2)]))}}),Tm=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),Fm=[Tm],Im=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),jm=[Im],Om=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:g(`${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:g(`${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"},Fm,2),l("span",{class:g(`${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"},jm,2)],2)]))}}),Dm={key:0},Pm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Bm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Hm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Rm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Em={class:"relative z-0 inline-flex shadow-sm rounded-md"},zm=["onClick"],Nm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Um={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},qm={class:"mt-8"},Qm={key:1,class:"mt-6"},Km=xs('
Or continue with
',1),Zm={class:"mt-6 grid grid-cols-3 gap-3"},Wm=["href","title"],Gm={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Jm=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),Xm=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),Ym=[Jm,Xm],e1=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,y=p.app.baseUrl,h=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=>h.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;h.value.provider=M.value.name,"authsecret"===M.value.name?(d.headers.set("authsecret",h.value.authsecret),h.value=s("Authenticate")):"basic"===M.value.name?(d.setCredentials(h.value.UserName,h.value.Password),h.value=s("Authenticate"),h.value.UserName=null,h.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=h.value.BearerToken,h.value=s("Authenticate")),b.value=await u.api(h.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new Xe,h.value=s("Authenticate"))}return(e,t)=>{let a=Z("ErrorSummary"),n=Z("AutoFormFields"),r=Z("PrimaryButton"),s=Z("Icon"),u=_o("href");return G(f)?(o(),i("div",Pm,[l("div",Bm,[l("h2",Hm,O(e.title),1),1Mt((o(),i("a",{onClick:e=>w.value=l,class:g([""===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,zm)),[[u,{provider:l}]])),256))])])):x("",!0)]),l("div",Nm,[I.value?(o(),ae(a,{key:0,class:"mb-3",errorSummary:I.value},null,8,["errorSummary"])):x("",!0),l("div",Um,[T.value.length?(o(),i("form",{key:0,onSubmit:Ue(j,["prevent"])},[ye(n,{modelValue:h.value,formLayout:T.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),l("div",qm,[ye(r,{class:"w-full"},{default:xe(()=>[ke("Sign In")]),_:1})])],32)):x("",!0),A.value.length?(o(),i("div",Qm,[Km,l("div",Zm,[(o(!0),i(Me,null,je(A.value,e=>(o(),i("div",null,[l("a",{href:G(y)+e.navItem.href+"?continue="+G(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",Gm,Ym))],8,Wm)]))),256))])])):x("",!0)])])])):(o(),i("div",Dm,"No Auth Plugin"))}}}),t1=["for"],s1={key:1,class:"border border-gray-200 flex justify-between"},l1={class:"p-2 flex flex-wrap gap-x-4"},n1=l("title",null,"Bold text (CTRL+B)",-1),o1=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),a1=[n1,o1],r1=l("title",null,"Italics (CTRL+I)",-1),i1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),u1=[r1,i1],d1=l("title",null,"Insert Link (CTRL+K)",-1),c1=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),f1=[d1,c1],v1=l("title",null,"Blockquote (CTRL+Q)",-1),p1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),m1=[v1,p1],h1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),g1=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),y1=[h1,g1],b1=l("title",null,"Insert Code (CTRL+<)",-1),w1=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),k1=[b1,w1],_1=l("title",null,"H2 Heading (CTRL+H)",-1),$1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),C1=[_1,$1],x1=l("title",null,"Numbered List (ALT+1)",-1),L1=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),V1=[x1,L1],S1=l("title",null,"Bulleted List (ALT+-)",-1),M1=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),A1=[S1,M1],T1=l("title",null,"Strike Through (ALT+S)",-1),F1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),I1=[T1,F1],j1=l("title",null,"Undo (CTRL+Z)",-1),O1=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),D1=[j1,O1],P1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),B1=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),H1=[P1,B1],R1={key:0,class:"p-2 flex flex-wrap gap-x-4"},E1=["href"],z1=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),N1=[z1],U1={class:""},q1=["name","id","label","value","rows","disabled"],Q1=["id"],K1=["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",Z1=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=[],h=[],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]),b=D();function w(e){r("update:modelValue",e)}function k(){return b.value.selectionStart!==b.value.selectionEnd}function C(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=b.value,l=e.value,t=e.selectionStart,e=l.substring(t,e.selectionEnd)||"",a=l.substring(0,t),n=a.lastIndexOf(` +`,"\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?(h.value=w.value[0],A()):"End"==e.code?(h.value=w.value[w.value.length-1],A()):"ArrowDown"==e.code?(h.value?(l=w.value.indexOf(h.value),h.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(y.value="",n.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),h.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(y,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,o0)):x("",!0),l("div",a0,[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=>y.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,r0),[[ko,y.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"},u0),n.value?(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(w.value,t=>(o(),i("li",{class:g([t===h.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,h.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",Rt(ks(t))),u(t)?(o(),i("span",{key:0,class:g(["absolute inset-y-0 right-0 flex items-center pr-4",t===h.value?"text-white":"text-indigo-600"])},v0,2)):x("",!0)],42,c0))),256))],40,d0)):!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",Rt(ks(e.modelValue)))],32)):x("",!0),p.value?(o(),i("div",p0,h0)):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,g0)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,y0)):x("",!0)],8,n0))}}),w0=["id","name","value"],k0={class:"block truncate"},_0=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=Z("Autocomplete");return o(),i(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,w0),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",k0,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=Z("SelectInput"),n=Z("CheckboxInput"),r=Z("TagInput"),s=Z("Combobox"),i=Z("FileInput"),u=Z("TextareaInput"),d=Z("MarkdownInput"),v=Z("TextInput");return G(J).component(c.value)?(o(),ae(an(G(J).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"]))}}}),C0={class:"lookup-field"},x0=["name","value"],L0={key:0,class:"flex justify-between"},V0=["for"],S0={key:0,class:"flex items-center"},M0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},A0=l("span",{class:"sr-only"},"Clear",-1),T0=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),F0=[A0,T0],I0={key:1,class:"mt-1 relative"},j0={class:"w-full inline-flex truncate"},O0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},D0=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),P0=["id"],B0=["id"],H0=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(""),y=D(""),h=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);var l,t=s.modelValue;s.modelValue[d.value]||(s.modelValue[d.value]=null);let a=b.value,n=null==a?void 0:a.ref;if(n){m.value="";let e=null==n.selfId?_e(t,a.name):_e(t,n.selfId);null==(e=Xt(e)?_e(t,n.refId):e)||null==(null==(l=r.value)?void 0:l.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==n.model}))||Xt(l=_e(t,a.name))||(m.value=""+l,y.value=a.name,null!=n.refLabel&&(null==(l=st(s.metadataType).find(e=>e.type==n.model))&&console.warn(`Could not find ${n.model} Property on `+s.metadataType.name),null!=(t=null!=l?_e(t,l.name):null)?(l=_e(t,n.refLabel))&&(m.value=""+l,Pt.setValue(n.model,e,n.refLabel,l)):(l=1==(null==(t=a.attributes)?void 0:t.some(e=>"Computed"==e.name)),t=await Pt.getOrFetchValue(p,r.value,n.model,n.refId,n.refLabel,l,e),m.value=t||n.model+": "+m.value)))}else console.warn(`No RefInfo for property '${d.value}'`)}),(e,t)=>{var a,n=Z("Icon");return o(),i("div",C0,[l("input",{type:"hidden",name:d.value,value:h.value},null,8,x0),c.value?(o(),i("div",L0,[l("label",{for:d.value,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(c.value),11,V0),h.value?(o(),i("div",S0,[l("span",M0,O(h.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"},F0)])):x("",!0)])):x("",!0),null!=(a=b.value)&&a.ref?(o(),i("div",I0,[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=G(s.modelValue))[d.value]=l,u("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",j0,[l("span",O0,[ye(n,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,O(m.value),1)])]),D0])])):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,P0)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},O(e.help),9,B0)):x("",!0)])}}}),R0=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(),y=v(()=>u.type||qt(u.modelValue)),h=v(()=>u.metaType??p(y.value)),b=v(()=>{var e;return f(null==(e=null==(e=s.value)?void 0:e.operations.find(e=>e.request.name==y.value))?void 0:e.dataModel)||h.value});function w(){var e,l=h.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 ${y.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=Z("ErrorSummary"),r=Z("LookupInput"),s=Z("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:g(t.flexClass)},[l("div",{class:g(t.divideClass)},[l("div",{class:g(t.spaceClass)},[l("fieldset",{class:g(t.fieldsetClass)},[(o(!0),i(Me,null,je(w(),l=>{var e;return o(),i("div",{key:l.id,class:g(["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 E0={key:0},z0={class:"text-red-700"},N0=l("b",null,"type",-1),U0={key:0},q0={key:2},Q0=["innerHTML"],K0=l("input",{type:"submit",class:"hidden"},null,-1),Z0={class:"flex justify-end"},W0=l("div",null,null,-1),G0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},J0=l("div",{class:"fixed inset-0"},null,-1),X0={class:"fixed inset-0 overflow-hidden"},Y0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},ef={class:"flex-1"},tf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},sf={class:"flex items-start justify-between space-x-3"},lf={class:"space-y-1"},nf={key:0},of={key:2},af=["innerHTML"],rf={class:"flex h-7 items-center"},uf={class:"flex justify-end"},df=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||y(),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 y(){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=y(),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),J()):u("error",A.value.error)):console.error("Not a valid form",e)}function N(e){u("update:modelValue",e)}function h(){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:J,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 J(){"slideOver"==s.formStyle?b.value=!1:h()}bt(b,()=>{yt(k,G,b.value),b.value||setTimeout(h,700)}),b.value=!0;let w=e=>{"Escape"===e.key&&J()};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,y=Z("AutoFormFields"),h=Z("FormLoading"),b=Z("PrimaryButton"),w=Z("CloseButton"),k=Z("SecondaryButton"),C=Z("ModalLookup");return o(),i("div",null,[_.value?"card"==t.formStyle?(o(),i("div",{key:1,class:g(F.value)},[l("form",{ref_key:"elForm",ref:V,onSubmit:e[0]||(e[0]=Ue(e=>z(e.target),["prevent"])),autocomplete:"off",class:g(t.innerFormClass)},[l("div",{class:g(t.bodyClass)},[l("div",{class:g(t.headerClass)},[t.$slots.heading?(o(),i("div",U0,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:g(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",q0,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:g($.value)},O(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),i("p",{key:4,class:g(["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}),K0,(o(),ae(y,{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:g(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(h,{key:0})):x("",!0)]),l("div",Z0,[W0,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",G0,[J0,l("div",X0,[l("div",{onMousedown:J,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:g(["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:g(I.value),onSubmit:e[1]||(e[1]=Ue(e=>z(e.target),["prevent"]))},[l("div",Y0,[l("div",ef,[l("div",tf,[l("div",sf,[l("div",lf,[t.$slots.heading?(o(),i("div",nf,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:g(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",of,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:g($.value)},O(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),i("p",{key:4,class:g(["notes",$.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,af)):x("",!0)]),l("div",rf,[ye(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:J})])])]),U(t.$slots,"header",{instance:null==(v=Be())?void 0:v.exposed,model:P.value}),(o(),ae(y,{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:g(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(h,{key:0})):x("",!0)]),l("div",uf,[ye(k,{onClick:J,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",E0,[l("p",z0,[ke("Could not create form for unknown "),N0,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)])}}}),cf={key:0},ff={class:"text-red-700"},vf=l("b",null,"type",-1),pf={key:0},mf={key:2},hf=["innerHTML"],gf={class:"flex justify-end"},yf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},bf=l("div",{class:"fixed inset-0"},null,-1),wf={class:"fixed inset-0 overflow-hidden"},kf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},_f={class:"flex-1"},$f={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Cf={class:"flex items-start justify-between space-x-3"},xf={class:"space-y-1"},Lf={key:0},Vf={key:2},Sf=["innerHTML"],Mf={class:"flex h-7 items-center"},Af={class:"flex justify-end"},Tf=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 y(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:h,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,h(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,h(L.value))))}function P(){s("done")}J.interceptors.has("AutoCreateForm.new")&&J.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=Z("AutoFormFields"),r=Z("FormLoading"),s=Z("SecondaryButton"),u=Z("PrimaryButton"),d=Z("CloseButton"),v=Z("ModalLookup");return o(),i("div",null,[L.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(V.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:g(S.value)},[l("div",null,[e.$slots.heading?(o(),i("div",pf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",mf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,hf)):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:g(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",gf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:G(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:G(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",yf,[bf,l("div",wf,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:g(S.value),onSubmit:Ue(_,["prevent"])},[l("div",kf,[l("div",_f,[l("div",$f,[l("div",Cf,[l("div",xf,[e.$slots.heading?(o(),i("div",Lf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",Vf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,Sf)):x("",!0)]),l("div",Mf,[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:g(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",Af,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:G(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:G(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",cf,[l("p",ff,[ke("Could not create form for unknown "),vf,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:y},null,8,["ref-info"])):x("",!0)])}}}),Ff={key:0},If={class:"text-red-700"},jf=l("b",null,"type",-1),Of={key:0},Df={key:2},Pf=["innerHTML"],Bf={class:"flex justify-end"},Hf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Rf=l("div",{class:"fixed inset-0"},null,-1),Ef={class:"fixed inset-0 overflow-hidden"},zf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Nf={class:"flex-1"},Uf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},qf={class:"flex items-start justify-between space-x-3"},Qf={class:"space-y-1"},Kf={key:0},Zf={key:2},Wf=["innerHTML"],Gf={class:"flex h-7 items-center"},Jf={class:"flex justify-end"},Xf=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){y.value=e,n.value=l}});let y=D(),n=D();async function q(e){n.value&&n.value(e),y.value=void 0,n.value=void 0}let{typeOf:u,apiOf:Q,typeProperties:c,createFormLayout:K,getPrimaryKey:W,Crud:h,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(()=>h.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=(J.interceptors.has("AutoEditForm.new")&&J.interceptors.invoke("AutoEditForm.new",{props:r,model:L,origModel:I}),Ps()),$=v(()=>j.loading.value),B=()=>Ze(u(h.model(k.value)),e=>W(e));function Y(e){var{op:l,prop:t}=e;l&&(h.isPatch(l)||h.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&&h.isPatch(n)){let s=K(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);J.interceptors.has("AutoEditForm.save.formLayout")&&J.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))}}),J.interceptors.has("AutoEditForm.save")&&J.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=Z("AutoFormFields"),r=Z("ConfirmDelete"),s=Z("FormLoading"),u=Z("SecondaryButton"),d=Z("PrimaryButton"),v=Z("CloseButton"),c=Z("ModalLookup");return o(),i("div",null,[k.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(X.value)},[l("form",{onSubmit:Ue(E,["prevent"])},[l("div",{class:g(M.value)},[l("div",null,[e.$slots.heading?(o(),i("div",Of,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Df,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Pf)):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:g(G(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&G($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Bf,[ye(u,{onClick:z,disabled:G($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:G($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",Hf,[Rf,l("div",Ef,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:g(M.value),onSubmit:Ue(E,["prevent"])},[l("div",zf,[l("div",Nf,[l("div",Uf,[l("div",qf,[l("div",Qf,[e.$slots.heading?(o(),i("div",Kf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Zf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Wf)):x("",!0)]),l("div",Gf,[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:g(G(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&G($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Jf,[ye(u,{onClick:z,disabled:G($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:G($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",Ff,[l("p",If,[ke("Could not create form for unknown "),jf,ke(" "+O(w.value),1)])])),"ModalLookup"==(null==(a=y.value)?void 0:a.name)&&y.value.ref?(o(),ae(c,{key:3,"ref-info":y.value.ref,onDone:q},null,8,["ref-info"])):x("",!0)])}}}),Yf={key:0},ev={class:"text-red-700"},tv=l("b",null,"type",-1),sv={key:0},lv={key:2},nv=["innerHTML"],ov={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},av=l("div",{class:"fixed inset-0"},null,-1),rv={class:"fixed inset-0 overflow-hidden"},iv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},uv={class:"flex-1"},dv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},cv={class:"flex items-start justify-between space-x-3"},fv={class:"space-y-1"},vv={key:0},pv={key:2},mv=["innerHTML"],hv={class:"flex h-7 items-center"},gv=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()}J.interceptors.has("AutoViewForm.new")&&J.interceptors.invoke("AutoViewForm.new",{props:t});let r=D(!1),y=D(""),h={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(h,y,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=Z("MarkupModel"),r=Z("CloseButton");return o(),i("div",null,[s.value?"card"==e.formStyle?(o(),i("div",{key:1,class:g(d.value)},[l("div",{class:g(c.value)},[l("div",null,[e.$slots.heading?(o(),i("div",sv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",lv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,nv)):x("",!0)]),ye(n,{value:e.model},null,8,["value"])],2)],2)):(o(),i("div",ov,[av,l("div",rv,[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:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",y.value])},[l("div",{class:g(c.value)},[l("div",iv,[l("div",uv,[l("div",dv,[l("div",cv,[l("div",fv,[e.$slots.heading?(o(),i("div",vv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:g(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",pv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:g(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:g(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,mv)):x("",!0)]),l("div",hv,[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",Yf,[l("p",ev,[ke("Could not create view for unknown "),tv,ke(" "+O(s.value),1)])]))])}}}),yv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),bv=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,G(a)]]),yv,l("span",Te({onClick:Ue(r,["prevent"]),class:s.value},e.$attrs),[U(e.$slots,"default",{},()=>[ke("Delete")])],16)],64))}}),wv={class:"flex",title:"loading..."},kv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},_v=xs('',3),$v=[_v],Cv={class:"ml-2 mt-1 text-gray-400"},xv=de({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Qe("ApiState",void 0),(e,t)=>(o(),i("div",wv,[e.icon?(o(),i("svg",kv,$v)):x("",!0),l("span",Cv,O(e.text),1)]))}}),Lv=["onClick"],Vv={key:3,class:"flex justify-between items-center"},Sv={class:"mr-1 select-none"},Mv=["onClick"],Av=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(),y=v(()=>qt(u.type)),h=v(()=>r(y.value)),b=v(()=>s(h.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=Z("CellFormat"),s=Z("PreviewFormat");return n.items.length?(o(),i("div",{key:0,ref_key:"refResults",ref:a,class:g(M.value)},[l("div",{class:g(V.value)},[l("div",{class:g(S.value)},[l("div",{class:g(T.value)},[l("table",{class:g(A.value)},[l("thead",{class:g(I.value)},[l("tr",{class:g(j.value)},[(o(!0),i(Me,null,je(B.value,t=>{return o(),i("td",{class:g([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)}},[G(p)[t+"-header"]?U(n.$slots,t+"-header",{key:0,column:t}):f(t)?U(n.$slots,f(t),{key:1,column:t}):G(p).header?U(n.$slots,"header",{key:2,column:t,label:w(t)}):(o(),i("div",Vv,[l("span",Sv,O(w(t)),1)]))],8,Lv)],2);var e}),256))],2)],2),l("tbody",{class:g(F.value)},[(o(!0),i(Me,null,je(n.items,(t,e)=>{return o(),i("tr",{class:g((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:g([L(e),G(he).tableCellClass])},[G(p)[e]?U(n.$slots,e,Rt(Te({key:0},t))):m(e)?U(n.$slots,m(e),Rt(Te({key:1},t))):k(e)?(o(),ae(r,{key:2,type:h.value,propType:k(e),modelValue:t},null,8,["type","propType","modelValue"])):(o(),ae(s,{key:3,value:G(_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,Mv);var l,a}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),Tv=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=Xt(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}}}),Fv={key:0},Iv={key:0,class:"mr-2"},jv=["innerHTML"],Ov=["innerHTML"],Dv={inheritAttrs:!1},Pv=de({...Dv,__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)=>G(Xt)(e.value)?(o(),i("span",Fv,[e.includeCount&&a.value?(o(),i("span",Iv,O(e.value.length),1)):x("",!0),l("span",{innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,jv)])):(o(),i("span",{key:1,innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,Ov))}}),Bv=["innerHTML"],Hv={key:0},Rv=l("b",null,null,-1),Ev={key:2},zv=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=Z("HtmlFormat",!0);return o(),i("div",{class:g(0==t.depth?"prose html-format":"")},[r.value?(o(),i("div",{key:0,innerHTML:G(ts)(t.value)},null,8,Bv)):s.value?(o(),i("div",{key:1,class:g(t.classes("array","div",t.depth,G(he).gridClass))},[G(Tt)(t.value[0])?(o(),i("div",Hv,"[ "+O(t.value.join(", "))+" ]",1)):(o(),i("div",{key:1,class:g(t.classes("array","div",t.depth,G(he).grid2Class))},[l("div",{class:g(t.classes("array","div",t.depth,G(he).grid3Class))},[l("div",{class:g(t.classes("array","div",t.depth,G(he).grid4Class))},[l("table",{class:g(t.classes("object","table",t.depth,G(he).tableClass))},[l("thead",{class:g(t.classes("array","thead",t.depth,G(he).theadClass))},[l("tr",null,[(o(!0),i(Me,null,je(c.value,e=>(o(),i("th",{class:g(t.classes("array","th",t.depth,G(he).theadCellClass+" whitespace-nowrap"))},[Rv,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:g(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:g(t.classes("array","td",t.depth,G(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",Ev,[l("table",{class:g(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:g(t.classes("object","tr",t.depth,""))},[l("th",{class:g(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:g(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}}}),Nv=["href"],Uv=["href","title"],qv=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=Z("Icon"),a=Z("HtmlFormat");return"link"==G(n)?(o(),i("a",{key:0,href:e.value,class:"text-indigo-600"},O(e.value),9,Nv)):"image"==G(n)?(o(),i("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[ye(t,{src:e.value,class:g(e.imageClass)},null,8,["src","class"])],8,Uv)):(o(),ae(a,{key:2,value:e.value},null,8,["value"]))}}}),Qv={class:"my-2 w-full"},Kv={class:"leading-7"},Zv={class:"px-2 text-left align-top"},Wv={colspan:"align-top"},Gv={class:"my-2 leading-7"},Jv={colspan:"2",class:"px-2 bg-indigo-700 text-white"},Xv={class:"leading-7"},Yv={colspan:"2",class:"px-2 align-top"},ep=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=Z("MarkupFormat");return o(),i("table",Qv,[(o(),i(Me,null,je(n,(e,t)=>l("tr",Kv,[l("th",Zv,O(G(Pe)(t)),1),l("td",Wv,[ye(a,{value:e},null,8,["value"])])])),64)),(o(),i(Me,null,je(r,(e,t)=>(o(),i(Me,null,[l("tr",Gv,[l("td",Jv,O(G(Pe)(t)),1)]),l("tr",Xv,[l("td",Yv,[ye(a,{value:e},null,8,["value"])])])],64))),64))])}}}),tp={class:"absolute top-0 right-0 pt-4 pr-4"},sp=l("span",{class:"sr-only"},"Close",-1),lp=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),np=[sp,lp],op=de({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),i("div",tp,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:g([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"])},np,2)]))}}),ap=["id","aria-labelledby"],rp=l("div",{class:"fixed inset-0"},null,-1),ip={class:"fixed inset-0 overflow-hidden"},up={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},dp={class:"flex min-h-0 flex-1 flex-col overflow-auto"},cp={class:"flex-1"},fp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},vp={class:"flex items-start justify-between space-x-3"},pp={class:"space-y-1"},mp={key:0},hp=["id"],gp={key:2,class:"text-sm text-gray-500"},yp={class:"flex h-7 items-center"},bp={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},wp=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=Z("CloseButton");return o(),i("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[rp,l("div",ip,[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:g(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",r.value])},[l("div",up,[l("div",dp,[l("div",cp,[l("div",fp,[l("div",vp,[l("div",pp,[e.$slots.title?(o(),i("div",mp,[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,hp)):x("",!0),e.$slots.subtitle?(o(),i("p",gp,[U(e.$slots,"subtitle")])):x("",!0)]),l("div",yp,[ye(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:g(e.contentClass)},[U(e.$slots,"default")],2)])]),e.$slots.footer?(o(),i("div",bp,[U(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,ap)}}}),kp=["id","data-transition-for","aria-labelledby"],_p={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"},Cp={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},xp=l("span",{class:"sr-only"},"Close",-1),Lp=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),Vp=[xp,Lp],Sp=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 y=e=>{"Escape"===e.key&&c()};return Ye(()=>window.addEventListener("keydown",y)),Ft(()=>window.removeEventListener("keydown",y)),(e,t)=>{var a,n=Z("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:g(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",s.value])},null,2),l("div",_p,[l("div",$p,[l("div",{class:g([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[G(r).closebutton?U(e.$slots,"createform",{key:0}):(o(),i("div",Cp,[l("button",{type:"button",onClick:c,class:g(e.closeButtonClass)},Vp,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,kp)}}}),Mp={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Ap={class:"mt-3 pl-5 flex flex-wrap items-center"},Tp={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Fp={class:"hidden md:inline"},Ip={class:"flex pb-1 sm:pb-0"},jp=["title"],Op=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),Dp=[Op],Pp=["disabled"],Bp=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),Hp=[Bp],Rp=["disabled"],Ep=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),zp=[Ep],Np=["disabled"],Up=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),qp=[Up],Qp=["disabled"],Kp=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),Zp=[Kp],Wp={key:0,class:"flex pb-1 sm:pb-0"},Gp={class:"px-4 text-lg text-black dark:text-white"},Jp={key:0},Xp={key:1},Yp=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),em={key:2},tm={key:1,class:"pl-2"},sm=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),lm=[sm],nm={class:"flex pb-1 sm:pb-0"},om={key:0,class:"pl-2"},am=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),rm={class:"mr-1"},im={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"},um=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),dm=[um],cm={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"},fm=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),vm=[fm],pm={key:1},mm={key:4},hm={key:0},gm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},ym={class:"mr-1 select-none"},bm={key:1,class:"flex justify-between items-center"},wm={class:"mr-1 select-none"},ln=25,km=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),y=D({take:ln}),h=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}),J=v(()=>{let e=V.value.map(e=>e.name),l=C(y.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),S=v(()=>y.value.take??ln),T=v(()=>h.value.response?_e(h.value.response,"results"):[]),A=v(()=>{var e;return(null==(e=h.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)),K=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)})}),W=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,y.value=e,p.setItem(H(),JSON.stringify(e)),await N()}async function N(){var a=(()=>{let a={include:"total",take:S.value},e=C(y.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"{h.value.response=h.value.error=void 0,w.value=e}),t=await u.api(e);l(),St(()=>h.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&&(y.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=Z("ErrorSummary"),a=Z("Loading"),r=Z("SettingsIcons"),s=Z("DataGrid"),u=Z("ModalDialog");return o(),i(Me,null,[n.refInfo?(o(),ae(u,{key:0,ref_key:"modalDialog",ref:W,id:n.id,onDone:Y},{default:xe(()=>[l("div",Mp,[l("div",Ap,[l("h3",Tp,[ke(" Select "),l("span",Fp,O(G(Pe)(n.refInfo.model)),1)]),l("div",Ip,[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)},Dp,8,jp)):x("",!0),n.showPagingNav?(o(),i("button",{key:1,type:"button",class:g(["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))},Hp,10,Pp)):x("",!0),n.showPagingNav?(o(),i("button",{key:2,type:"button",class:g(["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))},zp,10,Rp)):x("",!0),n.showPagingNav?(o(),i("button",{key:3,type:"button",class:g(["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))},qp,10,Np)):x("",!0),n.showPagingNav?(o(),i("button",{key:4,type:"button",class:g(["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))},Zp,10,Qp)):x("",!0)]),n.showPagingInfo?(o(),i("div",Wp,[l("div",Gp,[w.value?(o(),i("span",Jp,"Querying...")):x("",!0),T.value.length?(o(),i("span",Xp,[Yp,ke(" "+O(b.value+1)+" - "+O(Math.min(b.value+T.value.length,A.value))+" ",1),l("span",null," of "+O(A.value),1)])):h.value.completed?(o(),i("span",em,"No Results")):x("",!0)])])):x("",!0),q.value&&n.showResetPreferences?(o(),i("div",tm,[l("button",{type:"button",onClick:se,title:"Reset Preferences & Filters",class:g(f.value)},lm,2)])):x("",!0),l("div",nm,[n.showFiltersView&&0k.value="filters"==k.value?null:"filters"),class:g(f.value),"aria-expanded":"false"},[am,l("span",rm,O(E.value)+" "+O(1==E.value?"Filter":"Filters"),1),"filters"!=k.value?(o(),i("svg",im,dm)):(o(),i("svg",cm,vm))],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",pm,[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),h.value.error?(o(),ae(t,{key:2,status:h.value.error},null,8,["status"])):w.value?(o(),ae(a,{key:3})):(o(),i("div",mm,[T.value.length?(o(),i("div",hm,[ye(s,{id:n.id,items:T.value,type:n.refInfo.model,"selected-columns":J.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",bm,[l("span",wm,O(e),1)])):(o(),i("div",gm,[l("span",ym,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(G(c)),l=>({name:l,fn:xe(e=>[U(n.$slots,l,Rt(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:y.value,onDone:e[7]||(e[7]=e=>_.value=!1),onSave:re},null,8,["columns","prefs"])):x("",!0)],64)}}}),_m={class:"sm:hidden"},$m=["for"],Cm=["id","name"],xm=["value"],Lm={class:"hidden sm:block"},Vm={class:"border-b border-gray-200"},Sm={class:"-mb-px flex","aria-label":"Tabs"},Mm=["onClick"],Am=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",_m,[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,xm))),128))],40,Cm)]),l("div",Lm,[l("div",Vm,[l("nav",Sm,[(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:g([(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,Mm);var e}),256))])])]),l("div",{class:g(t.bodyClass)},[(o(),ae(an(t.tabs[u.value])))],2)]))}}),Tm=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),Fm=[Tm],Im=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),jm=[Im],Om=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:g(`${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:g(`${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"},Fm,2),l("span",{class:g(`${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"},jm,2)],2)]))}}),Dm={key:0},Pm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Bm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Hm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Rm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Em={class:"relative z-0 inline-flex shadow-sm rounded-md"},zm=["onClick"],Nm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Um={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},qm={class:"mt-8"},Qm={key:1,class:"mt-6"},Km=xs('
Or continue with
',1),Zm={class:"mt-6 grid grid-cols-3 gap-3"},Wm=["href","title"],Gm={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Jm=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),Xm=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),Ym=[Jm,Xm],e1=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,y=p.app.baseUrl,h=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=>h.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;h.value.provider=M.value.name,"authsecret"===M.value.name?(d.headers.set("authsecret",h.value.authsecret),h.value=s("Authenticate")):"basic"===M.value.name?(d.setCredentials(h.value.UserName,h.value.Password),h.value=s("Authenticate"),h.value.UserName=null,h.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=h.value.BearerToken,h.value=s("Authenticate")),b.value=await u.api(h.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new Xe,h.value=s("Authenticate"))}return(e,t)=>{let a=Z("ErrorSummary"),n=Z("AutoFormFields"),r=Z("PrimaryButton"),s=Z("Icon"),u=_o("href");return G(f)?(o(),i("div",Pm,[l("div",Bm,[l("h2",Hm,O(e.title),1),1Mt((o(),i("a",{onClick:e=>w.value=l,class:g([""===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,zm)),[[u,{provider:l}]])),256))])])):x("",!0)]),l("div",Nm,[I.value?(o(),ae(a,{key:0,class:"mb-3",errorSummary:I.value},null,8,["errorSummary"])):x("",!0),l("div",Um,[T.value.length?(o(),i("form",{key:0,onSubmit:Ue(j,["prevent"])},[ye(n,{modelValue:h.value,formLayout:T.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),l("div",qm,[ye(r,{class:"w-full"},{default:xe(()=>[ke("Sign In")]),_:1})])],32)):x("",!0),A.value.length?(o(),i("div",Qm,[Km,l("div",Zm,[(o(!0),i(Me,null,je(A.value,e=>(o(),i("div",null,[l("a",{href:G(y)+e.navItem.href+"?continue="+G(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",Gm,Ym))],8,Wm)]))),256))])])):x("",!0)])])])):(o(),i("div",Dm,"No Auth Plugin"))}}}),t1=["for"],s1={key:1,class:"border border-gray-200 flex justify-between"},l1={class:"p-2 flex flex-wrap gap-x-4"},n1=l("title",null,"Bold text (CTRL+B)",-1),o1=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),a1=[n1,o1],r1=l("title",null,"Italics (CTRL+I)",-1),i1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),u1=[r1,i1],d1=l("title",null,"Insert Link (CTRL+K)",-1),c1=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),f1=[d1,c1],v1=l("title",null,"Blockquote (CTRL+Q)",-1),p1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),m1=[v1,p1],h1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),g1=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),y1=[h1,g1],b1=l("title",null,"Insert Code (CTRL+<)",-1),w1=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),k1=[b1,w1],_1=l("title",null,"H2 Heading (CTRL+H)",-1),$1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),C1=[_1,$1],x1=l("title",null,"Numbered List (ALT+1)",-1),L1=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),V1=[x1,L1],S1=l("title",null,"Bulleted List (ALT+-)",-1),M1=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),A1=[S1,M1],T1=l("title",null,"Strike Through (ALT+S)",-1),F1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),I1=[T1,F1],j1=l("title",null,"Undo (CTRL+Z)",-1),O1=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),D1=[j1,O1],P1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),B1=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),H1=[P1,B1],R1={key:0,class:"p-2 flex flex-wrap gap-x-4"},E1=["href"],z1=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),N1=[z1],U1={class:""},q1=["name","id","label","value","rows","disabled"],Q1=["id"],K1=["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",Z1=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=[],h=[],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]),b=D();function w(e){r("update:modelValue",e)}function k(){return b.value.selectionStart!==b.value.selectionEnd}function C(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=b.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),w(e),St(()=>{b.value.focus(),b.value.setSelectionRange(l,t)})}function V(e,l,t="",{selectionAtEnd:a,offsetStart:n,offsetEnd:r,filterValue:s,filterSelection:o}={}){let i=b.value,u=i.value,d=i.selectionEnd;y.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),h=[];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))),w(u),St(()=>{i.focus(),n=d+(n||0),r=(n||0)+(r||0),i.setSelectionRange(n,r)})}t({props:n,textarea:b,updateModelValue:w,selection:C,hasSelection:k,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(` > `,` `,"Blockquote",{}),j=()=>V("![](",")");function $(e){var l,t=C();t&&!e.shiftKey?V("`","`","code"):(l=n.lang||"js",-1===t.indexOf(` diff --git a/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs b/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs index 5d95e27..e89a4d5 100644 --- a/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs +++ b/AiServer/wwwroot/lib/mjs/servicestack-vue.mjs @@ -1142,11 +1142,11 @@ const et = class et { }); if (c) { const f = et.Lookup[n] ?? (et.Lookup[n] = {}), m = []; - Object.keys(f).forEach((T) => { - const I = f[T]; - _e(I, r) && m.push(T); + Object.keys(f).forEach((A) => { + const I = f[A]; + _e(I, r) && m.push(A); }); - const $ = d.filter((T) => !m.includes(T)); + const $ = d.filter((A) => !m.includes(A)); if ($.length == 0) return; const p = u ? null : `${a},${r}`, w = { @@ -2172,7 +2172,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ function k(L, z) { return y(L).find((K) => K.value === z); } - function T() { + function A() { var z; if (!r.value) return; @@ -2194,7 +2194,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } function M() { var L; - if (u.value && T(), c.value) { + if (u.value && A(), c.value) { let z = Object.values(d.value).filter((K) => K); p.value.filters = z.length > 0 ? (L = f.value) != null && L.isEnumInt ? [{ key: "%HasAny", name: "HasAny", value: z.map((K) => parseInt(K)).reduce((K, le) => K + le, 0).toString() }] : [{ key: "%In", name: "In", value: z.join(",") }] : []; } @@ -2244,7 +2244,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "checkbox", id: q.key, value: q.key, - "onUpdate:modelValue": z[2] || (z[2] = (A) => d.value = A), + "onUpdate:modelValue": z[2] || (z[2] = (T) => d.value = T), class: "h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500" }, null, 8, pi), [ [al, d.value] @@ -2255,12 +2255,12 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, O(q.value), 9, mi) ]))), 128)) ])) : (o(), i("div", hi, [ - (o(!0), i(Me, null, je(w.value, (q, A) => (o(), i("div", gi, [ + (o(!0), i(Me, null, je(w.value, (q, T) => (o(), i("div", gi, [ l("span", yi, [ ke(O(L.column.name) + " " + O(q.name) + " " + O(se(q)) + " ", 1), l("button", { type: "button", - onClick: (te) => I(A), + onClick: (te) => I(T), 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) ]) @@ -2284,14 +2284,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "text", modelValue: u.value, "onUpdate:modelValue": z[4] || (z[4] = (q) => u.value = q), - onKeyup: on(T, ["enter"]), + onKeyup: on(A, ["enter"]), label: "", placeholder: "" }, null, 8, ["modelValue"])) : x("", !0), l("div", { class: "pt-1" }, [ l("button", { type: "button", - onClick: T, + onClick: A, 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) ]) @@ -2409,12 +2409,12 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ l("label", Di, O(k), 1) ]))), 128)) ])) : (o(), i("div", Pi, [ - (o(!0), i(Me, null, je(y.settings.filters, (k, T) => (o(), i("div", Bi, [ + (o(!0), i(Me, null, je(y.settings.filters, (k, A) => (o(), i("div", Bi, [ l("span", Hi, [ ke(O(y.name) + " " + O(k.name) + " " + O(c(y, k)) + " ", 1), l("button", { type: "button", - onClick: (I) => m(y, T), + onClick: (I) => m(y, A), 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) ]) @@ -2795,7 +2795,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ function k(_) { return w.value[_]; } - const T = v(() => d.tableStyle ?? r.value.tableStyle), I = v(() => d.gridClass ?? he.getGridClass(T.value)), se = v(() => d.grid2Class ?? he.getGrid2Class(T.value)), j = v(() => d.grid3Class ?? he.getGrid3Class(T.value)), F = v(() => d.grid4Class ?? he.getGrid4Class(T.value)), M = v(() => d.tableClass ?? he.getTableClass(T.value)), ie = v(() => d.theadClass ?? he.getTheadClass(T.value)), L = v(() => d.theadRowClass ?? he.getTheadRowClass(T.value)), z = v(() => d.theadCellClass ?? he.getTheadCellClass(T.value)), K = v(() => d.toolbarButtonClass ?? he.toolbarButtonClass); + const A = v(() => d.tableStyle ?? r.value.tableStyle), I = v(() => d.gridClass ?? he.getGridClass(A.value)), se = v(() => d.grid2Class ?? he.getGrid2Class(A.value)), j = v(() => d.grid3Class ?? he.getGrid3Class(A.value)), F = v(() => d.grid4Class ?? he.getGrid4Class(A.value)), M = v(() => d.tableClass ?? he.getTableClass(A.value)), ie = v(() => d.theadClass ?? he.getTheadClass(A.value)), L = v(() => d.theadRowClass ?? he.getTheadRowClass(A.value)), z = v(() => d.theadCellClass ?? he.getTheadCellClass(A.value)), K = v(() => d.toolbarButtonClass ?? he.toolbarButtonClass); function le(_, B) { var Ie; if (d.rowClass) @@ -2814,12 +2814,12 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ let _ = Ct(d.selectedColumns); return _.length > 0 ? _ : ee.value.length > 0 ? ee.value : []; } - const A = v(() => { + const T = v(() => { let B = q().map((re) => re.toLowerCase()); const ve = st(W.value); return B.length > 0 ? B.map((re) => ve.find((Ce) => Ce.name.toLowerCase() === re)).filter((re) => re != null) : ve; }), te = v(() => { - let _ = A.value.map((ve) => ve.name), B = Ct(pe.value.selectedColumns).map((ve) => ve.toLowerCase()); + let _ = T.value.map((ve) => ve.name), B = Ct(pe.value.selectedColumns).map((ve) => ve.toLowerCase()); return B.length > 0 ? _.filter((ve) => B.includes(ve.toLowerCase())) : _; }), b = D([]), N = D(new Xe()), E = D(new Xe()), h = D(), C = D(!1), Y = D(), X = D(), ne = D(!1), P = D(), V = D(d.skip), fe = D(!1), pe = D({ take: ps }), ue = D(!1), me = v(() => b.value.some((_) => _.settings.filters.length > 0 || !!_.settings.sort) || pe.value.selectedColumns), S = v(() => b.value.map((_) => _.settings.filters.length).reduce((_, B) => _ + B, 0)), ce = v(() => { var _; @@ -2987,7 +2987,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ const re = location.search ? location.search : location.hash.includes("?") ? "?" + ms(location.hash, "?") : ""; let Ce = Ws(re); if (Object.keys(Ce).forEach((Ie) => { - A.value.find((ut) => ut.name.toLowerCase() === Ie.toLowerCase()) && (_[Ie] = Ce[Ie]); + T.value.find((ut) => ut.name.toLowerCase() === Ie.toLowerCase()) && (_[Ie] = Ce[Ie]); }), typeof Ce.skip < "u") { const Ie = parseInt(Ce.skip); isNaN(Ie) || (V.value = _.skip = Ie); @@ -3055,7 +3055,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ var ve; N.value = new Xe(), E.value = new Xe(), C.value = !1, Y.value = null, X.value = null, ne.value = !1, P.value = null, V.value = d.skip, fe.value = !1, pe.value = { take: ps }, ue.value = !1; const _ = d.prefs || $s(u.getItem(Es())); - _ && (pe.value = _), b.value = A.value.map((re) => ({ + _ && (pe.value = _), b.value = T.value.map((re) => ({ name: re.name, type: re.type, meta: re, @@ -3193,7 +3193,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ G(R).toolbar ? U(_.$slots, "toolbar", { key: 3 }) : k("toolbar") ? (o(), i("div", pu, [ ne.value ? (o(), ae(jl, { key: 0, - columns: A.value, + columns: T.value, prefs: pe.value, onDone: B[1] || (B[1] = (Ne) => ne.value = !1), onSave: no @@ -3348,7 +3348,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ "selected-columns": te.value, class: "mt-1", onFiltersChanged: nt, - tableStyle: T.value, + tableStyle: A.value, gridClass: I.value, grid2Class: se.value, grid3Class: j.value, @@ -3805,7 +3805,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } const m = D(null), $ = D(""), p = v(() => s.type || "text"), w = v(() => s.label ?? Pe(at(s.id))); let y = Qe("ApiState", void 0); - const k = v(() => mt.call({ responseStatus: s.status ?? (y == null ? void 0 : y.error.value) }, s.id)), T = v(() => [ + const k = v(() => mt.call({ responseStatus: s.status ?? (y == null ? void 0 : y.error.value) }, s.id)), A = 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", k.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", s.inputClass @@ -3892,7 +3892,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ const N = Array.from(r.value); N.indexOf(b) == -1 && N.push(b), L(N), $.value = "", d.value = !1; } - function A(b) { + function T(b) { var E; const N = (E = b.clipboardData) == null ? void 0 : E.getData("Text"); te(N); @@ -3923,7 +3923,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ value: r.value.join(",") }, null, 8, hc), l("button", { - class: g(T.value), + class: g(A.value), onClick: Ue(se, ["prevent"]), onFocus: N[2] || (N[2] = (E) => d.value = !0), tabindex: "-1" @@ -3958,7 +3958,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ "aria-describedby": `${b.id}-error`, onKeydown: z, onKeypress: le, - onPaste: Ue(A, ["prevent", "stop"]), + onPaste: Ue(T, ["prevent", "stop"]), onFocus: M, onBlur: ie, onClick: N[1] || (N[1] = (E) => d.value = !0) @@ -4066,7 +4066,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, k = () => { var M; return (M = s.value) == null ? void 0 : M.click(); - }, T = (M) => M == null ? !1 : M.startsWith("data:") || M.startsWith("blob:"), I = v(() => { + }, A = (M) => M == null ? !1 : M.startsWith("data:") || M.startsWith("blob:"), I = v(() => { if (d.value.length > 0) return d.value[0].filePath; let M = typeof t.modelValue == "string" ? t.modelValue : t.values && t.values[0]; @@ -4116,14 +4116,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ l("td", Gc, [ l("div", { class: "flex w-full", - title: T(L.filePath) ? "" : L.filePath + title: A(L.filePath) ? "" : L.filePath }, [ l("img", { src: r[G(xt)(L.filePath)] || G(n)(G(xt)(L.filePath)), class: g(["mr-2 h-8 w-8", se(L.filePath)]), onError: (z) => r[G(xt)(L.filePath)] = G(a)(G(xt)(L.filePath)) }, null, 42, Xc), - T(L.filePath) ? (o(), i("span", e0, O(L.fileName), 1)) : (o(), i("a", { + A(L.filePath) ? (o(), i("span", e0, O(L.fileName), 1)) : (o(), i("a", { key: 0, href: G(n)(L.filePath || ""), target: "_blank", @@ -4140,7 +4140,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ I.value ? (o(), i("div", { key: 0, class: "shrink-0 cursor-pointer", - title: T(I.value) ? "" : I.value + title: A(I.value) ? "" : I.value }, [ l("img", { onClick: k, @@ -4220,31 +4220,31 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ setup(e, { expose: t, emit: s }) { const n = D(!1), a = e, r = s; t({ toggle: R }); - function u(A) { - return Array.isArray(a.modelValue) && a.modelValue.indexOf(A) >= 0; + function u(T) { + return Array.isArray(a.modelValue) && a.modelValue.indexOf(T) >= 0; } const d = v(() => a.label ?? Pe(at(a.id))); let c = Qe("ApiState", void 0); - const f = v(() => mt.call({ responseStatus: a.status ?? (c == null ? void 0 : c.error.value) }, a.id)), m = v(() => [ot.base, f.value ? ot.invalid : ot.valid]), $ = D(null), p = D(""), w = D(null), y = D(a.viewCount), k = D([]), T = v(() => p.value ? a.options.filter((te) => a.match(te, p.value)).slice(0, y.value) : a.options), I = ["Tab", "Escape", "ArrowDown", "ArrowUp", "Enter", "PageUp", "PageDown", "Home", "End"]; - function se(A) { - w.value = A, k.value.indexOf(A) > Math.floor(y.value * 0.9) && (y.value += a.viewCount, q()); + const f = v(() => mt.call({ responseStatus: a.status ?? (c == null ? void 0 : c.error.value) }, a.id)), m = v(() => [ot.base, f.value ? ot.invalid : ot.valid]), $ = D(null), p = D(""), w = D(null), y = D(a.viewCount), k = D([]), A = v(() => p.value ? a.options.filter((te) => a.match(te, p.value)).slice(0, y.value) : a.options), I = ["Tab", "Escape", "ArrowDown", "ArrowUp", "Enter", "PageUp", "PageDown", "Home", "End"]; + function se(T) { + w.value = T, k.value.indexOf(T) > Math.floor(y.value * 0.9) && (y.value += a.viewCount, q()); } const j = [",", ` `, " "]; - function F(A) { + function F(T) { var b; - const te = (b = A.clipboardData) == null ? void 0 : b.getData("Text"); + const te = (b = T.clipboardData) == null ? void 0 : b.getData("Text"); M(te); } - function M(A) { - if (!A) + function M(T) { + if (!T) return; - const te = j.some((b) => A.includes(b)); + const te = j.some((b) => T.includes(b)); if (!a.multiple || !te) { - const b = a.options.filter((N) => a.match(N, A)); + const b = a.options.filter((N) => a.match(N, T)); b.length == 1 && (ee(b[0]), n.value = !1, hs()); } else if (te) { - const b = new RegExp("\\r|\\n|\\t|,"), E = A.split(b).filter((h) => h.trim()).map((h) => a.options.find((C) => a.match(C, h))).filter((h) => !!h); + const b = new RegExp("\\r|\\n|\\t|,"), E = T.split(b).filter((h) => h.trim()).map((h) => a.options.find((C) => a.match(C, h))).filter((h) => !!h); if (E.length > 0) { p.value = "", n.value = !1, w.value = null; let h = Array.from(a.modelValue || []); @@ -4254,24 +4254,24 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } } } - function ie(A) { - I.indexOf(A.code) || W(); + function ie(T) { + I.indexOf(T.code) || W(); } - function L(A) { - if (!(A.shiftKey || A.ctrlKey || A.altKey)) { + function L(T) { + if (!(T.shiftKey || T.ctrlKey || T.altKey)) { if (!n.value) { - A.code == "ArrowDown" && (n.value = !0, w.value = k.value[0]); + T.code == "ArrowDown" && (n.value = !0, w.value = k.value[0]); return; } - if (A.code == "Escape") - n.value && (A.stopPropagation(), n.value = !1); - else if (A.code == "Tab") + if (T.code == "Escape") + n.value && (T.stopPropagation(), n.value = !1); + else if (T.code == "Tab") n.value = !1; - else if (A.code == "Home") + else if (T.code == "Home") w.value = k.value[0], K(); - else if (A.code == "End") + else if (T.code == "End") w.value = k.value[k.value.length - 1], K(); - else if (A.code == "ArrowDown") { + else if (T.code == "ArrowDown") { if (!w.value) w.value = k.value[0]; else { @@ -4279,7 +4279,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ w.value = te + 1 < k.value.length ? k.value[te + 1] : k.value[0]; } le(); - } else if (A.code == "ArrowUp") { + } else if (T.code == "ArrowUp") { if (!w.value) w.value = k.value[k.value.length - 1]; else { @@ -4288,54 +4288,54 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } le(); } else - A.code == "Enter" && (w.value ? (ee(w.value), a.multiple || (A.preventDefault(), hs())) : n.value = !1); + T.code == "Enter" && (w.value ? (ee(w.value), a.multiple || (T.preventDefault(), hs())) : n.value = !1); } } const z = { behavior: "smooth", block: "nearest", inline: "nearest", scrollMode: "if-needed" }; function K() { setTimeout(() => { - let A = _s(`#${a.id}-autocomplete li.active`); - A && A.scrollIntoView(z); + let T = _s(`#${a.id}-autocomplete li.active`); + T && T.scrollIntoView(z); }, 0); } function le() { setTimeout(() => { - let A = _s(`#${a.id}-autocomplete li.active`); - A && ("scrollIntoViewIfNeeded" in A ? A.scrollIntoViewIfNeeded(z) : A.scrollIntoView(z)); + let T = _s(`#${a.id}-autocomplete li.active`); + T && ("scrollIntoViewIfNeeded" in T ? T.scrollIntoViewIfNeeded(z) : T.scrollIntoView(z)); }, 0); } - function R(A) { + function R(T) { var te; - n.value = A, A && (W(), (te = $.value) == null || te.focus()); + n.value = T, T && (W(), (te = $.value) == null || te.focus()); } function W() { n.value = !0, q(); } - function ee(A) { + function ee(T) { if (p.value = "", n.value = !1, a.multiple) { let te = Array.from(a.modelValue || []); - u(A) ? te = te.filter((b) => b != A) : te.push(A), w.value = null, r("update:modelValue", te); + u(T) ? te = te.filter((b) => b != T) : te.push(T), w.value = null, r("update:modelValue", te); } else { - let te = A; - a.modelValue == A && (te = null), r("update:modelValue", te); + let te = T; + a.modelValue == T && (te = null), r("update:modelValue", te); } } function q() { - k.value = T.value; + k.value = A.value; } - return bt(p, q), (A, te) => (o(), i("div", { - id: `${A.id}-autocomplete` + return bt(p, q), (T, te) => (o(), i("div", { + id: `${T.id}-autocomplete` }, [ d.value ? (o(), i("label", { key: 0, - for: `${A.id}-text`, + for: `${T.id}-text`, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" }, O(d.value), 9, o0)) : x("", !0), l("div", a0, [ Mt(l("input", Te({ ref_key: "txtInput", ref: $, - id: `${A.id}-text`, + id: `${T.id}-text`, type: "text", role: "combobox", "aria-controls": "options", @@ -4344,14 +4344,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ spellcheck: "false", "onUpdate:modelValue": te[0] || (te[0] = (b) => p.value = b), class: m.value, - placeholder: A.multiple || !A.modelValue ? A.placeholder : "", + placeholder: T.multiple || !T.modelValue ? T.placeholder : "", onFocus: W, onKeydown: L, onKeyup: ie, onClick: W, onPaste: F, required: !1 - }, A.$attrs), null, 16, r0), [ + }, T.$attrs), null, 16, r0), [ [ko, p.value] ]), l("button", { @@ -4364,7 +4364,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ 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: L, - id: `${A.id}-options`, + id: `${T.id}-options`, role: "listbox" }, [ (o(!0), i(Me, null, je(k.value, (b) => (o(), i("li", { @@ -4374,31 +4374,31 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ role: "option", tabindex: "-1" }, [ - U(A.$slots, "item", Rt(ks(b))), + U(T.$slots, "item", Rt(ks(b))), u(b) ? (o(), i("span", { key: 0, class: g(["absolute inset-y-0 right-0 flex items-center pr-4", b === w.value ? "text-white" : "text-indigo-600"]) }, v0, 2)) : x("", !0) ], 42, c0))), 256)) - ], 40, d0)) : !A.multiple && A.modelValue ? (o(), i("div", { + ], 40, d0)) : !T.multiple && T.modelValue ? (o(), i("div", { key: 1, onKeydown: L, onClick: te[2] || (te[2] = (b) => R(!n.value)), class: "h-8 -mt-8 ml-3 pt-0.5" }, [ - U(A.$slots, "item", Rt(ks(A.modelValue))) + U(T.$slots, "item", Rt(ks(T.modelValue))) ], 32)) : x("", !0), f.value ? (o(), i("div", p0, h0)) : x("", !0) ]), f.value ? (o(), i("p", { key: 1, class: "mt-2 text-sm text-red-500", - id: `${A.id}-error` - }, O(f.value), 9, g0)) : A.help ? (o(), i("p", { + id: `${T.id}-error` + }, O(f.value), 9, g0)) : T.help ? (o(), i("p", { key: 2, class: "mt-2 text-sm text-gray-500", - id: `${A.id}-description` - }, O(A.help), 9, y0)) : x("", !0) + id: `${T.id}-description` + }, O(T.help), 9, y0)) : x("", !0) ], 8, n0)); } }), w0 = ["id", "name", "value"], k0 = { class: "block truncate" }, _0 = /* @__PURE__ */ de({ @@ -4454,11 +4454,11 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, w.$attrs, { modelValue: m.value, "onUpdate:modelValue": [ - y[0] || (y[0] = (T) => m.value = T), + y[0] || (y[0] = (A) => m.value = A), r ] }), { - item: xe(({ key: T, value: I }) => [ + item: xe(({ key: A, value: I }) => [ l("span", k0, O(I), 1) ]), _: 1 @@ -4495,8 +4495,8 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } }); return (f, m) => { - var j, F, M, ie, L, z, K, le, R, W, ee, q, A, te, b, N, E, h, C, Y, X, ne, P, V, fe, pe, ue, me; - const $ = Z("SelectInput"), p = Z("CheckboxInput"), w = Z("TagInput"), y = Z("Combobox"), k = Z("FileInput"), T = Z("TextareaInput"), I = Z("MarkdownInput"), se = Z("TextInput"); + var j, F, M, ie, L, z, K, le, R, W, ee, q, T, te, b, N, E, h, C, Y, X, ne, P, V, fe, pe, ue, me; + const $ = Z("SelectInput"), p = Z("CheckboxInput"), w = Z("TagInput"), y = Z("Combobox"), k = Z("FileInput"), A = Z("TextareaInput"), I = Z("MarkdownInput"), se = Z("TextInput"); return G(J).component(a.value) ? (o(), ae(an(G(J).component(a.value)), Te({ key: 0, id: f.input.id, @@ -4532,7 +4532,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ "input-class": (ee = f.input.css) == null ? void 0 : ee.input, "label-class": (q = f.input.css) == null ? void 0 : q.label, allowableValues: f.input.allowableValues, - string: ((A = f.input.prop) == null ? void 0 : A.type) == "String" + string: ((T = f.input.prop) == null ? void 0 : T.type) == "String" }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class", "allowableValues", "string"])) : a.value == "combobox" ? (o(), ae(y, Te({ key: 4, id: f.input.id, @@ -4552,7 +4552,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ "input-class": (h = f.input.css) == null ? void 0 : h.input, "label-class": (C = f.input.css) == null ? void 0 : C.label, files: c.value - }, u.value), null, 16, ["id", "status", "modelValue", "input-class", "label-class", "files"])) : a.value == "textarea" ? (o(), ae(T, Te({ + }, u.value), null, 16, ["id", "status", "modelValue", "input-class", "label-class", "files"])) : a.value == "textarea" ? (o(), ae(A, Te({ key: 6, id: f.input.id, modelValue: d.value, @@ -4640,14 +4640,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ var j, F, M; return ((M = rt((F = (j = y.value) == null ? void 0 : j.ref) == null ? void 0 : F.model)) == null ? void 0 : M.icon) || s.value.tableIcon; }); - let T; + let A; function I(j) { if (j) { - if (T == null) { + if (A == null) { console.warn("No ModalProvider required by LookupInput"); return; } - T.openModal({ name: "ModalLookup", ref: j }, (F) => { + A.openModal({ name: "ModalLookup", ref: j }, (F) => { if (console.debug("openModal", $.value, " -> ", F, Pt.setRefValue(j, F), j), F) { const M = _e(F, j.refId); $.value = Pt.setRefValue(j, F) || M; @@ -4662,7 +4662,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } return Ye(async () => { var K, le; - T = Qe("ModalProvider", void 0); + A = Qe("ModalProvider", void 0); const j = a.modelValue; a.modelValue[u.value] || (a.modelValue[u.value] = null); const F = y.value, M = F == null ? void 0 : F.ref; @@ -4690,8 +4690,8 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ q && ($.value = `${q}`, Pt.setValue(M.model, ie, M.refLabel, q)); } else { const q = ((le = F.attributes) == null ? void 0 : le.some((te) => te.name == "Computed")) == !0; - let A = await Pt.getOrFetchValue(f, n.value, M.model, M.refId, M.refLabel, q, ie); - $.value = A || `${M.model}: ${$.value}`; + let T = await Pt.getOrFetchValue(f, n.value, M.model, M.refId, M.refLabel, q, ie); + $.value = T || `${M.model}: ${$.value}`; } } } @@ -4783,7 +4783,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ function d(j, F) { n.modelValue[j] = F, a("update:modelValue", n.modelValue), r(); } - const { metadataApi: c, apiOf: f, typeOf: m, typeOfRef: $, createFormLayout: p, Crud: w } = lt(), y = v(() => n.type || qt(n.modelValue)), k = v(() => n.metaType ?? m(y.value)), T = v(() => { + const { metadataApi: c, apiOf: f, typeOf: m, typeOfRef: $, createFormLayout: p, Crud: w } = lt(), y = v(() => n.type || qt(n.modelValue)), k = v(() => n.metaType ?? m(y.value)), A = v(() => { var j, F; return $((F = (j = c.value) == null ? void 0 : j.operations.find((M) => M.request.name == y.value)) == null ? void 0 : F.dataModel) || k.value; }); @@ -4799,15 +4799,15 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } throw new Error(`MetadataType for ${y.value} not found`); } - const F = st(j), M = T.value, ie = n.formLayout ? Array.from(n.formLayout) : p(j), L = [], z = f(j.name); + const F = st(j), M = A.value, ie = n.formLayout ? Array.from(n.formLayout) : p(j), L = [], z = f(j.name); return ie.forEach((K) => { var ee; const le = F.find((q) => q.name == K.name); if (K.ignore) return; const R = ((ee = M == null ? void 0 : M.properties) == null ? void 0 : ee.find((q) => { - var A; - return q.name.toLowerCase() == ((A = K.name) == null ? void 0 : A.toLowerCase()); + var T; + return q.name.toLowerCase() == ((T = K.name) == null ? void 0 : T.toLowerCase()); })) ?? le, W = Object.assign({ prop: R, op: z }, K); n.configureField && n.configureField(W), L.push(W); }), n.configureFormLayout && n.configureFormLayout(L), L; @@ -4846,7 +4846,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, [ ((R = K.prop) == null ? void 0 : R.ref) != null && K.type != "file" && !K.prop.isPrimaryKey ? (o(), ae(ie, { key: 0, - metadataType: T.value, + metadataType: A.value, input: K, modelValue: j.modelValue, "onUpdate:modelValue": (ee) => u(K, ee), @@ -4870,16 +4870,16 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }); function Ps(e) { const t = D(!1), s = D(), n = D(), a = e ?? Qe("client"); - function r({ message: y, errorCode: k, fieldName: T, errors: I }) { - return k || (k = "Exception"), I || (I = []), s.value = T ? new qs({ + function r({ message: y, errorCode: k, fieldName: A, errors: I }) { + return k || (k = "Exception"), I || (I = []), s.value = A ? new qs({ errorCode: k, message: y, - errors: [new Gl({ fieldName: T, errorCode: k, message: y })] + errors: [new Gl({ fieldName: A, errorCode: k, message: y })] }) : new qs({ errorCode: k, message: y, errors: I }); } - function u({ fieldName: y, message: k, errorCode: T }) { - if (T || (T = "Exception"), !s.value) - r({ fieldName: y, message: k, errorCode: T }); + function u({ fieldName: y, message: k, errorCode: A }) { + if (A || (A = "Exception"), !s.value) + r({ fieldName: y, message: k, errorCode: A }); else { let I = new qs(s.value); I.errors = [ @@ -4887,41 +4887,41 @@ function Ps(e) { var j; return ((j = se.fieldName) == null ? void 0 : j.toLowerCase()) !== (y == null ? void 0 : y.toLowerCase()); }), - new Gl({ fieldName: y, message: k, errorCode: T }) + new Gl({ fieldName: y, message: k, errorCode: A }) ], s.value = I; } } - async function d(y, k, T) { + async function d(y, k, A) { t.value = !0; - let I = await a.api(Dt(y), k, T); + let I = await a.api(Dt(y), k, A); return t.value = !1, n.value = I.response, s.value = I.error, I; } - async function c(y, k, T) { + async function c(y, k, A) { t.value = !0; - let I = await a.apiVoid(Dt(y), k, T); + let I = await a.apiVoid(Dt(y), k, A); return t.value = !1, n.value = I.response, s.value = I.error, I; } - async function f(y, k, T, I) { + async function f(y, k, A, I) { t.value = !0; - let se = await a.apiForm(Dt(y), k, T, I); + let se = await a.apiForm(Dt(y), k, A, I); return t.value = !1, n.value = se.response, s.value = se.error, se; } - async function m(y, k, T, I) { + async function m(y, k, A, I) { t.value = !0; - let se = await a.apiFormVoid(Dt(y), k, T, I); + let se = await a.apiFormVoid(Dt(y), k, A, I); return t.value = !1, n.value = se.response, s.value = se.error, se; } - async function $(y, k, T, I) { - return gn(a, y, k, T, I); + async function $(y, k, A, I) { + return gn(a, y, k, A, I); } function p(y, k) { - const T = D(new Xe()), I = yn(async (se) => { - T.value = await a.api(se); + const A = D(new Xe()), I = yn(async (se) => { + A.value = await a.api(se); }, k == null ? void 0 : k.delayMs); return ws(async () => { const se = y(), j = cl(Ts(se)); - j && (T.value = new Xe({ response: j })), (k == null ? void 0 : k.delayMs) === 0 ? T.value = await a.api(se) : I(se); - }), (async () => T.value = await a.api(y(), k == null ? void 0 : k.args, k == null ? void 0 : k.method))(), T; + j && (A.value = new Xe({ response: j })), (k == null ? void 0 : k.delayMs) === 0 ? A.value = await a.api(se) : I(se); + }), (async () => A.value = await a.api(y(), k == null ? void 0 : k.args, k == null ? void 0 : k.method))(), A; } let w = { setError: r, addFieldError: u, loading: t, error: s, api: d, apiVoid: c, apiForm: f, apiFormVoid: m, swr: $, swrEffect: p, unRefs: Dt, setRef: mn }; return ss("ApiState", w), w; @@ -4981,10 +4981,10 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b async function y(V) { p.value && p.value(V), $.value = void 0, p.value = void 0; } - const k = Ps(), { getTypeName: T } = bn(), { typeOf: I, Crud: se, createDto: j } = lt(), F = D(new Xe()), M = v(() => n.panelClass || Ee.panelClass(n.formStyle)), ie = v(() => n.formClass || n.formStyle == "card" ? "shadow sm:rounded-md" : Bt.formClass), L = v(() => n.headingClass || Ee.headingClass(n.formStyle)), z = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), K = v(() => typeof n.buttonsClass == "string" ? n.buttonsClass : Ee.buttonsClass), le = v(() => { + const k = Ps(), { getTypeName: A } = bn(), { typeOf: I, Crud: se, createDto: j } = lt(), F = D(new Xe()), M = v(() => n.panelClass || Ee.panelClass(n.formStyle)), ie = v(() => n.formClass || n.formStyle == "card" ? "shadow sm:rounded-md" : Bt.formClass), L = v(() => n.headingClass || Ee.headingClass(n.formStyle)), z = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), K = v(() => typeof n.buttonsClass == "string" ? n.buttonsClass : Ee.buttonsClass), le = v(() => { var V; - return n.type ? T(n.type) : (V = n.modelValue) != null && V.getTypeName ? n.modelValue.getTypeName() : null; - }), R = v(() => n.metaType ?? I(le.value)), W = () => n.modelValue || te(), ee = D(W()), q = v(() => k.loading.value), A = v(() => { + return n.type ? A(n.type) : (V = n.modelValue) != null && V.getTypeName ? n.modelValue.getTypeName() : null; + }), R = v(() => n.metaType ?? I(le.value)), W = () => n.modelValue || te(), ee = D(W()), q = v(() => k.loading.value), T = v(() => { var V; return n.heading != null ? n.heading : ((V = R.value) == null ? void 0 : V.description) || Pe(le.value); }); @@ -5057,7 +5057,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b ])) : (o(), i("h3", { key: 1, class: g(L.value) - }, O(A.value), 3)), + }, O(T.value), 3)), V.$slots.subheading ? (o(), i("div", q0, [ U(V.$slots, "subheading") ])) : V.subHeading ? (o(), i("p", { @@ -5155,7 +5155,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b ])) : (o(), i("h3", { key: 1, class: g(L.value) - }, O(A.value), 3)), + }, O(T.value), 3)), V.$slots.subheading ? (o(), i("div", of, [ U(V.$slots, "subheading") ])) : V.subHeading ? (o(), i("p", { @@ -5301,30 +5301,30 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b async function y(P) { p.value && p.value(P), $.value = void 0, p.value = void 0; } - const { typeOf: k, typeProperties: T, Crud: I, createDto: se, formValues: j } = lt(), F = v(() => qt(n.type)), M = v(() => k(F.value)), L = D((() => typeof n.type == "string" ? se(n.type) : n.type ? new n.type() : null)()); + const { typeOf: k, typeProperties: A, Crud: I, createDto: se, formValues: j } = lt(), F = v(() => qt(n.type)), M = v(() => k(F.value)), L = D((() => typeof n.type == "string" ? se(n.type) : n.type ? new n.type() : null)()); t({ forceUpdate: d, props: n, setModel: c, formFields: r, model: L }); const z = v(() => n.panelClass || Ee.panelClass(n.formStyle)), K = v(() => n.formClass || Ee.formClass(n.formStyle)), le = v(() => n.headingClass || Ee.headingClass(n.formStyle)), R = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), W = v(() => n.buttonsClass || Ee.buttonsClass), ee = v(() => I.model(M.value)), q = v(() => { var P; return n.heading || ((P = k(F.value)) == null ? void 0 : P.description) || (ee.value ? `New ${Pe(ee.value)}` : Pe(F.value)); - }), A = D(new Xe()); + }), T = D(new Xe()); let te = Ps(), b = v(() => te.loading.value); J.interceptors.has("AutoCreateForm.new") && J.interceptors.invoke("AutoCreateForm.new", { props: n, model: L }); async function N(P) { var ue, me; let V = P.target; if (!n.autosave) { - a("save", new L.value.constructor(j(V, T(M.value)))); + a("save", new L.value.constructor(j(V, A(M.value)))); return; } let fe = Ze((ue = L.value) == null ? void 0 : ue.getMethod, (S) => typeof S == "function" ? S() : null) || "POST", pe = Ze((me = L.value) == null ? void 0 : me.createResponse, (S) => typeof S == "function" ? S() : null) == null; if (il.hasRequestBody(fe)) { let S = new L.value.constructor(), ce = new FormData(V); - pe ? A.value = await te.apiFormVoid(S, ce, { jsconfig: "eccn" }) : A.value = await te.apiForm(S, ce, { jsconfig: "eccn" }); + pe ? T.value = await te.apiFormVoid(S, ce, { jsconfig: "eccn" }) : T.value = await te.apiForm(S, ce, { jsconfig: "eccn" }); } else { - let S = j(V, T(M.value)), ce = new L.value.constructor(S); - pe ? A.value = await te.apiVoid(ce, { jsconfig: "eccn" }) : A.value = await te.api(ce, { jsconfig: "eccn" }); + let S = j(V, A(M.value)), ce = new L.value.constructor(S); + pe ? T.value = await te.apiVoid(ce, { jsconfig: "eccn" }) : T.value = await te.api(ce, { jsconfig: "eccn" }); } - A.value.succeeded ? (V.reset(), a("save", A.value.response)) : a("error", A.value.error); + T.value.succeeded ? (V.reset(), a("save", T.value.response)) : a("error", T.value.error); } function E() { a("done"); @@ -5384,7 +5384,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b key: u.value, modelValue: L.value, "onUpdate:modelValue": f, - api: A.value, + api: T.value, configureField: P.configureField, configureFormLayout: P.configureFormLayout }, null, 8, ["modelValue", "api", "configureField", "configureFormLayout"])), @@ -5482,7 +5482,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b key: u.value, modelValue: L.value, "onUpdate:modelValue": f, - api: A.value, + api: T.value, configureField: P.configureField, configureFormLayout: P.configureFormLayout }, null, 8, ["modelValue", "api", "configureField", "configureFormLayout"])), @@ -5589,11 +5589,11 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b async function y(S) { p.value && p.value(S), $.value = void 0, p.value = void 0; } - const { typeOf: k, apiOf: T, typeProperties: I, createFormLayout: se, getPrimaryKey: j, Crud: F, createDto: M, formValues: ie } = lt(), L = v(() => qt(n.type)), z = v(() => k(L.value)), K = () => typeof n.type == "string" ? M(n.type, ys(n.modelValue)) : n.type ? new n.type(ys(n.modelValue)) : null, le = D(K()); + const { typeOf: k, apiOf: A, typeProperties: I, createFormLayout: se, getPrimaryKey: j, Crud: F, createDto: M, formValues: ie } = lt(), L = v(() => qt(n.type)), z = v(() => k(L.value)), K = () => typeof n.type == "string" ? M(n.type, ys(n.modelValue)) : n.type ? new n.type(ys(n.modelValue)) : null, le = D(K()); t({ forceUpdate: d, props: n, setModel: c, formFields: r, model: le }); - const R = v(() => n.panelClass || Ee.panelClass(n.formStyle)), W = v(() => n.formClass || Ee.formClass(n.formStyle)), ee = v(() => n.headingClass || Ee.headingClass(n.formStyle)), q = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), A = v(() => F.model(z.value)), te = v(() => { + const R = v(() => n.panelClass || Ee.panelClass(n.formStyle)), W = v(() => n.formClass || Ee.formClass(n.formStyle)), ee = v(() => n.headingClass || Ee.headingClass(n.formStyle)), q = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), T = v(() => F.model(z.value)), te = v(() => { var S; - return n.heading || ((S = k(L.value)) == null ? void 0 : S.description) || (A.value ? `Update ${Pe(A.value)}` : Pe(L.value)); + return n.heading || ((S = k(L.value)) == null ? void 0 : S.description) || (T.value ? `Update ${Pe(T.value)}` : Pe(L.value)); }), b = D(new Xe()); let N = Object.assign({}, ys(n.modelValue)); J.interceptors.has("AutoEditForm.new") && J.interceptors.invoke("AutoEditForm.new", { props: n, model: le, origModel: N }); @@ -5615,7 +5615,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b let oe = new le.value.constructor(), be = _e(n.modelValue, ge.name), $e = new FormData(ce); ge && !Array.from($e.keys()).some((De) => De.toLowerCase() == ge.name.toLowerCase()) && $e.append(ge.name, be); let Ae = []; - const He = L.value && T(L.value); + const He = L.value && A(L.value); if (He && F.isPatch(He)) { let De = se(z.value), Oe = {}; if (ge && (Oe[ge.name] = be), De.forEach((Re) => { @@ -5645,7 +5645,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b let ce = C(); const Ve = ce ? _e(n.modelValue, ce.name) : null; if (!Ve) { - console.error(`Could not find Primary Key for Type ${L.value} (${A.value})`); + console.error(`Could not find Primary Key for Type ${L.value} (${T.value})`); return; } const Se = { [ce.name]: Ve }, ge = typeof n.deleteType == "string" ? M(n.deleteType, Se) : n.deleteType ? new n.deleteType(Se) : null; @@ -5917,10 +5917,10 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b function k() { s.formStyle == "slideOver" ? p.value = !1 : $(); } - const T = (I) => { + const A = (I) => { I.key === "Escape" && k(); }; - return Ye(() => window.addEventListener("keydown", T)), Ft(() => window.removeEventListener("keydown", T)), (I, se) => { + return Ye(() => window.addEventListener("keydown", A)), Ft(() => window.removeEventListener("keydown", A)), (I, se) => { var M, ie, L, z; const j = Z("MarkupModel"), F = Z("CloseButton"); return o(), i("div", null, [ @@ -6106,7 +6106,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b emits: ["headerSelected", "rowSelected"], setup(e, { emit: t }) { const s = e, n = t, a = D(), r = D(null), u = (E) => r.value === E, d = Ls(), c = (E) => Object.keys(d).find((h) => h.toLowerCase() == E.toLowerCase() + "-header"), f = (E) => Object.keys(d).find((h) => h.toLowerCase() == E.toLowerCase()), m = v(() => Gs(s.items).filter((E) => !!(d[E] || d[E + "-header"]))), { typeOf: $, typeProperties: p } = lt(), w = v(() => qt(s.type)), y = v(() => $(w.value)), k = v(() => p(y.value)); - function T(E) { + function A(E) { const h = s.headerTitles && _e(s.headerTitles, E) || E; return s.headerTitle ? s.headerTitle(h) : cn(h); } @@ -6135,7 +6135,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b function q(E, h) { return s.rowClass ? s.rowClass(E, h) : he.getTableRowClass(s.tableStyle, h, !!(s.isSelected && s.isSelected(E)), s.isSelected != null); } - function A(E, h) { + function T(E, h) { return s.rowStyle ? s.rowStyle(E, h) : void 0; } const te = v(() => { @@ -6192,9 +6192,9 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b }) : G(d).header ? U(E.$slots, "header", { key: 2, column: X, - label: T(X) + label: A(X) }) : (o(), i("div", Vv, [ - l("span", Sv, O(T(X)), 1) + l("span", Sv, O(A(X)), 1) ])) ], 8, Lv) ], 2))), 256)) @@ -6205,7 +6205,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b }, [ (o(!0), i(Me, null, je(E.items, (X, ne) => (o(), i("tr", { class: g(q(X, ne)), - style: ol(A(X, ne)), + style: ol(T(X, ne)), onClick: (P) => N(P, ne, X) }, [ (o(!0), i(Me, null, je(te.value, (P) => (o(), i("td", { @@ -6256,9 +6256,9 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b const p = _e(e.modelValue, $.name), w = p && f.refLabel && _e(p, f.refLabel); if (!w) return c; - const y = s(f.model), k = y == null ? void 0 : y.icon, T = k ? $t(eo, { image: k, class: "w-5 h-5 mr-1" }) : null; + const y = s(f.model), k = y == null ? void 0 : y.icon, A = k ? $t(eo, { image: k, class: "w-5 h-5 mr-1" }) : null; return $t("span", { class: "flex", title: `${f.model} ${r}` }, [ - T, + A, w ]); }; @@ -6629,24 +6629,24 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b openModal: w }); const $ = D(), p = D(); - function w(T, I) { - $.value = T, p.value = I; + function w(A, I) { + $.value = A, p.value = I; } - async function y(T) { - p.value && p.value(T), $.value = void 0, p.value = void 0; + async function y(A) { + p.value && p.value(A), $.value = void 0, p.value = void 0; } - const k = (T) => { - T.key === "Escape" && f(); + const k = (A) => { + A.key === "Escape" && f(); }; - return Ye(() => window.addEventListener("keydown", k)), Ft(() => window.removeEventListener("keydown", k)), (T, I) => { + return Ye(() => window.addEventListener("keydown", k)), Ft(() => window.removeEventListener("keydown", k)), (A, I) => { var j; const se = Z("ModalLookup"); return o(), i("div", { - id: T.id, - "data-transition-for": T.id, + id: A.id, + "data-transition-for": A.id, onMousedown: f, class: "relative z-10", - "aria-labelledby": `${T.id}-title`, + "aria-labelledby": `${A.id}-title`, role: "dialog", "aria-modal": "true" }, [ @@ -6656,21 +6656,22 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b l("div", _p, [ l("div", $p, [ l("div", { - class: g([T.modalClass, T.sizeClass, d.value]), + class: g([A.modalClass, A.sizeClass, d.value]), onMousedown: I[0] || (I[0] = Ue(() => { }, ["stop"])) }, [ l("div", null, [ - G(s).closebutton ? U(T.$slots, "createform", { key: 0 }) : (o(), i("div", Cp, [ + G(s).closebutton ? U(A.$slots, "createform", { key: 0 }) : (o(), i("div", Cp, [ l("button", { type: "button", onClick: f, - class: g(T.closeButtonClass) + class: g(A.closeButtonClass) }, Vp, 2) ])), - U(T.$slots, "default") + U(A.$slots, "default") ]) - ], 34) + ], 34), + U(A.$slots, "bottom") ]) ]), ((j = $.value) == null ? void 0 : j.name) == "ModalLookup" && $.value.ref ? (o(), ae(se, { @@ -6828,7 +6829,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b }, emits: ["done"], setup(e, { emit: t }) { - const s = e, n = t, a = Ls(), { config: r } = It(), { metadataApi: u, filterDefinitions: d } = lt(), c = Qe("client"), f = r.value.storage, m = v(() => s.toolbarButtonClass ?? he.toolbarButtonClass), $ = v(() => d.value), p = D({ take: ln }), w = D(new Xe()), y = D(s.skip), k = D(!1), T = D(), I = (H) => typeof H == "string" ? H.split(",") : H || []; + const s = e, n = t, a = Ls(), { config: r } = It(), { metadataApi: u, filterDefinitions: d } = lt(), c = Qe("client"), f = r.value.storage, m = v(() => s.toolbarButtonClass ?? he.toolbarButtonClass), $ = v(() => d.value), p = D({ take: ln }), w = D(new Xe()), y = D(s.skip), k = D(!1), A = D(), I = (H) => typeof H == "string" ? H.split(",") : H || []; function se(H, Q) { return he.getTableRowClass("fullWidth", Q, !1, !0); } @@ -6846,7 +6847,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b }), L = v(() => p.value.take ?? ln), z = v(() => w.value.response ? _e(w.value.response, "results") : []), K = v(() => { var H; return ((H = w.value.response) == null ? void 0 : H.total) ?? z.value.length ?? 0; - }), le = v(() => y.value > 0), R = v(() => y.value > 0), W = v(() => z.value.length >= L.value), ee = v(() => z.value.length >= L.value), q = D([]), A = v(() => q.value.some((H) => H.settings.filters.length > 0 || !!H.settings.sort)), te = v(() => q.value.map((H) => H.settings.filters.length).reduce((H, Q) => H + Q, 0)), b = v(() => ns(F.value)), N = v(() => { + }), le = v(() => y.value > 0), R = v(() => y.value > 0), W = v(() => z.value.length >= L.value), ee = v(() => z.value.length >= L.value), q = D([]), T = v(() => q.value.some((H) => H.settings.filters.length > 0 || !!H.settings.sort)), te = v(() => q.value.map((H) => H.settings.filters.length).reduce((H, Q) => H + Q, 0)), b = v(() => ns(F.value)), N = v(() => { var H; return (H = u.value) == null ? void 0 : H.operations.find((Q) => { var oe; @@ -7014,7 +7015,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b ])) : w.value.completed ? (o(), i("span", em, "No Results")) : x("", !0) ]) ])) : x("", !0), - A.value && H.showResetPreferences ? (o(), i("div", tm, [ + T.value && H.showResetPreferences ? (o(), i("div", tm, [ l("button", { type: "button", onClick: ge, @@ -7026,23 +7027,23 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b H.showFiltersView && te.value > 0 ? (o(), i("div", om, [ l("button", { type: "button", - onClick: Q[5] || (Q[5] = (Fe) => T.value = T.value == "filters" ? null : "filters"), + onClick: Q[5] || (Q[5] = (Fe) => A.value = A.value == "filters" ? null : "filters"), class: g(m.value), "aria-expanded": "false" }, [ am, l("span", rm, O(te.value) + " " + O(te.value == 1 ? "Filter" : "Filters"), 1), - T.value != "filters" ? (o(), i("svg", im, dm)) : (o(), i("svg", cm, vm)) + A.value != "filters" ? (o(), i("svg", im, dm)) : (o(), i("svg", cm, vm)) ], 2) ])) : x("", !0) ]) ]), - T.value == "filters" ? (o(), ae(Il, { + A.value == "filters" ? (o(), ae(Il, { key: 0, class: "border-y border-gray-200 dark:border-gray-800 py-8 my-2", definitions: $.value, columns: q.value, - onDone: Q[6] || (Q[6] = (Fe) => T.value = null), + onDone: Q[6] || (Q[6] = (Fe) => A.value = null), onChange: me }, null, 8, ["definitions", "columns"])) : x("", !0), C.value ? (o(), i("div", pm, [ @@ -7273,7 +7274,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b (W) => w.value[W.id] = W.type === "checkbox" ? !1 : "" )); }); - const T = v(() => (m == null ? void 0 : m.authProviders.filter((R) => R.formLayout)) || []), I = v(() => T.value[0] || {}), se = v(() => T.value[Math.max(T.value.length - 1, 0)] || {}), j = v(() => (k.value ? m == null ? void 0 : m.authProviders.find((R) => R.name === k.value) : null) ?? I.value), F = (R) => R === !1 || R === "false"; + const A = v(() => (m == null ? void 0 : m.authProviders.filter((R) => R.formLayout)) || []), I = v(() => A.value[0] || {}), se = v(() => A.value[Math.max(A.value.length - 1, 0)] || {}), j = v(() => (k.value ? m == null ? void 0 : m.authProviders.find((R) => R.name === k.value) : null) ?? I.value), F = (R) => R === !1 || R === "false"; function M(R) { return R.label || R.navItem && R.navItem.label; } @@ -7291,8 +7292,8 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b let R = Ho( m == null ? void 0 : m.authProviders.filter((ee) => ee.formLayout && ee.formLayout.length > 0), (ee, q) => { - let A = M(q) || at(q.name); - ee[A] = q.name === I.value.name ? "" : q.name; + let T = M(q) || at(q.name); + ee[T] = q.name === I.value.name ? "" : q.name; } ); const W = j.value; @@ -7308,7 +7309,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b } } return (R, W) => { - const ee = Z("ErrorSummary"), q = Z("AutoFormFields"), A = Z("PrimaryButton"), te = Z("Icon"), b = _o("href"); + const ee = Z("ErrorSummary"), q = Z("AutoFormFields"), T = Z("PrimaryButton"), te = Z("Icon"), b = _o("href"); return G(m) ? (o(), i("div", Pm, [ l("div", Bm, [ l("h2", Hm, O(R.title), 1), @@ -7349,7 +7350,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b "space-class": "space-y-6" }, null, 8, ["modelValue", "formLayout", "api"]), l("div", qm, [ - ye(A, { class: "w-full" }, { + ye(T, { class: "w-full" }, { default: xe(() => [ ke("Sign In") ]), @@ -7492,11 +7493,11 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b return $.value[h]; } const w = v(() => ["shadow-sm font-mono" + ot.base.replace("rounded-md", ""), c.value ? "text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300" : "text-gray-900 " + ot.valid, n.inputClass]), y = D(); - t({ props: n, textarea: y, updateModelValue: k, selection: I, hasSelection: T, selectionInfo: se, insert: F, replace: j }); + t({ props: n, textarea: y, updateModelValue: k, selection: I, hasSelection: A, selectionInfo: se, insert: F, replace: j }); function k(h) { a("update:modelValue", h); } - function T() { + function A() { return y.value.selectionStart !== y.value.selectionEnd; } function I() { @@ -7558,7 +7559,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b } } function W() { - if (T()) { + if (A()) { let { sel: h, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); if (h.indexOf(` `) === -1) @@ -7591,7 +7592,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b `, "List Item", { offsetStart: -10, offsetEnd: 9 }); } function ee() { - if (T()) { + if (A()) { let { sel: h, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); h.indexOf(` `) === -1 ? F(` @@ -7626,7 +7627,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b ## `, ` `, "Heading", { offsetStart: -8, offsetEnd: 7 }); } - function A() { + function T() { let { sel: h, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); !h.startsWith("//") && !V.startsWith("//") ? h ? F("", "", "//", { selectionAtEnd: !0, @@ -7689,7 +7690,7 @@ const E0 = { key: 0 }, z0 = { class: "text-red-700" }, N0 = /* @__PURE__ */ l("b }, filterSelection: (ne) => ne.replace(/\t/g, " ").replace(/^ ? ? ? ?/g, "").replace(/\n /g, ` `) - }), C.preventDefault()) : C.ctrlKey ? Y === "z" ? C.shiftKey ? N() && C.preventDefault() : b() && C.preventDefault() : Y === "b" && !C.shiftKey ? (M(), C.preventDefault()) : Y === "h" && !C.shiftKey ? (q(), C.preventDefault()) : Y === "i" && !C.shiftKey ? (ie(), C.preventDefault()) : Y === "q" && !C.shiftKey ? (K(), C.preventDefault()) : Y === "k" ? C.shiftKey ? (le(), C.preventDefault()) : (z(), C.preventDefault()) : Y === "," || C.key === "<" || C.key === ">" || C.keyCode === 188 ? (R(C), C.preventDefault()) : Y === "/" || C.key === "/" ? (A(), C.preventDefault()) : (Y === "?" || C.key === "?") && C.shiftKey && (te(), C.preventDefault()) : C.altKey && (C.key === "1" || C.key === "0" ? (W(), C.preventDefault()) : C.key === "-" ? (ee(), C.preventDefault()) : C.key === "s" && (L(), C.preventDefault())); + }), C.preventDefault()) : C.ctrlKey ? Y === "z" ? C.shiftKey ? N() && C.preventDefault() : b() && C.preventDefault() : Y === "b" && !C.shiftKey ? (M(), C.preventDefault()) : Y === "h" && !C.shiftKey ? (q(), C.preventDefault()) : Y === "i" && !C.shiftKey ? (ie(), C.preventDefault()) : Y === "q" && !C.shiftKey ? (K(), C.preventDefault()) : Y === "k" ? C.shiftKey ? (le(), C.preventDefault()) : (z(), C.preventDefault()) : Y === "," || C.key === "<" || C.key === ">" || C.keyCode === 188 ? (R(C), C.preventDefault()) : Y === "/" || C.key === "/" ? (T(), C.preventDefault()) : (Y === "?" || C.key === "?") && C.shiftKey && (te(), C.preventDefault()) : C.altKey && (C.key === "1" || C.key === "0" ? (W(), C.preventDefault()) : C.key === "-" ? (ee(), C.preventDefault()) : C.key === "s" && (L(), C.preventDefault())); }; }), (h, C) => { var Y;