diff --git a/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.min.mjs b/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.min.mjs index 704d7d2..b32389c 100644 --- a/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.min.mjs +++ b/BlazorDiffusion/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 h,createElementVNode as l,createCommentVNode as x,renderSlot as U,ref as D,toDisplayString as O,inject as Qe,nextTick as St,isRef as nn,unref as 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:h([a.value,n.value,"border-l-4 p-4"])},[l("div",Ro,[e.hideIcon?x("",!0):(o(),i("div",Eo,["warn"==e.type?(o(),i("svg",zo,Uo)):"error"==e.type?(o(),i("svg",qo,Ko)):"info"==e.type?(o(),i("svg",Zo,Go)):"success"==e.type?(o(),i("svg",Jo,Yo)):x("",!0)])),l("div",null,[l("p",{class:h([r.value,"text-sm"])},[U(e.$slots,"default")],2)])])],2))}}),ta={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},sa={class:"flex"},la=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),na={class:"ml-3"},oa={class:"text-sm font-medium text-green-800"},aa={key:0},ra={class:"ml-auto pl-3"},ia={class:"-mx-1.5 -my-1.5"},ua=l("span",{class:"sr-only"},"Dismiss",-1),da=l("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),ca=[ua,da],fa=de({__name:"AlertSuccess",props:{message:{}},setup(e){let a=D(!1);return(e,t)=>a.value?x("",!0):(o(),i("div",ta,[l("div",sa,[la,l("div",na,[l("h3",oa,[e.message?(o(),i("span",aa,O(e.message),1)):U(e.$slots,"default",{key:1})])]),l("div",ra,[l("div",ia,[l("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>a.value=!0)},ca)])])])]))}}),va={class:"flex"},pa=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),ma={class:"ml-3"},ha={class:"text-sm text-red-700 dark:text-red-200"},ga=de({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,a=Qe("ApiState",void 0),n=v(()=>t.status||null!=a&&a.error.value?$o.call({responseStatus:t.status??(null==a?void 0:a.error.value)},t.except??[]):null);return(e,t)=>n.value?(o(),i("div",{key:0,class:h("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[l("div",va,[pa,l("div",ma,[l("p",ha,O(n.value),1)])])],2)):x("",!0)}}),ya=["id","aria-describedby"],ba=de({__name:"InputDescription",props:{id:{},description:{}},setup(e){return(e,t)=>e.description?(o(),i("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:e.id+"-description","aria-describedby":e.id+"-description"},[l("div",null,O(e.description),1)],8,ya)):x("",!0)}});function Ms(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,10)??""}function fn(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,19)??""}function vn(e){return null==e?"":Co(e)}function pn(e,l){var t,a;return 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:h(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",e.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vr,2)),l("span",null,[U(e.$slots,"default")])])]))}}),mr=["href","onClick"],hr=["type"],tn="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",gr=de({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(e){return(t,e)=>{var a=Z("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(tn),href:t.href,onClick:e},[U(t.$slots,"default")],8,mr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:tn},t.$attrs),[U(t.$slots,"default")],16,hr))}}}),yr=["href","onClick"],br=["type"],wr=de({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(e){let t=e,a={blue:"focus:ring-indigo-500 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"focus:ring-indigo-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-500 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-500 bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-500 bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-indigo-500 bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},n=v(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black text-white "+(a[t.color]||a.indigo));return(t,e)=>{var a=Z("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(n.value),href:t.href,onClick:e},[U(t.$slots,"default")],10,yr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:n.value},t.$attrs),[U(t.$slots,"default")],16,br))}}}),kr=["type","href","onClick"],_r=["type"],sn="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black",$r=de({__name:"SecondaryButton",props:{type:{},href:{}},setup(e){return(t,e)=>{var a=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:h(sn),href:t.href,onClick:e},[U(t.$slots,"default")],8,kr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type??"button",class:sn},t.$attrs),[U(t.$slots,"default")],16,_r))}}});function Ge(e,l){return Array.isArray(e)?0<=e.indexOf(l):e==l||e.includes(l)}let Cs={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},ot={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},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"},fh=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:h(a.value)},[U(e.$slots,"default")],2))}}),Lr={class:"flex","aria-label":"Breadcrumb"},Vr={role:"list",class:"flex items-center space-x-4"},Sr=["href","title"],Mr=l("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),Ar={class:"sr-only"},Tr=de({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(e){return(e,t)=>(o(),i("nav",Lr,[l("ol",Vr,[l("li",null,[l("div",null,[l("a",{href:e.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:e.homeLabel},[Mr,l("span",Ar,O(e.homeLabel),1)],8,Sr)])]),U(e.$slots,"default")])]))}}),Fr={class:"flex items-center"},Ir=l("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),jr=["href","title"],Or=["title"],Dr=de({__name:"Breadcrumb",props:{href:{},title:{}},setup(e){return(e,t)=>(o(),i("li",null,[l("div",Fr,[Ir,e.href?(o(),i("a",{key:0,href:e.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:e.title},[U(e.$slots,"default")],8,jr)):(o(),i("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:e.title},[U(e.$slots,"default")],8,Or))])]))}}),Pr={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},Br={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Hr=de({__name:"NavList",props:{title:{}},setup(e){return(e,t)=>(o(),i("div",null,[e.title?(o(),i("h2",Pr,O(e.title),1)):x("",!0),l("ul",Br,[U(e.$slots,"default")])]))}}),Rr={class:"relative flex items-start space-x-4 py-6"},Er={class:"flex-shrink-0"},zr={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Nr={class:"min-w-0 flex-1"},Ur={class:"text-base font-medium text-gray-900 dark:text-gray-100"},qr={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Qr=["href"],Kr=l("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Zr={class:"text-base text-gray-500"},Wr=l("div",{class:"flex-shrink-0 self-center"},[l("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),Gr=de({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(e){return(e,t)=>{var a=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:h(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)),g=v(()=>1==u.column.meta.isEnum?_l(Fn(s.value.name)):[]),y=v(()=>{var e;return(null==(e=n(u.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),b=D({filters:[]}),w=v(()=>b.value.filters);function n(e){let l=u.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)}function k(e,l){return n(e).find(e=>e.value===l)}function C(){var e;c.value&&(e=null==(e=k(u.column.type,c.value))?void 0:e.name)&&(b.value.filters.push({key:c.value,name:e,value:p.value}),c.value=p.value="")}function L(){a("done")}function M(){var e;c.value="%",null!=(e=d.value)&&e.focus()}function V(){var e,l;p.value&&C(),m.value&&(l=Object.values(f.value).filter(e=>e),b.value.filters=0parseInt(e)).reduce((e,l)=>e+l,0).toString()}]:[{key:"%In",name:"In",value:l.join(",")}]:[]),a("save",b.value),a("done")}function S(e){b.value.sort=e===b.value.sort?void 0:e,St(V)}return ws(()=>b.value=Object.assign({},u.column.settings,{filters:Array.from(u.column.settings.filters)})),ws(()=>{let e,l,t,a,n,r=(null==(t=null==(l=null==(e=u.column.settings.filters)?void 0:e[0])?void 0:l.value)?void 0:t.split(","))||[];if(00<(l&parseInt(e))))||[]}f.value=r}),(a,t)=>{var e=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:h(`${"ASC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ui,2),l("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>S("DESC")),class:h(`${"DESC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ci,2)]),fi,m.value?(o(),i("div",vi,[(o(!0),i(Me,null,je(g.value,e=>(o(),i("div",{key:e.key,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>f.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,pi),[[al,f.value]]),l("label",{for:e.key,class:"ml-3"},O(e.value),9,mi)]))),128))])):(o(),i("div",hi,[(o(!0),i(Me,null,je(w.value,(e,t)=>(o(),i("div",gi,[l("span",yi,[ke(O(a.column.name)+" "+O(e.name)+" "+O((e=e,Pn(k(u.column.type,e.key),u.column.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;l=t,b.value.filters.splice(l,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},ki,8,bi)])]))),256)),l("div",_i,[ye(e,{id:"filterRule",class:"w-32 mr-1",modelValue:c.value,"onUpdate:modelValue":t[3]||(t[3]=e=>c.value=e),entries:y.value,label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(e=k(a.column.type,c.value))?void 0:e.valueType)?(o(),ae(n,{key:0,ref_key:"txtFilter",ref:d,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:p.value,"onUpdate:modelValue":t[4]||(t[4]=e=>p.value=e),onKeyup:on(C,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):x("",!0),l("div",{class:"pt-1"},[l("button",{type:"button",onClick:C,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ci)])])]))]),l("div",xi,[ye(r,{onClick:V,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(s,{onClick:L},{default:xe(()=>[ke(" Cancel ")]),_:1})])])],4)],512)}}}),Li={class:"px-4 sm:px-6 lg:px-8 text-sm"},Vi={class:"flex flex-wrap"},Si={class:"group pr-4 sm:pr-6 lg:pr-8"},Mi={class:"flex justify-between w-full font-medium"},Ai={class:"w-6 flex justify-end"},Ti={class:"hidden group-hover:inline"},Fi=["onClick","title"],Ii=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ji=[Ii],Oi={key:0,class:"pt-2"},Di={class:"ml-2"},Pi={key:1},Bi={class:"pt-2"},Hi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Ri=["onClick"],Ei=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),zi=[Ei],Ni=l("span",null,"Clear All",-1),Ui=[Ni],Il=de({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let a=e,r=t,n=v(()=>a.columns.filter(e=>0{let l=a.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)})(e).find(e=>e.value===l)}function u(){a.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(o(),i("div",Li,[l("div",Vi,[(o(!0),i(Me,null,je(n.value,n=>{return o(),i("fieldset",Si,[l("legend",Mi,[l("span",null,O(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 g=v(()=>n.tableStyle??Y.value.tableStyle),oe=v(()=>n.gridClass??he.getGridClass(g.value)),ie=v(()=>n.grid2Class??he.getGrid2Class(g.value)),ue=v(()=>n.grid3Class??he.getGrid3Class(g.value)),de=v(()=>n.grid4Class??he.getGrid4Class(g.value)),ve=v(()=>n.tableClass??he.getTableClass(g.value)),ce=v(()=>n.theadClass??he.getTheadClass(g.value)),pe=v(()=>n.theadRowClass??he.getTheadRowClass(g.value)),fe=v(()=>n.theadCellClass??he.getTheadCellClass(g.value)),y=v(()=>n.toolbarButtonClass??he.toolbarButtonClass);function me(e,l){var t,a;return n.rowClass?n.rowClass(e,l):(t=!!Q.value.AnyUpdate,a=(null!=(a=s.value)&&a.name?_e(e,s.value.name):null)==V.value,he.getTableRowClass(n.tableStyle,l,a,t))}let b=Ls(),ge=v(()=>{var e;return il((null==(e=Q.value.AnyQuery.viewModel)?void 0:e.name)||Q.value.AnyQuery.dataModel.name)}),be=v(()=>{let l=Object.keys(b).map(e=>e.toLowerCase());return st(ge.value).filter(e=>l.includes(e.name.toLowerCase())||l.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});let w=v(()=>{var e=(0<(e=Ct(n.selectedColumns)).length?e:0e.toLowerCase());let t=st(ge.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),we=v(()=>{let e=w.value.map(e=>e.name),l=Ct(j.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),k=D([]),C=D(new Xe),Ce=D(new Xe),L=D(),M=D(!1),V=D(),S=D(),T=D(!1),A=D(),F=D(n.skip),I=D(!1),j=D({take:ps}),$=D(!1),Le=v(()=>k.value.some(e=>0k.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Ve=v(()=>{var e;return st(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),s=v(()=>{var e;return ns(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),B=v(()=>j.value.take??ps),E=v(()=>C.value.response?_e(C.value.response,"results"):[]),_=v(()=>{var e;return((null==(e=C.value.response)?void 0:e.total)||E.value.length)??0}),Se=v(()=>00E.value.length>=B.value),De=v(()=>E.value.length>=B.value),P=D(),H=D(),Ae={NoQuery:"No Query API was found"};function Fe(l){if(l){if(n.canFilter)return n.canFilter(l);var e=Ve.value.find(e=>e.name.toLowerCase()==l.toLowerCase());if(e)return!Mn(e)}}function r(e){ee("nav",e),f("queryString")&&ul(e)}async function R(e){F.value+=e,F.value<0&&(F.value=0);var l=Math.floor(_.value/B.value)*B.value;F.value>l&&(F.value=l),r({skip:F.value||void 0}),await z()}async function Ie(e,l){var t,a;S.value=null,V.value=l,e&&l&&(a=Yt(Q.value.AnyQuery,{[e]:l}),(a=await le.api(a)).succeeded)&&((a=null==(a=_e(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(t=Q.value.AnyQuery)?void 0:t.request.name}(${e}:${l}) returned no results`),S.value=a)}async function $e(e,l){ee("rowSelected",e,l);var t=null==(t=s.value)?void 0:t.name,a=t?_e(e,t):null;t&&a&&(r({edit:a}),Ie(t,a))}function Ue(l,e){var t,a,n;f("filtering")&&(t=e.target,Fe(l)&&"TD"!==(null==t?void 0:t.tagName)&&(t=null==(t=null==t?void 0:t.closest("TABLE"))?void 0:t.getBoundingClientRect(),a=k.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&t&&(n=t.x+318+10,A.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),n),y:t.y+45}}),ee("headerSelected",l,e))}function Ee(){A.value=null}async function Pe(e){var l=null==(l=A.value)?void 0:l.column;l&&(l.settings=e,t.setItem(u(l.name),JSON.stringify(l.settings)),await z()),A.value=null}async function He(e){t.setItem(u(e.name),JSON.stringify(e.settings)),await z()}async function Re(e){T.value=!1,j.value=e,t.setItem(sl(),JSON.stringify(e)),await z()}function ze(e){var l;P.value&&(Object.assign(null==(l=P.value)?void 0:l.model,e),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)),hl=v(()=>Q.value.Create&&cl(Q.value.Create)),yl=v(()=>Q.value.AnyUpdate&&cl(Q.value.AnyUpdate)),bl=v(()=>bs(Q.value.Create)),xl=(v(()=>bs(Q.value.AnyUpdate)),v(()=>bs(Q.value.Delete)));function 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,[hl.value?(o(),ae(n,{key:0,title:"Create "+q.value,"invalid-access":hl.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,[yl.value?(o(),ae(n,{key:0,title:"Update "+q.value,"invalid-access":yl.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:h(["pl-2",Se.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!Se.value,onClick:e[3]||(e[3]=e=>R(-_.value))},_u,10,wu)):x("",!0),m("pagingNav")?(o(),i("button",{key:2,type:"button",class:h(["pl-2",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:h(["pl-2",Oe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"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:h(["pl-2",De.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!De.value,onClick:e[6]||(e[6]=e=>R(_.value))},Tu,10,Mu)):x("",!0)]),m("pagingInfo")?(o(),i("div",Fu,[l("div",Iu,[$.value?(o(),i("span",ju,"Querying...")):x("",!0),E.value.length?(o(),i("span",Ou,[Du,ke(" "+O(F.value+1)+" - "+O(Math.min(F.value+E.value.length,_.value))+" ",1),l("span",null," of "+O(_.value),1)])):C.value.completed?(o(),i("span",Pu,"No Results")):x("",!0)])])):x("",!0),l("div",Bu,[m("refresh")?(o(),i("div",Hu,[l("button",{type:"button",onClick:Ge,title:"Refresh",class:h(y.value)},Eu,2)])):x("",!0),m("downloadCsv")?(o(),i("div",zu,[l("button",{type:"button",onClick:We,title:"Download CSV",class:h(y.value)},Uu,2)])):x("",!0),m("copyApiUrl")?(o(),i("div",qu,[l("button",{type:"button",onClick:el,title:"Copy API URL",class:h(y.value)},[I.value?(o(),i("svg",Qu,Zu)):(o(),i("svg",Wu,Ju)),Xu],2)])):x("",!0),Le.value&&m("resetPreferences")?(o(),i("div",Yu,[l("button",{type:"button",onClick:tl,title:"Reset Preferences & Filters",class:h(y.value)},td,2)])):x("",!0),m("filtersView")&&0L.value="filters"==L.value?null:"filters"),class:h(y.value),"aria-expanded":"false"},[ld,l("span",nd,O(Me.value)+" "+O(1==Me.value?"Filter":"Filters"),1),"filters"!=L.value?(o(),i("svg",od,rd)):(o(),i("svg",id,dd))],2)])):x("",!0),m("newItem")&&Q.value.Create&&bl.value?(o(),i("div",cd,[l("button",{type:"button",onClick:al,title:q.value,class:h(y.value)},[vd,l("span",pd,O(nl.value),1)],10,fd)])):x("",!0),G(b).toolbarbuttons?U(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:y.value}):x("",!0)])])])):x("",!0),"filters"==L.value?(o(),ae(Il,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:pl.value,columns:k.value,onDone:e[8]||(e[8]=e=>L.value=null),onChange:He},null,8,["definitions","columns"])):x("",!0),Ce.value.error??C.value.error?(o(),ae(d,{key:6,status:Ce.value.error??C.value.error},null,8,["status"])):$.value?(o(),ae(v,{key:7,class:"p-2"})):x("",!0),A.value?(o(),i("div",md,[ye(Fl,{definitions:pl.value,column:A.value.column,"top-left":A.value.topLeft,onDone:Ee,onSave:Pe},null,8,["definitions","column","top-left"])])):x("",!0),E.value.length?(o(),ae(p,{key:9,id:t.id,items:E.value,type:t.type,"selected-columns":we.value,class:"mt-1",onFiltersChanged:z,tableStyle:g.value,gridClass:oe.value,grid2Class:ie.value,grid3Class:ue.value,grid4Class:de.value,tableClass:ve.value,theadClass:ce.value,theadRowClass:pe.value,theadCellClass:fe.value,tbodyClass:t.tbodyClass,rowClass:me,onRowSelected:$e,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:Ue},rl({header:xe(({column:t,label:e})=>{var a;return[f("filtering")&&Fe(t)?(o(),i("div",hd,[l("span",gd,O(e),1),ye(c,{column:k.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=A.value)?void 0:a.column.name)===t},null,8,["column","is-open"])])):(o(),i("div",yd,[l("span",bd,O(e),1)]))]}),_:2},[je(Object.keys(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:h(["w-4 h-4 transition-transform",e.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Vd,2)),"ASC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Sd,Ad)):"DESC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Td,Id)):x("",!0)])}}}),Od=de({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(e){return(l,e)=>{let t=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=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Bd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Hd=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Rd=[Hd],Ed=["id"],zd=["id"],Nd={inheritAttrs:!1},Ud=de({...Nd,__name:"TextInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e,{expose:t}){let a=e,n=(t({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),D());let r=v(()=>a.type||"text"),s=v(()=>a.label??Pe(at(a.id))),u=v(()=>a.placeholder??s.value);function d(e){return"range"===a.type?e.replace("shadow-sm ",""):e}let c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:a.status??(null==c?void 0:c.error.value)},a.id)),f=v(()=>[ot.base,p.value?ot.invalid:d(ot.valid),a.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[U(t.$slots,"header",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs)),s.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(s.value),11,Dd)):x("",!0),l("div",{class:h(d("mt-1 relative shadow-sm rounded-md"))},[l("input",Te({ref_key:"inputElement",ref:n,type:r.value,name:t.id,id:t.id,class:f.value,placeholder:u.value,value:G(pn)(r.value,t.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=p.value,"aria-describedby":t.id+"-error",step:"any"},G(ft)(t.$attrs,["class","value"])),null,16,Pd),p.value?(o(),i("div",Bd,Rd)):x("",!0)],2),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(p.value),9,Ed)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,zd)):x("",!0),U(t.$slots,"footer",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),qd=["for"],Qd={class:"mt-1 relative rounded-md shadow-sm"},Kd=["name","id","placeholder","aria-invalid","aria-describedby"],Zd=["id"],Wd=["id"],Gd={inheritAttrs:!1},Jd=de({...Gd,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=v(()=>t.placeholder??a.value),r=Qe("ApiState",void 0),s=v(()=>mt.call({responseStatus:t.status??(null==r?void 0:r.error.value)},t.id)),u=v(()=>["shadow-sm "+ot.base,s.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,t.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,qd)):x("",!0),l("div",Qd,[l("textarea",Te({name:t.id,id:t.id,class:u.value,placeholder:n.value,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=s.value,"aria-describedby":t.id+"-error"},G(ft)(t.$attrs,["class"])),O(t.modelValue),17,Kd)]),s.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(s.value),9,Zd)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,Wd)):x("",!0)],2))}}),Xd=["for"],Yd=["id","name","value","aria-invalid","aria-describedby"],ec=["value"],tc=["id"],sc={inheritAttrs:!1},lc=de({...sc,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},label:{},labelClass:{},options:{},values:{},entries:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id)),s=v(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Xd)):x("",!0),l("select",Te({id:t.id,name:t.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",r.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],value:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=r.value,"aria-describedby":t.id+"-error"},G(ft)(t.$attrs,["class"])),[(o(!0),i(Me,null,je(s.value,e=>(o(),i("option",{value:e.key},O(e.value),9,ec))),256))],16,Yd),r.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(r.value),9,tc)):x("",!0)],2))}}),nc={class:"flex items-center h-5"},oc=["id","name","checked"],ac={class:"ml-3 text-sm"},rc=["for"],ic={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},uc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},dc={inheritAttrs:!1},cc=de({...dc,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{}){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id));return(t,e)=>(o(),i("div",{class:h(["relative flex items-start",t.$attrs.class])},[l("div",nc,[l("input",Te({id:t.id,name:t.id,type:"checkbox",checked:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",t.inputClass]},G(ft)(t.$attrs,["class"])),null,16,oc)]),l("div",ac,[l("label",{for:t.id,class:h("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,rc),r.value?(o(),i("p",ic,O(r.value),1)):t.help?(o(),i("p",uc,O(t.help),1)):x("",!0)])],2))}}),fc=["id"],vc=["for"],pc={class:"mt-1 relative rounded-md shadow-sm"},mc=["id","name","value"],hc={class:"flex flex-wrap pb-1.5"},gc={class:"pt-1.5 pl-1"},yc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},bc=["onClick"],wc=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),kc=[wc],_c={class:"pt-1.5 pl-1 shrink"},$c=["type","name","id","aria-invalid","aria-describedby"],Cc=["id"],xc=["onMouseover","onClick"],Lc={class:"block truncate"},Vc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Sc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Mc=[Sc],Ac=["id"],Tc=["id"],Fc={inheritAttrs:!1},Ic=de({...Fc,__name:"TagInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:{},string:{type:Boolean},maxVisibleItems:{default:300},converter:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=e,n=t;let r=v(()=>{return Ze((e=a.modelValue,a.converter?a.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),s=D(),u=D(!1),d=v(()=>{let l=p.value.toLowerCase();return a.allowableValues&&0!=a.allowableValues.length?a.allowableValues.length<1e3?a.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(l)):a.allowableValues.filter(e=>!r.value.includes(e)&&e.startsWith(l)):[]});let c=D(null),p=D(""),f=v(()=>a.type||"text"),m=v(()=>a.label??Pe(at(a.id))),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",a.inputClass]),w=l=>V(r.value.filter(e=>e!=l));function k(e){var l;document.activeElement===e.target&&null!=(l=c.value)&&l.focus()}let C=D();function L(){u.value=!0,C.value=!0}function M(){$(T()),C.value=!1,setTimeout(()=>{C.value||(u.value=!1)},200)}function V(e){var l=a.string?e.join(","):e;n("update:modelValue",l)}function S(e){var l;"Backspace"==e.key&&0==p.value.length&&0e==l.key))&&l.preventDefault(),"Enter"==l.key||"NumpadEnter"==l.key||1==l.key.length&&e)&&$(t)}let F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function I(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function $(e){var l;0!==e.length&&(-1==(l=Array.from(r.value)).indexOf(e)&&l.push(e),V(l),p.value="",u.value=!1)}function B(t){var e,t=null==(e=t.clipboardData)?void 0:e.getData("Text");if(t){let e=new RegExp("\\n|\\t|"+a.delimiters.join("|")),l=Array.from(r.value);t.split(e).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),V(l),p.value=""}}return(e,t)=>(o(),i("div",{class:h([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(m.value),11,vc)):x("",!0),l("div",pc,[l("input",{type:"hidden",id:e.id,name:e.id,value:r.value.join(",")},null,8,mc),l("button",{class:h(b.value),onClick:Ue(k,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",hc,[(o(!0),i(Me,null,je(r.value,t=>(o(),i("div",gc,[l("span",yc,[ke(O(t)+" ",1),l("button",{type:"button",onClick:e=>w(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},kc,8,bc)])]))),256)),l("div",_c,[Mt(l("input",Te({ref_key:"txtInput",ref:c,type:f.value,role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:e.id+"-txt",id:e.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error",onKeydown:S,onKeypress:A,onPaste:Ue(B,["prevent","stop"]),onFocus:L,onBlur:M,onClick:t[1]||(t[1]=e=>u.value=!0)},G(ft)(e.$attrs,["class","required"])),null,16,$c),[[wo,p.value]])])])],34),u.value&&d.value.length?(o(),i("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(d.value.slice(0,e.maxVisibleItems),t=>(o(),i("li",{class:h([t===s.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var l;l=t,s.value=l},onClick:e=>$(t),role:"option",tabindex:"-1"},[l("span",Lc,O(t),1)],42,xc))),256))],40,Cc)):x("",!0),y.value?(o(),i("div",Vc,Mc)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,Ac)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Tc)):x("",!0)],10,fc))}}),jc={class:"relative flex-grow mr-2 sm:mr-4"},Oc=["for"],Dc={class:"block mt-2"},Pc={class:"sr-only"},Bc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Hc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Rc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Ec=[Rc],zc=["id"],Nc=["id"],Uc={key:0},qc=["title"],Qc=["alt","src"],Kc={key:1,class:"mt-3"},Zc={class:"w-full"},Wc={class:"pr-6 align-bottom pb-2"},Gc=["title"],Jc=["src","onError"],Xc=["href"],Yc={key:1,class:"overflow-hidden"},e0={class:"align-top pb-2 whitespace-nowrap"},t0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},s0=de({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(e){let t,a=e,n=D(null),{assetsPathResolver:r,fallbackPathResolver:s}=It(),u={},d=D(),c=D((null==(t=a.files)?void 0:t.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}a.values&&0{var l=e.replace(/\\/g,"/");return{fileName:rn(At(l,"/"),"."),filePath:l,contentType:el(l)}}).map(p));let f=v(()=>a.label??Pe(at(a.id))),m=v(()=>a.placeholder??f.value),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",a.inputClass]),w=e=>{var l=e.target;d.value="",c.value=Array.from(l.files||[]).map(e=>({fileName:e.name,filePath:pl(e),contentLength:e.size,contentType:e.type||el(e.name)}))},k=()=>{var e;return null==(e=n.value)?void 0:e.click()},C=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),L=v(()=>{var e;return 0!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function V(e){d.value=s(L.value)}return Ft(Cn),(e,t)=>(o(),i("div",{class:h(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",jc,[f.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(f.value),11,Oc)):x("",!0),l("div",Dc,[l("span",Pc,O(e.help??f.value),1),l("input",Te({ref_key:"input",ref:n,type:"file",multiple:e.multiple,name:e.id,id:e.id,class:b.value,placeholder:m.value,"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error"},e.$attrs,{onChange:w}),null,16,Bc),y.value?(o(),i("div",Hc,Ec)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,zc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Nc)):x("",!0)]),e.multiple?(o(),i("div",Kc,[l("table",Zc,[(o(!0),i(Me,null,je(c.value,t=>(o(),i("tr",null,[l("td",Wc,[l("div",{class:"flex w-full",title:C(t.filePath)?"":t.filePath},[l("img",{src:u[G(xt)(t.filePath)]||G(r)(G(xt)(t.filePath)),class:h(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[G(xt)(t.filePath)]=G(s)(G(xt)(t.filePath))},null,42,Jc),C(t.filePath)?(o(),i("span",Yc,O(t.fileName),1)):(o(),i("a",{key:0,href:G(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},O(t.fileName),9,Xc))],8,Gc)]),l("td",e0,[t.contentLength&&0[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=D(!1),r=e,s=a;function u(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}t({toggle:I});let d=v(()=>r.label??Pe(at(r.id))),c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:r.status??(null==c?void 0:c.error.value)},r.id)),f=v(()=>[ot.base,p.value?ot.invalid:ot.valid]),m=D(null),g=D(""),y=D(null),b=D(r.viewCount),w=D([]),k=v(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,b.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let L=[",",` -`,"\t"];function M(e){var l=null==(t=e.clipboardData)?void 0:t.getData("Text");if(l){var t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(l=>r.options.find(e=>r.match(e,l))).filter(e=>!!e);if(0{u(l)?e=e.filter(e=>e!=l):e.push(l)}),s("update:modelValue",e),hs()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&($(t[0]),n.value=!1,hs())}}}function V(e){C.indexOf(e.code)||j()}function S(e){var l;e.shiftKey||e.ctrlKey||e.altKey||(n.value?"Escape"==e.code?n.value&&(e.stopPropagation(),n.value=!1):"Tab"==e.code?n.value=!1:"Home"==e.code?(y.value=w.value[0],A()):"End"==e.code?(y.value=w.value[w.value.length-1],A()):"ArrowDown"==e.code?(y.value?(l=w.value.indexOf(y.value),y.value=l+1{var e=_s(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(T)},0)}function F(){setTimeout(()=>{var e=_s(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(T):e.scrollIntoView(T))},0)}function I(e){var l;(n.value=e)&&(j(),null!=(l=m.value))&&l.focus()}function j(){n.value=!0,B()}function $(l){if(g.value="",n.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),y.value=null,s("update:modelValue",e)}else{let e=l;r.modelValue==l&&(e=null),s("update:modelValue",e)}}function B(){w.value=k.value}return bt(g,B),(e,t)=>(o(),i("div",{id:e.id+"-autocomplete"},[d.value?(o(),i("label",{key:0,for:e.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},O(d.value),9,n0)):x("",!0),l("div",o0,[Mt(l("input",Te({ref_key:"txtInput",ref:m,id:e.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:f.value,placeholder:e.multiple||!e.modelValue?e.placeholder:"",onFocus:j,onKeydown:S,onKeyup:V,onClick:j,onPaste:M,required:!1},e.$attrs),null,16,a0),[[ko,g.value]]),l("button",{type:"button",onClick:t[1]||(t[1]=e=>I(!n.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},i0),n.value?(o(),i("ul",{key:0,class:"absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(w.value,t=>(o(),i("li",{class:h([t===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return l=t,y.value=l,void(w.value.indexOf(l)>Math.floor(.9*b.value)&&(b.value+=r.viewCount,B()));var l},onClick:e=>$(t),role:"option",tabindex:"-1"},[U(e.$slots,"item",Rt(ks(t))),u(t)?(o(),i("span",{key:0,class:h(["absolute inset-y-0 right-0 flex items-center pr-4",t===y.value?"text-white":"text-indigo-600"])},f0,2)):x("",!0)],42,d0))),256))],40,u0)):!e.multiple&&e.modelValue?(o(),i("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>I(!n.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[U(e.$slots,"item",Rt(ks(e.modelValue)))],32)):x("",!0),p.value?(o(),i("div",v0,m0)):x("",!0)]),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(p.value),9,h0)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,g0)):x("",!0)],8,l0))}}),b0=["id","name","value"],w0={class:"block truncate"},k0=de({__name:"Combobox",props:{id:{},modelValue:{},multiple:{type:Boolean},options:{},values:{},entries:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=e,r=(t({toggle(e){var l;null!=(l=d.value)&&l.toggle(e)}}),a);function s(e){r("update:modelValue",e)}let u=v(()=>null!=n.multiple?n.multiple:Array.isArray(n.modelValue)),d=D();function c(e,l){return!l||e.value.toLowerCase().includes(l.toLowerCase())}let p=v(()=>n.entries||(n.values?n.values.map(e=>({key:e,value:e})):n.options?Object.keys(n.options).map(e=>({key:e,value:n.options[e]})):[])),f=D(u.value?[]:null);Ye(function(){let l=n.modelValue&&"object"==typeof n.modelValue?n.modelValue.key:n.modelValue;null==l||""===l?f.value=u.value?[]:null:"string"==typeof l?f.value=p.value.find(e=>e.key===l)||null:Array.isArray(l)&&(f.value=p.value.filter(e=>l.includes(e.key)))});let m=v(()=>null==f.value?"":Array.isArray(f.value)?f.value.map(e=>encodeURIComponent(e.key)).join(","):f.value.key);return(e,t)=>{var a=Z("Autocomplete");return o(),i(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,b0),ye(a,Te({ref_key:"input",ref:d,id:e.id,options:p.value,match:c,multiple:u.value},e.$attrs,{modelValue:f.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>f.value=e),s]}),{item:xe(({value:e})=>[l("span",w0,O(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),_0=de({__name:"DynamicInput",props:{input:{},modelValue:{},api:{}},emits:["update:modelValue"],setup(e,{emit:l}){let t=e,a=l,c=v(()=>t.input.type||"text"),n="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),p=v(()=>ft(t.input,n)),f=D("file"===c.value?null:t.modelValue[t.input.id]),m=(bt(f,()=>{t.modelValue[t.input.id]=f.value,a("update:modelValue",t.modelValue)}),v(()=>{var e=t.modelValue[t.input.id];if("file"!==t.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:At(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){let l=[];return e.forEach(e=>{"string"==typeof e?l.push({filePath:e,fileName:At(e,"/")}):"object"==typeof e&&l.push(e)}),l}}));return(e,l)=>{var t,a=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"]))}}}),$0={class:"lookup-field"},C0=["name","value"],x0={key:0,class:"flex justify-between"},L0=["for"],V0={key:0,class:"flex items-center"},S0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},M0=l("span",{class:"sr-only"},"Clear",-1),A0=l("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),T0=[M0,A0],F0={key:1,class:"mt-1 relative"},I0={class:"w-full inline-flex truncate"},j0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},O0=l("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[l("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),D0=["id"],P0=["id"],B0=de({__name:"LookupInput",props:{id:{},status:{},input:{},metadataType:{},modelValue:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=It().config,r=lt().metadataApi,s=e,u=t,d=v(()=>s.id||s.input.id),c=v(()=>s.label??Pe(at(d.value))),n=Qe("ApiState",void 0),p=Qe("client"),f=v(()=>mt.call({responseStatus:s.status??(null==n?void 0:n.error.value)},d.value)),m=D(""),g=D(""),y=v(()=>_e(s.modelValue,d.value)),b=v(()=>st(s.metadataType).find(e=>e.name.toLowerCase()==d.value.toLowerCase())),w=v(()=>{var e;return(null==(e=rt(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||a.value.tableIcon}),k;function C(){s.modelValue[d.value]=null,m.value=""}return Ye(async()=>{k=Qe("ModalProvider",void 0);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,g.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",$0,[l("input",{type:"hidden",name:d.value,value:y.value},null,8,C0),c.value?(o(),i("div",x0,[l("label",{for:d.value,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(c.value),11,L0),y.value?(o(),i("div",V0,[l("span",S0,O(y.value),1),l("button",{onClick:C,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},T0)])):x("",!0)])):x("",!0),null!=(a=b.value)&&a.ref?(o(),i("div",F0,[l("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var a;(a=b.value.ref)&&(null==k?console.warn("No ModalProvider required by LookupInput"):k.openModal({name:"ModalLookup",ref:a},e=>{var l,t;console.debug("openModal",m.value," -> ",e,Pt.setRefValue(a,e),a),e&&(l=_e(e,a.refId),m.value=Pt.setRefValue(a,e)||l,(t=G(s.modelValue))[d.value]=l,u("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",I0,[l("span",j0,[ye(n,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,O(m.value),1)])]),O0])])):x("",!0),f.value?(o(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:d.value+"-error"},O(f.value),9,D0)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},O(e.help),9,P0)):x("",!0)])}}}),H0=de({__name:"AutoFormFields",props:{modelValue:{},type:{},metaType:{},api:{},formLayout:{},configureField:{},configureFormLayout:{},hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let u=e,n=a;function r(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function d(e,l){u.modelValue[e]=l,n("update:modelValue",u.modelValue),r()}t({forceUpdate:r,props:u,updateValue:d});let{metadataApi:s,apiOf:c,typeOf:p,typeOfRef:f,createFormLayout:m}=lt(),g=v(()=>u.type||qt(u.modelValue)),y=v(()=>u.metaType??p(g.value)),b=v(()=>{var e;return f(null==(e=null==(e=s.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value});function w(){var e,l=y.value;if(!l){if(u.formLayout)return e=u.formLayout.map(e=>{var l={name:e.id,type:Ia(e.type)},l=Object.assign({prop:l},e);return u.configureField&&u.configureField(l),l}),u.configureFormLayout&&u.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}let a=st(l),n=b.value,t=u.formLayout?Array.from(u.formLayout):m(l),r=[],s=c(l.name);return t.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==n?void 0:n.properties)?void 0:e.find(e=>{var l;return e.name.toLowerCase()==(null==(l=t.name)?void 0:l.toLowerCase())}))??l,l=Object.assign({prop:e,op:s},t),u.configureField&&u.configureField(l),r.push(l))}),u.configureFormLayout&&u.configureFormLayout(r),r}return(t,a)=>{let e,n=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:h(t.flexClass)},[l("div",{class:h(t.divideClass)},[l("div",{class:h(t.spaceClass)},[l("fieldset",{class:h(t.fieldsetClass)},[(o(!0),i(Me,null,je(w(),l=>{var e;return o(),i("div",{key:l.id,class:h(["w-full",(null==(e=l.css)?void 0:e.field)??("textarea"==l.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==l.type?" flex items-center":"")),"hidden"==l.type?"hidden":""])},[null==(null==(e=l.prop)?void 0:e.ref)||"file"==l.type||l.prop.isPrimaryKey?(o(),ae(s,{key:1,input:l,modelValue:t.modelValue,"onUpdate:modelValue":a[0]||(a[0]=e=>t.$emit("update:modelValue",e)),api:t.api},null,8,["input","modelValue","api"])):(o(),ae(r,{key:0,metadataType:b.value,input:l,modelValue:t.modelValue,"onUpdate:modelValue":e=>{d(l.id,_e(e,l.id))},status:null==(e=t.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Ps(e){let r=D(!1),s=D(),o=D(),i=e??Qe("client");function n({message:e,errorCode:l,fieldName:t,errors:a}){return l=l||"Exception",a=a||[],s.value=new qs(t?{errorCode:l,message:e,errors:[new Gl({fieldName:t,errorCode:l,message:e})]}:{errorCode:l,message:e,errors:a})}var l={setError:n,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",s.value?((a=new qs(s.value)).errors=[...(a.errors||[]).filter(e=>{var l;return(null==(l=e.fieldName)?void 0:l.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Gl({fieldName:t,message:e,errorCode:l})],s.value=a):n({fieldName:t,message:e,errorCode:l})},loading:r,error:s,api:async function(e,l,t){r.value=!0;var a=await i.api(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiVoid:async function(e,l,t){r.value=!0;var a=await i.apiVoid(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiForm:async function(e,l,t,a){r.value=!0;var n=await i.apiForm(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},apiFormVoid:async function(e,l,t,a){r.value=!0;var n=await i.apiFormVoid(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},swr:async function(e,l,t,a){return gn(i,e,l,t,a)},swrEffect:function(t,a){let n=D(new Xe),r=yn(async e=>{n.value=await i.api(e)},null==a?void 0:a.delayMs);return ws(async()=>{var e=t(),l=cl(Ts(e));l&&(n.value=new Xe({response:l})),0===(null==a?void 0:a.delayMs)?n.value=await i.api(e):r(e)}),(async()=>n.value=await i.api(t(),null==a?void 0:a.args,null==a?void 0:a.method))(),n},unRefs:Dt,setRef:mn};return ss("ApiState",l),l}let R0={key:0},E0={class:"text-red-700"},z0=l("b",null,"type",-1),N0={key:0},U0={key:2},q0=["innerHTML"],Q0=l("input",{type:"submit",class:"hidden"},null,-1),K0={class:"flex justify-end"},Z0=l("div",null,null,-1),W0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},G0=l("div",{class:"fixed inset-0"},null,-1),J0={class:"fixed inset-0 overflow-hidden"},X0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Y0={class:"flex-1"},ef={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},tf={class:"flex items-start justify-between space-x-3"},sf={class:"space-y-1"},lf={key:0},nf={key:2},of=["innerHTML"],af={class:"flex h-7 items-center"},rf={class:"flex justify-end"},uf=de({__name:"AutoForm",props:{type:{},modelValue:{},heading:{},subHeading:{},showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},metaType:{},configureField:{},configureFormLayout:{},panelClass:{},bodyClass:{},formClass:{},innerFormClass:{},headerClass:{default:"p-6"},buttonsClass:{},headingClass:{},subHeadingClass:{},submitLabel:{default:"Submit"},allowSubmit:{}},emits:["success","error","update:modelValue","done"],setup(e,{expose:t,emit:a}){let s=e,u=a,L=D(),M=D(1),V=D();function n(){M.value++,P.value=m();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}ss("ModalProvider",{openModal:function(e,l){S.value=e,r.value=l}});let S=D(),r=D();async function T(e){r.value&&r.value(e),S.value=void 0,r.value=void 0}let d=Ps(),c=bn().getTypeName,{typeOf:p,createDto:f}=lt(),A=D(new Xe),F=v(()=>s.panelClass||Ee.panelClass(s.formStyle)),I=v(()=>s.formClass||"card"==s.formStyle?"shadow sm:rounded-md":Bt.formClass),j=v(()=>s.headingClass||Ee.headingClass(s.formStyle)),$=v(()=>s.subHeadingClass||Ee.subHeadingClass(s.formStyle)),B=v(()=>("string"==typeof s.buttonsClass?s:Ee).buttonsClass),E=v(()=>{var e;return s.type?c(s.type):null!=(e=s.modelValue)&&e.getTypeName?s.modelValue.getTypeName():null}),_=v(()=>s.metaType??p(E.value)),m=()=>s.modelValue||g(),P=D(m()),H=v(()=>d.loading.value),R=v(()=>{var e;return null!=s.heading?s.heading:(null==(e=_.value)?void 0:e.description)||Pe(E.value)});function g(){return"string"==typeof s.type?f(s.type):s.type?new s.type:s.modelValue}async function z(e){var l,t,a,n,r;e&&"FORM"==e.tagName?(l=g(),r=Ze(null==l?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==l?void 0:l.createResponse,e=>"function"==typeof e?e():null),a=s.jsconfig,il.hasRequestBody(r)?(r=new l.constructor,n=new FormData(e),A.value=t?await d.apiFormVoid(r,n,{jsconfig:a}):await d.apiForm(r,n,{jsconfig:a})):(r=new l.constructor(Bo(P.value)),console.debug("AutoForm.submit",r),A.value=t?await d.apiVoid(r,{jsconfig:a}):await d.api(r,{jsconfig:a})),A.value.succeeded?(u("success",A.value.response),J()):u("error",A.value.error)):console.error("Not a valid form",e)}function N(e){u("update:modelValue",e)}function y(){u("done")}t({forceUpdate:n,props:s,setModel:async function(e){Object.assign(P.value,e),n(),await St(()=>null)},formFields:L,submit:async function(){z(V.value)},close: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:y()}bt(b,()=>{yt(k,G,b.value),b.value||setTimeout(y,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,g=Z("AutoFormFields"),y=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:h(F.value)},[l("form",{ref_key:"elForm",ref:V,onSubmit:e[0]||(e[0]=Ue(e=>z(e.target),["prevent"])),autocomplete:"off",class:h(t.innerFormClass)},[l("div",{class:h(t.bodyClass)},[l("div",{class:h(t.headerClass)},[t.$slots.heading?(o(),i("div",N0,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",U0,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(n=_.value)?void 0:n.notes},null,10,q0)):x("",!0)],2),U(t.$slots,"header",{instance:null==(r=Be())?void 0:r.exposed,model:P.value}),Q0,(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(s=Be())?void 0:s.exposed,model:P.value})],2),U(t.$slots,"buttons",{},()=>{var e;return[l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",K0,[Z0,ye(b,{disabled:!!t.allowSubmit&&!t.allowSubmit(P.value)},{default:xe(()=>[ke(O(t.submitLabel),1)]),_:1},8,["disabled"]),U(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})])],2)]})],34)],2)):(o(),i("div",W0,[G0,l("div",J0,[l("div",{onMousedown: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:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",G.value])},[l("form",{ref_key:"elForm",ref:V,class:h(I.value),onSubmit:e[1]||(e[1]=Ue(e=>z(e.target),["prevent"]))},[l("div",X0,[l("div",Y0,[l("div",ef,[l("div",tf,[l("div",sf,[t.$slots.heading?(o(),i("div",lf,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",nf,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,of)):x("",!0)]),l("div",af,[ye(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:J})])])]),U(t.$slots,"header",{instance:null==(v=Be())?void 0:v.exposed,model:P.value}),(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(c=Be())?void 0:c.exposed,model:P.value})])]),l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(p=Be())?void 0:p.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",rf,[ye(k,{onClick: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",R0,[l("p",E0,[ke("Could not create form for unknown "),z0,ke(" "+O(E.value),1)])])),"ModalLookup"==(null==(m=S.value)?void 0:m.name)&&S.value.ref?(o(),ae(C,{key:3,"ref-info":S.value.ref,onDone:T},null,8,["ref-info"])):x("",!0)])}}}),df={key:0},cf={class:"text-red-700"},ff=l("b",null,"type",-1),vf={key:0},pf={key:2},mf=["innerHTML"],hf={class:"flex justify-end"},gf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},yf=l("div",{class:"fixed inset-0"},null,-1),bf={class:"fixed inset-0 overflow-hidden"},wf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},kf={class:"flex-1"},_f={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},$f={class:"flex items-start justify-between space-x-3"},Cf={class:"space-y-1"},xf={key:0},Lf={key:2},Vf=["innerHTML"],Sf={class:"flex h-7 items-center"},Mf={class:"flex justify-end"},Af=de({__name:"AutoCreateForm",props:{type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,c=D(),p=D(1);function n(){p.value++,null!=(e=c.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function f(e){}ss("ModalProvider",{openModal:function(e,l){m.value=e,u.value=l}});let m=D(),u=D();async function g(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:y,Crud:b,createDto:w,formValues:k}=lt(),C=v(()=>qt(r.type)),L=v(()=>d(C.value)),M=D("string"==typeof r.type?w(r.type):r.type?new r.type:null),V=(t({forceUpdate:n,props:r,setModel:function(e){Object.assign(M.value,e),n()},formFields:c,model:M}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),S=v(()=>r.formClass||Ee.formClass(r.formStyle)),T=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),A=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),F=v(()=>r.buttonsClass||Ee.buttonsClass),I=v(()=>b.model(L.value)),j=v(()=>{var e;return r.heading||(null==(e=d(C.value))?void 0:e.description)||(I.value?"New "+Pe(I.value):Pe(C.value))}),$=D(new Xe),B=Ps(),E=v(()=>B.loading.value);async function _(e){var l,t,a,n=e.target;r.autosave?(t=Ze(null==(t=M.value)?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==Ze(null==(l=M.value)?void 0:l.createResponse,e=>"function"==typeof e?e():null),il.hasRequestBody(t)?(t=new M.value.constructor,a=new FormData(n),$.value=l?await B.apiFormVoid(t,a,{jsconfig:"eccn"}):await B.apiForm(t,a,{jsconfig:"eccn"})):(t=k(n,y(L.value)),a=new M.value.constructor(t),$.value=l?await B.apiVoid(a,{jsconfig:"eccn"}):await B.api(a,{jsconfig:"eccn"})),$.value.succeeded?(n.reset(),s("save",$.value.response)):s("error",$.value.error)):s("save",new M.value.constructor(k(n,y(L.value))))}function P(){s("done")}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:h(V.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:h(S.value)},[l("div",null,[e.$slots.heading?(o(),i("div",vf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",pf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,mf)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value})],2),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",hf,[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",gf,[yf,l("div",bf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(S.value),onSubmit:Ue(_,["prevent"])},[l("div",wf,[l("div",kf,[l("div",_f,[l("div",$f,[l("div",Cf,[e.$slots.heading?(o(),i("div",xf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",Lf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,Vf)):x("",!0)]),l("div",Sf,[ye(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(d=Be())?void 0:d.exposed,model:M.value})])]),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&G(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",Mf,[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",df,[l("p",cf,[ke("Could not create form for unknown "),ff,ke(" "+O(C.value),1)])])),"ModalLookup"==(null==(a=m.value)?void 0:a.name)&&m.value.ref?(o(),ae(v,{key:3,"ref-info":m.value.ref,onDone:g},null,8,["ref-info"])):x("",!0)])}}}),Tf={key:0},Ff={class:"text-red-700"},If=l("b",null,"type",-1),jf={key:0},Of={key:2},Df=["innerHTML"],Pf={class:"flex justify-end"},Bf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Hf=l("div",{class:"fixed inset-0"},null,-1),Rf={class:"fixed inset-0 overflow-hidden"},Ef={class:"flex min-h-0 flex-1 flex-col overflow-auto"},zf={class:"flex-1"},Nf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Uf={class:"flex items-start justify-between space-x-3"},qf={class:"space-y-1"},Qf={key:0},Kf={key:2},Zf=["innerHTML"],Wf={class:"flex h-7 items-center"},Gf={class:"flex justify-end"},Jf=de({__name:"AutoEditForm",props:{modelValue:{},type:{},deleteType:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","delete","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,p=D(),f=D(1);function m(e){}ss("ModalProvider",{openModal:function(e,l){g.value=e,n.value=l}});let g=D(),n=D();async function q(e){n.value&&n.value(e),g.value=void 0,n.value=void 0}let{typeOf:u,apiOf:Q,typeProperties:c,createFormLayout:K,getPrimaryKey:W,Crud:y,createDto:d,formValues:b}=lt(),w=v(()=>qt(r.type)),k=v(()=>u(w.value)),C=()=>"string"==typeof r.type?d(r.type,ys(r.modelValue)):r.type?new r.type(ys(r.modelValue)):null,L=D(C()),X=(t({forceUpdate:function(){f.value++,L.value=C();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(L.value,e)},formFields:p,model:L}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),M=v(()=>r.formClass||Ee.formClass(r.formStyle)),V=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),S=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),T=v(()=>y.model(k.value)),A=v(()=>{var e;return r.heading||(null==(e=u(w.value))?void 0:e.description)||(T.value?"Update "+Pe(T.value):Pe(w.value))}),F=D(new Xe),I=Object.assign({},ys(r.modelValue)),j=(J.interceptors.has("AutoEditForm.new")&&J.interceptors.invoke("AutoEditForm.new",{props:r,model:L,origModel:I}),Ps()),$=v(()=>j.loading.value),B=()=>Ze(u(y.model(k.value)),e=>W(e));function Y(e){var{op:l,prop:t}=e;l&&(y.isPatch(l)||y.isUpdate(l))&&(e.disabled=null==t?void 0:t.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(e){var a=e.target;if(r.autosave){let e=Ze(null==(n=L.value)?void 0:n.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==(n=L.value)?void 0:n.createResponse,e=>"function"==typeof e?e():null),d=B();if(il.hasRequestBody(e)){let e=new L.value.constructor,l=_e(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,l),[]);var n=w.value&&Q(w.value);if(n&&y.isPatch(n)){let s=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:h(X.value)},[l("form",{onSubmit:Ue(E,["prevent"])},[l("div",{class:h(M.value)},[l("div",null,[e.$slots.heading?(o(),i("div",jf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Of,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Df)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value})],2),l("div",{class:h(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",Pf,[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",Bf,[Hf,l("div",Rf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(M.value),onSubmit:Ue(E,["prevent"])},[l("div",Ef,[l("div",zf,[l("div",Nf,[l("div",Uf,[l("div",qf,[e.$slots.heading?(o(),i("div",Qf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Kf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Zf)):x("",!0)]),l("div",Wf,[ye(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:Y,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(v=Be())?void 0:v.exposed,model:L.value})])]),l("div",{class:h(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",Gf,[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",Tf,[l("p",Ff,[ke("Could not create form for unknown "),If,ke(" "+O(w.value),1)])])),"ModalLookup"==(null==(a=g.value)?void 0:a.name)&&g.value.ref?(o(),ae(c,{key:3,"ref-info":g.value.ref,onDone:q},null,8,["ref-info"])):x("",!0)])}}}),Xf={key:0},Yf={class:"text-red-700"},ev=l("b",null,"type",-1),tv={key:0},sv={key:2},lv=["innerHTML"],nv={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},ov=l("div",{class:"fixed inset-0"},null,-1),av={class:"fixed inset-0 overflow-hidden"},rv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},iv={class:"flex-1"},uv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},dv={class:"flex items-start justify-between space-x-3"},cv={class:"space-y-1"},fv={key:0},vv={key:2},pv=["innerHTML"],mv={class:"flex h-7 items-center"},hv=de({__name:"AutoViewForm",props:{model:{},apis:{},typeName:{},done:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{}},emits:["done"],setup(e,{}){let t=e,a=lt().typeOf,s=v(()=>t.typeName??t.apis.dataModel.name),u=v(()=>a(s.value)),d=v(()=>t.panelClass||Ee.panelClass(t.formStyle)),c=v(()=>t.formClass||Ee.formClass(t.formStyle)),p=v(()=>t.headingClass||Ee.headingClass(t.formStyle)),f=v(()=>t.subHeadingClass||Ee.subHeadingClass(t.formStyle)),m=v(()=>{var e;return t.heading||(null==(e=a(s.value))?void 0:e.description)||(null!=(e=t.model)&&e.id?Pe(s.value)+" "+t.model.id:"View "+Pe(s.value))});function n(){t.done&&t.done()}J.interceptors.has("AutoViewForm.new")&&J.interceptors.invoke("AutoViewForm.new",{props:t});let r=D(!1),g=D(""),y={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function b(){"slideOver"==t.formStyle?r.value=!1:n()}bt(r,()=>{yt(y,g,r.value),r.value||setTimeout(n,700)}),r.value=!0;let w=e=>{"Escape"===e.key&&b()};return Ye(()=>window.addEventListener("keydown",w)),Ft(()=>window.removeEventListener("keydown",w)),(e,t)=>{var a,n=Z("MarkupModel"),r=Z("CloseButton");return o(),i("div",null,[s.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(d.value)},[l("div",{class:h(c.value)},[l("div",null,[e.$slots.heading?(o(),i("div",tv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",sv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,lv)):x("",!0)]),ye(n,{value:e.model},null,8,["value"])],2)],2)):(o(),i("div",nv,[ov,l("div",av,[l("div",{onMousedown:b,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",g.value])},[l("div",{class:h(c.value)},[l("div",rv,[l("div",iv,[l("div",uv,[l("div",dv,[l("div",cv,[e.$slots.heading?(o(),i("div",fv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",vv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,pv)):x("",!0)]),l("div",mv,[ye(r,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:b})])])]),ye(n,{value:e.model},null,8,["value"])])])],2)],2)],32)],32)])])):(o(),i("div",Xf,[l("p",Yf,[ke("Could not create view for unknown "),ev,ke(" "+O(s.value),1)])]))])}}}),gv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),yv=de({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let a=D(!1),n=t,r=()=>{a.value&&n("delete")},s=v(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",a.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(o(),i(Me,null,[Mt(l("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>nn(a)?a.value=e:a=e)},null,512),[[al,G(a)]]),gv,l("span",Te({onClick:Ue(r,["prevent"]),class:s.value},e.$attrs),[U(e.$slots,"default",{},()=>[ke("Delete")])],16)],64))}}),bv={class:"flex",title:"loading..."},wv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},kv=xs('',3),_v=[kv],$v={class:"ml-2 mt-1 text-gray-400"},Cv=de({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Qe("ApiState",void 0),(e,t)=>(o(),i("div",bv,[e.icon?(o(),i("svg",wv,_v)):x("",!0),l("span",$v,O(e.text),1)]))}}),xv=["onClick"],Lv={key:3,class:"flex justify-between items-center"},Vv={class:"mr-1 select-none"},Sv=["onClick"],Mv=de({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:{},tableStyle:{default:"stripedRows"},selectedColumns:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},isSelected:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{}},emits:["headerSelected","rowSelected"],setup(e,{emit:t}){let u=e,d=t,a=D(),c=D(null),p=Ls(),f=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()+"-header"),m=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()),n=v(()=>Gs(u.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:r,typeProperties:s}=lt(),g=v(()=>qt(u.type)),y=v(()=>r(g.value)),b=v(()=>s(y.value));function w(e){var l=u.headerTitles&&_e(u.headerTitles,e)||e;return u.headerTitle?u.headerTitle(l):cn(l)}function k(e){let l=e.toLowerCase();return b.value.find(e=>e.name.toLowerCase()==l)}let C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){var l=u.visibleFrom&&_e(u.visibleFrom,e);return l&&Ze(C[l],e=>"hidden "+e)}let M=v(()=>u.gridClass??he.getGridClass(u.tableStyle)),V=v(()=>u.grid2Class??he.getGrid2Class(u.tableStyle)),S=v(()=>u.grid3Class??he.getGrid3Class(u.tableStyle)),T=v(()=>u.grid4Class??he.getGrid4Class(u.tableStyle)),A=v(()=>u.tableClass??he.getTableClass(u.tableStyle)),F=v(()=>u.tbodyClass??he.getTbodyClass(u.tbodyClass)),I=v(()=>u.theadClass??he.getTheadClass(u.tableStyle)),j=v(()=>u.theadRowClass??he.getTheadRowClass(u.tableStyle)),$=v(()=>u.theadCellClass??he.getTheadCellClass(u.tableStyle));let B=v(()=>{let e=("string"==typeof u.selectedColumns?u.selectedColumns.split(","):u.selectedColumns)||(0(e[l.name.toLowerCase()]=l.format,e),{});return e.filter(e=>{var l;return"hidden"!=(null==(l=t[e.toLowerCase()])?void 0:l.method)})});return(n,e)=>{let r=Z("CellFormat"),s=Z("PreviewFormat");return n.items.length?(o(),i("div",{key:0,ref_key:"refResults",ref:a,class:h(M.value)},[l("div",{class:h(V.value)},[l("div",{class:h(S.value)},[l("div",{class:h(T.value)},[l("table",{class:h(A.value)},[l("thead",{class:h(I.value)},[l("tr",{class:h(j.value)},[(o(!0),i(Me,null,je(B.value,t=>{return o(),i("td",{class:h([L(t),$.value,(e=t,c.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[l("div",{onClick:e=>{var l;e=e,l=t,d("headerSelected",l,e)}},[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",Lv,[l("span",Vv,O(w(t)),1)]))],8,xv)],2);var e}),256))],2)],2),l("tbody",{class:h(F.value)},[(o(!0),i(Me,null,je(n.items,(t,e)=>{return o(),i("tr",{class:h((l=t,a=e,u.rowClass?u.rowClass(l,a):he.getTableRowClass(u.tableStyle,a,!(!u.isSelected||!u.isSelected(l)),null!=u.isSelected))),style:ol((a=t,l=e,u.rowStyle?u.rowStyle(a,l):void 0)),onClick:e=>{var l;e=e,l=t,d("rowSelected",l,e)}},[(o(!0),i(Me,null,je(B.value,e=>{return o(),i("td",{class:h([L(e),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:y.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,Sv);var l,a}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),Av=de({props:{type:Object,propType:Object,modelValue:Object},setup(d,{attrs:v}){let c=lt().typeOf;return()=>{let e,l=null!=(o=d.propType)&&o.format?o.format:"TimeSpan"==(null==o?void 0:o.type)||"TimeOnly"==(null==o?void 0:o.type)?{method:"time"}:null,t=_e(d.modelValue,d.propType.name),a=Object.assign({},d,v),n=$t("span",{innerHTML:ts(t,l,a)}),r=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}}}),Tv={key:0},Fv={key:0,class:"mr-2"},Iv=["innerHTML"],jv=["innerHTML"],Ov={inheritAttrs:!1},Dv=de({...Ov,__name:"PreviewFormat",props:{value:{},format:{},includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(e){let t=e,a=v(()=>Array.isArray(t.value));return(e,t)=>G(Xt)(e.value)?(o(),i("span",Tv,[e.includeCount&&a.value?(o(),i("span",Fv,O(e.value.length),1)):x("",!0),l("span",{innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,Iv)])):(o(),i("span",{key:1,innerHTML:G(ts)(e.value,e.format,e.$attrs)},null,8,jv))}}),Pv=["innerHTML"],Bv={key:0},Hv=l("b",null,null,-1),Rv={key:2},Ev=de({__name:"HtmlFormat",props:{value:{},depth:{default:0},fieldAttrs:{},classes:{type:Function,default:(e,l,t,a,n)=>a}},setup(e){let t=e,r=v(()=>Tt(t.value)),s=v(()=>Array.isArray(t.value)),u=e=>cn(e),d=e=>t.fieldAttrs?t.fieldAttrs(e):null,c=v(()=>Gs(t.value));return(t,e)=>{let a=Z("HtmlFormat",!0);return o(),i("div",{class:h(0==t.depth?"prose html-format":"")},[r.value?(o(),i("div",{key:0,innerHTML:G(ts)(t.value)},null,8,Pv)):s.value?(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,G(he).gridClass))},[G(Tt)(t.value[0])?(o(),i("div",Bv,"[ "+O(t.value.join(", "))+" ]",1)):(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,G(he).grid2Class))},[l("div",{class:h(t.classes("array","div",t.depth,G(he).grid3Class))},[l("div",{class:h(t.classes("array","div",t.depth,G(he).grid4Class))},[l("table",{class:h(t.classes("object","table",t.depth,G(he).tableClass))},[l("thead",{class:h(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:h(t.classes("array","th",t.depth,G(he).theadCellClass+" whitespace-nowrap"))},[Hv,ke(O(u(e)),1)],2))),256))])],2),l("tbody",null,[(o(!0),i(Me,null,je(t.value,(l,e)=>(o(),i("tr",{class:h(t.classes("array","tr",t.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(o(!0),i(Me,null,je(c.value,e=>(o(),i("td",{class:h(t.classes("array","td",t.depth,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",Rv,[l("table",{class:h(t.classes("object","table",t.depth,"table-object"))},[(o(!0),i(Me,null,je((n=t.value)?Object.keys(n).map(e=>({key:u(e),val:n[e]})):[],e=>(o(),i("tr",{class:h(t.classes("object","tr",t.depth,""))},[l("th",{class:h(t.classes("object","th",t.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},O(e.key),3),l("td",{class:h(t.classes("object","td",t.depth,"align-top py-2 px-4 text-sm"))},[ye(a,Te({value:e.val,"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},d(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),zv=["href"],Nv=["href","title"],Uv=de({__name:"MarkupFormat",props:{value:{},imageClass:{default:"w-8 h-8"}},setup(e){var l=e,t=La().getMimeType,a=l.value;let n=typeof l.value;l="string"===n&&a.length?t(a):null;return"string"===n&&a.length&&(((t=a.startsWith("https://")||a.startsWith("http://"))||"/"===a[0])&&null!=l&&l.startsWith("image/")?n="image":t&&(n="link")),(e,l)=>{var t=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,zv)):"image"==G(n)?(o(),i("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[ye(t,{src:e.value,class:h(e.imageClass)},null,8,["src","class"])],8,Nv)):(o(),ae(a,{key:2,value:e.value},null,8,["value"]))}}}),qv={class:"my-2 w-full"},Qv={class:"leading-7"},Kv={class:"px-2 text-left align-top"},Zv={colspan:"align-top"},Wv={class:"my-2 leading-7"},Gv={colspan:"2",class:"px-2 bg-indigo-700 text-white"},Jv={class:"leading-7"},Xv={colspan:"2",class:"px-2 align-top"},Yv=de({__name:"MarkupModel",props:{value:{},imageClass:{}},setup(e){let a=e,t=Object.keys(a.value),n={},r={};return t.forEach(e=>{var l=a.value[e],t=typeof l;null==l||"function"==t||"symbol"==t?n[e]=`(${null==l?"null":"t"})`:"object"==t?r[e]=l:n[e]=l}),(e,t)=>{let a=Z("MarkupFormat");return o(),i("table",qv,[(o(),i(Me,null,je(n,(e,t)=>l("tr",Qv,[l("th",Kv,O(G(Pe)(t)),1),l("td",Zv,[ye(a,{value:e},null,8,["value"])])])),64)),(o(),i(Me,null,je(r,(e,t)=>(o(),i(Me,null,[l("tr",Wv,[l("td",Gv,O(G(Pe)(t)),1)]),l("tr",Jv,[l("td",Xv,[ye(a,{value:e},null,8,["value"])])])],64))),64))])}}}),ep={class:"absolute top-0 right-0 pt-4 pr-4"},tp=l("span",{class:"sr-only"},"Close",-1),sp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),lp=[tp,sp],np=de({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),i("div",ep,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:h([t.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},lp,2)]))}}),op=["id","aria-labelledby"],ap=l("div",{class:"fixed inset-0"},null,-1),rp={class:"fixed inset-0 overflow-hidden"},ip={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},up={class:"flex min-h-0 flex-1 flex-col overflow-auto"},dp={class:"flex-1"},cp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},fp={class:"flex items-start justify-between space-x-3"},vp={class:"space-y-1"},pp={key:0},mp=["id"],hp={key:2,class:"text-sm text-gray-500"},gp={class:"flex h-7 items-center"},yp={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},bp=de({__name:"SlideOver",props:{id:{default:"SlideOver"},title:{},contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(e,{emit:t}){let a=t,n=D(!1),r=D(""),s={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},u=(bt(n,()=>{yt(s,r,n.value),n.value||setTimeout(()=>a("done"),700)}),n.value=!0,()=>n.value=!1),d=e=>{"Escape"===e.key&&u()};return Ye(()=>window.addEventListener("keydown",d)),Ft(()=>window.removeEventListener("keydown",d)),(e,t)=>{var a=Z("CloseButton");return o(),i("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[ap,l("div",rp,[l("div",{onMousedown:u,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",r.value])},[l("div",ip,[l("div",up,[l("div",dp,[l("div",cp,[l("div",fp,[l("div",vp,[e.$slots.title?(o(),i("div",pp,[U(e.$slots,"title")])):x("",!0),e.title?(o(),i("h2",{key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:e.id+"-title"},O(e.title),9,mp)):x("",!0),e.$slots.subtitle?(o(),i("p",hp,[U(e.$slots,"subtitle")])):x("",!0)]),l("div",gp,[ye(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:h(e.contentClass)},[U(e.$slots,"default")],2)])]),e.$slots.footer?(o(),i("div",yp,[U(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,op)}}}),wp=["id","data-transition-for","aria-labelledby"],kp={class:"fixed inset-0 z-10 overflow-y-auto"},_p={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},$p={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},Cp=l("span",{class:"sr-only"},"Close",-1),xp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),Lp=[Cp,xp],Vp=de({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:nl.modalClass},sizeClass:{default:nl.sizeClass},closeButtonClass:{default:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"}},emits:["done"],setup(e,{emit:t}){let r=Ls(),a=t,n=D(!1),s=D(""),u={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},d=D(""),v={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},c=(bt(n,()=>{yt(u,s,n.value),yt(v,d,n.value),n.value||setTimeout(()=>a("done"),200)}),n.value=!0,()=>n.value=!1),p=(ss("ModalProvider",{openModal:function(e,l){p.value=e,f.value=l}}),D()),f=D();async function m(e){f.value&&f.value(e),p.value=void 0,f.value=void 0}let g=e=>{"Escape"===e.key&&c()};return Ye(()=>window.addEventListener("keydown",g)),Ft(()=>window.removeEventListener("keydown",g)),(e,t)=>{var a,n=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:h(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",s.value])},null,2),l("div",kp,[l("div",_p,[l("div",{class:h([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[G(r).closebutton?U(e.$slots,"createform",{key:0}):(o(),i("div",$p,[l("button",{type:"button",onClick:c,class:h(e.closeButtonClass)},Lp,2)])),U(e.$slots,"default")])],34),U(e.$slots,"bottom")])]),"ModalLookup"==(null==(a=p.value)?void 0:a.name)&&p.value.ref?(o(),ae(n,{key:0,"ref-info":p.value.ref,onDone:m},null,8,["ref-info"])):x("",!0)],40,wp)}}}),Sp={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Mp={class:"mt-3 pl-5 flex flex-wrap items-center"},Ap={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Tp={class:"hidden md:inline"},Fp={class:"flex pb-1 sm:pb-0"},Ip=["title"],jp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),Op=[jp],Dp=["disabled"],Pp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),Bp=[Pp],Hp=["disabled"],Rp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Ep=[Rp],zp=["disabled"],Np=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Up=[Np],qp=["disabled"],Qp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Kp=[Qp],Zp={key:0,class:"flex pb-1 sm:pb-0"},Wp={class:"px-4 text-lg text-black dark:text-white"},Gp={key:0},Jp={key:1},Xp=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Yp={key:2},em={key:1,class:"pl-2"},tm=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),sm=[tm],lm={class:"flex pb-1 sm:pb-0"},nm={key:0,class:"pl-2"},om=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),am={class:"mr-1"},rm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},im=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),um=[im],dm={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},cm=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),fm=[cm],vm={key:1},pm={key:4},mm={key:0},hm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gm={class:"mr-1 select-none"},ym={key:1,class:"flex justify-between items-center"},bm={class:"mr-1 select-none"},ln=25,wm=de({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:{},skip:{default:0},prefs:{},selectedColumns:{},allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:{},canFilter:{}},emits:["done"],setup(e,{emit:t}){let d=e,a=t,c=Ls(),n=It().config,{metadataApi:r,filterDefinitions:s}=lt(),u=Qe("client"),p=n.value.storage,f=v(()=>d.toolbarButtonClass??he.toolbarButtonClass),m=v(()=>s.value),g=D({take:ln}),y=D(new Xe),b=D(d.skip),w=D(!1),k=D(),C=e=>"string"==typeof e?e.split(","):e||[];function L(e,l){return he.getTableRowClass("fullWidth",l,!1,!0)}let M=v(()=>rt(d.refInfo.model)),V=v(()=>{var e=(0<(e=C(d.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());let t=st(M.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),J=v(()=>{let e=V.value.map(e=>e.name),l=C(g.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),S=v(()=>g.value.take??ln),T=v(()=>y.value.response?_e(y.value.response,"results"):[]),A=v(()=>{var e;return(null==(e=y.value.response)?void 0:e.total)??T.value.length??0}),F=v(()=>00T.value.length>=S.value),$=v(()=>T.value.length>=S.value),B=D([]),q=v(()=>B.value.some(e=>0B.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Q=v(()=>ns(M.value)),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,g.value=e,p.setItem(H(),JSON.stringify(e)),await N()}async function N(){var a=(()=>{let a={include:"total",take:S.value},e=C(g.value.selectedColumns||d.selectedColumns);var l;0{t.settings.sort&&n.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);a[l]=e.value})}),"u"{y.value.response=y.value.error=void 0,w.value=e}),t=await u.api(e);l(),St(()=>y.value=t);n=_e(t.response,"results")||[];t.succeeded&&n.label}else console.error("No Query API was found for "+d.refInfo.model)}async function se(){B.value.forEach(e=>{e.settings={filters:[]},p.removeItem(R(e.name))}),await N()}return Ye(async()=>{var e=d.prefs||$s(p.getItem(H()));e&&(g.value=e),B.value=V.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(p.getItem(R(e.name))))})),isNaN(d.skip)||(b.value=d.skip),await N()}),(n,e)=>{let t=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",Sp,[l("div",Mp,[l("h3",Ap,[ke(" Select "),l("span",Tp,O(G(Pe)(n.refInfo.model)),1)]),l("div",Fp,[n.showPreferences?(o(),i("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:n.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>_.value=!_.value)},Op,8,Ip)):x("",!0),n.showPagingNav?(o(),i("button",{key:1,type:"button",class:h(["pl-2",F.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!F.value,onClick:e[1]||(e[1]=e=>z(-A.value))},Bp,10,Dp)):x("",!0),n.showPagingNav?(o(),i("button",{key:2,type:"button",class:h(["pl-2",I.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!I.value,onClick:e[2]||(e[2]=e=>z(-S.value))},Ep,10,Hp)):x("",!0),n.showPagingNav?(o(),i("button",{key:3,type:"button",class:h(["pl-2",j.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!j.value,onClick:e[3]||(e[3]=e=>z(S.value))},Up,10,zp)):x("",!0),n.showPagingNav?(o(),i("button",{key:4,type:"button",class:h(["pl-2",$.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!$.value,onClick:e[4]||(e[4]=e=>z(A.value))},Kp,10,qp)):x("",!0)]),n.showPagingInfo?(o(),i("div",Zp,[l("div",Wp,[w.value?(o(),i("span",Gp,"Querying...")):x("",!0),T.value.length?(o(),i("span",Jp,[Xp,ke(" "+O(b.value+1)+" - "+O(Math.min(b.value+T.value.length,A.value))+" ",1),l("span",null," of "+O(A.value),1)])):y.value.completed?(o(),i("span",Yp,"No Results")):x("",!0)])])):x("",!0),q.value&&n.showResetPreferences?(o(),i("div",em,[l("button",{type:"button",onClick:se,title:"Reset Preferences & Filters",class:h(f.value)},sm,2)])):x("",!0),l("div",lm,[n.showFiltersView&&0k.value="filters"==k.value?null:"filters"),class:h(f.value),"aria-expanded":"false"},[om,l("span",am,O(E.value)+" "+O(1==E.value?"Filter":"Filters"),1),"filters"!=k.value?(o(),i("svg",rm,um)):(o(),i("svg",dm,fm))],2)])):x("",!0)])]),"filters"==k.value?(o(),ae(Il,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:m.value,columns:B.value,onDone:e[6]||(e[6]=e=>k.value=null),onChange:ne},null,8,["definitions","columns"])):x("",!0),P.value?(o(),i("div",vm,[ye(Fl,{definitions:m.value,column:P.value.column,"top-left":P.value.topLeft,onDone:le,onSave:te},null,8,["definitions","column","top-left"])])):x("",!0),y.value.error?(o(),ae(t,{key:2,status:y.value.error},null,8,["status"])):w.value?(o(),ae(a,{key:3})):(o(),i("div",pm,[T.value.length?(o(),i("div",mm,[ye(s,{id:n.id,items:T.value,type:n.refInfo.model,"selected-columns":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",ym,[l("span",bm,O(e),1)])):(o(),i("div",hm,[l("span",gm,O(e),1),ye(r,{column:B.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=P.value)?void 0:a.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[je(Object.keys(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:g.value,onDone:e[7]||(e[7]=e=>_.value=!1),onSave:re},null,8,["columns","prefs"])):x("",!0)],64)}}}),km={class:"sm:hidden"},_m=["for"],$m=["id","name"],Cm=["value"],xm={class:"hidden sm:block"},Lm={class:"border-b border-gray-200"},Vm={class:"-mb-px flex","aria-label":"Tabs"},Sm=["onClick"],Mm=de({__name:"Tabs",props:{tabs:{},id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>Pe(e)},selected:{},tabClass:{},bodyClass:{default:"p-4"},url:{type:Boolean,default:!0},clearQuery:{type:Boolean,default:!1}},setup(e){let t=e,a=v(()=>Object.keys(t.tabs)),n=e=>t.label?t.label(e):Pe(e),r=v(()=>t.id||"tabs"),s=v(()=>t.param||"tab"),u=D();function d(e){u.value=e,t.url&&ul({tab:e===a.value[0]?void 0:e},t.clearQuery)}let c=v(()=>100/Object.keys(t.tabs).length+"%");return Ye(()=>{var e;u.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),e=Ws(e)[s.value])&&(u.value=e)}),(t,e)=>(o(),i("div",null,[l("div",km,[l("label",{for:r.value,class:"sr-only"},"Select a tab",8,_m),l("select",{id:r.value,name:r.value,class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:e[0]||(e[0]=e=>{var l;return d(null==(l=e.target)?void 0:l.value)})},[(o(!0),i(Me,null,je(a.value,e=>(o(),i("option",{key:e,value:e},O(n(e)),9,Cm))),128))],40,$m)]),l("div",xm,[l("div",Lm,[l("nav",Vm,[(o(!0),i(Me,null,je(a.value,l=>{return o(),i("a",{href:"#",onClick:Ue(e=>d(l),["prevent"]),style:ol({width:c.value}),class:h([(e=l,u.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),t.tabClass])},O(n(l)),15,Sm);var e}),256))])])]),l("div",{class:h(t.bodyClass)},[(o(),ae(an(t.tabs[u.value])))],2)]))}}),Am=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),Tm=[Am],Fm=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),Im=[Fm],jm=de({__name:"DarkModeToggle",setup(e){let a=typeof document<"u"?document.documentElement:null,n=()=>!(null==a||!a.classList.contains("dark")),r=D("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(o(),i("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n()?null!=a&&a.classList.remove("dark"):null!=a&&a.classList.add("dark"),r.value=n(),localStorage.setItem("color-scheme",r.value?"dark":"light")})},[l("span",{class:h(`${r.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[l("span",{class:h(`${r.value?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Tm,2),l("span",{class:h(`${r.value?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Im,2)],2)]))}}),Om={key:0},Dm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Pm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Bm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Hm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Rm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Em=["onClick"],zm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Nm={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},Um={class:"mt-8"},qm={key:1,class:"mt-6"},Qm=xs('
Or continue with
',1),Km={class:"mt-6 grid grid-cols-3 gap-3"},Zm=["href","title"],Wm={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Gm=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),Jm=l("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),Xm=[Gm,Jm],Ym=de({__name:"SignIn",props:{provider:{},title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(e,{emit:t}){let a=e,n=t,{getMetadata:r,createDto:s}=lt(),u=Ps(),d=Qe("client"),c=Tl().signIn,p=r({assert:!0}),f=p.plugins.auth,m=document.baseURI,g=p.app.baseUrl,y=D(s("Authenticate")),b=D(new Xe),w=D(a.provider),k=(Ye(()=>{null!=f&&f.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]="checkbox"!==e.type&&""))}),v(()=>(null==f?void 0:f.authProviders.filter(e=>e.formLayout))||[])),C=v(()=>k.value[0]||{}),L=v(()=>k.value[Math.max(k.value.length-1,0)]||{}),M=v(()=>(w.value?null==f?void 0:f.authProviders.find(e=>e.name===w.value):null)??C.value),V=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}let T=v(()=>{var e;return((null==(e=M.value)?void 0:e.formLayout)||[]).map(e=>{var l;return Object.assign({},e,{type:null==(l=e.type)?void 0:l.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(l=e.type)?void 0:l.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),A=v(()=>!V(a.oauth)&&(null==f?void 0:f.authProviders.filter(e=>"oauth"===e.type))||[]),F=v(()=>{let e=Ho(null==f?void 0:f.authProviders.filter(e=>e.formLayout&&0{e[S(l)||at(l.name)]=l.name===C.value.name?"":l.name});var l=M.value;return e=l&&V(a.tabs)?{[S(l)||at(l.name)]:l}:e}),I=v(()=>{var e=T.value.map(e=>e.id).filter(e=>e);return b.value.summaryMessage(e)});async function j(){var e;y.value.provider=M.value.name,"authsecret"===M.value.name?(d.headers.set("authsecret",y.value.authsecret),y.value=s("Authenticate")):"basic"===M.value.name?(d.setCredentials(y.value.UserName,y.value.Password),y.value=s("Authenticate"),y.value.UserName=null,y.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=y.value.BearerToken,y.value=s("Authenticate")),b.value=await u.api(y.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new Xe,y.value=s("Authenticate"))}return(e,t)=>{let a=Z("ErrorSummary"),n=Z("AutoFormFields"),r=Z("PrimaryButton"),s=Z("Icon"),u=_o("href");return G(f)?(o(),i("div",Dm,[l("div",Pm,[l("h2",Bm,O(e.title),1),1Mt((o(),i("a",{onClick:e=>w.value=l,class:h([""===l||l===C.value.name?"rounded-l-md":l===L.value.name?"rounded-r-md -ml-px":"-ml-px",w.value===l?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[ke(O(e),1)],10,Em)),[[u,{provider:l}]])),256))])])):x("",!0)]),l("div",zm,[I.value?(o(),ae(a,{key:0,class:"mb-3",errorSummary:I.value},null,8,["errorSummary"])):x("",!0),l("div",Nm,[T.value.length?(o(),i("form",{key:0,onSubmit:Ue(j,["prevent"])},[ye(n,{modelValue:y.value,formLayout:T.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),l("div",Um,[ye(r,{class:"w-full"},{default:xe(()=>[ke("Sign In")]),_:1})])],32)):x("",!0),A.value.length?(o(),i("div",qm,[Qm,l("div",Km,[(o(!0),i(Me,null,je(A.value,e=>(o(),i("div",null,[l("a",{href:G(g)+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",Wm,Xm))],8,Zm)]))),256))])])):x("",!0)])])])):(o(),i("div",Om,"No Auth Plugin"))}}}),e1=["for"],t1={key:1,class:"border border-gray-200 flex justify-between"},s1={class:"p-2 flex flex-wrap gap-x-4"},l1=l("title",null,"Bold text (CTRL+B)",-1),n1=l("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),o1=[l1,n1],a1=l("title",null,"Italics (CTRL+I)",-1),r1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),i1=[a1,r1],u1=l("title",null,"Insert Link (CTRL+K)",-1),d1=l("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),c1=[u1,d1],f1=l("title",null,"Blockquote (CTRL+Q)",-1),v1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),p1=[f1,v1],m1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),h1=l("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),g1=[m1,h1],y1=l("title",null,"Insert Code (CTRL+<)",-1),b1=l("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),w1=[y1,b1],k1=l("title",null,"H2 Heading (CTRL+H)",-1),_1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),$1=[k1,_1],C1=l("title",null,"Numbered List (ALT+1)",-1),x1=l("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),L1=[C1,x1],V1=l("title",null,"Bulleted List (ALT+-)",-1),S1=l("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),M1=[V1,S1],A1=l("title",null,"Strike Through (ALT+S)",-1),T1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),F1=[A1,T1],I1=l("title",null,"Undo (CTRL+Z)",-1),j1=l("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),O1=[I1,j1],D1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),P1=l("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),B1=[D1,P1],H1={key:0,class:"p-2 flex flex-wrap gap-x-4"},R1=["href"],E1=l("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),z1=[E1],N1={class:""},U1=["name","id","label","value","rows","disabled"],q1=["id"],Q1=["id"],Je="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",K1=de({__name:"MarkdownInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},counter:{type:Boolean},rows:{},errorMessages:{},lang:{},autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:{}},emits:["update:modelValue","close"],setup(e,{expose:t,emit:a}){let n=e,r=a,y=[],b=[],s=Qe("ApiState",void 0),u=v(()=>mt.call({responseStatus:n.status??(null==s?void 0:s.error.value)},n.id)),d=v(()=>n.label??Pe(at(n.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),p=v(()=>n.hide?Vt(c,n.hide):Vt(c,[]));function f(e){return p.value[e]}let m=v(()=>["shadow-sm font-mono"+ot.base.replace("rounded-md",""),u.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,n.inputClass]),w=D();function k(e){r("update:modelValue",e)}function g(){return w.value.selectionStart!==w.value.selectionEnd}function C(){var e=w.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=w.value,l=e.value,t=e.selectionStart,e=l.substring(t,e.selectionEnd)||"",a=l.substring(0,t),n=a.lastIndexOf(` +var ho=Object.defineProperty,go=(e,l,t)=>l in e?ho(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Le=(e,l,t)=>(go(e,"symbol"!=typeof l?l+"":l,t),t);import{defineComponent as de,computed as v,openBlock as o,createElementBlock as i,normalizeClass as h,createElementVNode as l,createCommentVNode as x,renderSlot as U,ref as D,toDisplayString as O,inject as Qe,nextTick as St,isRef as nn,unref as W,mergeProps as Te,withModifiers as Ue,h as $t,resolveComponent as K,createBlock as ae,withCtx as xe,useAttrs as yo,createVNode as ye,createTextVNode as ke,watchEffect as ws,normalizeStyle as ol,Fragment as Me,renderList as je,withDirectives as Mt,vModelCheckbox as al,withKeys as on,createStaticVNode as xs,vModelSelect as bo,useSlots as Ls,getCurrentInstance as Be,onMounted as Ye,createSlots as rl,normalizeProps as Et,guardReactiveProps as ks,vModelDynamic as wo,onUnmounted as Ft,watch as bt,vModelText as ko,resolveDynamicComponent as an,provide as ss,resolveDirective as _o}from"vue";import{errorResponseExcept as $o,toDate as pt,toTime as Co,omit as ft,enc as Zs,appendQueryString as zt,lastLeftPart as rn,setQueryString as xo,nameOf as Lo,ApiResult as Xe,lastRightPart as At,leftPart as Vs,map as Ze,toDateTime as Vo,toCamelCase as So,mapGet as _e,chop as Mo,fromXsdDuration as un,isDate as Ss,timeFmt12 as Ao,dateFmt as To,apiValue as Fo,indexOfAny as Io,createBus as jo,toKebabCase as Wl,sanitize as Oo,humanize as Pe,delaySet as dn,rightPart as ms,queryString as Ws,combinePaths as Do,toPascalCase as at,errorResponse as mt,trimEnd as Po,$1 as _s,ResponseStatus as qs,ResponseError as Gl,HttpMethods as il,omitEmpty as Bo,uniqueKeys as Gs,humanify as cn,each as Ho}from"@servicestack/client";let Ro={class:"flex items-center"},Eo={key:0,class:"flex-shrink-0 mr-3"},zo={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},No=l("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),Uo=[No],qo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Qo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1),Ko=[Qo],Zo={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Wo=l("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1),Go=[Wo],Jo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Xo=l("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1),Yo=[Xo],ea=de({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(e){let t=e,a=v(()=>"info"==t.type?"bg-blue-50 dark:bg-blue-200":"error"==t.type?"bg-red-50 dark:bg-red-200":"success"==t.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),n=v(()=>"info"==t.type?"border-blue-400":"error"==t.type?"border-red-400":"success"==t.type?"border-green-400":"border-yellow-400"),r=v(()=>"info"==t.type?"text-blue-700":"error"==t.type?"text-red-700":"success"==t.type?"text-green-700":"text-yellow-700");return(e,t)=>(o(),i("div",{class:h([a.value,n.value,"border-l-4 p-4"])},[l("div",Ro,[e.hideIcon?x("",!0):(o(),i("div",Eo,["warn"==e.type?(o(),i("svg",zo,Uo)):"error"==e.type?(o(),i("svg",qo,Ko)):"info"==e.type?(o(),i("svg",Zo,Go)):"success"==e.type?(o(),i("svg",Jo,Yo)):x("",!0)])),l("div",null,[l("p",{class:h([r.value,"text-sm"])},[U(e.$slots,"default")],2)])])],2))}}),ta={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},sa={class:"flex"},la=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),na={class:"ml-3"},oa={class:"text-sm font-medium text-green-800"},aa={key:0},ra={class:"ml-auto pl-3"},ia={class:"-mx-1.5 -my-1.5"},ua=l("span",{class:"sr-only"},"Dismiss",-1),da=l("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),ca=[ua,da],fa=de({__name:"AlertSuccess",props:{message:{}},setup(e){let a=D(!1);return(e,t)=>a.value?x("",!0):(o(),i("div",ta,[l("div",sa,[la,l("div",na,[l("h3",oa,[e.message?(o(),i("span",aa,O(e.message),1)):U(e.$slots,"default",{key:1})])]),l("div",ra,[l("div",ia,[l("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>a.value=!0)},ca)])])])]))}}),va={class:"flex"},pa=l("div",{class:"flex-shrink-0"},[l("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),ma={class:"ml-3"},ha={class:"text-sm text-red-700 dark:text-red-200"},ga=de({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,a=Qe("ApiState",void 0),n=v(()=>t.status||null!=a&&a.error.value?$o.call({responseStatus:t.status??(null==a?void 0:a.error.value)},t.except??[]):null);return(e,t)=>n.value?(o(),i("div",{key:0,class:h("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[l("div",va,[pa,l("div",ma,[l("p",ha,O(n.value),1)])])],2)):x("",!0)}}),ya=["id","aria-describedby"],ba=de({__name:"InputDescription",props:{id:{},description:{}},setup(e){return(e,t)=>e.description?(o(),i("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:e.id+"-description","aria-describedby":e.id+"-description"},[l("div",null,O(e.description),1)],8,ya)):x("",!0)}});function Ms(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,10)??""}function fn(e){var l;return null==e||"object"==typeof e||null==(l=pt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,19)??""}function vn(e){return null==e?"":Co(e)}function pn(e,l){var t,a;return G.config.inputValue?G.config.inputValue(e,l):(t=typeof(a="date"===e?Ms(l):"datetime-local"===e?fn(l):"time"===e?vn(l):l),null==a?"":"boolean"==t||"number"==t?""+a:a)}function mn(e,l){e.value=null,St(()=>e.value=l)}function Dt(t){return Object.keys(t).forEach(e=>{var l=t[e];t[e]=nn(l)?W(l):l}),t}function yt(e,l,t){t?(l.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>l.value=e.entering.cls+" "+e.entering.to,0)):(l.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>l.value=e.leaving.cls+" "+e.leaving.to,0))}function hs(t){if(!("u"0":"<"+e+Js(t)+`>${l||""}`}function Js(t){return Object.keys(t).reduce((e,l)=>`${e} ${l}="${Zs(t[l])}"`,"")}function As(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Ht(e){return Vl(e)}let wa=["string","number","boolean","null","undefined"];function Tt(e){return 0<=wa.indexOf(typeof e)||e instanceof Date}function Rt(e){return!Tt(e)}class hn{get length(){return"u"",";"].some(e=>l.includes(e)))throw new Error(`Unsafe script: '${l}'`);var t=Object.assign(Object.keys(globalThis).reduce((e,l)=>(e[l]=void 0,e),{}),e);return new Function("with(this) { return ("+l+") }").call(t)}function Xs(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function cl(e){var l=G.config.storage.getItem(e);return l?JSON.parse(l):null}function Ts(e,l){return zt("swr."+Lo(e),l?Object.assign({},e,l):e)}function ka(e){var l;e.request&&(l=Ts(e.request,e.args),G.config.storage.removeItem(l))}async function gn(e,l,t,a,n){var r,s=Ts(l,a),o=(t(new Xe({response:cl(s)})),await e.api(l,a,n));return o.succeeded&&o.response&&(o.response._date=(new Date).valueOf(),r=JSON.stringify(o.response),G.config.storage.setItem(s,r),t(o)),o}function yn(l,t){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{l(...e)},t||100)}}function Ct(e){return"string"==typeof e?e.split(","):e||[]}function Vt(e,l){let t=Ct(l);return e.reduce((e,l)=>(e[l]=!t.includes(l),e),{})}function bn(){return{LocalStore:hn,dateInputFormat:Ms,dateTimeInputFormat:fn,timeInputFormat:vn,textInputValue:pn,setRef:mn,unRefs:Dt,transition:yt,focusNextElement:hs,getTypeName:Qt,htmlTag:dt,htmlAttrs:Js,linkAttrs:As,toAppUrl:Ht,isPrimitive:Tt,isComplexType:Rt,pushState:ul,scopedExpr:dl,copyText:Xs,fromCache:cl,swrCacheKey:Ts,swrClear:ka,swrApi:gn,asStrings:Ct,asOptions:Vt,createDebounce:yn}}let wn="png,jpg,jpeg,jfif,gif,svg,webp".split(","),kn={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},Jl=Object.keys(kn),vt=(e,l)=>``,gs={img:vt("4 4 16 16",""),vid:vt("0 0 24 24",""),aud:vt("0 0 24 24",""),ppt:vt("0 0 48 48",""),xls:vt("0 0 256 256",""),doc:vt("0 0 32 32",""),zip:vt("0 0 16 16",""),exe:vt("0 0 16 16",""),att:vt("0 0 24 24","")},_a=/[\r\n%#()<>?[\\\]^`{|}]/g,Xl=1024,$a=["Bytes","KB","MB","GB","TB"],Ca=(()=>{let l="application/",e=l+"vnd.openxmlformats-officedocument.",t="image/",a="text/",n="video/",r={jpg:t+"jpeg",tif:t+"tiff",svg:t+"svg+xml",ico:t+"x-icon",ts:a+"typescript",py:a+"x-python",sh:a+"x-sh",mp3:"audio/mpeg3",mpg:n+"mpeg",ogv:n+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:l+"vnd.ms-access"};function s(e,l){e.split(",").forEach(e=>r[e]=l)}function o(e,l){e.split(",").forEach(e=>r[e]=l(e))}return o("jpeg,gif,png,tiff,bmp,webp",e=>t+e),o("jsx,csv,css",e=>a+e),o("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>"audio/"+e),o("3gpp,avi,dv,divx,ogg,mp4,webm",e=>n+e),o("rtf,pdf",e=>l+e),s("htm,html,shtm",a+"html"),s("js,mjs,cjs",a+"javascript"),s("yml,yaml",l+"yaml"),s("bat,cmd",l+"bat"),s("xml,csproj,fsproj,vbproj",a+"xml"),s("txt,ps1",a+"plain"),s("qt,mov",n+"quicktime"),s("doc,dot",l+"msword"),s("xls,xlt,xla",l+"excel"),s("ppt,oit,pps,ppa",l+"vnd.ms-powerpoint"),s("cer,crt,der",l+"x-x509-ca-cert"),s("gz,tgz,zip,rar,lzh,z",l+"x-compressed"),s("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",l+"octet-stream"),r})(),Ys=[];function _n(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+<")).replace(/\s{2,}/g," ")).replace(_a,encodeURIComponent)}function fl(e){return"data:image/svg+xml;utf8,"+_n(e)}function $n(e){var l=URL.createObjectURL(e);return Ys.push(l),l}function Cn(){Ys.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Ys=[]}function vl(e){var l;return e?(l=Vs(e,"?"),At(l,"/")):null}function ls(e){var l=vl(e);return null==l||-1===l.indexOf(".")?null:At(l,".").toLowerCase()}function pl(e){var l=ls(e.name);return l&&0<=wn.indexOf(l)?$n(e):xt(e.name)}function ml(e){var l;return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(l=ls(e))&&0<=wn.indexOf(l))||!1}function xt(e){var l;return e?null==(l=ls(e))||ml(e)?e:Xt(l)||fl(gs.doc):null}function Xt(e){var l=xn(e);return l&&fl(l)||null}function xn(e){if(gs[e])return gs[e];for(let t=0;t({fileName:e.name,contentLength:e.size,filePath:pl(e)}))}function Fs(e,l){e.onerror=null,e.src=gl(e.src,l)||""}function gl(e,l){return Xt(At(e,".").toLowerCase())||(l?Xt(l)||l:null)||Xt("doc")}function el(e){var l;if(e)return l=At(e,".").toLowerCase(),Ca[l]||"application/"+l;throw new Error("fileNameOrExt required")}function La(){return{extSvg:xn,extSrc:Xt,getExt:ls,encodeSvg:_n,canPreview:ml,getFileName:vl,getMimeType:el,formatBytes:hl,filePathUri:xt,svgToDataUri:fl,fileImageUri:pl,objectUrl:$n,flush:Cn,inputFiles:xa,iconOnError:Fs,iconFallbackSrc:gl}}class Va{constructor(e){Le(this,"view"),Le(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}let Nt="/metadata/app.json",Sa={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},Ma={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},tl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},Aa=([...Object.keys(tl),...Object.values(tl)],{String:"string",Boolean:"bool",...tl});function fs(e){return Aa[e]||e}function Ln(e,l){return e?(l=l||[],"Nullable`1"===e?fs(l[0])+"?":e.endsWith("[]")?`List<${fs(e.substring(0,e.length-2))}>`:0===l.length?fs(e):Vs(fs(e),"`")+"<"+l.join(",")+">"):""}function Ta(e){return e&&Ln(e.name,e.genericArgs)}class Ut{constructor(){Le(this,"Query"),Le(this,"QueryInto"),Le(this,"Create"),Le(this,"Update"),Le(this,"Patch"),Le(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}get dataModel(){var e;return null==(e=this.AnyQuery)?void 0:e.dataModel}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){qe.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:qe.isQuery(e)&&!this.Query?this.Query=e:qe.isCreate(e)&&!this.Create?this.Create=e:qe.isUpdate(e)&&!this.Update?this.Update=e:qe.isPatch(e)&&!this.Patch?this.Patch=e:qe.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){let l=new Ut;return e.forEach(e=>{l.add(e)}),l}static forType(t,e){let l,a=new Ut;var n;return G.config.apisResolver&&t&&(n=G.config.apisResolver(t,e))&&(a.Query=n.Query,a.QueryInto=n.QueryInto,a.Create=n.Create,a.Update=n.Update,a.Patch=n.Patch,a.Delete=n.Delete),t&&(null!=(e=e??(null==(l=G.metadata.value)?void 0:l.api))&&e.operations.forEach(e=>{var l;(null==(l=e.dataModel)?void 0:l.name)==t&&a.add(e)})),a}}let qe={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>Ze(e.request.inherits,e=>0<=qe.AnyRead.indexOf(e.name)),isQuery:e=>Ze(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>Ze(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{var l;return null==(l=e.request.implements)?void 0:l.some(e=>0<=qe.AnyWrite.indexOf(e.name))},isCreate:e=>vs(e,qe.Create),isUpdate:e=>vs(e,qe.Update),isPatch:e=>vs(e,qe.Patch),isDelete:e=>vs(e,qe.Delete),model:e=>{var l;return e?Ze(e.inherits,e=>0<=qe.AnyRead.indexOf(e.name))?null==(l=e.inherits)?void 0:l.genericArgs[0]:null==(l=null==(l=e.implements)?void 0:l.find(e=>0<=qe.AnyWrite.indexOf(e.name)))?void 0:l.genericArgs[0]:null}};function Fa(e){var l;return(null==(l=e.input)?void 0:l.type)||Is(yl(e))}function Vn(e){return e.endsWith("?")?Mo(e,1):e}function Is(e){return Sa[Vn(e)]}function Ia(e){return e&&Ma[e]||"String"}function yl(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function sl(e){return e&&"number"==Is(e)||!1}function Sn(e){return e&&"string"==e.toLowerCase()||!1}function ja(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function Mn(e){var l;return!(null==e||!e.type||(l=yl(e),e.isValueType&&-1==l.indexOf("`"))||e.isEnum||null!=Is(e.type))}function An(e){var l;return!!(null!=e&&e.type&&(l=yl(e),e.isValueType&&-1==l.indexOf("`")||e.isEnum||"hidden"==(null==(l=e.input)?void 0:l.type)||"file"==(null==(l=e.input)?void 0:l.type)||"tag"==(null==(l=e.input)?void 0:l.type)||"combobox"==(null==(l=e.input)?void 0:l.type)||null!=Is(e.type)))}function Yt(e,l){let t="string"==typeof e?js(e):e,a=(t||(console.warn("Metadata not found for: "+e),t={request:{name:e}}),function(e){Object.assign(this,e)}),n=(r.prototype.createResponse=function(){return t.returnsVoid?void 0:new a},r.prototype.getTypeName=function(){return t.request.name},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function Oa(e,l,t={}){let a=function(e){Object.assign(this,e)},n=(r.prototype.createResponse=function(){return"function"==typeof t.createResponse?t.createResponse():new a},r.prototype.getTypeName=function(){return e},r.prototype.getMethod=function(){return t.method||"POST"},r);function r(e){Object.assign(this,e)}return new n(l)}function ys(t,e){return t?(Object.keys(t).forEach(e=>{var l=t[e];"string"==typeof l?l.startsWith("/Date")&&(t[e]=Ms(pt(l))):null!=l&&"object"==typeof l&&(Array.isArray(l)?t[e]=Array.from(l):t[e]=Object.assign({},l))}),t):{}}function Da(e,o){let i={};return Array.from(e.elements).forEach(e=>{var r,s=e;if(s.id&&null!=s.value&&""!==s.value){let l=s.id.toLowerCase(),e=o&&o.find(e=>e.name.toLowerCase()==l),t=null==e?void 0:e.type,a=null==(r=null==e?void 0:e.genericArgs)?void 0:r[0],n="checkbox"===s.type?s.checked:s.value;sl(t)?n=Number(n):"List`1"===t&&"string"==typeof n&&(n=n.split(",").map(e=>sl(a)?Number(e):e)),i[s.id]=n}}),i}function bl(e){var l;return(null==(l=null==e?void 0:e.api)?void 0:l.operations)&&0l)?!1:n)){if((t||a)&&(await Yl(t||Nt,a),null!=G.metadata.value))return;var r=Qe("client");if(null!=r&&(l=await r.api(new Va)).succeeded&&es(l.response),null!=G.metadata.value)return;await Yl(Nt)}return G.metadata.value}function rt(l,t){if(G.config.typeResolver){var e=G.config.typeResolver(l,t);if(e)return e}var a,e=null==(e=G.metadata.value)?void 0:e.api;return e&&l?e.types.find(e=>e.name.toLowerCase()===l.toLowerCase()&&(!t||e.namespace==t))||((a=js(l))?a.request:(a=e.operations.find(e=>e.response&&e.response.name.toLowerCase()===l.toLowerCase()&&(!t||e.response.namespace==t)))?a.response:null):null}function js(l){if(G.config.apiResolver){var e=G.config.apiResolver(l);if(e)return e}e=null==(e=G.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===l.toLowerCase()):null}function Ra({dataModel:e}){var l=null==(l=G.metadata.value)?void 0:l.api;if(!l)return[];let t=l.operations;if(e){let l="string"==typeof e?rt(e):e;t=t.filter(e=>Tn(e.dataModel,l))}return t}function kl(e){return e?rt(e.name,e.namespace):null}function Tn(e,l){return e&&l&&e.name===l.name&&(!e.namespace||!l.namespace||e.namespace===l.namespace)}function Ea(e,l){var t=rt(e);return t&&t.properties&&t.properties.find(e=>e.name.toLowerCase()===l.toLowerCase())}function Fn(e){return In(rt(e))}function In(l){if(l&&l.isEnum&&null!=l.enumNames){var t={};for(let e=0;el.push({key:e,value:t[e]})),l}}function za(e,l){t=e.name,a=(null==l?void 0:l.type)||Fa(e)||"text";var t,a,n=Object.assign({id:t,name:t,type:a},l);return e.isEnum&&(n.type="select",n.allowableEntries=_l(jn(e))),n}function Na(l){let r=[];if(l){let a=st(l),e=js(l.name),n=kl(null==e?void 0:e.dataModel);a.forEach(l=>{var e;if(An(l)){let t=za(l,l.input);if(t.id=So(t.id),"file"==t.type&&l.uploadTo&&!t.accept&&(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins.filesUpload)?void 0:e.locations.find(e=>e.name==l.uploadTo))&&!t.accept&&e.allowExtensions&&(t.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),n&&(e=null==(e=n.properties)?void 0:e.find(e=>e.name==l.name),l.ref||(l.ref=null==e?void 0:e.ref)),t.options)try{let e={input:t,$typeFields:a.map(e=>e.name),$dataModelFields:n?st(n).map(e=>e.name):[],...G.config.scopeWhitelist},l=dl(t.options,e);Object.keys(l).forEach(e=>{t[e]=l[e]})}catch{console.error(`failed to evaluate '${t.options}'`)}r.push(t)}})}return r}function $l(e,l){if(!l.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+e];var t=rt(l.type);if(null==t||!t.enumValues)return console.error("Could not find metadata for "+l.type),[""+e];var a=[];for(let r=0;r"number"==typeof e?$l(e,{type:l}):e}function st(e){if(!e)return[];let l=[],t={};for(;e;)e.properties&&e.properties.forEach(e=>{t[e.name]||(t[e.name]=1,l.push(e))}),e=e.inherits?kl(e.inherits):null;return l.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function vs(e,l){var t;return(null==(t=e.request.implements)?void 0:t.some(e=>e.name===l))||!1}function ns(e){return e?Dn(e,st(e)):null}function Dn(e,l){var t=l.find(e=>"id"===e.name.toLowerCase());if(t&&t.isPrimaryKey)return t;t=l.find(e=>e.isPrimaryKey)||t;if(!t){var a=qe.model(e);if(a)return Ze(rt(a),e=>ns(e));console.error("Primary Key not found in "+e.name)}return t||null}function Ua(e,l){return Ze(ns(e),e=>_e(l,e.name))}function Pn(e,l,t){return e&&"none"===e.valueType?"":"%In"===t.key||"%Between"===t.key?`(${t.value})`:qa(l,t.value)}function qa(e,l){return!e||sl(e=Vn(e))||"Boolean"===e?l:ja(e)?`[${l}]`:`'${l}'`}function gt(e,l){return{name:e,value:l}}let Qa=[gt("=","%"),gt("!=","%!"),gt(">=",">%"),gt(">","%>"),gt("<=","%<"),gt("<","<%"),gt("In","%In"),gt("Between","%Between"),{name:"Starts With",value:"%StartsWith",types:"string"},{name:"Contains",value:"%Contains",types:"string"},{name:"Ends With",value:"%EndsWith",types:"string"},{name:"Exists",value:"%IsNotNull",valueType:"none"},{name:"Not Exists",value:"%IsNull",valueType:"none"}];function lt(){var e=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.app)||null}),l=v(()=>{var e;return(null==(e=G.metadata.value)?void 0:e.api)||null}),t=v(()=>{var e;return(null==(e=null==(e=null==(e=G.metadata.value)?void 0:e.plugins)?void 0:e.autoQuery)?void 0:e.viewerConventions)||Qa});return wl(),{loadMetadata:Ha,getMetadata:Pa,setMetadata:es,clearMetadata:Ba,metadataApp:e,metadataApi:l,filterDefinitions:t,typeOf:rt,typeOfRef:kl,typeEquals:Tn,apiOf:js,findApis:Ra,typeName:Ta,typeName2:Ln,property:Ea,enumOptions:Fn,propertyOptions:jn,createFormLayout:Na,typeProperties:st,supportsProp:An,Crud:qe,Apis:Ut,getPrimaryKey:ns,getPrimaryKeyByProps:Dn,getId:Ua,createDto:Yt,makeDto:Oa,toFormValues:ys,formValues:Da,isComplexProp:Mn,asKvps:_l,expandEnumFlags:$l,enumFlagsConverter:On}}let et=class et{static async getOrFetchValue(e,l,t,a,n,r,s){return et.getValue(t,s,n)??(await et.fetchLookupIds(e,l,t,a,n,r,[s]),et.getValue(t,s,n))}static getValue(e,l,t){var a=et.Lookup[e];if(a){a=a[l];if(a)return a[t=t.toLowerCase()]}}static setValue(e,l,t,a){var n=et.Lookup[e]??(et.Lookup[e]={});(n[l]??(n[l]={}))[t=t.toLowerCase()]=a}static setRefValue(e,l){var t,a=_e(l,e.refId);return null==a||null==e.refLabel?null:(t=_e(l,e.refLabel),et.setValue(e.model,a,e.refLabel,t),t)}static async fetchLookupIds(e,l,n,r,s,o,i){var u=l.operations.find(e=>{var l;return qe.isAnyQuery(e)&&(null==(l=e.dataModel)?void 0:l.name)==n});if(u){let a=et.Lookup[n]??(et.Lookup[n]={}),t=[];Object.keys(a).forEach(e=>{var l=a[e];_e(l,s)&&t.push(e)});var d,v=i.filter(e=>!t.includes(e));0!=v.length&&(d=o?null:r+","+s,v={[r+"In"]:v.join(",")},d&&(v.fields=d),d=Yt(u,v),(v=await e.api(d,{jsconfig:"edv,eccn"})).succeeded?(_e(v.response,"results")||[]).forEach(e=>{var l,t;_e(e,r)?(l=""+_e(e,r),t=_e(e,s),s=s.toLowerCase(),(a[l]??(a[l]={}))[s]=""+t):console.error(`result[${r}] == null`,e)}):console.error("Failed to call "+u.request.name))}}},Pt=(Le(et,"Lookup",{}),et),ll=()=>(new Date).getTime(),Ka=["/","T",":","-"],ct={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Za=new Intl.RelativeTimeFormat(ct.locale,{}),en=31536e6,Qs={year:en,month:en/12,day:864e5,hour:36e5,minute:6e4,second:1e3},Lt={currency:Hn,bytes:Rn,link:En,linkTel:zn,linkMailTo:Nn,icon:Un,iconRounded:qn,attachment:Qn,hidden:Kn,time:Zn,relativeTime:xl,relativeTimeFromMs:Os,enumFlags:Gn,formatDate:Kt,formatNumber:Cl};"iconOnError"in globalThis||(globalThis.iconOnError=Fs);class Ke{}function Wa(e){ct=Object.assign({},ct,e)}function Ga(l){Object.keys(l||{}).forEach(e=>{"function"==typeof l[e]&&(Lt[e]=l[e])})}function Bn(){return Lt}function os(e,l){return l?dt("span",e,l):e}function Hn(e,l){var t=ft(l,["currency"]);return os(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==l?void 0:l.currency)||"USD"}).format(e),t)}function Rn(e,l){return os(hl(e),l)}function En(e,l){return dt("a",e,As({...l,href:e}))}function zn(e,l){return dt("a",e,As({...l,href:"tel:"+e}))}function Nn(e,l){var{subject:t,body:a}=l=l||{},n=ft(l,["subject","body"]),r={};return t&&(r.subject=t),a&&(r.body=a),dt("a",e,As({...n,href:"mailto:"+zt(e,r)}))}function Un(e,l){return dt("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function qn(e,l){return dt("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Ht(e),onerror:"iconOnError(this)"},l))}function Qn(e,l){var t=vl(e),a=(null==ls(t)||ml(e)?Ht:gl)(e),a=Ht(a),n=l&&(l["icon-class"]||l.iconClass),a=dt("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},n?{class:n}:null));return dt("a",a+`${t}`,Object.assign({class:"flex",href:Ht(e),title:e},l?ft(l,["icon-class","iconClass"]):null))}function Kn(e){return""}function Zn(e,l){var t="string"==typeof e?new Date(1e3*un(e)):Ss(e)?pt(e):null;return os(t?Ao(t):e,l)}function Kt(e,l){var t,a;return null==e?"":(t="number"==typeof e?new Date(e):"string"==typeof e?pt(e):e,Ss(t)?os(("function"==typeof(a=ct.date?Ds(ct.date):null)?a:To)(t),l):(console.warn(t+" is not a Date value"),null==e?"":""+e))}function Cl(e,l){if("number"!=typeof e)return e;let t=ct.number?Ds(ct.number):null,a="function"==typeof t?t(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,t),a=""+e),os(a,l)}function Wn(l,t,a){var e=Fo(l),n=t?Ds(t):null;if("function"!=typeof n)return(null!=e?Ss(e)?Kt(e,a):"number"==typeof e?Cl(e,a):e:null)??"";{let e=a;if(null!=t&&t.options)try{e=dl(t.options,a)}catch(e){console.error(`Could not evaluate '${t.options}'`,e,", with scope:",a)}return n(l,e)}}function ts(e,l,t){return(Tt(e)?Wn:tr)(e,l,t)}function Ja(e){if(null!=e){if("number"==typeof e)return e;if(Ss(e))return e.getTime()-ll();if("string"==typeof e){var l=Number(e);if(!isNaN(l))return l;if("P"===e[0]||e.startsWith("-P"))return 1e3*un(e)*-1;if(0<=Io(e,Ka))return pt(e).getTime()-ll()}}return NaN}function Os(e,l){for(var t in Qs)if(Math.abs(e)>Qs[t]||"second"===t)return(l||Za).format(Math.round(e/Qs[t]),t)}function xl(e,l){var t=Ja(e);return isNaN(t)?"":Os(t,l)}function Xa(e,l){return Os(e.getTime()-(l?l.getTime():ll()))}function Gn(e,l){return $l(e,l).join(", ")}function Ds(l){if(l){let{method:e,options:a}=l,n=e+`(${a})`,r=Lt[n]||Lt[e];if("function"==typeof r)return r;let s=l.locale||ct.locale;if(e.startsWith("Intl.")){var t=s?`'${s}'`:"undefined",t=`return new ${e}(${t},${a||"undefined"})`;try{let l=Function(t)();return r="Intl.DateTimeFormat"===e?e=>l.format(pt(e)):"Intl.NumberFormat"===e?e=>l.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>xl(e,l):e=>l.format(e),Lt[n]=r}catch(e){console.error("Invalid format: "+t,e)}}else{let t=globalThis[e];if("function"==typeof t){let l=null!=a?Function("return "+a)():void 0;return r=e=>t(e,l,s),Lt[n]=r}console.error(`No '${e}' function exists`,Object.keys(Lt))}}return null}function Jn(e,l){return e?e.length>l?e.substring(0,l)+"...":e:""}function Xn(e){return"/Date("===e.substring(0,6)?Kt(pt(e)):e}function Ya(e){return Ll(qt(e)).replace(/"/g,"")}function Yn(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function Ll(e,l=4){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,l)}function er(e){return"object"!=typeof(e=Yn(e))?"string"==typeof e?e:""+e:Ll(e=qt(e=Object.assign({},e)))}function qt(t){if(null==t)return null;if("string"==typeof t)return Xn(t);if(Tt(t))return t;if(t instanceof Date)return Kt(t);if(Array.isArray(t))return t.map(qt);if("object"!=typeof t)return t;{let l={};return Object.keys(t).forEach(e=>{"__type"!=e&&(l[e]=qt(t[e]))}),l}}function tr(e,l,t){let a=e;if(Array.isArray(e)){if(Tt(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return Kt(a,t);var n=Object.keys(a),r=[];for(let i=0;i${s}: `+Zs(Jn(Xn(o),ct.maxNestedFieldLength)))}return 2t.value.navigate(l.to??"/");return(e,l)=>(o(),i("a",Te({onClick:Ue(a,["prevent"]),title:e.to,href:"javascript:void(0)"},e.$attrs),[U(e.$slots,"default")],16,sr))}});class nr{constructor(){Le(this,"callbacks",{})}register(e,l){this.callbacks[e]=l}has(e){return!!this.callbacks[e]}invoke(e,l){var t=this.callbacks[e];"function"==typeof t&&t(e,l)}}let tt=class tt{static component(e){var l=tt.components[e];if(l)return l;let t=Wl(e),a=Object.keys(tt.components).find(e=>Wl(e)===t);return a&&tt.components[a]||null}},G=(Le(tt,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new hn,tableIcon:{svg:""},scopeWhitelist:{enumFlagsConverter:On,...Bn()}}),Le(tt,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Le(tt,"events",jo()),Le(tt,"user",D(null)),Le(tt,"metadata",D(null)),Le(tt,"components",{RouterLink:lr}),Le(tt,"interceptors",new nr),tt);function or(e){G.config=Object.assign(G.config,e)}function ar(e){G.autoQueryGridDefaults=Object.assign(G.autoQueryGridDefaults,e)}function Vl(e){return e&&G.config.assetsPathResolver?G.config.assetsPathResolver(e):e}function rr(e){return e&&G.config.fallbackPathResolver?G.config.fallbackPathResolver(e):e}function ir(e,l){G.interceptors.register(e,l)}function It(){var e=v(()=>G.config),l=v(()=>G.autoQueryGridDefaults);return{config:e,setConfig:or,events:G.events,autoQueryGridDefaults:l,setAutoQueryGridDefaults:ar,assetsPathResolver:Vl,fallbackPathResolver:rr,registerInterceptor:ir}}let eo=de({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(n,{attrs:r}){return()=>{let e=n.image;var l,t;n.type&&(t=lt().typeOf,(t=t(n.type))||console.warn(`Type ${n.type} does not exist`),null!=t&&t.icon?e=null==t?void 0:t.icon:console.warn(`Type ${n.type} does not have a [Svg] icon`));let a=n.svg||(null==e?void 0:e.svg)||"";return a.startsWith("").indexOf("class="),l=`${(null==e?void 0:e.cls)||""} `+(r.class||""),a=-1==t?`Fs(e.target)})}}}),ur={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},dr={class:"flex"},cr=l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),fr=l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),vr=[cr,fr],pr=de({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(e){return(e,t)=>(o(),i("div",ur,[l("div",dr,[(o(),i("svg",{class:h(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",e.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vr,2)),l("span",null,[U(e.$slots,"default")])])]))}}),mr=["href","onClick"],hr=["type"],tn="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",gr=de({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(tn),href:t.href,onClick:e},[U(t.$slots,"default")],8,mr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:tn},t.$attrs),[U(t.$slots,"default")],16,hr))}}}),yr=["href","onClick"],br=["type"],wr=de({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(e){let t=e,a={blue:"focus:ring-indigo-500 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"focus:ring-indigo-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-500 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-500 bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-500 bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-indigo-500 bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},n=v(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black text-white "+(a[t.color]||a.indigo));return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{class:h(n.value),href:t.href,onClick:e},[U(t.$slots,"default")],10,yr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type,class:n.value},t.$attrs),[U(t.$slots,"default")],16,br))}}}),kr=["type","href","onClick"],_r=["type"],sn="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black",$r=de({__name:"SecondaryButton",props:{type:{},href:{}},setup(e){return(t,e)=>{var a=K("router-link");return t.href?(o(),ae(a,{key:0,to:t.href},{default:xe(({navigate:e})=>[l("button",{type:t.type??"button",class:h(sn),href:t.href,onClick:e},[U(t.$slots,"default")],8,kr)]),_:3},8,["to"])):(o(),i("button",Te({key:1,type:t.type??"button",class:sn},t.$attrs),[U(t.$slots,"default")],16,_r))}}});function Ge(e,l){return Array.isArray(e)?0<=e.indexOf(l):e==l||e.includes(l)}let Cs={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},ot={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},Jt={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},Bt={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},nl={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ee={panelClass(e="slideOver"){return("card"==e?Jt:Bt).panelClass},formClass(e="slideOver"){return("card"==e?Jt:Bt).formClass},headingClass(e="slideOver"){return("card"==e?Jt:Bt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?Jt:Bt).subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},he={getGridClass(e=0){return he.gridClass},getGrid2Class(e="stripedRows"){return Ge(e,"fullWidth")?"overflow-x-auto":he.grid2Class},getGrid3Class(e="stripedRows"){return Ge(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":he.grid3Class},getGrid4Class(e="stripedRows"){return Ge(e,"whiteBackground")?"":Ge(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":he.grid4Class},getTableClass(e="stripedRows"){return Ge(e,"fullWidth")||Ge(e,"verticalLines")?"min-w-full divide-y divide-gray-300":he.tableClass},getTheadClass(e="stripedRows"){return Ge(e,"whiteBackground")?"":he.theadClass},getTheadRowClass(e="stripedRows"){return he.theadRowClass+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return he.theadCellClass+(Ge(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(Ge(e,"whiteBackground")||Ge(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":he.tableClass)+(Ge(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",l,t,a){return(a?"cursor-pointer ":"")+(t?"bg-indigo-100 dark:bg-blue-800":(a?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!Ge(e,"stripedRows")||l%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(Ge(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},Cr={colspans:"col-span-3 sm:col-span-3"},fh=Object.freeze(Object.defineProperty({__proto__:null,a:Cs,card:Jt,dummy:Cr,form:Ee,grid:he,input:ot,modal:nl,slideOver:Bt},Symbol.toStringTag,{value:"Module"})),xr=de({__name:"TextLink",props:{color:{default:"blue"}},setup(e){let l=yo(),t=e,a=v(()=>(Cs[t.color]||Cs.blue)+(l.href?"":" cursor-pointer"));return(e,l)=>(o(),i("a",{class:h(a.value)},[U(e.$slots,"default")],2))}}),Lr={class:"flex","aria-label":"Breadcrumb"},Vr={role:"list",class:"flex items-center space-x-4"},Sr=["href","title"],Mr=l("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),Ar={class:"sr-only"},Tr=de({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(e){return(e,t)=>(o(),i("nav",Lr,[l("ol",Vr,[l("li",null,[l("div",null,[l("a",{href:e.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:e.homeLabel},[Mr,l("span",Ar,O(e.homeLabel),1)],8,Sr)])]),U(e.$slots,"default")])]))}}),Fr={class:"flex items-center"},Ir=l("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),jr=["href","title"],Or=["title"],Dr=de({__name:"Breadcrumb",props:{href:{},title:{}},setup(e){return(e,t)=>(o(),i("li",null,[l("div",Fr,[Ir,e.href?(o(),i("a",{key:0,href:e.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:e.title},[U(e.$slots,"default")],8,jr)):(o(),i("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:e.title},[U(e.$slots,"default")],8,Or))])]))}}),Pr={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},Br={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Hr=de({__name:"NavList",props:{title:{}},setup(e){return(e,t)=>(o(),i("div",null,[e.title?(o(),i("h2",Pr,O(e.title),1)):x("",!0),l("ul",Br,[U(e.$slots,"default")])]))}}),Rr={class:"relative flex items-start space-x-4 py-6"},Er={class:"flex-shrink-0"},zr={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Nr={class:"min-w-0 flex-1"},Ur={class:"text-base font-medium text-gray-900 dark:text-gray-100"},qr={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Qr=["href"],Kr=l("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Zr={class:"text-base text-gray-500"},Wr=l("div",{class:"flex-shrink-0 self-center"},[l("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),Gr=de({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(e){return(e,t)=>{var a=K("Icon");return o(),i("li",Rr,[l("div",Er,[l("span",zr,[ye(a,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:e.icon,src:e.iconSrc,svg:e.iconSvg,alt:e.iconAlt},null,8,["image","src","svg","alt"])])]),l("div",Nr,[l("h3",Ur,[l("span",qr,[l("a",{href:e.href,class:"focus:outline-none"},[Kr,ke(" "+O(e.title),1)],8,Qr)])]),l("p",Zr,[U(e.$slots,"default")])]),Wr])}}});function to(e){return e&&e.SessionId?Oo(e):e}function Jr(e){G.user.value=to(e),G.events.publish("signIn",e)}function Xr(){G.user.value=null,G.events.publish("signOut",null)}let Sl=e=>(null==e?void 0:e.roles)||[],Ml=e=>(null==e?void 0:e.permissions)||[];function so(e){return 0<=Sl(G.user.value).indexOf(e)}function Yr(e){return 0<=Ml(G.user.value).indexOf(e)}function Al(){return so("Admin")}function bs(e){if(!e)return!1;if(!e.requiresAuth)return!0;var l=G.user.value;if(!l)return!1;if(Al())return!0;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!n.every(e=>0<=t.indexOf(e))||00<=t.indexOf(e))||!r.every(e=>0<=a.indexOf(e))||00<=a.indexOf(e)))}function ei(e){if(!e||!e.requiresAuth)return null;var l=G.user.value;if(!l)return`${e.request.name} requires Authentication`;if(Al())return null;let[t,a]=[Sl(l),Ml(l)],[n,r,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=n.filter(e=>t.indexOf(e)<0);return 0""+e+"").join(", ")} Role`+(1a.indexOf(e)<0)).length?`Requires ${l.map(e=>""+e+"").join(", ")} Permission`+(10<=t.indexOf(e))?`Requires any ${s.filter(e=>t.indexOf(e)<0).map(e=>""+e+"").join(", ")} Role`+(10<=a.indexOf(e))?`Requires any ${o.filter(e=>a.indexOf(e)<0).map(e=>""+e+"").join(", ")} Permission`+(1G.user.value||null),toAuth:to,isAuthenticated:v(()=>null!=G.user.value),hasRole:so,hasPermission:Yr,isAdmin:Al,canAccess:bs,invalidAccessMessage:ei}}let ti={key:0},si={class:"md:p-4"},lo=de({__name:"EnsureAccess",props:{invalidAccess:{},alertClass:{}},emits:["done"],setup(e){let r=Tl().isAuthenticated,t=It().config,s=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},u=()=>{var e=location.href.substring(location.origin.length)||"/",e=zt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var a=K("Alert"),n=K("SecondaryButton");return e.invalidAccess?(o(),i("div",ti,[ye(a,{class:h(e.alertClass),innerHTML:e.invalidAccess},null,8,["class","innerHTML"]),l("div",si,[W(r)?(o(),ae(n,{key:1,onClick:u},{default:xe(()=>[ke("Sign Out")]),_:1})):(o(),ae(n,{key:0,onClick:s},{default:xe(()=>[ke("Sign In")]),_:1}))])])):x("",!0)}}}),li={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ni={class:"p-4"},oi=l("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),ai={class:"flex w-full justify-center"},ri=l("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[l("g",{fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),l("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),ii=l("span",null,"ASC",-1),ui=[ri,ii],di=xs('DESC',2),ci=[di],fi=l("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),vi={key:0},pi=["id","value"],mi=["for"],hi={key:1},gi={class:"mb-2"},yi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},bi=["onClick"],wi=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ki=[wi],_i={class:"flex"},$i=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1),Ci=[$i],xi={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Fl=de({__name:"FilterColumn",props:{definitions:{},column:{},topLeft:{}},emits:["done","save"],setup(e,{emit:t}){let u=e,a=t,d=D(),c=D(""),p=D(""),f=D([]),m=v(()=>1==u.column.meta.isEnum),s=v(()=>rt("Nullable`1"===u.column.meta.type?u.column.meta.genericArgs[0]:u.column.meta.type)),g=v(()=>1==u.column.meta.isEnum?_l(Fn(s.value.name)):[]),y=v(()=>{var e;return(null==(e=n(u.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),b=D({filters:[]}),w=v(()=>b.value.filters);function n(e){let l=u.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)}function k(e,l){return n(e).find(e=>e.value===l)}function C(){var e;c.value&&(e=null==(e=k(u.column.type,c.value))?void 0:e.name)&&(b.value.filters.push({key:c.value,name:e,value:p.value}),c.value=p.value="")}function L(){a("done")}function M(){var e;c.value="%",null!=(e=d.value)&&e.focus()}function V(){var e,l;p.value&&C(),m.value&&(l=Object.values(f.value).filter(e=>e),b.value.filters=0parseInt(e)).reduce((e,l)=>e+l,0).toString()}]:[{key:"%In",name:"In",value:l.join(",")}]:[]),a("save",b.value),a("done")}function S(e){b.value.sort=e===b.value.sort?void 0:e,St(V)}return ws(()=>b.value=Object.assign({},u.column.settings,{filters:Array.from(u.column.settings.filters)})),ws(()=>{let e,l,t,a,n,r=(null==(t=null==(l=null==(e=u.column.settings.filters)?void 0:e[0])?void 0:l.value)?void 0:t.split(","))||[];if(00<(l&parseInt(e))))||[]}f.value=r}),(a,t)=>{var e=K("SelectInput"),n=K("TextInput"),r=K("PrimaryButton"),s=K("SecondaryButton");return o(),i("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:L,onVnodeMounted:M},[l("div",{class:"absolute",style:ol(`top:${a.topLeft.y}px;left:${a.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[l("div",li,[l("div",ni,[oi,l("div",ai,[l("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>S("ASC")),class:h(`${"ASC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ui,2),l("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>S("DESC")),class:h(`${"DESC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},ci,2)]),fi,m.value?(o(),i("div",vi,[(o(!0),i(Me,null,je(g.value,e=>(o(),i("div",{key:e.key,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>f.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,pi),[[al,f.value]]),l("label",{for:e.key,class:"ml-3"},O(e.value),9,mi)]))),128))])):(o(),i("div",hi,[(o(!0),i(Me,null,je(w.value,(e,t)=>(o(),i("div",gi,[l("span",yi,[ke(O(a.column.name)+" "+O(e.name)+" "+O((e=e,Pn(k(u.column.type,e.key),u.column.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;l=t,b.value.filters.splice(l,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},ki,8,bi)])]))),256)),l("div",_i,[ye(e,{id:"filterRule",class:"w-32 mr-1",modelValue:c.value,"onUpdate:modelValue":t[3]||(t[3]=e=>c.value=e),entries:y.value,label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(e=k(a.column.type,c.value))?void 0:e.valueType)?(o(),ae(n,{key:0,ref_key:"txtFilter",ref:d,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:p.value,"onUpdate:modelValue":t[4]||(t[4]=e=>p.value=e),onKeyup:on(C,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):x("",!0),l("div",{class:"pt-1"},[l("button",{type:"button",onClick:C,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ci)])])]))]),l("div",xi,[ye(r,{onClick:V,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(s,{onClick:L},{default:xe(()=>[ke(" Cancel ")]),_:1})])])],4)],512)}}}),Li={class:"px-4 sm:px-6 lg:px-8 text-sm"},Vi={class:"flex flex-wrap"},Si={class:"group pr-4 sm:pr-6 lg:pr-8"},Mi={class:"flex justify-between w-full font-medium"},Ai={class:"w-6 flex justify-end"},Ti={class:"hidden group-hover:inline"},Fi=["onClick","title"],Ii=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ji=[Ii],Oi={key:0,class:"pt-2"},Di={class:"ml-2"},Pi={key:1},Bi={class:"pt-2"},Hi={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Ri=["onClick"],Ei=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),zi=[Ei],Ni=l("span",null,"Clear All",-1),Ui=[Ni],Il=de({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let a=e,r=t,n=v(()=>a.columns.filter(e=>0{let l=a.definitions;return l=Sn(e)?l:l.filter(e=>"string"!==e.types)})(e).find(e=>e.value===l)}function u(){a.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(o(),i("div",Li,[l("div",Vi,[(o(!0),i(Me,null,je(n.value,n=>{return o(),i("fieldset",Si,[l("legend",Mi,[l("span",null,O(W(Pe)(n.name)),1),l("span",Ai,[l("span",Ti,[l("button",{onClick:e=>{var l;(l=n).settings.filters=[],r("change",l)},title:`Clear all ${W(Pe)(n.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},ji,8,Fi)])])]),n.meta.isEnum?(o(),i("div",Oi,[(o(!0),i(Me,null,je((e=n.settings.filters,null==(t=null==(t=null==e?void 0:e[0])?void 0:t.value)?void 0:t.split(",")),e=>(o(),i("div",{key:e,class:"flex items-center"},[l("label",Di,O(e),1)]))),128))])):(o(),i("div",Pi,[(o(!0),i(Me,null,je(n.settings.filters,(e,t)=>{return o(),i("div",Bi,[l("span",Hi,[ke(O(n.name)+" "+O(e.name)+" "+O((e=e,Pn(s((a=n).type,e.value),a.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;(l=n).settings.filters.splice(t,1),r("change",l)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},zi,8,Ri)])]);var a}),256))]))]);var e,t}),256))]),l("div",{class:"flex justify-center pt-4"},[l("button",{type:"button",onClick:u,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ui)])]))}}),qi={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qi={class:""},Ki={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Zi=l("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Wi={class:"mt-4"},Gi=["for"],Ji=["id"],Xi=["value","selected"],Yi={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},eu=["id","checked"],tu=["for"],su={class:"mt-4"},lu={class:"pb-2 px-4"},nu={class:""},ou=["id","value"],au=["for"],ru={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},jl=de({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:{},prefs:{},maxLimit:{}},emits:["done","save"],setup(e,{emit:t}){let a=It().autoQueryGridDefaults,s=e,n=t,u=D({}),d=(ws(()=>u.value=Object.assign({take:a.value.take,selectedColumns:[]},s.prefs)),[10,25,50,100,250,500,1e3]);function v(){n("done")}function c(){n("save",u.value)}return(e,t)=>{let a=K("PrimaryButton"),n=K("SecondaryButton"),r=K("ModalDialog");return o(),ae(r,{id:e.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:xe(()=>[l("div",qi,[l("div",Qi,[l("div",Ki,[Zi,l("div",Wi,[l("label",{for:e.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,Gi),Mt(l("select",{id:e.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>u.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(o(!0),i(Me,null,je(d.filter(e=>null==s.maxLimit||e<=s.maxLimit),e=>(o(),i("option",{value:e,selected:e===u.value.take},O(e),9,Xi))),256))],8,Ji),[[bo,u.value.take]])]),l("div",Yi,[l("input",{type:"radio",id:e.id+"-allColumns",onClick:t[1]||(t[1]=e=>u.value.selectedColumns=[]),checked:0===u.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,eu),l("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:e.id+"-allColumns"},"View all columns",8,tu)]),l("div",su,[l("div",lu,[l("div",nu,[(o(!0),i(Me,null,je(e.columns,e=>(o(),i("div",{key:e.name,class:"flex items-center"},[Mt(l("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,ou),[[al,u.value.selectedColumns]]),l("label",{for:e.name,class:"ml-3"},O(e.name),9,au)]))),128))])])])])])]),l("div",ru,[ye(a,{onClick:c,color:"red",class:"ml-2"},{default:xe(()=>[ke(" Save ")]),_:1}),ye(n,{onClick:v},{default:xe(()=>[ke(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),iu={key:0},uu={key:1},du={key:2,class:"pt-1"},cu={key:0},fu={key:1},vu={key:2},pu={key:4},mu={class:"pl-1 pt-1 flex flex-wrap"},hu={class:"flex mt-1"},gu=["title"],yu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),bu=[yu],wu=["disabled"],ku=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),_u=[ku],$u=["disabled"],Cu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),xu=[Cu],Lu=["disabled"],Vu=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Su=[Vu],Mu=["disabled"],Au=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Tu=[Au],Fu={key:0,class:"flex mt-1"},Iu={class:"px-4 text-lg text-black dark:text-white"},ju={key:0},Ou={key:1},Du=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Pu={key:2},Bu={class:"flex flex-wrap"},Hu={key:0,class:"pl-2 mt-1"},Ru=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001 0 0 0 14.868 3"})],-1),Eu=[Ru],zu={key:1,class:"pl-2 mt-1"},Nu=xs('Excel',2),Uu=[Nu],qu={key:2,class:"pl-2 mt-1"},Qu={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Ku=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Zu=[Ku],Wu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Gu=l("g",{fill:"none"},[l("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Ju=[Gu],Xu=l("span",{class:"whitespace-nowrap"},"Copy URL",-1),Yu={key:3,class:"pl-2 mt-1"},ed=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),td=[ed],sd={key:4,class:"pl-2 mt-1"},ld=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),nd={class:"mr-1"},od={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ad=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),rd=[ad],id={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ud=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),dd=[ud],cd={key:5,class:"pl-2 mt-1"},fd=["title"],vd=l("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),pd={class:"whitespace-nowrap"},md={key:8},hd={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gd={class:"mr-1 select-none"},yd={key:1,class:"flex justify-between items-center"},bd={class:"mr-1 select-none"},ps=25,wd=de({__name:"AutoQueryGrid",props:{filterDefinitions:{},id:{default:"AutoQueryGrid"},apis:{},type:{},prefs:{},deny:{},hide:{},selectedColumns:{},toolbarButtonClass:{},tableStyle:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{},modelTitle:{},newButtonLabel:{},apiPrefs:{},canFilter:{},disableKeyBindings:{},configureField:{},skip:{default:0},create:{type:Boolean},edit:{},filters:{}},emits:["headerSelected","rowSelected","nav"],setup(e,{expose:d,emit:c}){let{config:p,autoQueryGridDefaults:X}=It(),Y=X,t=p.value.storage,n=e,ee=c,le=Qe("client"),te="filtering,queryString,queryFilters".split(","),ne="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","),re=v(()=>n.deny?Vt(te,n.deny):Vt(te,Y.value.deny)),se=v(()=>n.hide?Vt(ne,n.hide):Vt(ne,Y.value.hide));function f(e){return re.value[e]}function m(e){return se.value[e]}let g=v(()=>n.tableStyle??Y.value.tableStyle),oe=v(()=>n.gridClass??he.getGridClass(g.value)),ie=v(()=>n.grid2Class??he.getGrid2Class(g.value)),ue=v(()=>n.grid3Class??he.getGrid3Class(g.value)),de=v(()=>n.grid4Class??he.getGrid4Class(g.value)),ve=v(()=>n.tableClass??he.getTableClass(g.value)),ce=v(()=>n.theadClass??he.getTheadClass(g.value)),pe=v(()=>n.theadRowClass??he.getTheadRowClass(g.value)),fe=v(()=>n.theadCellClass??he.getTheadCellClass(g.value)),y=v(()=>n.toolbarButtonClass??he.toolbarButtonClass);function me(e,l){var t,a;return n.rowClass?n.rowClass(e,l):(t=!!Q.value.AnyUpdate,a=(null!=(a=s.value)&&a.name?_e(e,s.value.name):null)==V.value,he.getTableRowClass(n.tableStyle,l,a,t))}let b=Ls(),ge=v(()=>{var e;return il((null==(e=Q.value.AnyQuery.viewModel)?void 0:e.name)||Q.value.AnyQuery.dataModel.name)}),be=v(()=>{let l=Object.keys(b).map(e=>e.toLowerCase());return st(ge.value).filter(e=>l.includes(e.name.toLowerCase())||l.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});let w=v(()=>{var e=(0<(e=Ct(n.selectedColumns)).length?e:0e.toLowerCase());let t=st(ge.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),we=v(()=>{let e=w.value.map(e=>e.name),l=Ct(j.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),k=D([]),C=D(new Xe),Ce=D(new Xe),L=D(),M=D(!1),V=D(),S=D(),T=D(!1),A=D(),F=D(n.skip),I=D(!1),j=D({take:ps}),$=D(!1),Le=v(()=>k.value.some(e=>0k.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Ve=v(()=>{var e;return st(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),s=v(()=>{var e;return ns(il(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)))}),B=v(()=>j.value.take??ps),E=v(()=>C.value.response?_e(C.value.response,"results"):[]),_=v(()=>{var e;return((null==(e=C.value.response)?void 0:e.total)||E.value.length)??0}),Se=v(()=>00E.value.length>=B.value),De=v(()=>E.value.length>=B.value),P=D(),H=D(),Ae={NoQuery:"No Query API was found"};function Fe(l){if(l){if(n.canFilter)return n.canFilter(l);var e=Ve.value.find(e=>e.name.toLowerCase()==l.toLowerCase());if(e)return!Mn(e)}}function r(e){ee("nav",e),f("queryString")&&ul(e)}async function R(e){F.value+=e,F.value<0&&(F.value=0);var l=Math.floor(_.value/B.value)*B.value;F.value>l&&(F.value=l),r({skip:F.value||void 0}),await z()}async function Ie(e,l){var t,a;S.value=null,V.value=l,e&&l&&(a=Yt(Q.value.AnyQuery,{[e]:l}),(a=await le.api(a)).succeeded)&&((a=null==(a=_e(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(t=Q.value.AnyQuery)?void 0:t.request.name}(${e}:${l}) returned no results`),S.value=a)}async function $e(e,l){ee("rowSelected",e,l);var t=null==(t=s.value)?void 0:t.name,a=t?_e(e,t):null;t&&a&&(r({edit:a}),Ie(t,a))}function Ue(l,e){var t,a,n;f("filtering")&&(t=e.target,Fe(l)&&"TD"!==(null==t?void 0:t.tagName)&&(t=null==(t=null==t?void 0:t.closest("TABLE"))?void 0:t.getBoundingClientRect(),a=k.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&t&&(n=t.x+318+10,A.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),n),y:t.y+45}}),ee("headerSelected",l,e))}function Ee(){A.value=null}async function Pe(e){var l=null==(l=A.value)?void 0:l.column;l&&(l.settings=e,t.setItem(u(l.name),JSON.stringify(l.settings)),await z()),A.value=null}async function He(e){t.setItem(u(e.name),JSON.stringify(e.settings)),await z()}async function Re(e){T.value=!1,j.value=e,t.setItem(sl(),JSON.stringify(e)),await z()}function ze(e){var l;P.value&&(Object.assign(null==(l=P.value)?void 0:l.model,e),Ke())}function Ne(e){Object.assign(S.value,e),Ke()}function Ke(){null!=(e=P.value)&&e.forceUpdate(),null!=(e=H.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function z(){await qe(Ze())}async function Ge(){await z()}d({update:z,search:qe,createRequestArgs:Ze,reset:Cl,createDone:J,createSave:kl,editDone:Z,editSave:wl,forceUpdate:Ke,setEdit:Ne,edit:S,createForm:P,editForm:H,apiPrefs:j,results:E,skip:F,take:B,total:_}),G.interceptors.has("AutoQueryGrid.new")&&G.interceptors.invoke("AutoQueryGrid.new",{props:n});let We=/iPad|iPhone|iPod/.test(navigator.userAgent);async function qe(t){var a=Q.value.AnyQuery;if(a){let e=Yt(a,t),l=await le.api(e);dn(e=>{C.value.response=C.value.error=void 0,$.value=e,We?St(()=>C.value=l):C.value=l})();a=_e(l.response,"results")||[];l.succeeded&&a.label}else console.error(Ae.NoQuery)}function Ze(){let r={include:"total",take:B.value},l=Ct(j.value.selectedColumns||n.selectedColumns);if(0{var e,l=a.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&n.push(l.ref.selfId),_e(b,t)&&n.push(...a.filter(e=>{var l;return(null==(l=null==(l=e.ref)?void 0:l.selfId)?void 0:l.toLowerCase())==t.toLowerCase()}).map(e=>e.name))}),n.forEach(e=>{l.includes(e)||l.push(e)}),r.fields=l.join(",")}let e=[];if(k.value.forEach(t=>{t.settings.sort&&e.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);r[l]=e.value})}),n.filters&&Object.keys(n.filters).forEach(e=>{r[e]=n.filters[e]}),f("queryString")&&f("queryFilters")){var t=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):"");let e=Ws(t);Object.keys(e).forEach(l=>{w.value.find(e=>e.name.toLowerCase()===l.toLowerCase())&&(r[l]=e[l])}),typeof e.skip<"u"&&(t=parseInt(e.skip),isNaN(t)||(F.value=r.skip=t))}return"u"I.value=!1,3e3)}function ll(e="json"){var l=Ze(),t="/api/"+(null==(t=Q.value.AnyQuery)?void 0:t.request.name),t=Do(le.baseUrl,zt(t,{...l,jsconfig:"edv"}));return 0<=t.indexOf("?")?Vs(t,"?")+"."+e+"?"+ms(t,"?"):t+".json"}async function tl(){k.value.forEach(e=>{e.settings={filters:[]},t.removeItem(u(e.name))}),j.value={take:ps},t.removeItem(sl()),await z()}function al(){M.value=!0,r({create:null})}let a=v(()=>Qt(n.type)),N=v(()=>{var e;return a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name)}),q=v(()=>n.modelTitle||N.value),nl=v(()=>n.newButtonLabel||"New "+q.value),sl=()=>{var e;return n.id+"/ApiPrefs/"+(a.value||(null==(e=Q.value.AnyQuery)?void 0:e.dataModel.name))},u=e=>{var l;return`Column/${n.id}:${a.value||(null==(l=Q.value.AnyQuery)?void 0:l.dataModel.name)}.`+e},{metadataApi:ol,typeOf:il,apiOf:dl,filterDefinitions:vl}=lt(),cl=Tl().invalidAccessMessage,pl=v(()=>n.filterDefinitions||vl.value),Q=v(()=>{var e=Ct(n.apis);return 0dl(e)).filter(e=>null!=e).map(e=>e)):Ut.forType(a.value,ol.value)}),fl=e=>`${e}`,ml=v(()=>{var e;return ol.value?0<(e=Ct(n.apis).map(e=>null==dl(e)?e:null).filter(e=>null!=e)).length?fl(`Unknown API${1useMetadata()`)}),gl=v(()=>Q.value.AnyQuery&&cl(Q.value.AnyQuery)),hl=v(()=>Q.value.Create&&cl(Q.value.Create)),yl=v(()=>Q.value.AnyUpdate&&cl(Q.value.AnyUpdate)),bl=v(()=>bs(Q.value.Create)),xl=(v(()=>bs(Q.value.AnyUpdate)),v(()=>bs(Q.value.Delete)));function Z(){S.value=null,V.value=null,r({edit:void 0})}function J(){M.value=!1,r({create:void 0})}async function wl(){await z(),Z()}async function kl(){await z(),J()}function Cl(){C.value=new Xe,Ce.value=new Xe,M.value=!1,V.value=null,S.value=null,T.value=!1,A.value=null,F.value=n.skip,I.value=!1,j.value={take:ps},$.value=!1;var e,l=n.prefs||$s(t.getItem(sl())),l=(l&&(j.value=l),k.value=w.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(t.getItem(u(e.name))))})),isNaN(n.skip)||(F.value=n.skip),null==(l=s.value)?void 0:l.name);f("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),typeof(e=Ws(e)).create<"u"?M.value=typeof e.create<"u":!l||"string"!=typeof e.edit&&"number"!=typeof e.edit||Ie(l,e.edit)),!0===n.create&&(M.value=!0),l&&null!=n.edit&&Ie(l,n.edit)}return Ye(async()=>{Cl(),await z()}),(t,e)=>{let a=K("Alert"),n=K("EnsureAccessDialog"),r=K("AutoCreateForm"),s=K("AutoEditForm"),u=K("AutoViewForm"),d=K("ErrorSummary"),v=K("Loading"),c=K("SettingsIcons"),p=K("DataGrid");return ml.value?(o(),i("div",iu,[ye(a,{innerHTML:ml.value},null,8,["innerHTML"])])):gl.value?(o(),i("div",uu,[ye(lo,{"invalid-access":gl.value},null,8,["invalid-access"])])):(o(),i("div",du,[m("forms")&&M.value&&Q.value.Create?(o(),i("div",cu,[hl.value?(o(),ae(n,{key:0,title:"Create "+q.value,"invalid-access":hl.value,"alert-class":"text-yellow-700",onDone:J},null,8,["title","invalid-access"])):W(b).createform?U(t.$slots,"createform",{key:1,type:Q.value.Create.request.name,configure:t.configureField,done:J,save:kl}):(o(),ae(r,{key:2,ref_key:"createForm",ref:P,type:Q.value.Create.request.name,configure:t.configureField,onDone:J,onSave:kl},{header:xe(()=>[U(t.$slots,"formheader",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"create",formInstance:P.value,apis:Q.value,type:N.value,updateModel:ze})]),_:3},8,["type","configure"]))])):m("forms")&&S.value&&Q.value.AnyUpdate?(o(),i("div",fu,[yl.value?(o(),ae(n,{key:0,title:"Update "+q.value,"invalid-access":yl.value,"alert-class":"text-yellow-700",onDone:Z},null,8,["title","invalid-access"])):W(b).editform?U(t.$slots,"editform",{key:1,model:S.value,type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,done:Z,save:wl}):(o(),ae(s,{key:2,ref_key:"editForm",ref:H,modelValue:S.value,"onUpdate:modelValue":e[0]||(e[0]=e=>S.value=e),type:Q.value.AnyUpdate.request.name,deleteType:xl.value?Q.value.Delete.request.name:null,configure:t.configureField,onDone:Z,onSave:wl,onDelete:wl},{header:xe(()=>[U(t.$slots,"formheader",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),footer:xe(()=>[U(t.$slots,"formfooter",{form:"edit",formInstance:H.value,apis:Q.value,type:N.value,model:S.value,id:V.value,updateModel:Ne})]),_:3},8,["modelValue","type","deleteType","configure"]))])):m("forms")&&S.value?(o(),i("div",vu,[W(b).viewform?U(t.$slots,"viewform",{key:0,model:S.value,apis:Q.value,done:Z}):(o(),ae(u,{key:1,model:S.value,apis:Q.value,done:Z},null,8,["model","apis"]))])):x("",!0),W(b).toolbar?U(t.$slots,"toolbar",{key:3}):m("toolbar")?(o(),i("div",pu,[T.value?(o(),ae(jl,{key:0,columns:w.value,prefs:j.value,onDone:e[1]||(e[1]=e=>T.value=!1),onSave:Re},null,8,["columns","prefs"])):x("",!0),l("div",mu,[l("div",hu,[m("preferences")?(o(),i("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:q.value+" Preferences",onClick:e[2]||(e[2]=e=>T.value=!T.value)},bu,8,gu)):x("",!0),m("pagingNav")?(o(),i("button",{key:1,type:"button",class:h(["pl-2",Se.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!Se.value,onClick:e[3]||(e[3]=e=>R(-_.value))},_u,10,wu)):x("",!0),m("pagingNav")?(o(),i("button",{key:2,type:"button",class:h(["pl-2",Oe.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!Oe.value,onClick:e[4]||(e[4]=e=>R(-B.value))},xu,10,$u)):x("",!0),m("pagingNav")?(o(),i("button",{key:3,type:"button",class:h(["pl-2",Te.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!Te.value,onClick:e[5]||(e[5]=e=>R(B.value))},Su,10,Lu)):x("",!0),m("pagingNav")?(o(),i("button",{key:4,type:"button",class:h(["pl-2",De.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!De.value,onClick:e[6]||(e[6]=e=>R(_.value))},Tu,10,Mu)):x("",!0)]),m("pagingInfo")?(o(),i("div",Fu,[l("div",Iu,[$.value?(o(),i("span",ju,"Querying...")):x("",!0),E.value.length?(o(),i("span",Ou,[Du,ke(" "+O(F.value+1)+" - "+O(Math.min(F.value+E.value.length,_.value))+" ",1),l("span",null," of "+O(_.value),1)])):C.value.completed?(o(),i("span",Pu,"No Results")):x("",!0)])])):x("",!0),l("div",Bu,[m("refresh")?(o(),i("div",Hu,[l("button",{type:"button",onClick:Ge,title:"Refresh",class:h(y.value)},Eu,2)])):x("",!0),m("downloadCsv")?(o(),i("div",zu,[l("button",{type:"button",onClick:Je,title:"Download CSV",class:h(y.value)},Uu,2)])):x("",!0),m("copyApiUrl")?(o(),i("div",qu,[l("button",{type:"button",onClick:el,title:"Copy API URL",class:h(y.value)},[I.value?(o(),i("svg",Qu,Zu)):(o(),i("svg",Wu,Ju)),Xu],2)])):x("",!0),Le.value&&m("resetPreferences")?(o(),i("div",Yu,[l("button",{type:"button",onClick:tl,title:"Reset Preferences & Filters",class:h(y.value)},td,2)])):x("",!0),m("filtersView")&&0L.value="filters"==L.value?null:"filters"),class:h(y.value),"aria-expanded":"false"},[ld,l("span",nd,O(Me.value)+" "+O(1==Me.value?"Filter":"Filters"),1),"filters"!=L.value?(o(),i("svg",od,rd)):(o(),i("svg",id,dd))],2)])):x("",!0),m("newItem")&&Q.value.Create&&bl.value?(o(),i("div",cd,[l("button",{type:"button",onClick:al,title:q.value,class:h(y.value)},[vd,l("span",pd,O(nl.value),1)],10,fd)])):x("",!0),W(b).toolbarbuttons?U(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:y.value}):x("",!0)])])])):x("",!0),"filters"==L.value?(o(),ae(Il,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:pl.value,columns:k.value,onDone:e[8]||(e[8]=e=>L.value=null),onChange:He},null,8,["definitions","columns"])):x("",!0),Ce.value.error??C.value.error?(o(),ae(d,{key:6,status:Ce.value.error??C.value.error},null,8,["status"])):$.value?(o(),ae(v,{key:7,class:"p-2"})):x("",!0),A.value?(o(),i("div",md,[ye(Fl,{definitions:pl.value,column:A.value.column,"top-left":A.value.topLeft,onDone:Ee,onSave:Pe},null,8,["definitions","column","top-left"])])):x("",!0),E.value.length?(o(),ae(p,{key:9,id:t.id,items:E.value,type:t.type,"selected-columns":we.value,class:"mt-1",onFiltersChanged:z,tableStyle:g.value,gridClass:oe.value,grid2Class:ie.value,grid3Class:ue.value,grid4Class:de.value,tableClass:ve.value,theadClass:ce.value,theadRowClass:pe.value,theadCellClass:fe.value,tbodyClass:t.tbodyClass,rowClass:me,onRowSelected:$e,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:Ue},rl({header:xe(({column:t,label:e})=>{var a;return[f("filtering")&&Fe(t)?(o(),i("div",hd,[l("span",gd,O(e),1),ye(c,{column:k.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=A.value)?void 0:a.column.name)===t},null,8,["column","is-open"])])):(o(),i("div",yd,[l("span",bd,O(e),1)]))]}),_:2},[je(Object.keys(W(b)),l=>({name:l,fn:xe(e=>[U(t.$slots,l,Et(ks(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):x("",!0)]))}}}),kd={class:"flex"},_d={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},$d=l("g",{fill:"none"},[l("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Cd=[$d],xd=l("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),Ld=l("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1),Vd=[xd,Ld],Sd={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Md=l("g",{fill:"none"},[l("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1),Ad=[Md],Td={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Fd=l("g",{fill:"none"},[l("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1),Id=[Fd],jd=de({__name:"SettingsIcons",props:{column:{},isOpen:{type:Boolean}},setup(e){return(e,l)=>{var t;return o(),i("div",kd,[null!=(t=null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.filters)&&t.length?(o(),i("svg",_d,Cd)):(o(),i("svg",{key:1,class:h(["w-4 h-4 transition-transform",e.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Vd,2)),"ASC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Sd,Ad)):"DESC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),i("svg",Td,Id)):x("",!0)])}}}),Od=de({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(e){return(l,e)=>{let t=K("EnsureAccess"),a=K("SlideOver");return l.invalidAccess?(o(),ae(a,{key:0,title:l.title,onDone:e[0]||(e[0]=e=>l.$emit("done")),"content-class":"relative flex-1"},rl({default:xe(()=>[ye(t,{alertClass:l.alertClass,invalidAccess:l.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[l.subtitle?{name:"subtitle",fn:xe(()=>[ke(O(l.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):x("",!0)}}}),Dd=["for"],Pd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Bd={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Hd=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Rd=[Hd],Ed=["id"],zd=["id"],Nd={inheritAttrs:!1},Ud=de({...Nd,__name:"TextInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e,{expose:t}){let a=e,n=(t({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),D());let r=v(()=>a.type||"text"),s=v(()=>a.label??Pe(at(a.id))),u=v(()=>a.placeholder??s.value);function d(e){return"range"===a.type?e.replace("shadow-sm ",""):e}let c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:a.status??(null==c?void 0:c.error.value)},a.id)),f=v(()=>[ot.base,p.value?ot.invalid:d(ot.valid),a.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[U(t.$slots,"header",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs)),s.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(s.value),11,Dd)):x("",!0),l("div",{class:h(d("mt-1 relative shadow-sm rounded-md"))},[l("input",Te({ref_key:"inputElement",ref:n,type:r.value,name:t.id,id:t.id,class:f.value,placeholder:u.value,value:W(pn)(r.value,t.modelValue),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=p.value,"aria-describedby":t.id+"-error",step:"any"},W(ft)(t.$attrs,["class","value"])),null,16,Pd),p.value?(o(),i("div",Bd,Rd)):x("",!0)],2),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(p.value),9,Ed)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,zd)):x("",!0),U(t.$slots,"footer",Te({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),qd=["for"],Qd={class:"mt-1 relative rounded-md shadow-sm"},Kd=["name","id","placeholder","aria-invalid","aria-describedby"],Zd=["id"],Wd=["id"],Gd={inheritAttrs:!1},Jd=de({...Gd,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=v(()=>t.placeholder??a.value),r=Qe("ApiState",void 0),s=v(()=>mt.call({responseStatus:t.status??(null==r?void 0:r.error.value)},t.id)),u=v(()=>["shadow-sm "+ot.base,s.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,t.inputClass]);return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,qd)):x("",!0),l("div",Qd,[l("textarea",Te({name:t.id,id:t.id,class:u.value,placeholder:n.value,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=s.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),O(t.modelValue),17,Kd)]),s.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(s.value),9,Zd)):t.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},O(t.help),9,Wd)):x("",!0)],2))}}),Xd=["for"],Yd=["id","name","value","aria-invalid","aria-describedby"],ec=["value"],tc=["id"],sc={inheritAttrs:!1},lc=de({...sc,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},label:{},labelClass:{},options:{},values:{},entries:{}},setup(e){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id)),s=v(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(o(),i("div",{class:h([t.$attrs.class])},[a.value?(o(),i("label",{key:0,for:t.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,Xd)):x("",!0),l("select",Te({id:t.id,name:t.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",r.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],value:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=r.value,"aria-describedby":t.id+"-error"},W(ft)(t.$attrs,["class"])),[(o(!0),i(Me,null,je(s.value,e=>(o(),i("option",{value:e.key},O(e.value),9,ec))),256))],16,Yd),r.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},O(r.value),9,tc)):x("",!0)],2))}}),nc={class:"flex items-center h-5"},oc=["id","name","checked"],ac={class:"ml-3 text-sm"},rc=["for"],ic={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},uc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},dc={inheritAttrs:!1},cc=de({...dc,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{}){let t=e,a=v(()=>t.label??Pe(at(t.id))),n=Qe("ApiState",void 0),r=v(()=>mt.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id));return(t,e)=>(o(),i("div",{class:h(["relative flex items-start",t.$attrs.class])},[l("div",nc,[l("input",Te({id:t.id,name:t.id,type:"checkbox",checked:t.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",t.inputClass]},W(ft)(t.$attrs,["class"])),null,16,oc)]),l("div",ac,[l("label",{for:t.id,class:h("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},O(a.value),11,rc),r.value?(o(),i("p",ic,O(r.value),1)):t.help?(o(),i("p",uc,O(t.help),1)):x("",!0)])],2))}}),fc=["id"],vc=["for"],pc={class:"mt-1 relative rounded-md shadow-sm"},mc=["id","name","value"],hc={class:"flex flex-wrap pb-1.5"},gc={class:"pt-1.5 pl-1"},yc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},bc=["onClick"],wc=l("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[l("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),kc=[wc],_c={class:"pt-1.5 pl-1 shrink"},$c=["type","name","id","aria-invalid","aria-describedby"],Cc=["id"],xc=["onMouseover","onClick"],Lc={class:"block truncate"},Vc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Sc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Mc=[Sc],Ac=["id"],Tc=["id"],Fc={inheritAttrs:!1},Ic=de({...Fc,__name:"TagInput",props:{status:{},id:{},type:{},inputClass:{},label:{},labelClass:{},help:{},modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:{},string:{type:Boolean},maxVisibleItems:{default:300},converter:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=e,n=t;let r=v(()=>{return Ze((e=a.modelValue,a.converter?a.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),s=D(),u=D(!1),d=v(()=>{let l=p.value.toLowerCase();return a.allowableValues&&0!=a.allowableValues.length?a.allowableValues.length<1e3?a.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(l)):a.allowableValues.filter(e=>!r.value.includes(e)&&e.startsWith(l)):[]});let c=D(null),p=D(""),f=v(()=>a.type||"text"),m=v(()=>a.label??Pe(at(a.id))),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",a.inputClass]),w=l=>V(r.value.filter(e=>e!=l));function k(e){var l;document.activeElement===e.target&&null!=(l=c.value)&&l.focus()}let C=D();function L(){u.value=!0,C.value=!0}function M(){$(T()),C.value=!1,setTimeout(()=>{C.value||(u.value=!1)},200)}function V(e){var l=a.string?e.join(","):e;n("update:modelValue",l)}function S(e){var l;"Backspace"==e.key&&0==p.value.length&&0e==l.key))&&l.preventDefault(),"Enter"==l.key||"NumpadEnter"==l.key||1==l.key.length&&e)&&$(t)}let F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function I(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=_s(`#${a.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function $(e){var l;0!==e.length&&(-1==(l=Array.from(r.value)).indexOf(e)&&l.push(e),V(l),p.value="",u.value=!1)}function B(t){var e,t=null==(e=t.clipboardData)?void 0:e.getData("Text");if(t){let e=new RegExp("\\n|\\t|"+a.delimiters.join("|")),l=Array.from(r.value);t.split(e).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),V(l),p.value=""}}return(e,t)=>(o(),i("div",{class:h([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(m.value),11,vc)):x("",!0),l("div",pc,[l("input",{type:"hidden",id:e.id,name:e.id,value:r.value.join(",")},null,8,mc),l("button",{class:h(b.value),onClick:Ue(k,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",hc,[(o(!0),i(Me,null,je(r.value,t=>(o(),i("div",gc,[l("span",yc,[ke(O(t)+" ",1),l("button",{type:"button",onClick:e=>w(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},kc,8,bc)])]))),256)),l("div",_c,[Mt(l("input",Te({ref_key:"txtInput",ref:c,type:f.value,role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:e.id+"-txt",id:e.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error",onKeydown:S,onKeypress:A,onPaste:Ue(B,["prevent","stop"]),onFocus:L,onBlur:M,onClick:t[1]||(t[1]=e=>u.value=!0)},W(ft)(e.$attrs,["class","required"])),null,16,$c),[[wo,p.value]])])])],34),u.value&&d.value.length?(o(),i("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(d.value.slice(0,e.maxVisibleItems),t=>(o(),i("li",{class:h([t===s.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var l;l=t,s.value=l},onClick:e=>$(t),role:"option",tabindex:"-1"},[l("span",Lc,O(t),1)],42,xc))),256))],40,Cc)):x("",!0),y.value?(o(),i("div",Vc,Mc)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,Ac)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Tc)):x("",!0)],10,fc))}}),jc={class:"relative flex-grow mr-2 sm:mr-4"},Oc=["for"],Dc={class:"block mt-2"},Pc={class:"sr-only"},Bc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Hc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Rc=l("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Ec=[Rc],zc=["id"],Nc=["id"],Uc={key:0},qc=["title"],Qc=["alt","src"],Kc={key:1,class:"mt-3"},Zc={class:"w-full"},Wc={class:"pr-6 align-bottom pb-2"},Gc=["title"],Jc=["src","onError"],Xc=["href"],Yc={key:1,class:"overflow-hidden"},e0={class:"align-top pb-2 whitespace-nowrap"},t0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},s0=de({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(e){let t,a=e,n=D(null),{assetsPathResolver:r,fallbackPathResolver:s}=It(),u={},d=D(),c=D((null==(t=a.files)?void 0:t.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}a.values&&0{var l=e.replace(/\\/g,"/");return{fileName:rn(At(l,"/"),"."),filePath:l,contentType:el(l)}}).map(p));let f=v(()=>a.label??Pe(at(a.id))),m=v(()=>a.placeholder??f.value),g=Qe("ApiState",void 0),y=v(()=>mt.call({responseStatus:a.status??(null==g?void 0:g.error.value)},a.id)),b=v(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",a.inputClass]),w=e=>{var l=e.target;d.value="",c.value=Array.from(l.files||[]).map(e=>({fileName:e.name,filePath:pl(e),contentLength:e.size,contentType:e.type||el(e.name)}))},k=()=>{var e;return null==(e=n.value)?void 0:e.click()},C=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),L=v(()=>{var e;return 0!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function V(e){d.value=s(L.value)}return Ft(Cn),(e,t)=>(o(),i("div",{class:h(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",jc,[f.value?(o(),i("label",{key:0,for:e.id,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(f.value),11,Oc)):x("",!0),l("div",Dc,[l("span",Pc,O(e.help??f.value),1),l("input",Te({ref_key:"input",ref:n,type:"file",multiple:e.multiple,name:e.id,id:e.id,class:b.value,placeholder:m.value,"aria-invalid":null!=y.value,"aria-describedby":e.id+"-error"},e.$attrs,{onChange:w}),null,16,Bc),y.value?(o(),i("div",Hc,Ec)):x("",!0)]),y.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(y.value),9,zc)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Nc)):x("",!0)]),e.multiple?(o(),i("div",Kc,[l("table",Zc,[(o(!0),i(Me,null,je(c.value,t=>(o(),i("tr",null,[l("td",Wc,[l("div",{class:"flex w-full",title:C(t.filePath)?"":t.filePath},[l("img",{src:u[W(xt)(t.filePath)]||W(r)(W(xt)(t.filePath)),class:h(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[W(xt)(t.filePath)]=W(s)(W(xt)(t.filePath))},null,42,Jc),C(t.filePath)?(o(),i("span",Yc,O(t.fileName),1)):(o(),i("a",{key:0,href:W(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},O(t.fileName),9,Xc))],8,Gc)]),l("td",e0,[t.contentLength&&0[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=D(!1),r=e,s=a;function u(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}t({toggle:I});let d=v(()=>r.label??Pe(at(r.id))),c=Qe("ApiState",void 0),p=v(()=>mt.call({responseStatus:r.status??(null==c?void 0:c.error.value)},r.id)),f=v(()=>[ot.base,p.value?ot.invalid:ot.valid]),m=D(null),g=D(""),y=D(null),b=D(r.viewCount),w=D([]),k=v(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,b.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let L=[",",` +`,"\t"];function M(e){var l=null==(t=e.clipboardData)?void 0:t.getData("Text");if(l){var t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(l=>r.options.find(e=>r.match(e,l))).filter(e=>!!e);if(0{u(l)?e=e.filter(e=>e!=l):e.push(l)}),s("update:modelValue",e),hs()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&($(t[0]),n.value=!1,hs())}}}function V(e){C.indexOf(e.code)||j()}function S(e){var l;e.shiftKey||e.ctrlKey||e.altKey||(n.value?"Escape"==e.code?n.value&&(e.stopPropagation(),n.value=!1):"Tab"==e.code?n.value=!1:"Home"==e.code?(y.value=w.value[0],A()):"End"==e.code?(y.value=w.value[w.value.length-1],A()):"ArrowDown"==e.code?(y.value?(l=w.value.indexOf(y.value),y.value=l+1{var e=_s(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(T)},0)}function F(){setTimeout(()=>{var e=_s(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(T):e.scrollIntoView(T))},0)}function I(e){var l;(n.value=e)&&(j(),null!=(l=m.value))&&l.focus()}function j(){n.value=!0,B()}function $(l){if(g.value="",n.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),y.value=null,s("update:modelValue",e)}else{let e=l;r.modelValue==l&&(e=null),s("update:modelValue",e)}}function B(){w.value=k.value}return bt(g,B),(e,t)=>(o(),i("div",{id:e.id+"-autocomplete"},[d.value?(o(),i("label",{key:0,for:e.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},O(d.value),9,n0)):x("",!0),l("div",o0,[Mt(l("input",Te({ref_key:"txtInput",ref:m,id:e.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:f.value,placeholder:e.multiple||!e.modelValue?e.placeholder:"",onFocus:j,onKeydown:S,onKeyup:V,onClick:j,onPaste:M,required:!1},e.$attrs),null,16,a0),[[ko,g.value]]),l("button",{type:"button",onClick:t[1]||(t[1]=e=>I(!n.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},i0),n.value?(o(),i("ul",{key:0,class:"absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:e.id+"-options",role:"listbox"},[(o(!0),i(Me,null,je(w.value,t=>(o(),i("li",{class:h([t===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return l=t,y.value=l,void(w.value.indexOf(l)>Math.floor(.9*b.value)&&(b.value+=r.viewCount,B()));var l},onClick:e=>$(t),role:"option",tabindex:"-1"},[U(e.$slots,"item",Et(ks(t))),u(t)?(o(),i("span",{key:0,class:h(["absolute inset-y-0 right-0 flex items-center pr-4",t===y.value?"text-white":"text-indigo-600"])},f0,2)):x("",!0)],42,d0))),256))],40,u0)):!e.multiple&&e.modelValue?(o(),i("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>I(!n.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[U(e.$slots,"item",Et(ks(e.modelValue)))],32)):x("",!0),p.value?(o(),i("div",v0,m0)):x("",!0)]),p.value?(o(),i("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(p.value),9,h0)):e.help?(o(),i("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,g0)):x("",!0)],8,l0))}}),b0=["id","name","value"],w0={class:"block truncate"},k0=de({__name:"Combobox",props:{id:{},modelValue:{},multiple:{type:Boolean},options:{},values:{},entries:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=e,r=(t({toggle(e){var l;null!=(l=d.value)&&l.toggle(e)}}),a);function s(e){r("update:modelValue",e)}let u=v(()=>null!=n.multiple?n.multiple:Array.isArray(n.modelValue)),d=D();function c(e,l){return!l||e.value.toLowerCase().includes(l.toLowerCase())}let p=v(()=>n.entries||(n.values?n.values.map(e=>({key:e,value:e})):n.options?Object.keys(n.options).map(e=>({key:e,value:n.options[e]})):[])),f=D(u.value?[]:null);Ye(function(){let l=n.modelValue&&"object"==typeof n.modelValue?n.modelValue.key:n.modelValue;null==l||""===l?f.value=u.value?[]:null:"string"==typeof l?f.value=p.value.find(e=>e.key===l)||null:Array.isArray(l)&&(f.value=p.value.filter(e=>l.includes(e.key)))});let m=v(()=>null==f.value?"":Array.isArray(f.value)?f.value.map(e=>encodeURIComponent(e.key)).join(","):f.value.key);return(e,t)=>{var a=K("Autocomplete");return o(),i(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,b0),ye(a,Te({ref_key:"input",ref:d,id:e.id,options:p.value,match:c,multiple:u.value},e.$attrs,{modelValue:f.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>f.value=e),s]}),{item:xe(({value:e})=>[l("span",w0,O(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),_0=de({__name:"DynamicInput",props:{input:{},modelValue:{},api:{}},emits:["update:modelValue"],setup(e,{emit:l}){let t=e,a=l,c=v(()=>t.input.type||"text"),n="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),p=v(()=>ft(t.input,n)),f=D("file"===c.value?null:t.modelValue[t.input.id]),m=(bt(f,()=>{t.modelValue[t.input.id]=f.value,a("update:modelValue",t.modelValue)}),v(()=>{var e=t.modelValue[t.input.id];if("file"!==t.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:At(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){let l=[];return e.forEach(e=>{"string"==typeof e?l.push({filePath:e,fileName:At(e,"/")}):"object"==typeof e&&l.push(e)}),l}}));return(e,l)=>{var t,a=K("SelectInput"),n=K("CheckboxInput"),r=K("TagInput"),s=K("Combobox"),i=K("FileInput"),u=K("TextareaInput"),d=K("MarkdownInput"),v=K("TextInput");return W(G).component(c.value)?(o(),ae(an(W(G).component(c.value)),Te({key:0,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(t=e.input.css)?void 0:t.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"select"==c.value?(o(),ae(a,Te({key:1,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[1]||(l[1]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(a=e.input.css)?void 0:a.input,"label-class":null==(t=e.input.css)?void 0:t.label,entries:e.input.allowableEntries,values:e.input.allowableValues},p.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==c.value?(o(),ae(n,Te({key:2,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==c.value?(o(),ae(r,Te({key:3,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[3]||(l[3]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label,allowableValues:e.input.allowableValues,string:"String"==(null==(r=e.input.prop)?void 0:r.type)},p.value),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==c.value?(o(),ae(s,Te({key:4,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[4]||(l[4]=e=>f.value=e),status:null==(a=e.api)?void 0:a.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label,entries:e.input.allowableEntries,values:e.input.allowableValues},p.value),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==c.value?(o(),ae(i,Te({key:5,id:e.input.id,status:null==(r=e.api)?void 0:r.error,modelValue:f.value,"onUpdate:modelValue":l[5]||(l[5]=e=>f.value=e),"input-class":null==(s=e.input.css)?void 0:s.input,"label-class":null==(a=e.input.css)?void 0:a.label,files:m.value},p.value),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==c.value?(o(),ae(u,Te({key:6,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[6]||(l[6]=e=>f.value=e),status:null==(t=e.api)?void 0:t.error,"input-class":null==(n=e.input.css)?void 0:n.input,"label-class":null==(i=e.input.css)?void 0:i.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==c.value?(o(),ae(d,Te({key:7,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[7]||(l[7]=e=>f.value=e),status:null==(r=e.api)?void 0:r.error,"input-class":null==(s=e.input.css)?void 0:s.input,"label-class":null==(a=e.input.css)?void 0:a.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):(o(),ae(v,Te({key:8,type:c.value,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[8]||(l[8]=e=>f.value=e),status:null==(u=e.api)?void 0:u.error,"input-class":null==(t=e.input.css)?void 0:t.input,"label-class":null==(n=e.input.css)?void 0:n.label},p.value),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),$0={class:"lookup-field"},C0=["name","value"],x0={key:0,class:"flex justify-between"},L0=["for"],V0={key:0,class:"flex items-center"},S0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},M0=l("span",{class:"sr-only"},"Clear",-1),A0=l("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),T0=[M0,A0],F0={key:1,class:"mt-1 relative"},I0={class:"w-full inline-flex truncate"},j0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},O0=l("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[l("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[l("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),D0=["id"],P0=["id"],B0=de({__name:"LookupInput",props:{id:{},status:{},input:{},metadataType:{},modelValue:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=It().config,r=lt().metadataApi,s=e,u=t,d=v(()=>s.id||s.input.id),c=v(()=>s.label??Pe(at(d.value))),n=Qe("ApiState",void 0),p=Qe("client"),f=v(()=>mt.call({responseStatus:s.status??(null==n?void 0:n.error.value)},d.value)),m=D(""),g=D(""),y=v(()=>_e(s.modelValue,d.value)),b=v(()=>st(s.metadataType).find(e=>e.name.toLowerCase()==d.value.toLowerCase())),w=v(()=>{var e;return(null==(e=rt(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||a.value.tableIcon}),k;function C(){s.modelValue[d.value]=null,m.value=""}return Ye(async()=>{k=Qe("ModalProvider",void 0);let t=s.modelValue,e=(s.modelValue[d.value]||(s.modelValue[d.value]=null),b.value),a=null==e?void 0:e.ref;if(a){m.value="";let l=null==a.selfId?_e(t,e.name):_e(t,a.selfId);var n=Rt(l);console.log("refIdValue",l,Rt(l),t,a),null!=(l=n?_e(t,a.refId):l)&&(n=null==(n=r.value)?void 0:n.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==a.model}),console.debug("LookupInput queryOp",n),null==n||Rt(n=_e(t,e.name))||(m.value=""+n,g.value=e.name,null!=a.refLabel&&((n=st(s.metadataType).filter(e=>e.type==a.model)).length||console.warn(`Could not find ${a.model} Property on `+s.metadataType.name),null!=(n=(n=n.map(e=>_e(t,e.name)).filter(e=>!!e)).length<=1?n[0]:n.find(e=>e[a.refId??"id"]==l))?(n=_e(n,a.refLabel))&&(m.value=""+n,Pt.setValue(a.model,l,a.refLabel,n)):(n=1==(null==(n=e.attributes)?void 0:n.some(e=>"Computed"==e.name)),n=await Pt.getOrFetchValue(p,r.value,a.model,a.refId,a.refLabel,n,l),m.value=n||a.model+": "+m.value))))}else console.warn(`No RefInfo for property '${d.value}'`)}),(e,t)=>{var a,n=K("Icon");return o(),i("div",$0,[l("input",{type:"hidden",name:d.value,value:y.value},null,8,C0),c.value?(o(),i("div",x0,[l("label",{for:d.value,class:h("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(c.value),11,L0),y.value?(o(),i("div",V0,[l("span",S0,O(y.value),1),l("button",{onClick:C,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},T0)])):x("",!0)])):x("",!0),null!=(a=b.value)&&a.ref?(o(),i("div",F0,[l("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var a;(a=b.value.ref)&&(null==k?console.warn("No ModalProvider required by LookupInput"):k.openModal({name:"ModalLookup",ref:a},e=>{var l,t;console.debug("openModal",m.value," -> ",e,Pt.setRefValue(a,e),a),e&&(l=_e(e,a.refId),m.value=Pt.setRefValue(a,e)||l,(t=W(s.modelValue))[d.value]=l,u("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",I0,[l("span",j0,[ye(n,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,O(m.value),1)])]),O0])])):x("",!0),f.value?(o(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:d.value+"-error"},O(f.value),9,D0)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:d.value+"-description"},O(e.help),9,P0)):x("",!0)])}}}),H0=de({__name:"AutoFormFields",props:{modelValue:{},type:{},metaType:{},api:{},formLayout:{},configureField:{},configureFormLayout:{},hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let u=e,n=a;function r(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function d(e,l){u.modelValue[e]=l,n("update:modelValue",u.modelValue),r()}t({forceUpdate:r,props:u,updateValue:d});let{metadataApi:s,apiOf:c,typeOf:p,typeOfRef:f,createFormLayout:m}=lt(),g=v(()=>u.type||Qt(u.modelValue)),y=v(()=>u.metaType??p(g.value)),b=v(()=>{var e;return f(null==(e=null==(e=s.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value});function w(){var e,l=y.value;if(!l){if(u.formLayout)return e=u.formLayout.map(e=>{var l={name:e.id,type:Ia(e.type)},l=Object.assign({prop:l},e);return u.configureField&&u.configureField(l),l}),u.configureFormLayout&&u.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}let a=st(l),n=b.value,t=u.formLayout?Array.from(u.formLayout):m(l),r=[],s=c(l.name);return t.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==n?void 0:n.properties)?void 0:e.find(e=>{var l;return e.name.toLowerCase()==(null==(l=t.name)?void 0:l.toLowerCase())}))??l,l=Object.assign({prop:e,op:s},t),u.configureField&&u.configureField(l),r.push(l))}),u.configureFormLayout&&u.configureFormLayout(r),r}return(t,a)=>{let e,n=K("ErrorSummary"),r=K("LookupInput"),s=K("DynamicInput");return o(),i(Me,null,[t.hideSummary?x("",!0):(o(),ae(n,{key:0,status:null==(e=t.api)?void 0:e.error,except:w().filter(e=>"hidden"!=e.type).map(e=>e.id)},null,8,["status","except"])),l("div",{class:h(t.flexClass)},[l("div",{class:h(t.divideClass)},[l("div",{class:h(t.spaceClass)},[l("fieldset",{class:h(t.fieldsetClass)},[(o(!0),i(Me,null,je(w(),l=>{var e;return o(),i("div",{key:l.id,class:h(["w-full",(null==(e=l.css)?void 0:e.field)??("textarea"==l.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==l.type?" flex items-center":"")),"hidden"==l.type?"hidden":""])},[null==(null==(e=l.prop)?void 0:e.ref)||"file"==l.type||l.prop.isPrimaryKey?(o(),ae(s,{key:1,input:l,modelValue:t.modelValue,"onUpdate:modelValue":a[0]||(a[0]=e=>t.$emit("update:modelValue",e)),api:t.api},null,8,["input","modelValue","api"])):(o(),ae(r,{key:0,metadataType:b.value,input:l,modelValue:t.modelValue,"onUpdate:modelValue":e=>{d(l.id,_e(e,l.id))},status:null==(e=t.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Ps(e){let r=D(!1),s=D(),o=D(),i=e??Qe("client");function n({message:e,errorCode:l,fieldName:t,errors:a}){return l=l||"Exception",a=a||[],s.value=new qs(t?{errorCode:l,message:e,errors:[new Gl({fieldName:t,errorCode:l,message:e})]}:{errorCode:l,message:e,errors:a})}var l={setError:n,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",s.value?((a=new qs(s.value)).errors=[...(a.errors||[]).filter(e=>{var l;return(null==(l=e.fieldName)?void 0:l.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Gl({fieldName:t,message:e,errorCode:l})],s.value=a):n({fieldName:t,message:e,errorCode:l})},loading:r,error:s,api:async function(e,l,t){r.value=!0;var a=await i.api(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiVoid:async function(e,l,t){r.value=!0;var a=await i.apiVoid(Dt(e),l,t);return r.value=!1,o.value=a.response,s.value=a.error,a},apiForm:async function(e,l,t,a){r.value=!0;var n=await i.apiForm(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},apiFormVoid:async function(e,l,t,a){r.value=!0;var n=await i.apiFormVoid(Dt(e),l,t,a);return r.value=!1,o.value=n.response,s.value=n.error,n},swr:async function(e,l,t,a){return gn(i,e,l,t,a)},swrEffect:function(t,a){let n=D(new Xe),r=yn(async e=>{n.value=await i.api(e)},null==a?void 0:a.delayMs);return ws(async()=>{var e=t(),l=cl(Ts(e));l&&(n.value=new Xe({response:l})),0===(null==a?void 0:a.delayMs)?n.value=await i.api(e):r(e)}),(async()=>n.value=await i.api(t(),null==a?void 0:a.args,null==a?void 0:a.method))(),n},unRefs:Dt,setRef:mn};return ss("ApiState",l),l}let R0={key:0},E0={class:"text-red-700"},z0=l("b",null,"type",-1),N0={key:0},U0={key:2},q0=["innerHTML"],Q0=l("input",{type:"submit",class:"hidden"},null,-1),K0={class:"flex justify-end"},Z0=l("div",null,null,-1),W0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},G0=l("div",{class:"fixed inset-0"},null,-1),J0={class:"fixed inset-0 overflow-hidden"},X0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Y0={class:"flex-1"},ef={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},tf={class:"flex items-start justify-between space-x-3"},sf={class:"space-y-1"},lf={key:0},nf={key:2},of=["innerHTML"],af={class:"flex h-7 items-center"},rf={class:"flex justify-end"},uf=de({__name:"AutoForm",props:{type:{},modelValue:{},heading:{},subHeading:{},showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},metaType:{},configureField:{},configureFormLayout:{},panelClass:{},bodyClass:{},formClass:{},innerFormClass:{},headerClass:{default:"p-6"},buttonsClass:{},headingClass:{},subHeadingClass:{},submitLabel:{default:"Submit"},allowSubmit:{}},emits:["success","error","update:modelValue","done"],setup(e,{expose:t,emit:a}){let s=e,u=a,L=D(),M=D(1),V=D();function n(){M.value++,P.value=m();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}ss("ModalProvider",{openModal:function(e,l){S.value=e,r.value=l}});let S=D(),r=D();async function T(e){r.value&&r.value(e),S.value=void 0,r.value=void 0}let d=Ps(),c=bn().getTypeName,{typeOf:p,createDto:f}=lt(),A=D(new Xe),F=v(()=>s.panelClass||Ee.panelClass(s.formStyle)),I=v(()=>s.formClass||"card"==s.formStyle?"shadow sm:rounded-md":Bt.formClass),j=v(()=>s.headingClass||Ee.headingClass(s.formStyle)),$=v(()=>s.subHeadingClass||Ee.subHeadingClass(s.formStyle)),B=v(()=>("string"==typeof s.buttonsClass?s:Ee).buttonsClass),E=v(()=>{var e;return s.type?c(s.type):null!=(e=s.modelValue)&&e.getTypeName?s.modelValue.getTypeName():null}),_=v(()=>s.metaType??p(E.value)),m=()=>s.modelValue||g(),P=D(m()),H=v(()=>d.loading.value),R=v(()=>{var e;return null!=s.heading?s.heading:(null==(e=_.value)?void 0:e.description)||Pe(E.value)});function g(){return"string"==typeof s.type?f(s.type):s.type?new s.type:s.modelValue}async function z(e){var l,t,a,n,r;e&&"FORM"==e.tagName?(l=g(),r=Ze(null==l?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==l?void 0:l.createResponse,e=>"function"==typeof e?e():null),a=s.jsconfig,il.hasRequestBody(r)?(r=new l.constructor,n=new FormData(e),A.value=t?await d.apiFormVoid(r,n,{jsconfig:a}):await d.apiForm(r,n,{jsconfig:a})):(r=new l.constructor(Bo(P.value)),console.debug("AutoForm.submit",r),A.value=t?await d.apiVoid(r,{jsconfig:a}):await d.api(r,{jsconfig:a})),A.value.succeeded?(u("success",A.value.response),W()):u("error",A.value.error)):console.error("Not a valid form",e)}function N(e){u("update:modelValue",e)}function y(){u("done")}t({forceUpdate:n,props:s,setModel:async function(e){Object.assign(P.value,e),n(),await St(()=>null)},formFields:L,submit:async function(){z(V.value)},close:W,model:P});let b=D(!1),G=D(""),k={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function W(){"slideOver"==s.formStyle?b.value=!1:y()}bt(b,()=>{yt(k,G,b.value),b.value||setTimeout(y,700)}),b.value=!0;let w=e=>{"Escape"===e.key&&W()};return Ye(()=>window.addEventListener("keydown",w)),Ft(()=>window.removeEventListener("keydown",w)),(t,e)=>{let a,n,r,s,u,d,v,c,p,f,m,g=K("AutoFormFields"),y=K("FormLoading"),b=K("PrimaryButton"),w=K("CloseButton"),k=K("SecondaryButton"),C=K("ModalLookup");return o(),i("div",null,[_.value?"card"==t.formStyle?(o(),i("div",{key:1,class:h(F.value)},[l("form",{ref_key:"elForm",ref:V,onSubmit:e[0]||(e[0]=Ue(e=>z(e.target),["prevent"])),autocomplete:"off",class:h(t.innerFormClass)},[l("div",{class:h(t.bodyClass)},[l("div",{class:h(t.headerClass)},[t.$slots.heading?(o(),i("div",N0,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",U0,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(n=_.value)?void 0:n.notes},null,10,q0)):x("",!0)],2),U(t.$slots,"header",{instance:null==(r=Be())?void 0:r.exposed,model:P.value}),Q0,(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(s=Be())?void 0:s.exposed,model:P.value})],2),U(t.$slots,"buttons",{},()=>{var e;return[l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",K0,[Z0,ye(b,{disabled:!!t.allowSubmit&&!t.allowSubmit(P.value)},{default:xe(()=>[ke(O(t.submitLabel),1)]),_:1},8,["disabled"]),U(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:P.value})])],2)]})],34)],2)):(o(),i("div",W0,[G0,l("div",J0,[l("div",{onMousedown:W,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",G.value])},[l("form",{ref_key:"elForm",ref:V,class:h(I.value),onSubmit:e[1]||(e[1]=Ue(e=>z(e.target),["prevent"]))},[l("div",X0,[l("div",Y0,[l("div",ef,[l("div",tf,[l("div",sf,[t.$slots.heading?(o(),i("div",lf,[U(t.$slots,"heading")])):(o(),i("h3",{key:1,class:h(j.value)},O(R.value),3)),t.$slots.subheading?(o(),i("div",nf,[U(t.$slots,"subheading")])):t.subHeading?(o(),i("p",{key:3,class:h($.value)},O(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),i("p",{key:4,class:h(["notes",$.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,of)):x("",!0)]),l("div",af,[ye(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:W})])])]),U(t.$slots,"header",{instance:null==(v=Be())?void 0:v.exposed,model:P.value}),(o(),ae(g,{ref_key:"formFields",ref:L,key:M.value,type:t.type,modelValue:P.value,"onUpdate:modelValue":N,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),U(t.$slots,"footer",{instance:null==(c=Be())?void 0:c.exposed,model:P.value})])]),l("div",{class:h(B.value)},[l("div",null,[U(t.$slots,"leftbuttons",{instance:null==(p=Be())?void 0:p.exposed,model:P.value})]),l("div",null,[t.showLoading&&H.value?(o(),ae(y,{key:0})):x("",!0)]),l("div",rf,[ye(k,{onClick:W,disabled:H.value},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(b,{class:"ml-4",disabled:!!t.allowSubmit&&!t.allowSubmit(P.value)},{default:xe(()=>[ke(O(t.submitLabel),1)]),_:1},8,["disabled"]),U(t.$slots,"rightbuttons",{instance:null==(f=Be())?void 0:f.exposed,model:P.value})])],2)],34)],2)],32)],32)])])):(o(),i("div",R0,[l("p",E0,[ke("Could not create form for unknown "),z0,ke(" "+O(E.value),1)])])),"ModalLookup"==(null==(m=S.value)?void 0:m.name)&&S.value.ref?(o(),ae(C,{key:3,"ref-info":S.value.ref,onDone:T},null,8,["ref-info"])):x("",!0)])}}}),df={key:0},cf={class:"text-red-700"},ff=l("b",null,"type",-1),vf={key:0},pf={key:2},mf=["innerHTML"],hf={class:"flex justify-end"},gf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},yf=l("div",{class:"fixed inset-0"},null,-1),bf={class:"fixed inset-0 overflow-hidden"},wf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},kf={class:"flex-1"},_f={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},$f={class:"flex items-start justify-between space-x-3"},Cf={class:"space-y-1"},xf={key:0},Lf={key:2},Vf=["innerHTML"],Sf={class:"flex h-7 items-center"},Mf={class:"flex justify-end"},Af=de({__name:"AutoCreateForm",props:{type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,c=D(),p=D(1);function n(){p.value++,null!=(e=c.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function f(e){}ss("ModalProvider",{openModal:function(e,l){m.value=e,u.value=l}});let m=D(),u=D();async function g(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:y,Crud:b,createDto:w,formValues:k}=lt(),C=v(()=>Qt(r.type)),L=v(()=>d(C.value)),M=D("string"==typeof r.type?w(r.type):r.type?new r.type:null),V=(t({forceUpdate:n,props:r,setModel:function(e){Object.assign(M.value,e),n()},formFields:c,model:M}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),S=v(()=>r.formClass||Ee.formClass(r.formStyle)),T=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),A=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),F=v(()=>r.buttonsClass||Ee.buttonsClass),I=v(()=>b.model(L.value)),j=v(()=>{var e;return r.heading||(null==(e=d(C.value))?void 0:e.description)||(I.value?"New "+Pe(I.value):Pe(C.value))}),$=D(new Xe),B=Ps(),E=v(()=>B.loading.value);async function _(e){var l,t,a,n=e.target;r.autosave?(t=Ze(null==(t=M.value)?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==Ze(null==(l=M.value)?void 0:l.createResponse,e=>"function"==typeof e?e():null),il.hasRequestBody(t)?(t=new M.value.constructor,a=new FormData(n),$.value=l?await B.apiFormVoid(t,a,{jsconfig:"eccn"}):await B.apiForm(t,a,{jsconfig:"eccn"})):(t=k(n,y(L.value)),a=new M.value.constructor(t),$.value=l?await B.apiVoid(a,{jsconfig:"eccn"}):await B.api(a,{jsconfig:"eccn"})),$.value.succeeded?(n.reset(),s("save",$.value.response)):s("error",$.value.error)):s("save",new M.value.constructor(k(n,y(L.value))))}function P(){s("done")}G.interceptors.has("AutoCreateForm.new")&&G.interceptors.invoke("AutoCreateForm.new",{props:r,model:M});let H=D(!1),R=D(""),q={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function z(){"slideOver"==r.formStyle?H.value=!1:P()}bt(H,()=>{yt(q,R,H.value),H.value||setTimeout(P,700)}),H.value=!0;let N=e=>{"Escape"===e.key&&z()};return Ye(()=>window.addEventListener("keydown",N)),Ft(()=>window.removeEventListener("keydown",N)),(e,t)=>{var a,n=K("AutoFormFields"),r=K("FormLoading"),s=K("SecondaryButton"),u=K("PrimaryButton"),d=K("CloseButton"),v=K("ModalLookup");return o(),i("div",null,[L.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(V.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:h(S.value)},[l("div",null,[e.$slots.heading?(o(),i("div",vf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",pf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,mf)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value})],2),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&W(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",hf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:W(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:W(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",gf,[yf,l("div",bf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(S.value),onSubmit:Ue(_,["prevent"])},[l("div",wf,[l("div",kf,[l("div",_f,[l("div",$f,[l("div",Cf,[e.$slots.heading?(o(),i("div",xf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(T.value)},O(j.value),3)),e.$slots.subheading?(o(),i("div",Lf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(A.value)},O(e.subHeading),3)):null!=(a=L.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",A.value]),innerHTML:null==(a=L.value)?void 0:a.notes},null,10,Vf)):x("",!0)]),l("div",Sf,[ye(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:M.value}),(o(),ae(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(d=Be())?void 0:d.exposed,model:M.value})])]),l("div",{class:h(F.value)},[l("div",null,[e.showLoading&&W(E)?(o(),ae(r,{key:0})):x("",!0)]),l("div",Mf,[e.showCancel?(o(),ae(s,{key:0,onClick:z,disabled:W(E)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"])):x("",!0),ye(u,{type:"submit",class:"ml-4",disabled:W(E)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",df,[l("p",cf,[ke("Could not create form for unknown "),ff,ke(" "+O(C.value),1)])])),"ModalLookup"==(null==(a=m.value)?void 0:a.name)&&m.value.ref?(o(),ae(v,{key:3,"ref-info":m.value.ref,onDone:g},null,8,["ref-info"])):x("",!0)])}}}),Tf={key:0},Ff={class:"text-red-700"},If=l("b",null,"type",-1),jf={key:0},Of={key:2},Df=["innerHTML"],Pf={class:"flex justify-end"},Bf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Hf=l("div",{class:"fixed inset-0"},null,-1),Rf={class:"fixed inset-0 overflow-hidden"},Ef={class:"flex min-h-0 flex-1 flex-col overflow-auto"},zf={class:"flex-1"},Nf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Uf={class:"flex items-start justify-between space-x-3"},qf={class:"space-y-1"},Qf={key:0},Kf={key:2},Zf=["innerHTML"],Wf={class:"flex h-7 items-center"},Gf={class:"flex justify-end"},Jf=de({__name:"AutoEditForm",props:{modelValue:{},type:{},deleteType:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:{},configureFormLayout:{}},emits:["done","save","delete","error"],setup(e,{expose:t,emit:a}){let r=e,s=a,p=D(),f=D(1);function m(e){}ss("ModalProvider",{openModal:function(e,l){g.value=e,n.value=l}});let g=D(),n=D();async function q(e){n.value&&n.value(e),g.value=void 0,n.value=void 0}let{typeOf:u,apiOf:Q,typeProperties:c,createFormLayout:Z,getPrimaryKey:J,Crud:y,createDto:d,formValues:b}=lt(),w=v(()=>Qt(r.type)),k=v(()=>u(w.value)),C=()=>"string"==typeof r.type?d(r.type,ys(r.modelValue)):r.type?new r.type(ys(r.modelValue)):null,L=D(C()),X=(t({forceUpdate:function(){f.value++,L.value=C();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(L.value,e)},formFields:p,model:L}),v(()=>r.panelClass||Ee.panelClass(r.formStyle))),M=v(()=>r.formClass||Ee.formClass(r.formStyle)),V=v(()=>r.headingClass||Ee.headingClass(r.formStyle)),S=v(()=>r.subHeadingClass||Ee.subHeadingClass(r.formStyle)),T=v(()=>y.model(k.value)),A=v(()=>{var e;return r.heading||(null==(e=u(w.value))?void 0:e.description)||(T.value?"Update "+Pe(T.value):Pe(w.value))}),F=D(new Xe),I=Object.assign({},ys(r.modelValue)),j=(G.interceptors.has("AutoEditForm.new")&&G.interceptors.invoke("AutoEditForm.new",{props:r,model:L,origModel:I}),Ps()),$=v(()=>j.loading.value),B=()=>Ze(u(y.model(k.value)),e=>J(e));function Y(e){var{op:l,prop:t}=e;l&&(y.isPatch(l)||y.isUpdate(l))&&(e.disabled=null==t?void 0:t.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(e){var a=e.target;if(r.autosave){let e=Ze(null==(n=L.value)?void 0:n.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ze(null==(n=L.value)?void 0:n.createResponse,e=>"function"==typeof e?e():null),d=B();if(il.hasRequestBody(e)){let e=new L.value.constructor,l=_e(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,l),[]);var n=w.value&&Q(w.value);if(n&&y.isPatch(n)){let s=Z(k.value),o={};if(d&&(o[d.name]=l),s.forEach(t=>{var a=t.id,n=_e(I,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var r=i.get(a);G.interceptors.has("AutoEditForm.save.formLayout")&&G.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:n,formLayout:s,input:t,newValue:r});let e=null!=r,l="checkbox"===t.type?e!=!!n:"file"===t.type?e:r!=n;(l=r||n?l:!1)&&(r?o[a]=r:"file"!==t.type&&u.push(a))}}),G.interceptors.has("AutoEditForm.save")&&G.interceptors.invoke("AutoEditForm.save",{origModel:I,formLayout:s,dirtyValues:o}),Array.from(i.keys()).filter(e=>!o[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void z()}n=0"function"==typeof e?e():null)?F.value=await j.apiVoid(t):F.value=await j.api(t),F.value.succeeded?s("delete",F.value.response):s("error",F.value.error)):console.error(`Could not find Primary Key for Type ${w.value} (${T.value})`)}function P(){s("done")}let H=D(!1),R=D(""),ee={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function z(){"slideOver"==r.formStyle?H.value=!1:P()}bt(H,()=>{yt(ee,R,H.value),H.value||setTimeout(P,700)}),H.value=!0;let N=e=>{"Escape"===e.key&&z()};return Ye(()=>window.addEventListener("keydown",N)),Ft(()=>window.removeEventListener("keydown",N)),(e,t)=>{var a,n=K("AutoFormFields"),r=K("ConfirmDelete"),s=K("FormLoading"),u=K("SecondaryButton"),d=K("PrimaryButton"),v=K("CloseButton"),c=K("ModalLookup");return o(),i("div",null,[k.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(X.value)},[l("form",{onSubmit:Ue(E,["prevent"])},[l("div",{class:h(M.value)},[l("div",null,[e.$slots.heading?(o(),i("div",jf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Of,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Df)):x("",!0)]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value})],2),l("div",{class:h(W(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&W($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Pf,[ye(u,{onClick:z,disabled:W($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:W($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),i("div",Bf,[Hf,l("div",Rf,[l("div",{onMousedown:z,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[l("form",{class:h(M.value),onSubmit:Ue(E,["prevent"])},[l("div",Ef,[l("div",zf,[l("div",Nf,[l("div",Uf,[l("div",qf,[e.$slots.heading?(o(),i("div",Qf,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(V.value)},O(A.value),3)),e.$slots.subheading?(o(),i("div",Kf,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(S.value)},O(e.subHeading),3)):null!=(a=k.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",S.value]),innerHTML:null==(a=k.value)?void 0:a.notes},null,10,Zf)):x("",!0)]),l("div",Wf,[ye(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:z})])])]),U(e.$slots,"header",{formInstance:null==(a=Be())?void 0:a.exposed,model:L.value}),(o(),ae(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:L.value,"onUpdate:modelValue":m,api:F.value,configureField:Y,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),U(e.$slots,"footer",{formInstance:null==(v=Be())?void 0:v.exposed,model:L.value})])]),l("div",{class:h(W(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ae(r,{key:0,onDelete:_})):x("",!0)]),l("div",null,[e.showLoading&&W($)?(o(),ae(s,{key:0})):x("",!0)]),l("div",Gf,[ye(u,{onClick:z,disabled:W($)},{default:xe(()=>[ke("Cancel")]),_:1},8,["disabled"]),ye(d,{type:"submit",class:"ml-4",disabled:W($)},{default:xe(()=>[ke("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),i("div",Tf,[l("p",Ff,[ke("Could not create form for unknown "),If,ke(" "+O(w.value),1)])])),"ModalLookup"==(null==(a=g.value)?void 0:a.name)&&g.value.ref?(o(),ae(c,{key:3,"ref-info":g.value.ref,onDone:q},null,8,["ref-info"])):x("",!0)])}}}),Xf={key:0},Yf={class:"text-red-700"},ev=l("b",null,"type",-1),tv={key:0},sv={key:2},lv=["innerHTML"],nv={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},ov=l("div",{class:"fixed inset-0"},null,-1),av={class:"fixed inset-0 overflow-hidden"},rv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},iv={class:"flex-1"},uv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},dv={class:"flex items-start justify-between space-x-3"},cv={class:"space-y-1"},fv={key:0},vv={key:2},pv=["innerHTML"],mv={class:"flex h-7 items-center"},hv=de({__name:"AutoViewForm",props:{model:{},apis:{},typeName:{},done:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{}},emits:["done"],setup(e,{}){let t=e,a=lt().typeOf,s=v(()=>t.typeName??t.apis.dataModel.name),u=v(()=>a(s.value)),d=v(()=>t.panelClass||Ee.panelClass(t.formStyle)),c=v(()=>t.formClass||Ee.formClass(t.formStyle)),p=v(()=>t.headingClass||Ee.headingClass(t.formStyle)),f=v(()=>t.subHeadingClass||Ee.subHeadingClass(t.formStyle)),m=v(()=>{var e;return t.heading||(null==(e=a(s.value))?void 0:e.description)||(null!=(e=t.model)&&e.id?Pe(s.value)+" "+t.model.id:"View "+Pe(s.value))});function n(){t.done&&t.done()}G.interceptors.has("AutoViewForm.new")&&G.interceptors.invoke("AutoViewForm.new",{props:t});let r=D(!1),g=D(""),y={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function b(){"slideOver"==t.formStyle?r.value=!1:n()}bt(r,()=>{yt(y,g,r.value),r.value||setTimeout(n,700)}),r.value=!0;let w=e=>{"Escape"===e.key&&b()};return Ye(()=>window.addEventListener("keydown",w)),Ft(()=>window.removeEventListener("keydown",w)),(e,t)=>{var a,n=K("MarkupModel"),r=K("CloseButton");return o(),i("div",null,[s.value?"card"==e.formStyle?(o(),i("div",{key:1,class:h(d.value)},[l("div",{class:h(c.value)},[l("div",null,[e.$slots.heading?(o(),i("div",tv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",sv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,lv)):x("",!0)]),ye(n,{value:e.model},null,8,["value"])],2)],2)):(o(),i("div",nv,[ov,l("div",av,[l("div",{onMousedown:b,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",g.value])},[l("div",{class:h(c.value)},[l("div",rv,[l("div",iv,[l("div",uv,[l("div",dv,[l("div",cv,[e.$slots.heading?(o(),i("div",fv,[U(e.$slots,"heading")])):(o(),i("h3",{key:1,class:h(p.value)},O(m.value),3)),e.$slots.subheading?(o(),i("div",vv,[U(e.$slots,"subheading")])):e.subHeading?(o(),i("p",{key:3,class:h(f.value)},O(e.subHeading),3)):null!=(a=u.value)&&a.notes?(o(),i("p",{key:4,class:h(["notes",f.value]),innerHTML:null==(a=u.value)?void 0:a.notes},null,10,pv)):x("",!0)]),l("div",mv,[ye(r,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:b})])])]),ye(n,{value:e.model},null,8,["value"])])])],2)],2)],32)],32)])])):(o(),i("div",Xf,[l("p",Yf,[ke("Could not create view for unknown "),ev,ke(" "+O(s.value),1)])]))])}}}),gv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),yv=de({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let a=D(!1),n=t,r=()=>{a.value&&n("delete")},s=v(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",a.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(o(),i(Me,null,[Mt(l("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>nn(a)?a.value=e:a=e)},null,512),[[al,W(a)]]),gv,l("span",Te({onClick:Ue(r,["prevent"]),class:s.value},e.$attrs),[U(e.$slots,"default",{},()=>[ke("Delete")])],16)],64))}}),bv={class:"flex",title:"loading..."},wv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},kv=xs('',3),_v=[kv],$v={class:"ml-2 mt-1 text-gray-400"},Cv=de({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Qe("ApiState",void 0),(e,t)=>(o(),i("div",bv,[e.icon?(o(),i("svg",wv,_v)):x("",!0),l("span",$v,O(e.text),1)]))}}),xv=["onClick"],Lv={key:3,class:"flex justify-between items-center"},Vv={class:"mr-1 select-none"},Sv=["onClick"],Mv=de({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:{},tableStyle:{default:"stripedRows"},selectedColumns:{},gridClass:{},grid2Class:{},grid3Class:{},grid4Class:{},tableClass:{},theadClass:{},tbodyClass:{},theadRowClass:{},theadCellClass:{},isSelected:{},headerTitle:{},headerTitles:{},visibleFrom:{},rowClass:{},rowStyle:{}},emits:["headerSelected","rowSelected"],setup(e,{emit:t}){let u=e,d=t,a=D(),c=D(null),p=Ls(),f=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()+"-header"),m=l=>Object.keys(p).find(e=>e.toLowerCase()==l.toLowerCase()),n=v(()=>Gs(u.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:r,typeProperties:s}=lt(),g=v(()=>Qt(u.type)),y=v(()=>r(g.value)),b=v(()=>s(y.value));function w(e){var l=u.headerTitles&&_e(u.headerTitles,e)||e;return u.headerTitle?u.headerTitle(l):cn(l)}function k(e){let l=e.toLowerCase();return b.value.find(e=>e.name.toLowerCase()==l)}let C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){var l=u.visibleFrom&&_e(u.visibleFrom,e);return l&&Ze(C[l],e=>"hidden "+e)}let M=v(()=>u.gridClass??he.getGridClass(u.tableStyle)),V=v(()=>u.grid2Class??he.getGrid2Class(u.tableStyle)),S=v(()=>u.grid3Class??he.getGrid3Class(u.tableStyle)),T=v(()=>u.grid4Class??he.getGrid4Class(u.tableStyle)),A=v(()=>u.tableClass??he.getTableClass(u.tableStyle)),F=v(()=>u.tbodyClass??he.getTbodyClass(u.tbodyClass)),I=v(()=>u.theadClass??he.getTheadClass(u.tableStyle)),j=v(()=>u.theadRowClass??he.getTheadRowClass(u.tableStyle)),$=v(()=>u.theadCellClass??he.getTheadCellClass(u.tableStyle));let B=v(()=>{let e=("string"==typeof u.selectedColumns?u.selectedColumns.split(","):u.selectedColumns)||(0(e[l.name.toLowerCase()]=l.format,e),{});return e.filter(e=>{var l;return"hidden"!=(null==(l=t[e.toLowerCase()])?void 0:l.method)})});return(n,e)=>{let r=K("CellFormat"),s=K("PreviewFormat");return n.items.length?(o(),i("div",{key:0,ref_key:"refResults",ref:a,class:h(M.value)},[l("div",{class:h(V.value)},[l("div",{class:h(S.value)},[l("div",{class:h(T.value)},[l("table",{class:h(A.value)},[l("thead",{class:h(I.value)},[l("tr",{class:h(j.value)},[(o(!0),i(Me,null,je(B.value,t=>{return o(),i("td",{class:h([L(t),$.value,(e=t,c.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[l("div",{onClick:e=>{var l;e=e,l=t,d("headerSelected",l,e)}},[W(p)[t+"-header"]?U(n.$slots,t+"-header",{key:0,column:t}):f(t)?U(n.$slots,f(t),{key:1,column:t}):W(p).header?U(n.$slots,"header",{key:2,column:t,label:w(t)}):(o(),i("div",Lv,[l("span",Vv,O(w(t)),1)]))],8,xv)],2);var e}),256))],2)],2),l("tbody",{class:h(F.value)},[(o(!0),i(Me,null,je(n.items,(t,e)=>{return o(),i("tr",{class:h((l=t,a=e,u.rowClass?u.rowClass(l,a):he.getTableRowClass(u.tableStyle,a,!(!u.isSelected||!u.isSelected(l)),null!=u.isSelected))),style:ol((a=t,l=e,u.rowStyle?u.rowStyle(a,l):void 0)),onClick:e=>{var l;e=e,l=t,d("rowSelected",l,e)}},[(o(!0),i(Me,null,je(B.value,e=>{return o(),i("td",{class:h([L(e),W(he).tableCellClass])},[W(p)[e]?U(n.$slots,e,Et(Te({key:0},t))):m(e)?U(n.$slots,m(e),Et(Te({key:1},t))):k(e)?(o(),ae(r,{key:2,type:y.value,propType:k(e),modelValue:t},null,8,["type","propType","modelValue"])):(o(),ae(s,{key:3,value:W(_e)(t,e),format:null!=(l=k(e))&&l.format?l.format:"TimeSpan"==(null==l?void 0:l.type)||"TimeOnly"==(null==l?void 0:l.type)?{method:"time"}:null},null,8,["value","format"]))],2);var l}),256))],14,Sv);var l,a}),256))],2)],2)],2)],2)],2)],2)):x("",!0)}}}),Av=de({props:{type:Object,propType:Object,modelValue:Object},setup(d,{attrs:v}){let c=lt().typeOf;return()=>{let e,l=null!=(o=d.propType)&&o.format?o.format:"TimeSpan"==(null==o?void 0:o.type)||"TimeOnly"==(null==o?void 0:o.type)?{method:"time"}:null,t=_e(d.modelValue,d.propType.name),a=Object.assign({},d,v),n=$t("span",{innerHTML:ts(t,l,a)}),r=Rt(t)&&Array.isArray(t)?$t("span",{},[$t("span",{class:"mr-2"},""+t.length),n]):n,s=null==(e=d.propType)?void 0:e.ref;var o,i,u;return s&&(i=st(d.type).find(e=>e.type===s.model))&&(i=(i=_e(d.modelValue,i.name))&&s.refLabel&&_e(i,s.refLabel))?(u=(u=null==(u=c(s.model))?void 0:u.icon)?$t(eo,{image:u,class:"w-5 h-5 mr-1"}):null,$t("span",{class:"flex",title:s.model+" "+t},[u,i])):r}}}),Tv={key:0},Fv={key:0,class:"mr-2"},Iv=["innerHTML"],jv=["innerHTML"],Ov={inheritAttrs:!1},Dv=de({...Ov,__name:"PreviewFormat",props:{value:{},format:{},includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(e){let t=e,a=v(()=>Array.isArray(t.value));return(e,t)=>W(Rt)(e.value)?(o(),i("span",Tv,[e.includeCount&&a.value?(o(),i("span",Fv,O(e.value.length),1)):x("",!0),l("span",{innerHTML:W(ts)(e.value,e.format,e.$attrs)},null,8,Iv)])):(o(),i("span",{key:1,innerHTML:W(ts)(e.value,e.format,e.$attrs)},null,8,jv))}}),Pv=["innerHTML"],Bv={key:0},Hv=l("b",null,null,-1),Rv={key:2},Ev=de({__name:"HtmlFormat",props:{value:{},depth:{default:0},fieldAttrs:{},classes:{type:Function,default:(e,l,t,a,n)=>a}},setup(e){let t=e,r=v(()=>Tt(t.value)),s=v(()=>Array.isArray(t.value)),u=e=>cn(e),d=e=>t.fieldAttrs?t.fieldAttrs(e):null,c=v(()=>Gs(t.value));return(t,e)=>{let a=K("HtmlFormat",!0);return o(),i("div",{class:h(0==t.depth?"prose html-format":"")},[r.value?(o(),i("div",{key:0,innerHTML:W(ts)(t.value)},null,8,Pv)):s.value?(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,W(he).gridClass))},[W(Tt)(t.value[0])?(o(),i("div",Bv,"[ "+O(t.value.join(", "))+" ]",1)):(o(),i("div",{key:1,class:h(t.classes("array","div",t.depth,W(he).grid2Class))},[l("div",{class:h(t.classes("array","div",t.depth,W(he).grid3Class))},[l("div",{class:h(t.classes("array","div",t.depth,W(he).grid4Class))},[l("table",{class:h(t.classes("object","table",t.depth,W(he).tableClass))},[l("thead",{class:h(t.classes("array","thead",t.depth,W(he).theadClass))},[l("tr",null,[(o(!0),i(Me,null,je(c.value,e=>(o(),i("th",{class:h(t.classes("array","th",t.depth,W(he).theadCellClass+" whitespace-nowrap"))},[Hv,ke(O(u(e)),1)],2))),256))])],2),l("tbody",null,[(o(!0),i(Me,null,je(t.value,(l,e)=>(o(),i("tr",{class:h(t.classes("array","tr",t.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(o(!0),i(Me,null,je(c.value,e=>(o(),i("td",{class:h(t.classes("array","td",t.depth,W(he).tableCellClass))},[ye(a,Te({value:l[e],"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},d(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(o(),i("div",Rv,[l("table",{class:h(t.classes("object","table",t.depth,"table-object"))},[(o(!0),i(Me,null,je((n=t.value)?Object.keys(n).map(e=>({key:u(e),val:n[e]})):[],e=>(o(),i("tr",{class:h(t.classes("object","tr",t.depth,""))},[l("th",{class:h(t.classes("object","th",t.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},O(e.key),3),l("td",{class:h(t.classes("object","td",t.depth,"align-top py-2 px-4 text-sm"))},[ye(a,Te({value:e.val,"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},d(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),zv=["href"],Nv=["href","title"],Uv=de({__name:"MarkupFormat",props:{value:{},imageClass:{default:"w-8 h-8"}},setup(e){var l=e,t=La().getMimeType,a=l.value;let n=typeof l.value;l="string"===n&&a.length?t(a):null;return"string"===n&&a.length&&(((t=a.startsWith("https://")||a.startsWith("http://"))||"/"===a[0])&&null!=l&&l.startsWith("image/")?n="image":t&&(n="link")),(e,l)=>{var t=K("Icon"),a=K("HtmlFormat");return"link"==W(n)?(o(),i("a",{key:0,href:e.value,class:"text-indigo-600"},O(e.value),9,zv)):"image"==W(n)?(o(),i("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[ye(t,{src:e.value,class:h(e.imageClass)},null,8,["src","class"])],8,Nv)):(o(),ae(a,{key:2,value:e.value},null,8,["value"]))}}}),qv={class:"my-2 w-full"},Qv={class:"leading-7"},Kv={class:"px-2 text-left align-top"},Zv={colspan:"align-top"},Wv={class:"my-2 leading-7"},Gv={colspan:"2",class:"px-2 bg-indigo-700 text-white"},Jv={class:"leading-7"},Xv={colspan:"2",class:"px-2 align-top"},Yv=de({__name:"MarkupModel",props:{value:{},imageClass:{}},setup(e){let a=e,t=Object.keys(a.value),n={},r={};return t.forEach(e=>{var l=a.value[e],t=typeof l;null==l||"function"==t||"symbol"==t?n[e]=`(${null==l?"null":"t"})`:"object"==t?r[e]=l:n[e]=l}),(e,t)=>{let a=K("MarkupFormat");return o(),i("table",qv,[(o(),i(Me,null,je(n,(e,t)=>l("tr",Qv,[l("th",Kv,O(W(Pe)(t)),1),l("td",Zv,[ye(a,{value:e},null,8,["value"])])])),64)),(o(),i(Me,null,je(r,(e,t)=>(o(),i(Me,null,[l("tr",Wv,[l("td",Gv,O(W(Pe)(t)),1)]),l("tr",Jv,[l("td",Xv,[ye(a,{value:e},null,8,["value"])])])],64))),64))])}}}),ep={class:"absolute top-0 right-0 pt-4 pr-4"},tp=l("span",{class:"sr-only"},"Close",-1),sp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),lp=[tp,sp],np=de({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),i("div",ep,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:h([t.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},lp,2)]))}}),op=["id","aria-labelledby"],ap=l("div",{class:"fixed inset-0"},null,-1),rp={class:"fixed inset-0 overflow-hidden"},ip={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},up={class:"flex min-h-0 flex-1 flex-col overflow-auto"},dp={class:"flex-1"},cp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},fp={class:"flex items-start justify-between space-x-3"},vp={class:"space-y-1"},pp={key:0},mp=["id"],hp={key:2,class:"text-sm text-gray-500"},gp={class:"flex h-7 items-center"},yp={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},bp=de({__name:"SlideOver",props:{id:{default:"SlideOver"},title:{},contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(e,{emit:t}){let a=t,n=D(!1),r=D(""),s={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},u=(bt(n,()=>{yt(s,r,n.value),n.value||setTimeout(()=>a("done"),700)}),n.value=!0,()=>n.value=!1),d=e=>{"Escape"===e.key&&u()};return Ye(()=>window.addEventListener("keydown",d)),Ft(()=>window.removeEventListener("keydown",d)),(e,t)=>{var a=K("CloseButton");return o(),i("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[ap,l("div",rp,[l("div",{onMousedown:u,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:h(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",r.value])},[l("div",ip,[l("div",up,[l("div",dp,[l("div",cp,[l("div",fp,[l("div",vp,[e.$slots.title?(o(),i("div",pp,[U(e.$slots,"title")])):x("",!0),e.title?(o(),i("h2",{key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:e.id+"-title"},O(e.title),9,mp)):x("",!0),e.$slots.subtitle?(o(),i("p",hp,[U(e.$slots,"subtitle")])):x("",!0)]),l("div",gp,[ye(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:h(e.contentClass)},[U(e.$slots,"default")],2)])]),e.$slots.footer?(o(),i("div",yp,[U(e.$slots,"footer")])):x("",!0)])],2)],32)],32)])],8,op)}}}),wp=["id","data-transition-for","aria-labelledby"],kp={class:"fixed inset-0 z-10 overflow-y-auto"},_p={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},$p={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},Cp=l("span",{class:"sr-only"},"Close",-1),xp=l("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),Lp=[Cp,xp],Vp=de({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:nl.modalClass},sizeClass:{default:nl.sizeClass},closeButtonClass:{default:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"}},emits:["done"],setup(e,{emit:t}){let r=Ls(),a=t,n=D(!1),s=D(""),u={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},d=D(""),v={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},c=(bt(n,()=>{yt(u,s,n.value),yt(v,d,n.value),n.value||setTimeout(()=>a("done"),200)}),n.value=!0,()=>n.value=!1),p=(ss("ModalProvider",{openModal:function(e,l){p.value=e,f.value=l}}),D()),f=D();async function m(e){f.value&&f.value(e),p.value=void 0,f.value=void 0}let g=e=>{"Escape"===e.key&&c()};return Ye(()=>window.addEventListener("keydown",g)),Ft(()=>window.removeEventListener("keydown",g)),(e,t)=>{var a,n=K("ModalLookup");return o(),i("div",{id:e.id,"data-transition-for":e.id,onMousedown:c,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[l("div",{class:h(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",s.value])},null,2),l("div",kp,[l("div",_p,[l("div",{class:h([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[W(r).closebutton?U(e.$slots,"createform",{key:0}):(o(),i("div",$p,[l("button",{type:"button",onClick:c,class:h(e.closeButtonClass)},Lp,2)])),U(e.$slots,"default")])],34),U(e.$slots,"bottom")])]),"ModalLookup"==(null==(a=p.value)?void 0:a.name)&&p.value.ref?(o(),ae(n,{key:0,"ref-info":p.value.ref,onDone:m},null,8,["ref-info"])):x("",!0)],40,wp)}}}),Sp={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Mp={class:"mt-3 pl-5 flex flex-wrap items-center"},Ap={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Tp={class:"hidden md:inline"},Fp={class:"flex pb-1 sm:pb-0"},Ip=["title"],jp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("g",{"stroke-width":"1.5",fill:"none"},[l("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),Op=[jp],Dp=["disabled"],Pp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),Bp=[Pp],Hp=["disabled"],Rp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Ep=[Rp],zp=["disabled"],Np=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),Up=[Np],qp=["disabled"],Qp=l("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[l("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),Kp=[Qp],Zp={key:0,class:"flex pb-1 sm:pb-0"},Wp={class:"px-4 text-lg text-black dark:text-white"},Gp={key:0},Jp={key:1},Xp=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Yp={key:2},em={key:1,class:"pl-2"},tm=l("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),sm=[tm],lm={class:"flex pb-1 sm:pb-0"},nm={key:0,class:"pl-2"},om=l("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),am={class:"mr-1"},rm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},im=l("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),um=[im],dm={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},cm=l("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),fm=[cm],vm={key:1},pm={key:4},mm={key:0},hm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},gm={class:"mr-1 select-none"},ym={key:1,class:"flex justify-between items-center"},bm={class:"mr-1 select-none"},ln=25,wm=de({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:{},skip:{default:0},prefs:{},selectedColumns:{},allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:{},canFilter:{}},emits:["done"],setup(e,{emit:t}){let d=e,a=t,c=Ls(),n=It().config,{metadataApi:r,filterDefinitions:s}=lt(),u=Qe("client"),p=n.value.storage,f=v(()=>d.toolbarButtonClass??he.toolbarButtonClass),m=v(()=>s.value),g=D({take:ln}),y=D(new Xe),b=D(d.skip),w=D(!1),k=D(),C=e=>"string"==typeof e?e.split(","):e||[];function L(e,l){return he.getTableRowClass("fullWidth",l,!1,!0)}let M=v(()=>rt(d.refInfo.model)),V=v(()=>{var e=(0<(e=C(d.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());let t=st(M.value);return 0t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),G=v(()=>{let e=V.value.map(e=>e.name),l=C(g.value.selectedColumns).map(e=>e.toLowerCase());return 0l.includes(e.toLowerCase())):e}),S=v(()=>g.value.take??ln),T=v(()=>y.value.response?_e(y.value.response,"results"):[]),A=v(()=>{var e;return(null==(e=y.value.response)?void 0:e.total)??T.value.length??0}),F=v(()=>00T.value.length>=S.value),$=v(()=>T.value.length>=S.value),B=D([]),q=v(()=>B.value.some(e=>0B.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Q=v(()=>ns(M.value)),Z=v(()=>{var e;return null==(e=r.value)?void 0:e.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==d.refInfo.model&&qe.isAnyQuery(e)})}),J=D(),_=D(!1),P=D(),H=()=>d.id+"/ApiPrefs/"+d.refInfo.model,R=e=>`Column/${d.id}:${d.refInfo.model}.`+e;async function z(e){b.value+=e,b.value<0&&(b.value=0);var l=Math.floor(A.value/S.value)*S.value;b.value>l&&(b.value=l),await N()}async function X(e,l){a("done",e)}function Y(){a("done",null)}function ee(l,e){var t,a=e.target;"TD"!==(null==a?void 0:a.tagName)&&(a=null==(a=null==a?void 0:a.closest("TABLE"))?void 0:a.getBoundingClientRect(),t=B.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&a&&(a=("DIV"===(null==(a=e.target)?void 0:a.tagName)?e.target:null==(a=e.target)?void 0:a.closest("DIV")).getBoundingClientRect(),P.value={column:t,topLeft:{x:Math.max(Math.floor(a.x+25),343),y:Math.floor(115)}})}function le(){P.value=null}async function te(e){var l=null==(l=P.value)?void 0:l.column;l&&(l.settings=e,p.setItem(R(l.name),JSON.stringify(l.settings)),await N()),P.value=null}async function ne(e){p.setItem(R(e.name),JSON.stringify(e.settings)),await N()}async function re(e){_.value=!1,g.value=e,p.setItem(H(),JSON.stringify(e)),await N()}async function N(){var a=(()=>{let a={include:"total",take:S.value},e=C(g.value.selectedColumns||d.selectedColumns);var l;0{t.settings.sort&&n.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);a[l]=e.value})}),"u"{y.value.response=y.value.error=void 0,w.value=e}),t=await u.api(e);l(),St(()=>y.value=t);n=_e(t.response,"results")||[];t.succeeded&&n.label}else console.error("No Query API was found for "+d.refInfo.model)}async function se(){B.value.forEach(e=>{e.settings={filters:[]},p.removeItem(R(e.name))}),await N()}return Ye(async()=>{var e=d.prefs||$s(p.getItem(H()));e&&(g.value=e),B.value=V.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},$s(p.getItem(R(e.name))))})),isNaN(d.skip)||(b.value=d.skip),await N()}),(n,e)=>{let t=K("ErrorSummary"),a=K("Loading"),r=K("SettingsIcons"),s=K("DataGrid"),u=K("ModalDialog");return o(),i(Me,null,[n.refInfo?(o(),ae(u,{key:0,ref_key:"modalDialog",ref:J,id:n.id,onDone:Y},{default:xe(()=>[l("div",Sp,[l("div",Mp,[l("h3",Ap,[ke(" Select "),l("span",Tp,O(W(Pe)(n.refInfo.model)),1)]),l("div",Fp,[n.showPreferences?(o(),i("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:n.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>_.value=!_.value)},Op,8,Ip)):x("",!0),n.showPagingNav?(o(),i("button",{key:1,type:"button",class:h(["pl-2",F.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!F.value,onClick:e[1]||(e[1]=e=>z(-A.value))},Bp,10,Dp)):x("",!0),n.showPagingNav?(o(),i("button",{key:2,type:"button",class:h(["pl-2",I.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!I.value,onClick:e[2]||(e[2]=e=>z(-S.value))},Ep,10,Hp)):x("",!0),n.showPagingNav?(o(),i("button",{key:3,type:"button",class:h(["pl-2",j.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!j.value,onClick:e[3]||(e[3]=e=>z(S.value))},Up,10,zp)):x("",!0),n.showPagingNav?(o(),i("button",{key:4,type:"button",class:h(["pl-2",$.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!$.value,onClick:e[4]||(e[4]=e=>z(A.value))},Kp,10,qp)):x("",!0)]),n.showPagingInfo?(o(),i("div",Zp,[l("div",Wp,[w.value?(o(),i("span",Gp,"Querying...")):x("",!0),T.value.length?(o(),i("span",Jp,[Xp,ke(" "+O(b.value+1)+" - "+O(Math.min(b.value+T.value.length,A.value))+" ",1),l("span",null," of "+O(A.value),1)])):y.value.completed?(o(),i("span",Yp,"No Results")):x("",!0)])])):x("",!0),q.value&&n.showResetPreferences?(o(),i("div",em,[l("button",{type:"button",onClick:se,title:"Reset Preferences & Filters",class:h(f.value)},sm,2)])):x("",!0),l("div",lm,[n.showFiltersView&&0k.value="filters"==k.value?null:"filters"),class:h(f.value),"aria-expanded":"false"},[om,l("span",am,O(E.value)+" "+O(1==E.value?"Filter":"Filters"),1),"filters"!=k.value?(o(),i("svg",rm,um)):(o(),i("svg",dm,fm))],2)])):x("",!0)])]),"filters"==k.value?(o(),ae(Il,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:m.value,columns:B.value,onDone:e[6]||(e[6]=e=>k.value=null),onChange:ne},null,8,["definitions","columns"])):x("",!0),P.value?(o(),i("div",vm,[ye(Fl,{definitions:m.value,column:P.value.column,"top-left":P.value.topLeft,onDone:le,onSave:te},null,8,["definitions","column","top-left"])])):x("",!0),y.value.error?(o(),ae(t,{key:2,status:y.value.error},null,8,["status"])):w.value?(o(),ae(a,{key:3})):(o(),i("div",pm,[T.value.length?(o(),i("div",mm,[ye(s,{id:n.id,items:T.value,type:n.refInfo.model,"selected-columns":G.value,onFiltersChanged:N,tableStyle:"fullWidth",rowClass:L,onRowSelected:X,onHeaderSelected:ee},rl({header:xe(({column:t,label:e})=>{var a;return[!n.allowFiltering||d.canFilter&&!d.canFilter(t)?(o(),i("div",ym,[l("span",bm,O(e),1)])):(o(),i("div",hm,[l("span",gm,O(e),1),ye(r,{column:B.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=P.value)?void 0:a.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[je(Object.keys(W(c)),l=>({name:l,fn:xe(e=>[U(n.$slots,l,Et(ks(e)))])}))]),1032,["id","items","type","selected-columns"])])):x("",!0)]))])]),_:3},8,["id"])):x("",!0),_.value?(o(),ae(jl,{key:1,columns:V.value,prefs:g.value,onDone:e[7]||(e[7]=e=>_.value=!1),onSave:re},null,8,["columns","prefs"])):x("",!0)],64)}}}),km={class:"sm:hidden"},_m=["for"],$m=["id","name"],Cm=["value"],xm={class:"hidden sm:block"},Lm={class:"border-b border-gray-200"},Vm={class:"-mb-px flex","aria-label":"Tabs"},Sm=["onClick"],Mm=de({__name:"Tabs",props:{tabs:{},id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>Pe(e)},selected:{},tabClass:{},bodyClass:{default:"p-4"},url:{type:Boolean,default:!0},clearQuery:{type:Boolean,default:!1}},setup(e){let t=e,a=v(()=>Object.keys(t.tabs)),n=e=>t.label?t.label(e):Pe(e),r=v(()=>t.id||"tabs"),s=v(()=>t.param||"tab"),u=D();function d(e){u.value=e,t.url&&ul({tab:e===a.value[0]?void 0:e},t.clearQuery)}let c=v(()=>100/Object.keys(t.tabs).length+"%");return Ye(()=>{var e;u.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+ms(location.hash,"?"):""),e=Ws(e)[s.value])&&(u.value=e)}),(t,e)=>(o(),i("div",null,[l("div",km,[l("label",{for:r.value,class:"sr-only"},"Select a tab",8,_m),l("select",{id:r.value,name:r.value,class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:e[0]||(e[0]=e=>{var l;return d(null==(l=e.target)?void 0:l.value)})},[(o(!0),i(Me,null,je(a.value,e=>(o(),i("option",{key:e,value:e},O(n(e)),9,Cm))),128))],40,$m)]),l("div",xm,[l("div",Lm,[l("nav",Vm,[(o(!0),i(Me,null,je(a.value,l=>{return o(),i("a",{href:"#",onClick:Ue(e=>d(l),["prevent"]),style:ol({width:c.value}),class:h([(e=l,u.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),t.tabClass])},O(n(l)),15,Sm);var e}),256))])])]),l("div",{class:h(t.bodyClass)},[(o(),ae(an(t.tabs[u.value])))],2)]))}}),Am=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),Tm=[Am],Fm=l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[l("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),Im=[Fm],jm=de({__name:"DarkModeToggle",setup(e){let a=typeof document<"u"?document.documentElement:null,n=()=>!(null==a||!a.classList.contains("dark")),r=D("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(o(),i("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n()?null!=a&&a.classList.remove("dark"):null!=a&&a.classList.add("dark"),r.value=n(),localStorage.setItem("color-scheme",r.value?"dark":"light")})},[l("span",{class:h(`${r.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[l("span",{class:h(`${r.value?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Tm,2),l("span",{class:h(`${r.value?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Im,2)],2)]))}}),Om={key:0},Dm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Pm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Bm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Hm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Rm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Em=["onClick"],zm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Nm={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},Um={class:"mt-8"},qm={key:1,class:"mt-6"},Qm=xs('
Or continue with
',1),Km={class:"mt-6 grid grid-cols-3 gap-3"},Zm=["href","title"],Wm={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Gm=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),Jm=l("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),Xm=[Gm,Jm],Ym=de({__name:"SignIn",props:{provider:{},title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(e,{emit:t}){let a=e,n=t,{getMetadata:r,createDto:s}=lt(),u=Ps(),d=Qe("client"),c=Tl().signIn,p=r({assert:!0}),f=p.plugins.auth,m=document.baseURI,g=p.app.baseUrl,y=D(s("Authenticate")),b=D(new Xe),w=D(a.provider),k=(Ye(()=>{null!=f&&f.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]="checkbox"!==e.type&&""))}),v(()=>(null==f?void 0:f.authProviders.filter(e=>e.formLayout))||[])),C=v(()=>k.value[0]||{}),L=v(()=>k.value[Math.max(k.value.length-1,0)]||{}),M=v(()=>(w.value?null==f?void 0:f.authProviders.find(e=>e.name===w.value):null)??C.value),V=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}let T=v(()=>{var e;return((null==(e=M.value)?void 0:e.formLayout)||[]).map(e=>{var l;return Object.assign({},e,{type:null==(l=e.type)?void 0:l.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(l=e.type)?void 0:l.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),A=v(()=>!V(a.oauth)&&(null==f?void 0:f.authProviders.filter(e=>"oauth"===e.type))||[]),F=v(()=>{let e=Ho(null==f?void 0:f.authProviders.filter(e=>e.formLayout&&0{e[S(l)||at(l.name)]=l.name===C.value.name?"":l.name});var l=M.value;return e=l&&V(a.tabs)?{[S(l)||at(l.name)]:l}:e}),I=v(()=>{var e=T.value.map(e=>e.id).filter(e=>e);return b.value.summaryMessage(e)});async function j(){var e;y.value.provider=M.value.name,"authsecret"===M.value.name?(d.headers.set("authsecret",y.value.authsecret),y.value=s("Authenticate")):"basic"===M.value.name?(d.setCredentials(y.value.UserName,y.value.Password),y.value=s("Authenticate"),y.value.UserName=null,y.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=y.value.BearerToken,y.value=s("Authenticate")),b.value=await u.api(y.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new Xe,y.value=s("Authenticate"))}return(e,t)=>{let a=K("ErrorSummary"),n=K("AutoFormFields"),r=K("PrimaryButton"),s=K("Icon"),u=_o("href");return W(f)?(o(),i("div",Dm,[l("div",Pm,[l("h2",Bm,O(e.title),1),1Mt((o(),i("a",{onClick:e=>w.value=l,class:h([""===l||l===C.value.name?"rounded-l-md":l===L.value.name?"rounded-r-md -ml-px":"-ml-px",w.value===l?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[ke(O(e),1)],10,Em)),[[u,{provider:l}]])),256))])])):x("",!0)]),l("div",zm,[I.value?(o(),ae(a,{key:0,class:"mb-3",errorSummary:I.value},null,8,["errorSummary"])):x("",!0),l("div",Nm,[T.value.length?(o(),i("form",{key:0,onSubmit:Ue(j,["prevent"])},[ye(n,{modelValue:y.value,formLayout:T.value,api:b.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),l("div",Um,[ye(r,{class:"w-full"},{default:xe(()=>[ke("Sign In")]),_:1})])],32)):x("",!0),A.value.length?(o(),i("div",qm,[Qm,l("div",Km,[(o(!0),i(Me,null,je(A.value,e=>(o(),i("div",null,[l("a",{href:W(g)+e.navItem.href+"?continue="+W(m),title:S(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[e.icon?(o(),ae(s,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(o(),i("svg",Wm,Xm))],8,Zm)]))),256))])])):x("",!0)])])])):(o(),i("div",Om,"No Auth Plugin"))}}}),e1=["for"],t1={key:1,class:"border border-gray-200 flex justify-between"},s1={class:"p-2 flex flex-wrap gap-x-4"},l1=l("title",null,"Bold text (CTRL+B)",-1),n1=l("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),o1=[l1,n1],a1=l("title",null,"Italics (CTRL+I)",-1),r1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),i1=[a1,r1],u1=l("title",null,"Insert Link (CTRL+K)",-1),d1=l("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),c1=[u1,d1],f1=l("title",null,"Blockquote (CTRL+Q)",-1),v1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),p1=[f1,v1],m1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),h1=l("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),g1=[m1,h1],y1=l("title",null,"Insert Code (CTRL+<)",-1),b1=l("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),w1=[y1,b1],k1=l("title",null,"H2 Heading (CTRL+H)",-1),_1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),$1=[k1,_1],C1=l("title",null,"Numbered List (ALT+1)",-1),x1=l("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),L1=[C1,x1],V1=l("title",null,"Bulleted List (ALT+-)",-1),S1=l("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),M1=[V1,S1],A1=l("title",null,"Strike Through (ALT+S)",-1),T1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),F1=[A1,T1],I1=l("title",null,"Undo (CTRL+Z)",-1),j1=l("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),O1=[I1,j1],D1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),P1=l("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),B1=[D1,P1],H1={key:0,class:"p-2 flex flex-wrap gap-x-4"},R1=["href"],E1=l("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),z1=[E1],N1={class:""},U1=["name","id","label","value","rows","disabled"],q1=["id"],Q1=["id"],Je="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",K1=de({__name:"MarkdownInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},counter:{type:Boolean},rows:{},errorMessages:{},lang:{},autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:{}},emits:["update:modelValue","close"],setup(e,{expose:t,emit:a}){let n=e,r=a,y=[],b=[],s=Qe("ApiState",void 0),u=v(()=>mt.call({responseStatus:n.status??(null==s?void 0:s.error.value)},n.id)),d=v(()=>n.label??Pe(at(n.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),p=v(()=>n.hide?Vt(c,n.hide):Vt(c,[]));function f(e){return p.value[e]}let m=v(()=>["shadow-sm font-mono"+ot.base.replace("rounded-md",""),u.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ot.valid,n.inputClass]),w=D();function k(e){r("update:modelValue",e)}function g(){return w.value.selectionStart!==w.value.selectionEnd}function C(){var e=w.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function L(){var e=w.value,l=e.value,t=e.selectionStart,e=l.substring(t,e.selectionEnd)||"",a=l.substring(0,t),n=a.lastIndexOf(` `);return{value:l,sel:e,selPos:t,beforeSel:a,afterSel:l.substring(t),prevCRPos:n,beforeCR:0<=n?a.substring(0,n+1):"",afterCR:0<=n?a.substring(n+1):""}}function M({value:e,selectionStart:l,selectionEnd:t}){null==t&&(t=l),k(e),St(()=>{w.value.focus(),w.value.setSelectionRange(l,t)})}function V(e,l,t="",{selectionAtEnd:a,offsetStart:n,offsetEnd:r,filterValue:s,filterSelection:o}={}){let i=w.value,u=i.value,d=i.selectionEnd;y.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),b=[];var v,c=i.selectionStart,p=i.selectionEnd,f=u.substring(0,c),m=u.substring(p),g=e&&f.endsWith(e)&&m.startsWith(l);c==p?(g?(u=f.substring(0,f.length-e.length)+m.substring(l.length),d+=-l.length):(u=f+e+t+l+m,d+=e.length,n=0,r=(null==t?void 0:t.length)||0,a&&(d+=r,r=0)),s&&(v={pos:d},u=s(u,v),d=v.pos)):(v=u.substring(c,p),o&&(v=o(v)),g?(u=f.substring(0,f.length-e.length)+v+m.substring(l.length),n=-v.length-e.length,r=v.length):(u=f+e+v+l+m,n?d+=(e+l).length:(d=c,n=e.length,r=v.length))),k(u),St(()=>{i.focus(),n=d+(n||0),r=(n||0)+(r||0),i.setSelectionRange(n,r)})}t({props:n,textarea:w,updateModelValue:k,selection:C,hasSelection:g,selectionInfo:L,insert:V,replace:M});let S=()=>V("**","**","bold"),T=()=>V("_","_","italics"),A=()=>V("~~","~~","strikethrough"),F=()=>V("[","](https://)","",{offsetStart:-9,offsetEnd:8}),I=()=>V(` > `,` `,"Blockquote",{}),j=()=>V("![](",")");function $(e){var l,t=C();t&&!e.shiftKey?V("`","`","code"):(l=n.lang||"js",-1===t.indexOf(` @@ -34,4 +34,4 @@ var ho=Object.defineProperty,go=(e,l,t)=>l in e?ho(e,l,{enumerable:!0,configurab `,""),e.preventDefault());else{{let{sel:e,selPos:l,beforeSel:a,afterSel:n,prevCRPos:r,beforeCR:s,afterCR:o}=L();e.startsWith("//")||o.startsWith("//")?V("","","",{filterValue:(e,l)=>{var t;return 0<=r&&(t=o.replace(/^\/\//,""),a=s+t,l.pos-=o.length-t.length),a+n},filterSelection:e=>e.replace(/^\/\//g,"").replace(/\n\/\//g,` `)}):e?V("","","//",{selectionAtEnd:!0,filterSelection:e=>"//"+e.replace(/\n$/,"").replace(/\n/g,` //`)+` -`}):M({value:s+"//"+o+n,selectionStart:l+2})}e.preventDefault()}else I(),e.preventDefault();else T(),e.preventDefault();else _(),e.preventDefault();else S(),e.preventDefault();else e.altKey&&("1"===e.key||"0"===e.key?(B(),e.preventDefault()):"-"===e.key?(E(),e.preventDefault()):"s"===e.key&&(A(),e.preventDefault()))}}}),(e,t)=>{var a;return o(),i("div",null,[U(e.$slots,"header",Te({inputElement:w.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs)),d.value?(o(),i("label",{key:0,for:e.id,class:h("mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(d.value),11,e1)):x("",!0),e.disabled?x("",!0):(o(),i("div",t1,[l("div",s1,[f("bold")?(o(),i("svg",{key:0,class:h(Je),onClick:S,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},o1)):x("",!0),f("italics")?(o(),i("svg",{key:1,class:h(Je),onClick:T,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},i1)):x("",!0),f("link")?(o(),i("svg",{key:2,class:h(Je),onClick:F,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},c1)):x("",!0),f("blockquote")?(o(),i("svg",{key:3,class:h(Je),onClick:I,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},p1)):x("",!0),f("image")?(o(),i("svg",{key:4,class:h(Je),onClick:j,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},g1)):x("",!0),f("code")?(o(),i("svg",{key:5,class:h(Je),onClick:$,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},w1)):x("",!0),f("heading")?(o(),i("svg",{key:6,class:h(Je),onClick:_,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},$1)):x("",!0),f("orderedList")?(o(),i("svg",{key:7,class:h(Je),icon:"",onClick:B,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},L1)):x("",!0),f("unorderedList")?(o(),i("svg",{key:8,class:h(Je),onClick:E,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},M1)):x("",!0),f("strikethrough")?(o(),i("svg",{key:9,class:h(Je),onClick:A,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},F1)):x("",!0),f("undo")?(o(),i("svg",{key:10,class:h(Je),onClick:P,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},O1)):x("",!0),f("redo")?(o(),i("svg",{key:11,class:h(Je),onClick:H,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},B1)):x("",!0),U(e.$slots,"toolbarbuttons",{instance:null==(a=Be())?void 0:a.exposed})]),f("help")&&e.helpUrl?(o(),i("div",H1,[l("a",{title:"formatting help",target:"_blank",href:e.helpUrl,tabindex:"-1"},[(o(),i("svg",{class:h(Je),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},z1))],8,R1)])):x("",!0)])),l("div",N1,[l("textarea",{ref_key:"txt",ref:w,name:e.id,id:e.id,class:h(m.value),label:e.label,value:e.modelValue,rows:e.rows||6,disabled:e.disabled,onInput:t[0]||(t[0]=e=>{var l;return k((null==(l=e.target)?void 0:l.value)||"")}),onKeydown:on(R,["tab"])},null,42,U1)]),u.value?(o(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(u.value),9,q1)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Q1)):x("",!0),U(e.$slots,"footer",Te({inputElement:w.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs))])}}}),Z1={key:0,class:"relative z-10 lg:hidden",role:"dialog","aria-modal":"true"},W1={class:"fixed inset-0 flex"},G1=l("span",{class:"sr-only"},"Close sidebar",-1),J1=l("svg",{class:"h-6 w-6 text-white dark:text-black",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),X1=[G1,J1],Y1={class:"flex grow flex-col gap-y-5 overflow-y-auto bg-white dark:bg-black px-6 pb-2"},eh={class:"hidden lg:fixed lg:inset-y-0 lg:z-10 lg:flex lg:w-72 lg:flex-col"},th={class:"flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-black px-6"},sh={class:h(["sticky top-0 flex items-center gap-x-6 bg-white dark:bg-black px-4 py-4 shadow-sm sm:px-6 lg:hidden"])},lh=l("span",{class:"sr-only"},"Open sidebar",-1),nh=l("svg",{class:"h-6 w-6",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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})],-1),oh=[lh,nh],ah=de({__name:"SidebarLayout",setup(e,{expose:t}){let a=bn().transition,n=D(!0),r=D(""),s={entering:{cls:"transition-opacity ease-linear duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"transition-opacity ease-linear duration-300",from:"opacity-100",to:"opacity-0"}},u=D(""),d={entering:{cls:"transition ease-in-out duration-300 transform",from:"-translate-x-full",to:"translate-x-0"},leaving:{cls:"transition ease-in-out duration-300 transform",from:"translate-x-0",to:"-translate-x-full"}},v=D(""),c={entering:{cls:"ease-in-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in-out duration-300",from:"opacity-100",to:"opacity-0"}};function p(e){a(s,r,e),a(d,u,e),a(c,v,e),setTimeout(()=>n.value=e,300)}function f(){p(!0)}function m(){p(!1)}return t({show:f,hide:m,toggle:p}),(e,t)=>(o(),i("div",null,[n.value?(o(),i("div",Z1,[l("div",{class:h(["fixed inset-0 bg-gray-900/80",r.value])},null,2),l("div",W1,[l("div",{class:h(["relative mr-16 flex w-full max-w-xs flex-1",u.value])},[l("div",{class:h(["absolute left-full top-0 flex w-16 justify-center pt-5",v.value])},[l("button",{type:"button",onClick:m,class:"-m-2.5 p-2.5"},X1)],2),l("div",Y1,[U(e.$slots,"default")])],2)])])):x("",!0),l("div",eh,[l("div",th,[U(e.$slots,"default")])]),l("div",sh,[l("button",{type:"button",onClick:f,class:"-m-2.5 p-2.5 text-gray-700 dark:text-gray-200 lg:hidden"},oh),U(e.$slots,"mobiletitlebar")])]))}}),rh={Alert:ea,AlertSuccess:fa,ErrorSummary:ga,InputDescription:ba,Icon:eo,Loading:pr,OutlineButton:gr,PrimaryButton:wr,SecondaryButton:$r,TextLink:xr,Breadcrumbs:Tr,Breadcrumb:Dr,NavList:Hr,NavListItem:Gr,AutoQueryGrid:wd,SettingsIcons:jd,FilterViews:Il,FilterColumn:Fl,QueryPrefs:jl,EnsureAccess:lo,EnsureAccessDialog:Od,TextInput:Ud,TextareaInput:Jd,SelectInput:lc,CheckboxInput:cc,TagInput:Ic,FileInput:s0,Autocomplete:y0,Combobox:k0,DynamicInput:_0,LookupInput:B0,AutoFormFields:H0,AutoForm:uf,AutoCreateForm:Af,AutoEditForm:Jf,AutoViewForm:hv,ConfirmDelete:yv,FormLoading:Cv,DataGrid:Mv,CellFormat:Av,PreviewFormat:Dv,HtmlFormat:Ev,MarkupFormat:Uv,MarkupModel:Yv,CloseButton:np,SlideOver:bp,ModalDialog:Vp,ModalLookup:wm,Tabs:Mm,DarkModeToggle:jm,SignIn:Ym,MarkdownInput:K1,SidebarLayout:ah},Ks=rh,vh={install(l){function t(l){var e=Object.keys(l).filter(e=>l[e]).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(l[e])).join("&");return e?"?"+e:"./"}Object.keys(Ks).forEach(e=>{l.component(e,Ks[e])}),l.directive("href",function(e,l){e.href=t(l.value),e.onclick=e=>{e.preventDefault(),history.pushState(l.value,"",t(l.value))}})},component(e,l){return e?l?J.components[e]=l:J.components[e]||Ks[e]||null:null}};export{fh as css,vh as default,Tl as useAuth,Ps as useClient,It as useConfig,La as useFiles,ch as useFormatters,lt as useMetadata,bn as useUtils}; \ No newline at end of file +`}):M({value:s+"//"+o+n,selectionStart:l+2})}e.preventDefault()}else I(),e.preventDefault();else T(),e.preventDefault();else _(),e.preventDefault();else S(),e.preventDefault();else e.altKey&&("1"===e.key||"0"===e.key?(B(),e.preventDefault()):"-"===e.key?(E(),e.preventDefault()):"s"===e.key&&(A(),e.preventDefault()))}}}),(e,t)=>{var a;return o(),i("div",null,[U(e.$slots,"header",Te({inputElement:w.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs)),d.value?(o(),i("label",{key:0,for:e.id,class:h("mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},O(d.value),11,e1)):x("",!0),e.disabled?x("",!0):(o(),i("div",t1,[l("div",s1,[f("bold")?(o(),i("svg",{key:0,class:h(Je),onClick:S,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},o1)):x("",!0),f("italics")?(o(),i("svg",{key:1,class:h(Je),onClick:T,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},i1)):x("",!0),f("link")?(o(),i("svg",{key:2,class:h(Je),onClick:F,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},c1)):x("",!0),f("blockquote")?(o(),i("svg",{key:3,class:h(Je),onClick:I,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},p1)):x("",!0),f("image")?(o(),i("svg",{key:4,class:h(Je),onClick:j,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},g1)):x("",!0),f("code")?(o(),i("svg",{key:5,class:h(Je),onClick:$,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},w1)):x("",!0),f("heading")?(o(),i("svg",{key:6,class:h(Je),onClick:_,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},$1)):x("",!0),f("orderedList")?(o(),i("svg",{key:7,class:h(Je),icon:"",onClick:B,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},L1)):x("",!0),f("unorderedList")?(o(),i("svg",{key:8,class:h(Je),onClick:E,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},M1)):x("",!0),f("strikethrough")?(o(),i("svg",{key:9,class:h(Je),onClick:A,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},F1)):x("",!0),f("undo")?(o(),i("svg",{key:10,class:h(Je),onClick:P,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},O1)):x("",!0),f("redo")?(o(),i("svg",{key:11,class:h(Je),onClick:H,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},B1)):x("",!0),U(e.$slots,"toolbarbuttons",{instance:null==(a=Be())?void 0:a.exposed})]),f("help")&&e.helpUrl?(o(),i("div",H1,[l("a",{title:"formatting help",target:"_blank",href:e.helpUrl,tabindex:"-1"},[(o(),i("svg",{class:h(Je),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},z1))],8,R1)])):x("",!0)])),l("div",N1,[l("textarea",{ref_key:"txt",ref:w,name:e.id,id:e.id,class:h(m.value),label:e.label,value:e.modelValue,rows:e.rows||6,disabled:e.disabled,onInput:t[0]||(t[0]=e=>{var l;return k((null==(l=e.target)?void 0:l.value)||"")}),onKeydown:on(R,["tab"])},null,42,U1)]),u.value?(o(),i("p",{key:2,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},O(u.value),9,q1)):e.help?(o(),i("p",{key:3,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},O(e.help),9,Q1)):x("",!0),U(e.$slots,"footer",Te({inputElement:w.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs))])}}}),Z1={key:0,class:"relative z-10 lg:hidden",role:"dialog","aria-modal":"true"},W1={class:"fixed inset-0 flex"},G1=l("span",{class:"sr-only"},"Close sidebar",-1),J1=l("svg",{class:"h-6 w-6 text-white dark:text-black",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),X1=[G1,J1],Y1={class:"flex grow flex-col gap-y-5 overflow-y-auto bg-white dark:bg-black px-6 pb-2"},eh={class:"hidden lg:fixed lg:inset-y-0 lg:z-10 lg:flex lg:w-72 lg:flex-col"},th={class:"flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-black px-6"},sh={class:h(["sticky top-0 flex items-center gap-x-6 bg-white dark:bg-black px-4 py-4 shadow-sm sm:px-6 lg:hidden"])},lh=l("span",{class:"sr-only"},"Open sidebar",-1),nh=l("svg",{class:"h-6 w-6",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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})],-1),oh=[lh,nh],ah=de({__name:"SidebarLayout",setup(e,{expose:t}){let a=bn().transition,n=D(!0),r=D(""),s={entering:{cls:"transition-opacity ease-linear duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"transition-opacity ease-linear duration-300",from:"opacity-100",to:"opacity-0"}},u=D(""),d={entering:{cls:"transition ease-in-out duration-300 transform",from:"-translate-x-full",to:"translate-x-0"},leaving:{cls:"transition ease-in-out duration-300 transform",from:"translate-x-0",to:"-translate-x-full"}},v=D(""),c={entering:{cls:"ease-in-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in-out duration-300",from:"opacity-100",to:"opacity-0"}};function p(e){a(s,r,e),a(d,u,e),a(c,v,e),setTimeout(()=>n.value=e,300)}function f(){p(!0)}function m(){p(!1)}return t({show:f,hide:m,toggle:p}),(e,t)=>(o(),i("div",null,[n.value?(o(),i("div",Z1,[l("div",{class:h(["fixed inset-0 bg-gray-900/80",r.value])},null,2),l("div",W1,[l("div",{class:h(["relative mr-16 flex w-full max-w-xs flex-1",u.value])},[l("div",{class:h(["absolute left-full top-0 flex w-16 justify-center pt-5",v.value])},[l("button",{type:"button",onClick:m,class:"-m-2.5 p-2.5"},X1)],2),l("div",Y1,[U(e.$slots,"default")])],2)])])):x("",!0),l("div",eh,[l("div",th,[U(e.$slots,"default")])]),l("div",sh,[l("button",{type:"button",onClick:f,class:"-m-2.5 p-2.5 text-gray-700 dark:text-gray-200 lg:hidden"},oh),U(e.$slots,"mobiletitlebar")])]))}}),rh={Alert:ea,AlertSuccess:fa,ErrorSummary:ga,InputDescription:ba,Icon:eo,Loading:pr,OutlineButton:gr,PrimaryButton:wr,SecondaryButton:$r,TextLink:xr,Breadcrumbs:Tr,Breadcrumb:Dr,NavList:Hr,NavListItem:Gr,AutoQueryGrid:wd,SettingsIcons:jd,FilterViews:Il,FilterColumn:Fl,QueryPrefs:jl,EnsureAccess:lo,EnsureAccessDialog:Od,TextInput:Ud,TextareaInput:Jd,SelectInput:lc,CheckboxInput:cc,TagInput:Ic,FileInput:s0,Autocomplete:y0,Combobox:k0,DynamicInput:_0,LookupInput:B0,AutoFormFields:H0,AutoForm:uf,AutoCreateForm:Af,AutoEditForm:Jf,AutoViewForm:hv,ConfirmDelete:yv,FormLoading:Cv,DataGrid:Mv,CellFormat:Av,PreviewFormat:Dv,HtmlFormat:Ev,MarkupFormat:Uv,MarkupModel:Yv,CloseButton:np,SlideOver:bp,ModalDialog:Vp,ModalLookup:wm,Tabs:Mm,DarkModeToggle:jm,SignIn:Ym,MarkdownInput:K1,SidebarLayout:ah},Ks=rh,vh={install(l){function t(l){var e=Object.keys(l).filter(e=>l[e]).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(l[e])).join("&");return e?"?"+e:"./"}Object.keys(Ks).forEach(e=>{l.component(e,Ks[e])}),l.directive("href",function(e,l){e.href=t(l.value),e.onclick=e=>{e.preventDefault(),history.pushState(l.value,"",t(l.value))}})},component(e,l){return e?l?G.components[e]=l:G.components[e]||Ks[e]||null:null}};export{fh as css,vh as default,Tl as useAuth,Ps as useClient,It as useConfig,La as useFiles,ch as useFormatters,lt as useMetadata,bn as useUtils}; \ No newline at end of file diff --git a/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.mjs b/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.mjs index 35aeba3..7825292 100644 --- a/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.mjs +++ b/BlazorDiffusion/wwwroot/lib/mjs/servicestack-vue.mjs @@ -1,8 +1,8 @@ var ho = Object.defineProperty; var go = (e, t, s) => t in e ? ho(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s; var Le = (e, t, s) => (go(e, typeof t != "symbol" ? t + "" : t, s), s); -import { defineComponent as de, computed as v, openBlock as o, createElementBlock as i, normalizeClass as h, createElementVNode as l, createCommentVNode as x, renderSlot as U, ref as D, toDisplayString as O, inject as Qe, nextTick as St, isRef as nn, unref as 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"; +import { defineComponent as de, computed as v, openBlock as o, createElementBlock as i, normalizeClass as h, createElementVNode as l, createCommentVNode as x, renderSlot as U, ref as D, toDisplayString as O, inject as Qe, nextTick as St, isRef as nn, unref as W, mergeProps as Te, withModifiers as Ue, h as $t, resolveComponent as K, createBlock as ae, withCtx as xe, useAttrs as yo, createVNode as ye, createTextVNode as ke, watchEffect as ws, normalizeStyle as ol, Fragment as Me, renderList as je, withDirectives as Mt, vModelCheckbox as al, withKeys as on, createStaticVNode as xs, vModelSelect as bo, useSlots as Ls, getCurrentInstance as Be, onMounted as Ye, createSlots as rl, normalizeProps as Et, guardReactiveProps as ks, vModelDynamic as wo, onUnmounted as Ft, watch as bt, vModelText as ko, resolveDynamicComponent as an, provide as ss, resolveDirective as _o } from "vue"; +import { errorResponseExcept as $o, toDate as pt, toTime as Co, omit as ft, enc as Zs, appendQueryString as zt, lastLeftPart as rn, setQueryString as xo, nameOf as Lo, ApiResult as Xe, lastRightPart as At, leftPart as Vs, map as Ze, toDateTime as Vo, toCamelCase as So, mapGet as _e, chop as Mo, fromXsdDuration as un, isDate as Ss, timeFmt12 as Ao, dateFmt as To, apiValue as Fo, indexOfAny as Io, createBus as jo, toKebabCase as Wl, sanitize as Oo, humanize as Pe, delaySet as dn, rightPart as ms, queryString as Ws, combinePaths as Do, toPascalCase as at, errorResponse as mt, trimEnd as Po, $1 as _s, ResponseStatus as qs, ResponseError as Gl, HttpMethods as il, omitEmpty as Bo, uniqueKeys as Gs, humanify as cn, each as Ho } from "@servicestack/client"; const Ro = { class: "flex items-center" }, Eo = { key: 0, class: "flex-shrink-0 mr-3" @@ -207,8 +207,8 @@ function vn(e) { return e == null ? "" : Co(e); } function pn(e, t) { - if (J.config.inputValue) - return J.config.inputValue(e, t); + if (G.config.inputValue) + return G.config.inputValue(e, t); let s = e === "date" ? Ms(t) : e === "datetime-local" ? fn(t) : e === "time" ? vn(t) : t; const n = typeof s; return s = s == null ? "" : n == "boolean" || n == "number" ? `${s}` : s, s; @@ -219,7 +219,7 @@ function mn(e, t) { function Dt(e) { return Object.keys(e).forEach((t) => { const s = e[t]; - e[t] = nn(s) ? G(s) : s; + e[t] = nn(s) ? W(s) : s; }), e; } function yt(e, t, s) { @@ -237,7 +237,7 @@ function hs(e) { u > -1 && (r[u + 1] || r[0]).focus(); } } -function qt(e) { +function Qt(e) { if (!e) return null; if (typeof e == "string") @@ -270,7 +270,7 @@ let wa = ["string", "number", "boolean", "null", "undefined"]; function Tt(e) { return wa.indexOf(typeof e) >= 0 || e instanceof Date; } -function Xt(e) { +function Rt(e) { return !Tt(e); } class hn { @@ -298,7 +298,7 @@ function $s(e) { } function ul(e, t) { if (typeof history < "u") { - const s = t ? Et(rn(location.href, "?"), e) : xo(location.href, e); + const s = t ? zt(rn(location.href, "?"), e) : xo(location.href, e); history.pushState({}, "", s); } } @@ -315,16 +315,16 @@ function Xs(e) { typeof navigator < "u" && navigator.clipboard.writeText(e); } function cl(e) { - const t = J.config.storage.getItem(e); + const t = G.config.storage.getItem(e); return t ? JSON.parse(t) : null; } function Ts(e, t) { - return Et(`swr.${Lo(e)}`, t ? Object.assign({}, e, t) : e); + return zt(`swr.${Lo(e)}`, t ? Object.assign({}, e, t) : e); } function ka(e) { if (e.request) { const t = Ts(e.request, e.args); - J.config.storage.removeItem(t); + G.config.storage.removeItem(t); } } async function gn(e, t, s, n, a) { @@ -334,7 +334,7 @@ async function gn(e, t, s, n, a) { if (u.succeeded && u.response) { u.response._date = (/* @__PURE__ */ new Date()).valueOf(); const d = JSON.stringify(u.response); - J.config.storage.setItem(r, d), s(u); + G.config.storage.setItem(r, d), s(u); } return u; } @@ -364,13 +364,13 @@ function bn() { unRefs: Dt, transition: yt, focusNextElement: hs, - getTypeName: qt, + getTypeName: Qt, htmlTag: dt, htmlAttrs: Js, linkAttrs: As, toAppUrl: Ht, isPrimitive: Tt, - isComplexType: Xt, + isComplexType: Rt, pushState: ul, scopedExpr: dl, copyText: Xs, @@ -479,9 +479,9 @@ function xt(e) { if (!e) return null; let t = ls(e); - return t == null || ml(e) ? e : Jt(t) || fl(gs.doc); + return t == null || ml(e) ? e : Xt(t) || fl(gs.doc); } -function Jt(e) { +function Xt(e) { let t = xn(e); return t && fl(t) || null; } @@ -508,7 +508,7 @@ function Fs(e, t) { e.onerror = null, e.src = gl(e.src, t) || ""; } function gl(e, t) { - return Jt(At(e, ".").toLowerCase()) || (t ? Jt(t) || t : null) || Jt("doc"); + return Xt(At(e, ".").toLowerCase()) || (t ? Xt(t) || t : null) || Xt("doc"); } function el(e) { if (!e) @@ -519,7 +519,7 @@ function el(e) { function La() { return { extSvg: xn, - extSrc: Jt, + extSrc: Xt, getExt: ls, encodeSvg: _n, canPreview: ml, @@ -552,7 +552,7 @@ class Va { return {}; } } -const zt = "/metadata/app.json", Sa = { +const Nt = "/metadata/app.json", Sa = { Boolean: "checkbox", DateTime: "date", DateOnly: "date", @@ -605,7 +605,7 @@ function Ln(e, t) { function Ta(e) { return e && Ln(e.name, e.genericArgs); } -class Nt { +class Ut { constructor() { Le(this, "Query"); Le(this, "QueryInto"); @@ -634,19 +634,19 @@ class Nt { qe.isQueryInto(t) && !this.QueryInto ? this.QueryInto = t : qe.isQuery(t) && !this.Query ? this.Query = t : qe.isCreate(t) && !this.Create ? this.Create = t : qe.isUpdate(t) && !this.Update ? this.Update = t : qe.isPatch(t) && !this.Patch ? this.Patch = t : qe.isDelete(t) && !this.Delete && (this.Delete = t); } static from(t) { - const s = new Nt(); + const s = new Ut(); return t.forEach((n) => { s.add(n); }), s; } static forType(t, s) { var a; - let n = new Nt(); - if (J.config.apisResolver && t) { - const r = J.config.apisResolver(t, s); + let n = new Ut(); + if (G.config.apisResolver && t) { + const r = G.config.apisResolver(t, s); r && (n.Query = r.Query, n.QueryInto = r.QueryInto, n.Create = r.Create, n.Update = r.Update, n.Patch = r.Patch, n.Delete = r.Delete); } - return t && (s ?? (s = (a = J.metadata.value) == null ? void 0 : a.api), s == null || s.operations.forEach((r) => { + return t && (s ?? (s = (a = G.metadata.value) == null ? void 0 : a.api), s == null || s.operations.forEach((r) => { var u; ((u = r.dataModel) == null ? void 0 : u.name) == t && n.add(r); })), n; @@ -788,32 +788,32 @@ function bl(e) { return ((t = e == null ? void 0 : e.api) == null ? void 0 : t.operations) && e.api.operations.length > 0; } function Pa(e) { - if (!wl() && (e != null && e.assert) && !J.metadata.value) + if (!wl() && (e != null && e.assert) && !G.metadata.value) throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata"); - return J.metadata.value; + return G.metadata.value; } function es(e) { - return e && bl(e) ? (e.date = Vo(/* @__PURE__ */ new Date()), J.metadata.value = e, typeof localStorage < "u" && localStorage.setItem(zt, JSON.stringify(e)), !0) : !1; + return e && bl(e) ? (e.date = Vo(/* @__PURE__ */ new Date()), G.metadata.value = e, typeof localStorage < "u" && localStorage.setItem(Nt, JSON.stringify(e)), !0) : !1; } function Ba() { - J.metadata.value = null, typeof localStorage < "u" && localStorage.removeItem(zt); + G.metadata.value = null, typeof localStorage < "u" && localStorage.removeItem(Nt); } function wl() { - if (J.metadata.value != null) + if (G.metadata.value != null) return !0; let e = globalThis.Server; if (bl(e)) es(e); else { - const t = typeof localStorage < "u" ? localStorage.getItem(zt) : null; + const t = typeof localStorage < "u" ? localStorage.getItem(Nt) : null; if (t) try { es(JSON.parse(t)); } catch { - console.error(`Could not JSON.parse ${zt} from localStorage`); + console.error(`Could not JSON.parse ${Nt} from localStorage`); } } - return J.metadata.value != null; + return G.metadata.value != null; } async function Yl(e, t) { let s = t ? await t() : await fetch(e); @@ -822,38 +822,38 @@ async function Yl(e, t) { es(JSON.parse(n)); } else console.error(`Could not download ${t ? "AppMetadata" : e}: ${s.statusText}`); - bl(J.metadata.value) || console.warn("AppMetadata is not available"); + bl(G.metadata.value) || console.warn("AppMetadata is not available"); } async function Ha(e) { var r; const { olderThan: t, resolvePath: s, resolve: n } = e || {}; let a = wl() && t !== 0; if (a && t) { - let u = pt((r = J.metadata.value) == null ? void 0 : r.date); + let u = pt((r = G.metadata.value) == null ? void 0 : r.date); (!u || (/* @__PURE__ */ new Date()).getTime() - u.getTime() > t) && (a = !1); } if (!a) { - if ((s || n) && (await Yl(s || zt, n), J.metadata.value != null)) + if ((s || n) && (await Yl(s || Nt, n), G.metadata.value != null)) return; const u = Qe("client"); if (u != null) { const d = await u.api(new Va()); d.succeeded && es(d.response); } - if (J.metadata.value != null) + if (G.metadata.value != null) return; - await Yl(zt); + await Yl(Nt); } - return J.metadata.value; + return G.metadata.value; } function rt(e, t) { var u; - if (J.config.typeResolver) { - let d = J.config.typeResolver(e, t); + if (G.config.typeResolver) { + let d = G.config.typeResolver(e, t); if (d) return d; } - let s = (u = J.metadata.value) == null ? void 0 : u.api; + let s = (u = G.metadata.value) == null ? void 0 : u.api; if (!s || !e) return null; let n = s.types.find((d) => d.name.toLowerCase() === e.toLowerCase() && (!t || d.namespace == t)); @@ -867,17 +867,17 @@ function rt(e, t) { } function js(e) { var n; - if (J.config.apiResolver) { - const a = J.config.apiResolver(e); + if (G.config.apiResolver) { + const a = G.config.apiResolver(e); if (a) return a; } - let t = (n = J.metadata.value) == null ? void 0 : n.api; + let t = (n = G.metadata.value) == null ? void 0 : n.api; return t ? t.operations.find((a) => a.request.name.toLowerCase() === e.toLowerCase()) : null; } function Ra({ dataModel: e }) { var n; - const t = (n = J.metadata.value) == null ? void 0 : n.api; + const t = (n = G.metadata.value) == null ? void 0 : n.api; if (!t) return []; let s = t.operations; @@ -961,7 +961,7 @@ function Na(e) { return; const u = za(r, r.input); if (u.id = So(u.id), u.type == "file" && r.uploadTo && !u.accept) { - const m = (c = (d = J.metadata.value) == null ? void 0 : d.plugins.filesUpload) == null ? void 0 : c.locations.find((_) => _.name == r.uploadTo); + const m = (c = (d = G.metadata.value) == null ? void 0 : d.plugins.filesUpload) == null ? void 0 : c.locations.find((_) => _.name == r.uploadTo); m && !u.accept && m.allowExtensions && (u.accept = m.allowExtensions.map((_) => _.startsWith(".") ? _ : `.${_}`).join(",")); } if (a) { @@ -972,12 +972,12 @@ function Na(e) { try { const m = { input: u, - $typeFields: s.map((b) => b.name), - $dataModelFields: a ? st(a).map((b) => b.name) : [], - ...J.config.scopeWhitelist + $typeFields: s.map((w) => w.name), + $dataModelFields: a ? st(a).map((w) => w.name) : [], + ...G.config.scopeWhitelist }, _ = dl(u.options, m); - Object.keys(_).forEach((b) => { - u[b] = _[b]; + Object.keys(_).forEach((w) => { + u[w] = _[w]; }); } catch { console.error(`failed to evaluate '${u.options}'`); @@ -1067,13 +1067,13 @@ const Qa = [ function lt() { const e = v(() => { var n; - return ((n = J.metadata.value) == null ? void 0 : n.app) || null; + return ((n = G.metadata.value) == null ? void 0 : n.app) || null; }), t = v(() => { var n; - return ((n = J.metadata.value) == null ? void 0 : n.api) || null; + return ((n = G.metadata.value) == null ? void 0 : n.api) || null; }), s = v(() => { var n, a, r; - return ((r = (a = (n = J.metadata.value) == null ? void 0 : n.plugins) == null ? void 0 : a.autoQuery) == null ? void 0 : r.viewerConventions) || Qa; + return ((r = (a = (n = G.metadata.value) == null ? void 0 : n.plugins) == null ? void 0 : a.autoQuery) == null ? void 0 : r.viewerConventions) || Qa; }); return wl(), { loadMetadata: Ha, @@ -1097,7 +1097,7 @@ function lt() { typeProperties: st, supportsProp: An, Crud: qe, - Apis: Nt, + Apis: Ut, getPrimaryKey: ns, getPrimaryKeyByProps: Dn, getId: Ua, @@ -1142,28 +1142,28 @@ const et = class et { }); if (c) { const f = et.Lookup[n] ?? (et.Lookup[n] = {}), m = []; - Object.keys(f).forEach((A) => { - const I = f[A]; - _e(I, r) && m.push(A); + Object.keys(f).forEach((T) => { + const j = f[T]; + _e(j, r) && m.push(T); }); - const _ = d.filter((A) => !m.includes(A)); + const _ = d.filter((T) => !m.includes(T)); if (_.length == 0) return; - const b = u ? null : `${a},${r}`, p = { + const w = u ? null : `${a},${r}`, p = { [a + "In"]: _.join(",") }; - b && (p.fields = b); + w && (p.fields = w); const y = Yt(c, p), k = await t.api(y, { jsconfig: "edv,eccn" }); if (k.succeeded) - (_e(k.response, "results") || []).forEach((I) => { - if (!_e(I, a)) { - console.error(`result[${a}] == null`, I); + (_e(k.response, "results") || []).forEach((j) => { + if (!_e(j, a)) { + console.error(`result[${a}] == null`, j); return; } - const se = `${_e(I, a)}`, j = _e(I, r); + const se = `${_e(j, a)}`, F = _e(j, r); r = r.toLowerCase(); - const F = f[se] ?? (f[se] = {}); - F[r] = `${j}`; + const I = f[se] ?? (f[se] = {}); + I[r] = `${F}`; }); else { console.error(`Failed to call ${c.request.name}`); @@ -1205,7 +1205,7 @@ let Pt = et, ll = () => (/* @__PURE__ */ new Date()).getTime(), Ka = ["/", "T", relativeTime: xl, relativeTimeFromMs: Os, enumFlags: Gn, - formatDate: Qt, + formatDate: Kt, formatNumber: Cl }; "iconOnError" in globalThis || (globalThis.iconOnError = Fs); @@ -1242,7 +1242,7 @@ function zn(e, t) { function Nn(e, t) { t || (t = {}); let { subject: s, body: n } = t, a = ft(t, ["subject", "body"]), r = {}; - return s && (r.subject = s), n && (r.body = n), dt("a", e, As({ ...a, href: `mailto:${Et(e, r)}` })); + return s && (r.subject = s), n && (r.body = n), dt("a", e, As({ ...a, href: `mailto:${zt(e, r)}` })); } function Un(e, t) { return dt("img", void 0, Object.assign({ class: "w-6 h-6", title: e, src: Ht(e), onerror: "iconOnError(this)" }, t)); @@ -1263,7 +1263,7 @@ function Zn(e, t) { let s = typeof e == "string" ? new Date(un(e) * 1e3) : Ss(e) ? pt(e) : null; return os(s ? Ao(s) : e, t); } -function Qt(e, t) { +function Kt(e, t) { if (e == null) return ""; let s = typeof e == "number" ? new Date(e) : typeof e == "string" ? pt(e) : e; @@ -1290,7 +1290,7 @@ function Wn(e, t, s) { } return a(e, u); } - let r = n != null ? Ss(n) ? Qt(n, s) : typeof n == "number" ? Cl(n, s) : n : null; + let r = n != null ? Ss(n) ? Kt(n, s) : typeof n == "number" ? Cl(n, s) : n : null; return r ?? ""; } function ts(e, t, s) { @@ -1358,10 +1358,10 @@ function Jn(e, t) { return e ? e.length > t ? e.substring(0, t) + "..." : e : ""; } function Xn(e) { - return e.substring(0, 6) === "/Date(" ? Qt(pt(e)) : e; + return e.substring(0, 6) === "/Date(" ? Kt(pt(e)) : e; } function Ya(e) { - return Ll(Ut(e)).replace(/"/g, ""); + return Ll(qt(e)).replace(/"/g, ""); } function Yn(e) { if (e == null || e === "") @@ -1378,9 +1378,9 @@ function Ll(e, t = 4) { return e = Yn(e), typeof e != "object" ? typeof e == "string" ? e : `${e}` : JSON.stringify(e, void 0, t); } function er(e) { - return e = Yn(e), typeof e != "object" ? typeof e == "string" ? e : `${e}` : (e = Object.assign({}, e), e = Ut(e), Ll(e)); + return e = Yn(e), typeof e != "object" ? typeof e == "string" ? e : `${e}` : (e = Object.assign({}, e), e = qt(e), Ll(e)); } -function Ut(e) { +function qt(e) { if (e == null) return null; if (typeof e == "string") @@ -1388,13 +1388,13 @@ function Ut(e) { if (Tt(e)) return e; if (e instanceof Date) - return Qt(e); + return Kt(e); if (Array.isArray(e)) - return e.map(Ut); + return e.map(qt); if (typeof e == "object") { let t = {}; return Object.keys(e).forEach((s) => { - s != "__type" && (t[s] = Ut(e[s])); + s != "__type" && (t[s] = qt(e[s])); }), t; } return e; @@ -1409,10 +1409,10 @@ function tr(e, t, s) { if (n == null) return ""; if (n instanceof Date) - return Qt(n, s); + return Kt(n, s); let a = Object.keys(n), r = []; for (let u = 0; u < Math.min(ct.maxNestedFields, a.length); u++) { - let d = a[u], c = `${Ut(n[d])}`; + let d = a[u], c = `${qt(n[d])}`; r.push(`${d}: ${Zs(Jn(Xn(c), ct.maxNestedFieldLength))}`); } return a.length > 2 && r.push("..."), dt("span", "{ " + r.join(", ") + " }", Object.assign({ title: Zs(Ya(e)) }, s)); @@ -1440,11 +1440,11 @@ function ch() { relativeTimeFromDate: Xa, relativeTimeFromMs: Os, enumFlags: Gn, - formatDate: Qt, + formatDate: Kt, formatNumber: Cl, indentJson: Ll, prettyJson: er, - scrub: Ut, + scrub: qt, truncate: Jn, apiValueFmt: Wn, iconOnError: Fs @@ -1512,24 +1512,24 @@ Le(tt, "config", { }), Le(tt, "events", jo()), Le(tt, "user", D(null)), Le(tt, "metadata", D(null)), Le(tt, "components", { RouterLink: lr }), Le(tt, "interceptors", new nr()); -let J = tt; +let G = tt; function or(e) { - J.config = Object.assign(J.config, e); + G.config = Object.assign(G.config, e); } function ar(e) { - J.autoQueryGridDefaults = Object.assign(J.autoQueryGridDefaults, e); + G.autoQueryGridDefaults = Object.assign(G.autoQueryGridDefaults, e); } function Vl(e) { - return e && J.config.assetsPathResolver ? J.config.assetsPathResolver(e) : e; + return e && G.config.assetsPathResolver ? G.config.assetsPathResolver(e) : e; } function rr(e) { - return e && J.config.fallbackPathResolver ? J.config.fallbackPathResolver(e) : e; + return e && G.config.fallbackPathResolver ? G.config.fallbackPathResolver(e) : e; } function ir(e, t) { - J.interceptors.register(e, t); + G.interceptors.register(e, t); } function It() { - const e = v(() => J.config), t = v(() => J.autoQueryGridDefaults), s = J.events; + const e = v(() => G.config), t = v(() => G.autoQueryGridDefaults), s = G.events; return { config: e, setConfig: or, @@ -1613,7 +1613,7 @@ const eo = de({ }, setup(e) { return (t, s) => { - const n = Z("router-link"); + const n = K("router-link"); return t.href ? (o(), ae(n, { key: 0, to: t.href @@ -1655,7 +1655,7 @@ const eo = de({ 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 " + (s[t.color] || s.indigo)); return (a, r) => { - const u = Z("router-link"); + const u = K("router-link"); return a.href ? (o(), ae(u, { key: 0, to: a.href @@ -1687,7 +1687,7 @@ const eo = de({ }, setup(e) { return (t, s) => { - const n = Z("router-link"); + const n = K("router-link"); return t.href ? (o(), ae(n, { key: 0, to: t.href @@ -1728,7 +1728,7 @@ const Cs = { 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 = { +}, Jt = { panelClass: "shadow sm:rounded-md", formClass: "space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6", headingClass: "text-lg font-medium leading-6 text-gray-900 dark:text-gray-100", @@ -1745,16 +1745,16 @@ const Cs = { 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 e == "card" ? Gt.panelClass : Bt.panelClass; + return e == "card" ? Jt.panelClass : Bt.panelClass; }, formClass(e = "slideOver") { - return e == "card" ? Gt.formClass : Bt.formClass; + return e == "card" ? Jt.formClass : Bt.formClass; }, headingClass(e = "slideOver") { - return e == "card" ? Gt.headingClass : Bt.headingClass; + return e == "card" ? Jt.headingClass : Bt.headingClass; }, subHeadingClass(e = "slideOver") { - return e == "card" ? Gt.subHeadingClass : Bt.subHeadingClass; + return e == "card" ? Jt.subHeadingClass : 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" @@ -1807,7 +1807,7 @@ const Cs = { }, fh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, a: Cs, - card: Gt, + card: Jt, dummy: Cr, form: Ee, grid: he, @@ -1957,7 +1957,7 @@ const Cs = { }, setup(e) { return (t, s) => { - const n = Z("Icon"); + const n = K("Icon"); return o(), i("li", Rr, [ l("div", Er, [ l("span", zr, [ @@ -1995,17 +1995,17 @@ function to(e) { return e && e.SessionId ? Oo(e) : e; } function Jr(e) { - J.user.value = to(e), J.events.publish("signIn", e); + G.user.value = to(e), G.events.publish("signIn", e); } function Xr() { - J.user.value = null, J.events.publish("signOut", null); + G.user.value = null, G.events.publish("signOut", null); } const Sl = (e) => (e == null ? void 0 : e.roles) || [], Ml = (e) => (e == null ? void 0 : e.permissions) || []; function so(e) { - return Sl(J.user.value).indexOf(e) >= 0; + return Sl(G.user.value).indexOf(e) >= 0; } function Yr(e) { - return Ml(J.user.value).indexOf(e) >= 0; + return Ml(G.user.value).indexOf(e) >= 0; } function Al() { return so("Admin"); @@ -2015,7 +2015,7 @@ function bs(e) { return !1; if (!e.requiresAuth) return !0; - const t = J.user.value; + const t = G.user.value; if (!t) return !1; if (Al()) @@ -2031,7 +2031,7 @@ function bs(e) { function ei(e) { if (!e || !e.requiresAuth) return null; - const t = J.user.value; + const t = G.user.value; if (!t) return `${e.request.name} requires Authentication`; if (Al()) @@ -2048,7 +2048,7 @@ function ei(e) { return f.length > 0 ? `Requires ${f.map((m) => "" + m + "").join(", ")} Permission` + (f.length > 1 ? "s" : "") : u.length > 0 && !u.some((m) => s.indexOf(m) >= 0) ? `Requires any ${u.filter((m) => s.indexOf(m) < 0).map((m) => "" + m + "").join(", ")} Role` + (c.length > 1 ? "s" : "") : d.length > 0 && !d.every((m) => n.indexOf(m) >= 0) ? `Requires any ${d.filter((m) => n.indexOf(m) < 0).map((m) => "" + m + "").join(", ")} Permission` + (f.length > 1 ? "s" : "") : null; } function Tl() { - const e = v(() => J.user.value || null), t = v(() => J.user.value != null); + const e = v(() => G.user.value || null), t = v(() => G.user.value != null); return { signIn: Jr, signOut: Xr, user: e, toAuth: to, isAuthenticated: t, hasRole: so, hasPermission: Yr, isAdmin: Al, canAccess: bs, invalidAccessMessage: ei }; } const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ @@ -2061,22 +2061,22 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ setup(e) { const { isAuthenticated: t } = Tl(), { config: s } = It(), n = () => { let r = location.href.substring(location.origin.length) || "/"; - const u = Et(s.value.redirectSignIn, { redirect: r }); + const u = zt(s.value.redirectSignIn, { redirect: r }); s.value.navigate(u); }, a = () => { let r = location.href.substring(location.origin.length) || "/"; - const u = Et(s.value.redirectSignOut, { ReturnUrl: r }); + const u = zt(s.value.redirectSignOut, { ReturnUrl: r }); s.value.navigate(u); }; return (r, u) => { - const d = Z("Alert"), c = Z("SecondaryButton"); + const d = K("Alert"), c = K("SecondaryButton"); return r.invalidAccess ? (o(), i("div", ti, [ ye(d, { class: h(r.alertClass), innerHTML: r.invalidAccess }, null, 8, ["class", "innerHTML"]), l("div", si, [ - G(t) ? (o(), ae(c, { + W(t) ? (o(), ae(c, { key: 1, onClick: a }, { @@ -2152,69 +2152,69 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ setup(e, { emit: t }) { const s = e, n = t, a = D(), r = D(""), u = D(""), d = D([]), c = v(() => s.column.meta.isEnum == !0), f = v(() => rt(s.column.meta.type === "Nullable`1" ? s.column.meta.genericArgs[0] : s.column.meta.type)), m = v(() => s.column.meta.isEnum == !0 ? _l(Fn(f.value.name)) : []), _ = v(() => { var L; - return ((L = y(s.column.type)) == null ? void 0 : L.map((z) => ({ key: z.value, value: z.name }))) || []; - }), b = D({ filters: [] }), p = v(() => b.value.filters); - ws(() => b.value = Object.assign({}, s.column.settings, { + return ((L = y(s.column.type)) == null ? void 0 : L.map((E) => ({ key: E.value, value: E.name }))) || []; + }), w = D({ filters: [] }), p = v(() => w.value.filters); + ws(() => w.value = Object.assign({}, s.column.settings, { filters: Array.from(s.column.settings.filters) })), ws(() => { - var z, K, le, R, W; - let L = ((le = (K = (z = s.column.settings.filters) == null ? void 0 : z[0]) == null ? void 0 : K.value) == null ? void 0 : le.split(",")) || []; + var E, Q, le, R, J; + let L = ((le = (Q = (E = s.column.settings.filters) == null ? void 0 : E[0]) == null ? void 0 : Q.value) == null ? void 0 : le.split(",")) || []; if (L.length > 0 && ((R = f.value) != null && R.isEnumInt)) { - const ee = parseInt(L[0]); - L = ((W = f.value.enumValues) == null ? void 0 : W.filter((q) => (ee & parseInt(q)) > 0)) || []; + const Y = parseInt(L[0]); + L = ((J = f.value.enumValues) == null ? void 0 : J.filter((Z) => (Y & parseInt(Z)) > 0)) || []; } d.value = L; }); function y(L) { - let z = s.definitions; - return Sn(L) || (z = z.filter((K) => K.types !== "string")), z; + let E = s.definitions; + return Sn(L) || (E = E.filter((Q) => Q.types !== "string")), E; } - function k(L, z) { - return y(L).find((K) => K.value === z); + function k(L, E) { + return y(L).find((Q) => Q.value === E); } - function A() { - var z; + function T() { + var E; if (!r.value) return; - let L = (z = k(s.column.type, r.value)) == null ? void 0 : z.name; - L && (b.value.filters.push({ key: r.value, name: L, value: u.value }), r.value = u.value = ""); + let L = (E = k(s.column.type, r.value)) == null ? void 0 : E.name; + L && (w.value.filters.push({ key: r.value, name: L, value: u.value }), r.value = u.value = ""); } - function I(L) { - b.value.filters.splice(L, 1); + function j(L) { + w.value.filters.splice(L, 1); } function se(L) { return Pn(k(s.column.type, L.key), s.column.type, L); } - function j() { + function F() { n("done"); } - function F() { + function I() { var L; r.value = "%", (L = a.value) == null || L.focus(); } - function M() { + function A() { var L; - if (u.value && A(), c.value) { - let z = Object.values(d.value).filter((K) => K); - b.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(",") }] : []; + if (u.value && T(), c.value) { + let E = Object.values(d.value).filter((Q) => Q); + w.value.filters = E.length > 0 ? (L = f.value) != null && L.isEnumInt ? [{ key: "%HasAny", name: "HasAny", value: E.map((Q) => parseInt(Q)).reduce((Q, le) => Q + le, 0).toString() }] : [{ key: "%In", name: "In", value: E.join(",") }] : []; } - n("save", b.value), n("done"); + n("save", w.value), n("done"); } function ie(L) { - b.value.sort = L === b.value.sort ? void 0 : L, St(M); + w.value.sort = L === w.value.sort ? void 0 : L, St(A); } - return (L, z) => { - var ee; - const K = Z("SelectInput"), le = Z("TextInput"), R = Z("PrimaryButton"), W = Z("SecondaryButton"); + return (L, E) => { + var Y; + const Q = K("SelectInput"), le = K("TextInput"), R = K("PrimaryButton"), J = K("SecondaryButton"); return o(), i("div", { class: "fixed z-20 inset-0 overflow-y-auto", - onClick: j, - onVnodeMounted: F + onClick: F, + onVnodeMounted: I }, [ l("div", { class: "absolute", style: ol(`top:${L.topLeft.y}px;left:${L.topLeft.x}px`), - onClick: z[5] || (z[5] = Ue(() => { + onClick: E[5] || (E[5] = Ue(() => { }, ["stop"])) }, [ l("div", li, [ @@ -2224,58 +2224,58 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ l("button", { type: "button", title: "Sort Ascending", - onClick: z[0] || (z[0] = (q) => ie("ASC")), - class: h(`${b.value.sort === "ASC" ? "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`) + onClick: E[0] || (E[0] = (Z) => ie("ASC")), + class: h(`${w.value.sort === "ASC" ? "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: z[1] || (z[1] = (q) => ie("DESC")), - class: h(`${b.value.sort === "DESC" ? "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`) + onClick: E[1] || (E[1] = (Z) => ie("DESC")), + class: h(`${w.value.sort === "DESC" ? "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, c.value ? (o(), i("div", vi, [ - (o(!0), i(Me, null, je(m.value, (q) => (o(), i("div", { - key: q.key, + (o(!0), i(Me, null, je(m.value, (Z) => (o(), i("div", { + key: Z.key, class: "flex items-center" }, [ Mt(l("input", { type: "checkbox", - id: q.key, - value: q.key, - "onUpdate:modelValue": z[2] || (z[2] = (T) => d.value = T), + id: Z.key, + value: Z.key, + "onUpdate:modelValue": E[2] || (E[2] = (V) => d.value = V), class: "h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500" }, null, 8, pi), [ [al, d.value] ]), l("label", { - for: q.key, + for: Z.key, class: "ml-3" - }, O(q.value), 9, mi) + }, O(Z.value), 9, mi) ]))), 128)) ])) : (o(), i("div", hi, [ - (o(!0), i(Me, null, je(p.value, (q, T) => (o(), i("div", gi, [ + (o(!0), i(Me, null, je(p.value, (Z, V) => (o(), i("div", gi, [ l("span", yi, [ - ke(O(L.column.name) + " " + O(q.name) + " " + O(se(q)) + " ", 1), + ke(O(L.column.name) + " " + O(Z.name) + " " + O(se(Z)) + " ", 1), l("button", { type: "button", - onClick: (te) => I(T), + onClick: (te) => j(V), 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(K, { + ye(Q, { id: "filterRule", class: "w-32 mr-1", modelValue: r.value, - "onUpdate:modelValue": z[3] || (z[3] = (q) => r.value = q), + "onUpdate:modelValue": E[3] || (E[3] = (Z) => r.value = Z), entries: _.value, label: "", placeholder: "" }, null, 8, ["modelValue", "entries"]), - ((ee = k(L.column.type, r.value)) == null ? void 0 : ee.valueType) !== "none" ? (o(), ae(le, { + ((Y = k(L.column.type, r.value)) == null ? void 0 : Y.valueType) !== "none" ? (o(), ae(le, { key: 0, ref_key: "txtFilter", ref: a, @@ -2283,15 +2283,15 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ class: "w-32 mr-1", type: "text", modelValue: u.value, - "onUpdate:modelValue": z[4] || (z[4] = (q) => u.value = q), - onKeyup: on(A, ["enter"]), + "onUpdate:modelValue": E[4] || (E[4] = (Z) => u.value = Z), + onKeyup: on(T, ["enter"]), label: "", placeholder: "" }, null, 8, ["modelValue"])) : x("", !0), l("div", { class: "pt-1" }, [ l("button", { type: "button", - onClick: A, + onClick: T, 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) ]) @@ -2300,7 +2300,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ ]), l("div", xi, [ ye(R, { - onClick: M, + onClick: A, color: "red", class: "ml-2" }, { @@ -2309,7 +2309,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ ]), _: 1 }), - ye(W, { onClick: j }, { + ye(J, { onClick: F }, { default: xe(() => [ ke(" Cancel ") ]), @@ -2360,42 +2360,42 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, emits: ["done", "change"], setup(e, { emit: t }) { - const s = e, n = t, a = v(() => s.columns.filter((b) => b.settings.filters.length > 0)); - function r(b) { + const s = e, n = t, a = v(() => s.columns.filter((w) => w.settings.filters.length > 0)); + function r(w) { var p, y; - return (y = (p = b == null ? void 0 : b[0]) == null ? void 0 : p.value) == null ? void 0 : y.split(","); + return (y = (p = w == null ? void 0 : w[0]) == null ? void 0 : p.value) == null ? void 0 : y.split(","); } - function u(b) { + function u(w) { let p = s.definitions; - return Sn(b) || (p = p.filter((y) => y.types !== "string")), p; + return Sn(w) || (p = p.filter((y) => y.types !== "string")), p; } - function d(b, p) { - return u(b).find((y) => y.value === p); + function d(w, p) { + return u(w).find((y) => y.value === p); } - function c(b, p) { - return Pn(d(b.type, p.value), b.type, p); + function c(w, p) { + return Pn(d(w.type, p.value), w.type, p); } - function f(b) { - b.settings.filters = [], n("change", b); + function f(w) { + w.settings.filters = [], n("change", w); } - function m(b, p) { - b.settings.filters.splice(p, 1), n("change", b); + function m(w, p) { + w.settings.filters.splice(p, 1), n("change", w); } function _() { - s.columns.forEach((b) => { - b.settings.filters = [], n("change", b); + s.columns.forEach((w) => { + w.settings.filters = [], n("change", w); }), n("done"); } - return (b, p) => (o(), i("div", Li, [ + return (w, p) => (o(), i("div", Li, [ l("div", Vi, [ (o(!0), i(Me, null, je(a.value, (y) => (o(), i("fieldset", Si, [ l("legend", Mi, [ - l("span", null, O(G(Pe)(y.name)), 1), + l("span", null, O(W(Pe)(y.name)), 1), l("span", Ai, [ l("span", Ti, [ l("button", { onClick: (k) => f(y), - title: `Clear all ${G(Pe)(y.name)} filters`, + title: `Clear all ${W(Pe)(y.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) ]) @@ -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, A) => (o(), i("div", Bi, [ + (o(!0), i(Me, null, je(y.settings.filters, (k, T) => (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, A), + onClick: (j) => m(y, 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" }, zi, 8, Ri) ]) @@ -2454,7 +2454,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ a("save", r.value); } return (f, m) => { - const _ = Z("PrimaryButton"), b = Z("SecondaryButton"), p = Z("ModalDialog"); + const _ = K("PrimaryButton"), w = K("SecondaryButton"), p = K("ModalDialog"); return o(), ae(p, { id: f.id, onDone: d, @@ -2534,7 +2534,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ ]), _: 1 }), - ye(b, { onClick: d }, { + ye(w, { onClick: d }, { default: xe(() => [ ke(" Cancel ") ]), @@ -2788,40 +2788,40 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, emits: ["headerSelected", "rowSelected", "nav"], setup(e, { expose: t, emit: s }) { - const { config: n, autoQueryGridDefaults: a } = It(), r = a, u = n.value.storage, d = e, c = s, f = Qe("client"), m = "filtering,queryString,queryFilters".split(","), _ = "copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","), b = v(() => d.deny ? Vt(m, d.deny) : Vt(m, r.value.deny)), p = v(() => d.hide ? Vt(_, d.hide) : Vt(_, r.value.hide)); + const { config: n, autoQueryGridDefaults: a } = It(), r = a, u = n.value.storage, d = e, c = s, f = Qe("client"), m = "filtering,queryString,queryFilters".split(","), _ = "copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","), w = v(() => d.deny ? Vt(m, d.deny) : Vt(m, r.value.deny)), p = v(() => d.hide ? Vt(_, d.hide) : Vt(_, r.value.hide)); function y($) { - return b.value[$]; + return w.value[$]; } function k($) { return p.value[$]; } - 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); + const T = v(() => d.tableStyle ?? r.value.tableStyle), j = v(() => d.gridClass ?? he.getGridClass(T.value)), se = v(() => d.grid2Class ?? he.getGrid2Class(T.value)), F = v(() => d.grid3Class ?? he.getGrid3Class(T.value)), I = v(() => d.grid4Class ?? he.getGrid4Class(T.value)), A = v(() => d.tableClass ?? he.getTableClass(T.value)), ie = v(() => d.theadClass ?? he.getTheadClass(T.value)), L = v(() => d.theadRowClass ?? he.getTheadRowClass(T.value)), E = v(() => d.theadCellClass ?? he.getTheadCellClass(T.value)), Q = v(() => d.toolbarButtonClass ?? he.toolbarButtonClass); function le($, B) { var Ie; if (d.rowClass) return d.rowClass($, B); - const ve = !!we.value.AnyUpdate, Ce = ((Ie = Ve.value) != null && Ie.name ? _e($, Ve.value.name) : null) == Y.value; + const ve = !!we.value.AnyUpdate, Ce = ((Ie = Ve.value) != null && Ie.name ? _e($, Ve.value.name) : null) == ee.value; return he.getTableRowClass(d.tableStyle, B, Ce, ve); } - const R = Ls(), W = v(() => { + const R = Ls(), J = v(() => { var $; return zs((($ = we.value.AnyQuery.viewModel) == null ? void 0 : $.name) || we.value.AnyQuery.dataModel.name); - }), ee = v(() => { + }), Y = v(() => { const $ = Object.keys(R).map((B) => B.toLowerCase()); - return st(W.value).filter((B) => $.includes(B.name.toLowerCase()) || $.includes(B.name.toLowerCase() + "-header")).map((B) => B.name); + return st(J.value).filter((B) => $.includes(B.name.toLowerCase()) || $.includes(B.name.toLowerCase() + "-header")).map((B) => B.name); }); - function q() { + function Z() { let $ = Ct(d.selectedColumns); - return $.length > 0 ? $ : ee.value.length > 0 ? ee.value : []; + return $.length > 0 ? $ : Y.value.length > 0 ? Y.value : []; } - const T = v(() => { - let B = q().map((re) => re.toLowerCase()); - const ve = st(W.value); + const V = v(() => { + let B = Z().map((re) => re.toLowerCase()); + const ve = st(J.value); return B.length > 0 ? B.map((re) => ve.find((Ce) => Ce.name.toLowerCase() === re)).filter((re) => re != null) : ve; }), te = v(() => { - let $ = T.value.map((ve) => ve.name), B = Ct(pe.value.selectedColumns).map((ve) => ve.toLowerCase()); + let $ = V.value.map((ve) => ve.name), B = Ct(pe.value.selectedColumns).map((ve) => ve.toLowerCase()); return B.length > 0 ? $.filter((ve) => B.includes(ve.toLowerCase())) : $; - }), w = D([]), N = D(new Xe()), E = D(new Xe()), g = 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(() => w.value.some(($) => $.settings.filters.length > 0 || !!$.settings.sort) || pe.value.selectedColumns), S = v(() => w.value.map(($) => $.settings.filters.length).reduce(($, B) => $ + B, 0)), ce = v(() => { + }), b = D([]), N = D(new Xe()), z = D(new Xe()), g = D(), C = D(!1), ee = D(), X = D(), ne = D(!1), P = D(), S = 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), M = v(() => b.value.map(($) => $.settings.filters.length).reduce(($, B) => $ + B, 0)), ce = v(() => { var $; return st(zs(Ot.value || (($ = we.value.AnyQuery) == null ? void 0 : $.dataModel.name))); }), Ve = v(() => { @@ -2830,7 +2830,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }), Se = v(() => pe.value.take ?? ps), ge = v(() => N.value.response ? _e(N.value.response, "results") : []), H = v(() => { var $; return ((($ = N.value.response) == null ? void 0 : $.total) || ge.value.length) ?? 0; - }), Q = v(() => V.value > 0), oe = v(() => V.value > 0), be = v(() => ge.value.length >= Se.value), $e = v(() => ge.value.length >= Se.value), Ae = D(), He = D(), Fe = { + }), q = v(() => S.value > 0), oe = v(() => S.value > 0), be = v(() => ge.value.length >= Se.value), $e = v(() => ge.value.length >= Se.value), Ae = D(), He = D(), Fe = { NoQuery: "No Query API was found" }; t({ @@ -2838,7 +2838,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ search: Dl, createRequestArgs: Rs, reset: Ql, - createDone: Wt, + createDone: Gt, createSave: Us, editDone: wt, editSave: ds, @@ -2849,10 +2849,10 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ editForm: He, apiPrefs: pe, results: ge, - skip: V, + skip: S, take: Se, total: H - }), J.interceptors.has("AutoQueryGrid.new") && J.interceptors.invoke("AutoQueryGrid.new", { props: d }); + }), G.interceptors.has("AutoQueryGrid.new") && G.interceptors.invoke("AutoQueryGrid.new", { props: d }); function De($) { if ($) { if (d.canFilter) @@ -2867,13 +2867,13 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ c("nav", $), y("queryString") && ul($); } async function We($) { - V.value += $, V.value < 0 && (V.value = 0); + S.value += $, S.value < 0 && (S.value = 0); const B = Math.floor(H.value / Se.value) * Se.value; - V.value > B && (V.value = B), Oe({ skip: V.value || void 0 }), await nt(); + S.value > B && (S.value = B), Oe({ skip: S.value || void 0 }), await nt(); } async function Re($, B) { var Ce, Ie; - if (X.value = null, Y.value = B, !$ || !B) + if (X.value = null, ee.value = B, !$ || !B) return; let ve = Yt(we.value.AnyQuery, { [$]: B }); const re = await f.api(ve); @@ -2894,7 +2894,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ return; let ve = B.target; if (De($) && (ve == null ? void 0 : ve.tagName) !== "TD") { - let Ce = (re = ve == null ? void 0 : ve.closest("TABLE")) == null ? void 0 : re.getBoundingClientRect(), Ie = w.value.find((ze) => ze.name.toLowerCase() == $.toLowerCase()); + let Ce = (re = ve == null ? void 0 : ve.closest("TABLE")) == null ? void 0 : re.getBoundingClientRect(), Ie = b.value.find((ze) => ze.name.toLowerCase() == $.toLowerCase()); if (Ie && Ce) { let ze = 318, ut = Ce.x + ze + 10; P.value = { @@ -2976,7 +2976,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }), $.fields = B.join(","); } let ve = []; - if (w.value.forEach((re) => { + if (b.value.forEach((re) => { re.settings.sort && ve.push((re.settings.sort === "DESC" ? "-" : "") + re.name), re.settings.filters.forEach((Ce) => { let Ie = Ce.key.replace("%", re.name); $[Ie] = Ce.value; @@ -2987,13 +2987,13 @@ 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) => { - T.value.find((ut) => ut.name.toLowerCase() === Ie.toLowerCase()) && ($[Ie] = Ce[Ie]); + V.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); + isNaN(Ie) || (S.value = $.skip = Ie); } } - return typeof $.skip > "u" && V.value > 0 && ($.skip = V.value), ve.length > 0 && ($.orderBy = ve.join(",")), $; + return typeof $.skip > "u" && S.value > 0 && ($.skip = S.value), ve.length > 0 && ($.orderBy = ve.join(",")), $; } function ro() { const $ = Pl("csv"); @@ -3005,21 +3005,21 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } function Pl($ = "json") { var Ie; - const B = Rs(), ve = `/api/${(Ie = we.value.AnyQuery) == null ? void 0 : Ie.request.name}`, re = Do(f.baseUrl, Et(ve, { ...B, jsconfig: "edv" })); + const B = Rs(), ve = `/api/${(Ie = we.value.AnyQuery) == null ? void 0 : Ie.request.name}`, re = Do(f.baseUrl, zt(ve, { ...B, jsconfig: "edv" })); return re.indexOf("?") >= 0 ? Vs(re, "?") + "." + $ + "?" + ms(re, "?") : re + ".json"; } async function uo() { - w.value.forEach(($) => { + b.value.forEach(($) => { $.settings = { filters: [] }, u.removeItem(is($.name)); }), pe.value = { take: ps }, u.removeItem(Es()), await nt(); } function co() { C.value = !0, Oe({ create: null }); } - const Ot = v(() => qt(d.type)), Kt = v(() => { + const Ot = v(() => Qt(d.type)), Zt = v(() => { var $; return Ot.value || (($ = we.value.AnyQuery) == null ? void 0 : $.dataModel.name); - }), Zt = v(() => d.modelTitle || Kt.value), fo = v(() => d.newButtonLabel || `New ${Zt.value}`), Es = () => { + }), Wt = v(() => d.modelTitle || Zt.value), fo = v(() => d.newButtonLabel || `New ${Wt.value}`), Es = () => { var $; return `${d.id}/ApiPrefs/${Ot.value || (($ = we.value.AnyQuery) == null ? void 0 : $.dataModel.name)}`; }, is = ($) => { @@ -3027,7 +3027,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ return `Column/${d.id}:${Ot.value || ((B = we.value.AnyQuery) == null ? void 0 : B.dataModel.name)}.${$}`; }, { metadataApi: Bl, typeOf: zs, apiOf: Hl, filterDefinitions: vo } = lt(), { invalidAccessMessage: Ns } = Tl(), Rl = v(() => d.filterDefinitions || vo.value), we = v(() => { let $ = Ct(d.apis); - return $.length > 0 ? Nt.from($.map((B) => Hl(B)).filter((B) => B != null).map((B) => B)) : Nt.forType(Ot.value, Bl.value); + return $.length > 0 ? Ut.from($.map((B) => Hl(B)).filter((B) => B != null).map((B) => B)) : Ut.forType(Ot.value, Bl.value); }), us = ($) => `${$}`, El = v(() => { if (!Bl.value) return us(`AppMetadata not loaded, see useMetadata()`); @@ -3040,22 +3040,22 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ v(() => bs(we.value.AnyUpdate)); const ql = v(() => bs(we.value.Delete)); function wt() { - X.value = null, Y.value = null, Oe({ edit: void 0 }); + X.value = null, ee.value = null, Oe({ edit: void 0 }); } - function Wt() { + function Gt() { C.value = !1, Oe({ create: void 0 }); } async function ds() { await nt(), wt(); } async function Us() { - await nt(), Wt(); + await nt(), Gt(); } function Ql() { 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; + N.value = new Xe(), z.value = new Xe(), C.value = !1, ee.value = null, X.value = null, ne.value = !1, P.value = null, S.value = d.skip, fe.value = !1, pe.value = { take: ps }, ue.value = !1; const $ = d.prefs || $s(u.getItem(Es())); - $ && (pe.value = $), w.value = T.value.map((re) => ({ + $ && (pe.value = $), b.value = V.value.map((re) => ({ name: re.name, type: re.type, meta: re, @@ -3065,7 +3065,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, $s(u.getItem(is(re.name))) ) - })), isNaN(d.skip) || (V.value = d.skip); + })), isNaN(d.skip) || (S.value = d.skip); let B = (ve = Ve.value) == null ? void 0 : ve.name; if (y("queryString")) { const re = location.search ? location.search : location.hash.includes("?") ? "?" + ms(location.hash, "?") : ""; @@ -3077,24 +3077,24 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ return Ye(async () => { Ql(), await nt(); }), ($, B) => { - const ve = Z("Alert"), re = Z("EnsureAccessDialog"), Ce = Z("AutoCreateForm"), Ie = Z("AutoEditForm"), ze = Z("AutoViewForm"), ut = Z("ErrorSummary"), Kl = Z("Loading"), cs = Z("SettingsIcons"), kt = Z("DataGrid"); + const ve = K("Alert"), re = K("EnsureAccessDialog"), Ce = K("AutoCreateForm"), Ie = K("AutoEditForm"), ze = K("AutoViewForm"), ut = K("ErrorSummary"), Kl = K("Loading"), cs = K("SettingsIcons"), kt = K("DataGrid"); return El.value ? (o(), i("div", iu, [ ye(ve, { innerHTML: El.value }, null, 8, ["innerHTML"]) ])) : zl.value ? (o(), i("div", uu, [ ye(lo, { "invalid-access": zl.value }, null, 8, ["invalid-access"]) ])) : (o(), i("div", du, [ - C.value && we.value.Create ? (o(), i("div", cu, [ + k("forms") && C.value && we.value.Create ? (o(), i("div", cu, [ Nl.value ? (o(), ae(re, { key: 0, - title: `Create ${Zt.value}`, + title: `Create ${Wt.value}`, "invalid-access": Nl.value, "alert-class": "text-yellow-700", - onDone: Wt - }, null, 8, ["title", "invalid-access"])) : G(R).createform ? U($.$slots, "createform", { + onDone: Gt + }, null, 8, ["title", "invalid-access"])) : W(R).createform ? U($.$slots, "createform", { key: 1, type: we.value.Create.request.name, configure: $.configureField, - done: Wt, + done: Gt, save: Us }) : (o(), ae(Ce, { key: 2, @@ -3102,7 +3102,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ ref: Ae, type: we.value.Create.request.name, configure: $.configureField, - onDone: Wt, + onDone: Gt, onSave: Us }, { header: xe(() => [ @@ -3110,7 +3110,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ form: "create", formInstance: Ae.value, apis: we.value, - type: Kt.value, + type: Zt.value, updateModel: Ol }) ]), @@ -3119,20 +3119,20 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ form: "create", formInstance: Ae.value, apis: we.value, - type: Kt.value, + type: Zt.value, updateModel: Ol }) ]), _: 3 }, 8, ["type", "configure"])) - ])) : X.value && we.value.AnyUpdate ? (o(), i("div", fu, [ + ])) : k("forms") && X.value && we.value.AnyUpdate ? (o(), i("div", fu, [ Ul.value ? (o(), ae(re, { key: 0, - title: `Update ${Zt.value}`, + title: `Update ${Wt.value}`, "invalid-access": Ul.value, "alert-class": "text-yellow-700", onDone: wt - }, null, 8, ["title", "invalid-access"])) : G(R).editform ? U($.$slots, "editform", { + }, null, 8, ["title", "invalid-access"])) : W(R).editform ? U($.$slots, "editform", { key: 1, model: X.value, type: we.value.AnyUpdate.request.name, @@ -3158,9 +3158,9 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ form: "edit", formInstance: He.value, apis: we.value, - type: Kt.value, + type: Zt.value, model: X.value, - id: Y.value, + id: ee.value, updateModel: Bs }) ]), @@ -3169,16 +3169,16 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ form: "edit", formInstance: He.value, apis: we.value, - type: Kt.value, + type: Zt.value, model: X.value, - id: Y.value, + id: ee.value, updateModel: Bs }) ]), _: 3 }, 8, ["modelValue", "type", "deleteType", "configure"])) - ])) : X.value ? (o(), i("div", vu, [ - G(R).viewform ? U($.$slots, "viewform", { + ])) : k("forms") && X.value ? (o(), i("div", vu, [ + W(R).viewform ? U($.$slots, "viewform", { key: 0, model: X.value, apis: we.value, @@ -3190,10 +3190,10 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ done: wt }, null, 8, ["model", "apis"])) ])) : x("", !0), - G(R).toolbar ? U($.$slots, "toolbar", { key: 3 }) : k("toolbar") ? (o(), i("div", pu, [ + W(R).toolbar ? U($.$slots, "toolbar", { key: 3 }) : k("toolbar") ? (o(), i("div", pu, [ ne.value ? (o(), ae(jl, { key: 0, - columns: T.value, + columns: V.value, prefs: pe.value, onDone: B[1] || (B[1] = (Ne) => ne.value = !1), onSave: no @@ -3204,15 +3204,15 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ key: 0, type: "button", class: "text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400", - title: `${Zt.value} Preferences`, + title: `${Wt.value} Preferences`, onClick: B[2] || (B[2] = (Ne) => ne.value = !ne.value) }, bu, 8, gu)) : x("", !0), k("pagingNav") ? (o(), i("button", { key: 1, type: "button", - class: h(["pl-2", Q.value ? "text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400" : "text-gray-400 dark:text-gray-500"]), + class: h(["pl-2", q.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: !Q.value, + disabled: !q.value, onClick: B[3] || (B[3] = (Ne) => We(-H.value)) }, _u, 10, wu)) : x("", !0), k("pagingNav") ? (o(), i("button", { @@ -3245,7 +3245,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ ue.value ? (o(), i("span", ju, "Querying...")) : x("", !0), ge.value.length ? (o(), i("span", Ou, [ Du, - ke(" " + O(V.value + 1) + " - " + O(Math.min(V.value + ge.value.length, H.value)) + " ", 1), + ke(" " + O(S.value + 1) + " - " + O(Math.min(S.value + ge.value.length, H.value)) + " ", 1), l("span", null, " of " + O(H.value), 1) ])) : N.value.completed ? (o(), i("span", Pu, "No Results")) : x("", !0) ]) @@ -3256,7 +3256,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "button", onClick: oo, title: "Refresh", - class: h(K.value) + class: h(Q.value) }, Eu, 2) ])) : x("", !0), k("downloadCsv") ? (o(), i("div", zu, [ @@ -3264,7 +3264,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "button", onClick: ro, title: "Download CSV", - class: h(K.value) + class: h(Q.value) }, Uu, 2) ])) : x("", !0), k("copyApiUrl") ? (o(), i("div", qu, [ @@ -3272,7 +3272,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "button", onClick: io, title: "Copy API URL", - class: h(K.value) + class: h(Q.value) }, [ fe.value ? (o(), i("svg", Qu, Zu)) : (o(), i("svg", Wu, Ju)), Xu @@ -3283,18 +3283,18 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: "button", onClick: uo, title: "Reset Preferences & Filters", - class: h(K.value) + class: h(Q.value) }, td, 2) ])) : x("", !0), - k("filtersView") && S.value > 0 ? (o(), i("div", sd, [ + k("filtersView") && M.value > 0 ? (o(), i("div", sd, [ l("button", { type: "button", onClick: B[7] || (B[7] = (Ne) => g.value = g.value == "filters" ? null : "filters"), - class: h(K.value), + class: h(Q.value), "aria-expanded": "false" }, [ ld, - l("span", nd, O(S.value) + " " + O(S.value == 1 ? "Filter" : "Filters"), 1), + l("span", nd, O(M.value) + " " + O(M.value == 1 ? "Filter" : "Filters"), 1), g.value != "filters" ? (o(), i("svg", od, rd)) : (o(), i("svg", id, dd)) ], 2) ])) : x("", !0), @@ -3302,16 +3302,16 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ l("button", { type: "button", onClick: co, - title: Zt.value, - class: h(K.value) + title: Wt.value, + class: h(Q.value) }, [ vd, l("span", pd, O(fo.value), 1) ], 10, fd) ])) : x("", !0), - G(R).toolbarbuttons ? U($.$slots, "toolbarbuttons", { + W(R).toolbarbuttons ? U($.$slots, "toolbarbuttons", { key: 6, - toolbarButtonClass: K.value + toolbarButtonClass: Q.value }) : x("", !0) ]) ]) @@ -3320,13 +3320,13 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ key: 5, class: "border-y border-gray-200 dark:border-gray-800 py-8 my-2", definitions: Rl.value, - columns: w.value, + columns: b.value, onDone: B[8] || (B[8] = (Ne) => g.value = null), onChange: rs }, null, 8, ["definitions", "columns"])) : x("", !0), - E.value.error ?? N.value.error ? (o(), ae(ut, { + z.value.error ?? N.value.error ? (o(), ae(ut, { key: 6, - status: E.value.error ?? N.value.error + status: z.value.error ?? N.value.error }, null, 8, ["status"])) : ue.value ? (o(), ae(Kl, { key: 7, class: "p-2" @@ -3348,15 +3348,15 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ "selected-columns": te.value, class: "mt-1", onFiltersChanged: nt, - tableStyle: A.value, - gridClass: I.value, + tableStyle: T.value, + gridClass: j.value, grid2Class: se.value, - grid3Class: j.value, - grid4Class: F.value, - tableClass: M.value, + grid3Class: F.value, + grid4Class: I.value, + tableClass: A.value, theadClass: ie.value, theadRowClass: L.value, - theadCellClass: z.value, + theadCellClass: E.value, tbodyClass: $.tbodyClass, rowClass: le, onRowSelected: it, @@ -3372,7 +3372,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ y("filtering") && De(Ne) ? (o(), i("div", hd, [ l("span", gd, O(_t), 1), ye(cs, { - column: w.value.find((mo) => mo.name.toLowerCase() === Ne.toLowerCase()), + column: b.value.find((mo) => mo.name.toLowerCase() === Ne.toLowerCase()), "is-open": ((Zl = P.value) == null ? void 0 : Zl.column.name) === Ne }, null, 8, ["column", "is-open"]) ])) : (o(), i("div", yd, [ @@ -3382,10 +3382,10 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }), _: 2 }, [ - je(Object.keys(G(R)), (Ne) => ({ + je(Object.keys(W(R)), (Ne) => ({ name: Ne, fn: xe((_t) => [ - U($.$slots, Ne, Rt(ks(_t))) + U($.$slots, Ne, Et(ks(_t))) ]) })) ]), 1032, ["id", "items", "type", "selected-columns", "tableStyle", "gridClass", "grid2Class", "grid3Class", "grid4Class", "tableClass", "theadClass", "theadRowClass", "theadCellClass", "tbodyClass", "rowStyle", "headerTitle", "headerTitles", "visibleFrom"])) : x("", !0) @@ -3471,7 +3471,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ emits: ["done"], setup(e) { return (t, s) => { - const n = Z("EnsureAccess"), a = Z("SlideOver"); + const n = K("EnsureAccess"), a = K("SlideOver"); return t.invalidAccess ? (o(), ae(a, { key: 0, title: t.title, @@ -3544,7 +3544,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ return n.type === "range" ? p.replace("shadow-sm ", "") : p; } let m = Qe("ApiState", void 0); - const _ = v(() => mt.call({ responseStatus: n.status ?? (m == null ? void 0 : m.error.value) }, n.id)), b = v(() => [ot.base, _.value ? ot.invalid : f(ot.valid), n.inputClass]); + const _ = v(() => mt.call({ responseStatus: n.status ?? (m == null ? void 0 : m.error.value) }, n.id)), w = v(() => [ot.base, _.value ? ot.invalid : f(ot.valid), n.inputClass]); return (p, y) => (o(), i("div", { class: h([p.$attrs.class]) }, [ @@ -3568,14 +3568,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ type: u.value, name: p.id, id: p.id, - class: b.value, + class: w.value, placeholder: c.value, - value: G(pn)(u.value, p.modelValue), + value: W(pn)(u.value, p.modelValue), onInput: y[0] || (y[0] = (k) => p.$emit("update:modelValue", s(k.target))), "aria-invalid": _.value != null, "aria-describedby": `${p.id}-error`, step: "any" - }, G(ft)(p.$attrs, ["class", "value"])), null, 16, Pd), + }, W(ft)(p.$attrs, ["class", "value"])), null, 16, Pd), _.value ? (o(), i("div", Bd, Rd)) : x("", !0) ], 2), _.value ? (o(), i("p", { @@ -3631,7 +3631,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ onInput: f[0] || (f[0] = (m) => c.$emit("update:modelValue", t(m.target))), "aria-invalid": u.value != null, "aria-describedby": `${c.id}-error` - }, G(ft)(c.$attrs, ["class"])), O(c.modelValue), 17, Kd) + }, W(ft)(c.$attrs, ["class"])), O(c.modelValue), 17, Kd) ]), u.value ? (o(), i("p", { key: 1, @@ -3684,7 +3684,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ onInput: c[0] || (c[0] = (f) => d.$emit("update:modelValue", t(f.target))), "aria-invalid": r.value != null, "aria-describedby": `${d.id}-error` - }, G(ft)(d.$attrs, ["class"])), [ + }, W(ft)(d.$attrs, ["class"])), [ (o(!0), i(Me, null, je(u.value, (f) => (o(), i("option", { value: f.key }, O(f.value), 9, ec))), 256)) @@ -3734,7 +3734,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ checked: u.modelValue, onInput: d[0] || (d[0] = (c) => u.$emit("update:modelValue", c.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", u.inputClass] - }, G(ft)(u.$attrs, ["class"])), null, 16, oc) + }, W(ft)(u.$attrs, ["class"])), null, 16, oc) ]), l("div", ac, [ l("label", { @@ -3798,148 +3798,148 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ emits: ["update:modelValue"], setup(e, { emit: t }) { const s = e, n = t; - function a(w) { - return s.converter ? s.converter(w) : w; + function a(b) { + return s.converter ? s.converter(b) : b; } - const r = v(() => Ze(a(s.modelValue), (w) => typeof w == "string" ? w.trim().length == 0 ? [] : w.split(",") : w) || []), u = D(), d = D(!1), c = v(() => { - const w = _.value.toLowerCase(); - return !s.allowableValues || s.allowableValues.length == 0 ? [] : s.allowableValues.length < 1e3 ? s.allowableValues.filter((N) => !r.value.includes(N) && N.toLowerCase().includes(w)) : s.allowableValues.filter((N) => !r.value.includes(N) && N.startsWith(w)); + const r = v(() => Ze(a(s.modelValue), (b) => typeof b == "string" ? b.trim().length == 0 ? [] : b.split(",") : b) || []), u = D(), d = D(!1), c = v(() => { + const b = _.value.toLowerCase(); + return !s.allowableValues || s.allowableValues.length == 0 ? [] : s.allowableValues.length < 1e3 ? s.allowableValues.filter((N) => !r.value.includes(N) && N.toLowerCase().includes(b)) : s.allowableValues.filter((N) => !r.value.includes(N) && N.startsWith(b)); }); - function f(w) { - u.value = w; + function f(b) { + u.value = b; } - const m = D(null), _ = D(""), b = v(() => s.type || "text"), p = v(() => s.label ?? Pe(at(s.id))); + const m = D(null), _ = D(""), w = v(() => s.type || "text"), p = 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)), A = v(() => [ + const k = v(() => mt.call({ responseStatus: s.status ?? (y == null ? void 0 : y.error.value) }, s.id)), T = 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 - ]), I = (w) => L(r.value.filter((N) => N != w)); - function se(w) { + ]), j = (b) => L(r.value.filter((N) => N != b)); + function se(b) { var N; - document.activeElement === w.target && ((N = m.value) == null || N.focus()); + document.activeElement === b.target && ((N = m.value) == null || N.focus()); } - const j = D(); - function F() { - d.value = !0, j.value = !0; + const F = D(); + function I() { + d.value = !0, F.value = !0; } - function M() { - F(); + function A() { + I(); } function ie() { - q(K()), j.value = !1, setTimeout(() => { - j.value || (d.value = !1); + Z(Q()), F.value = !1, setTimeout(() => { + F.value || (d.value = !1); }, 200); } - function L(w) { - const N = s.string ? w.join(",") : w; + function L(b) { + const N = s.string ? b.join(",") : b; n("update:modelValue", N); } - function z(w) { - if (w.key == "Backspace" && _.value.length == 0 && r.value.length > 0 && I(r.value[r.value.length - 1]), !(!s.allowableValues || s.allowableValues.length == 0)) - if (w.code == "Escape" || w.code == "Tab") + function E(b) { + if (b.key == "Backspace" && _.value.length == 0 && r.value.length > 0 && j(r.value[r.value.length - 1]), !(!s.allowableValues || s.allowableValues.length == 0)) + if (b.code == "Escape" || b.code == "Tab") d.value = !1; - else if (w.code == "Home") - u.value = c.value[0], W(); - else if (w.code == "End") - u.value = c.value[c.value.length - 1], W(); - else if (w.code == "ArrowDown") { + else if (b.code == "Home") + u.value = c.value[0], J(); + else if (b.code == "End") + u.value = c.value[c.value.length - 1], J(); + else if (b.code == "ArrowDown") { if (d.value = !0, !u.value) u.value = c.value[0]; else { const N = c.value.indexOf(u.value); u.value = N + 1 < c.value.length ? c.value[N + 1] : c.value[0]; } - ee(); - } else if (w.code == "ArrowUp") { + Y(); + } else if (b.code == "ArrowUp") { if (!u.value) u.value = c.value[c.value.length - 1]; else { const N = c.value.indexOf(u.value); u.value = N - 1 >= 0 ? c.value[N - 1] : c.value[c.value.length - 1]; } - ee(); + Y(); } else - w.code == "Enter" ? u.value && d.value ? (q(u.value), w.preventDefault()) : d.value = !1 : d.value = c.value.length > 0; + b.code == "Enter" ? u.value && d.value ? (Z(u.value), b.preventDefault()) : d.value = !1 : d.value = c.value.length > 0; } - function K() { + function Q() { if (_.value.length == 0) return ""; - let w = Po(_.value.trim(), ","); - return w[0] == "," && (w = w.substring(1)), w = w.trim(), w.length == 0 && d.value && c.value.length > 0 ? u.value : w; + let b = Po(_.value.trim(), ","); + return b[0] == "," && (b = b.substring(1)), b = b.trim(), b.length == 0 && d.value && c.value.length > 0 ? u.value : b; } - function le(w) { - const N = K(); + function le(b) { + const N = Q(); if (N.length > 0) { - const E = s.delimiters.some((C) => C == w.key); - if (E && w.preventDefault(), w.key == "Enter" || w.key == "NumpadEnter" || w.key.length == 1 && E) { - q(N); + const z = s.delimiters.some((C) => C == b.key); + if (z && b.preventDefault(), b.key == "Enter" || b.key == "NumpadEnter" || b.key.length == 1 && z) { + Z(N); return; } } } const R = { behavior: "smooth", block: "nearest", inline: "nearest", scrollMode: "if-needed" }; - function W() { + function J() { setTimeout(() => { - let w = _s(`#${s.id}-tag li.active`); - w && w.scrollIntoView(R); + let b = _s(`#${s.id}-tag li.active`); + b && b.scrollIntoView(R); }, 0); } - function ee() { + function Y() { setTimeout(() => { - let w = _s(`#${s.id}-tag li.active`); - w && ("scrollIntoViewIfNeeded" in w ? w.scrollIntoViewIfNeeded(R) : w.scrollIntoView(R)); + let b = _s(`#${s.id}-tag li.active`); + b && ("scrollIntoViewIfNeeded" in b ? b.scrollIntoViewIfNeeded(R) : b.scrollIntoView(R)); }, 0); } - function q(w) { - if (w.length === 0) + function Z(b) { + if (b.length === 0) return; const N = Array.from(r.value); - N.indexOf(w) == -1 && N.push(w), L(N), _.value = "", d.value = !1; + N.indexOf(b) == -1 && N.push(b), L(N), _.value = "", d.value = !1; } - function T(w) { - var E; - const N = (E = w.clipboardData) == null ? void 0 : E.getData("Text"); + function V(b) { + var z; + const N = (z = b.clipboardData) == null ? void 0 : z.getData("Text"); te(N); } - function te(w) { - if (!w) + function te(b) { + if (!b) return; - const N = new RegExp(`\\n|\\t|${s.delimiters.join("|")}`), E = Array.from(r.value); - w.split(N).map((C) => C.trim()).forEach((C) => { - E.indexOf(C) == -1 && E.push(C); - }), L(E), _.value = ""; - } - return (w, N) => (o(), i("div", { - class: h([w.$attrs.class]), - id: `${w.id}-tag`, + const N = new RegExp(`\\n|\\t|${s.delimiters.join("|")}`), z = Array.from(r.value); + b.split(N).map((C) => C.trim()).forEach((C) => { + z.indexOf(C) == -1 && z.push(C); + }), L(z), _.value = ""; + } + return (b, N) => (o(), i("div", { + class: h([b.$attrs.class]), + id: `${b.id}-tag`, onmousemove: "cancelBlur=true" }, [ p.value ? (o(), i("label", { key: 0, - for: w.id, - class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${w.labelClass ?? ""}`) + for: b.id, + class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${b.labelClass ?? ""}`) }, O(p.value), 11, vc)) : x("", !0), l("div", pc, [ l("input", { type: "hidden", - id: w.id, - name: w.id, + id: b.id, + name: b.id, value: r.value.join(",") }, null, 8, mc), l("button", { - class: h(A.value), + class: h(T.value), onClick: Ue(se, ["prevent"]), - onFocus: N[2] || (N[2] = (E) => d.value = !0), + onFocus: N[2] || (N[2] = (z) => d.value = !0), tabindex: "-1" }, [ l("div", hc, [ - (o(!0), i(Me, null, je(r.value, (E) => (o(), i("div", gc, [ + (o(!0), i(Me, null, je(r.value, (z) => (o(), i("div", gc, [ l("span", yc, [ - ke(O(E) + " ", 1), + ke(O(z) + " ", 1), l("button", { type: "button", - onClick: (g) => I(E), + onClick: (g) => j(z), class: "flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black" }, kc, 8, bc) ]) @@ -3948,26 +3948,26 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ Mt(l("input", Te({ ref_key: "txtInput", ref: m, - type: b.value, + type: w.value, role: "combobox", "aria-controls": "options", "aria-expanded": "false", autocomplete: "off", spellcheck: "false", - name: `${w.id}-txt`, - id: `${w.id}-txt`, + name: `${b.id}-txt`, + id: `${b.id}-txt`, class: "p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none", style: `box-shadow:none !important;width:${_.value.length + 1}ch`, - "onUpdate:modelValue": N[0] || (N[0] = (E) => _.value = E), + "onUpdate:modelValue": N[0] || (N[0] = (z) => _.value = z), "aria-invalid": k.value != null, - "aria-describedby": `${w.id}-error`, - onKeydown: z, + "aria-describedby": `${b.id}-error`, + onKeydown: E, onKeypress: le, - onPaste: Ue(T, ["prevent", "stop"]), - onFocus: M, + onPaste: Ue(V, ["prevent", "stop"]), + onFocus: A, onBlur: ie, - onClick: N[1] || (N[1] = (E) => d.value = !0) - }, G(ft)(w.$attrs, ["class", "required"])), null, 16, $c), [ + onClick: N[1] || (N[1] = (z) => d.value = !0) + }, W(ft)(b.$attrs, ["class", "required"])), null, 16, $c), [ [wo, _.value] ]) ]) @@ -3976,18 +3976,18 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ d.value && c.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: z, - id: `${w.id}-options`, + onKeydown: E, + id: `${b.id}-options`, role: "listbox" }, [ - (o(!0), i(Me, null, je(c.value.slice(0, w.maxVisibleItems), (E) => (o(), i("li", { - class: h([E === u.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: (g) => f(E), - onClick: (g) => q(E), + (o(!0), i(Me, null, je(c.value.slice(0, b.maxVisibleItems), (z) => (o(), i("li", { + class: h([z === u.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: (g) => f(z), + onClick: (g) => Z(z), role: "option", tabindex: "-1" }, [ - l("span", Lc, O(E), 1) + l("span", Lc, O(z), 1) ], 42, xc))), 256)) ], 40, Cc)) : x("", !0), k.value ? (o(), i("div", Vc, Mc)) : x("", !0) @@ -3995,12 +3995,12 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ k.value ? (o(), i("p", { key: 1, class: "mt-2 text-sm text-red-500", - id: `${w.id}-error` - }, O(k.value), 9, Ac)) : w.help ? (o(), i("p", { + id: `${b.id}-error` + }, O(k.value), 9, Ac)) : b.help ? (o(), i("p", { key: 2, class: "mt-2 text-sm text-gray-500", - id: `${w.id}-description` - }, O(w.help), 9, Tc)) : x("", !0) + id: `${b.id}-description` + }, O(b.help), 9, Tc)) : x("", !0) ], 10, fc)); } }), jc = { class: "relative flex-grow mr-2 sm:mr-4" }, Oc = ["for"], Dc = { class: "block mt-2" }, Pc = { class: "sr-only" }, Bc = ["multiple", "name", "id", "placeholder", "aria-invalid", "aria-describedby"], Hc = { @@ -4045,23 +4045,23 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ files: {} }, setup(e) { - var F; - const t = e, s = D(null), { assetsPathResolver: n, fallbackPathResolver: a } = It(), r = {}, u = D(), d = D(((F = t.files) == null ? void 0 : F.map(c)) || []); - function c(M) { - return M.filePath = n(M.filePath), M; + var I; + const t = e, s = D(null), { assetsPathResolver: n, fallbackPathResolver: a } = It(), r = {}, u = D(), d = D(((I = t.files) == null ? void 0 : I.map(c)) || []); + function c(A) { + return A.filePath = n(A.filePath), A; } - t.values && t.values.length > 0 && (d.value = t.values.map((M) => { - let ie = M.replace(/\\/g, "/"); + t.values && t.values.length > 0 && (d.value = t.values.map((A) => { + let ie = A.replace(/\\/g, "/"); return { fileName: rn(At(ie, "/"), "."), filePath: ie, contentType: el(ie) }; }).map(c)); const f = v(() => t.label ?? Pe(at(t.id))), m = v(() => t.placeholder ?? f.value); let _ = Qe("ApiState", void 0); - const b = v(() => mt.call({ responseStatus: t.status ?? (_ == null ? void 0 : _.error.value) }, t.id)), p = v(() => [ + const w = v(() => mt.call({ responseStatus: t.status ?? (_ == null ? void 0 : _.error.value) }, t.id)), p = 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", - b.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", + w.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", t.inputClass - ]), y = (M) => { - let ie = M.target; + ]), y = (A) => { + let ie = A.target; u.value = "", d.value = Array.from(ie.files || []).map((L) => ({ fileName: L.name, filePath: pl(L), @@ -4069,90 +4069,90 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ contentType: L.type || el(L.name) })); }, k = () => { - var M; - return (M = s.value) == null ? void 0 : M.click(); - }, A = (M) => M == null ? !1 : M.startsWith("data:") || M.startsWith("blob:"), I = v(() => { + var A; + return (A = s.value) == null ? void 0 : A.click(); + }, T = (A) => A == null ? !1 : A.startsWith("data:") || A.startsWith("blob:"), j = v(() => { if (d.value.length > 0) return d.value[0].filePath; - let M = typeof t.modelValue == "string" ? t.modelValue : t.values && t.values[0]; - return M && xt(n(M)) || null; - }), se = (M) => !M || M.startsWith("data:") || M.endsWith(".svg") ? "" : "rounded-full object-cover"; - function j(M) { - u.value = a(I.value); - } - return Ft(Cn), (M, ie) => (o(), i("div", { - class: h(["flex", M.multiple ? "flex-col" : "justify-between"]) + let A = typeof t.modelValue == "string" ? t.modelValue : t.values && t.values[0]; + return A && xt(n(A)) || null; + }), se = (A) => !A || A.startsWith("data:") || A.endsWith(".svg") ? "" : "rounded-full object-cover"; + function F(A) { + u.value = a(j.value); + } + return Ft(Cn), (A, ie) => (o(), i("div", { + class: h(["flex", A.multiple ? "flex-col" : "justify-between"]) }, [ l("div", jc, [ f.value ? (o(), i("label", { key: 0, - for: M.id, - class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${M.labelClass ?? ""}`) + for: A.id, + class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${A.labelClass ?? ""}`) }, O(f.value), 11, Oc)) : x("", !0), l("div", Dc, [ - l("span", Pc, O(M.help ?? f.value), 1), + l("span", Pc, O(A.help ?? f.value), 1), l("input", Te({ ref_key: "input", ref: s, type: "file", - multiple: M.multiple, - name: M.id, - id: M.id, + multiple: A.multiple, + name: A.id, + id: A.id, class: p.value, placeholder: m.value, - "aria-invalid": b.value != null, - "aria-describedby": `${M.id}-error` - }, M.$attrs, { onChange: y }), null, 16, Bc), - b.value ? (o(), i("div", Hc, Ec)) : x("", !0) + "aria-invalid": w.value != null, + "aria-describedby": `${A.id}-error` + }, A.$attrs, { onChange: y }), null, 16, Bc), + w.value ? (o(), i("div", Hc, Ec)) : x("", !0) ]), - b.value ? (o(), i("p", { + w.value ? (o(), i("p", { key: 1, class: "mt-2 text-sm text-red-500", - id: `${M.id}-error` - }, O(b.value), 9, zc)) : M.help ? (o(), i("p", { + id: `${A.id}-error` + }, O(w.value), 9, zc)) : A.help ? (o(), i("p", { key: 2, class: "mt-2 text-sm text-gray-500", - id: `${M.id}-description` - }, O(M.help), 9, Nc)) : x("", !0) + id: `${A.id}-description` + }, O(A.help), 9, Nc)) : x("", !0) ]), - M.multiple ? (o(), i("div", Kc, [ + A.multiple ? (o(), i("div", Kc, [ l("table", Zc, [ (o(!0), i(Me, null, je(d.value, (L) => (o(), i("tr", null, [ l("td", Wc, [ l("div", { class: "flex w-full", - title: A(L.filePath) ? "" : L.filePath + title: T(L.filePath) ? "" : L.filePath }, [ l("img", { - src: r[G(xt)(L.filePath)] || G(n)(G(xt)(L.filePath)), + src: r[W(xt)(L.filePath)] || W(n)(W(xt)(L.filePath)), class: h(["mr-2 h-8 w-8", se(L.filePath)]), - onError: (z) => r[G(xt)(L.filePath)] = G(a)(G(xt)(L.filePath)) + onError: (E) => r[W(xt)(L.filePath)] = W(a)(W(xt)(L.filePath)) }, null, 42, Jc), - A(L.filePath) ? (o(), i("span", Yc, O(L.fileName), 1)) : (o(), i("a", { + T(L.filePath) ? (o(), i("span", Yc, O(L.fileName), 1)) : (o(), i("a", { key: 0, - href: G(n)(L.filePath || ""), + href: W(n)(L.filePath || ""), target: "_blank", class: "overflow-hidden" }, O(L.fileName), 9, Xc)) ], 8, Gc) ]), l("td", e0, [ - L.contentLength && L.contentLength > 0 ? (o(), i("span", t0, O(G(hl)(L.contentLength)), 1)) : x("", !0) + L.contentLength && L.contentLength > 0 ? (o(), i("span", t0, O(W(hl)(L.contentLength)), 1)) : x("", !0) ]) ]))), 256)) ]) ])) : (o(), i("div", Uc, [ - I.value ? (o(), i("div", { + j.value ? (o(), i("div", { key: 0, class: "shrink-0 cursor-pointer", - title: A(I.value) ? "" : I.value + title: T(j.value) ? "" : j.value }, [ l("img", { onClick: k, - class: h(["h-16 w-16", se(I.value)]), + class: h(["h-16 w-16", se(j.value)]), alt: `Current ${f.value ?? ""}`, - src: u.value || G(n)(I.value), - onError: j + src: u.value || W(n)(j.value), + onError: F }, null, 42, Qc) ], 8, qc)) : x("", !0) ])) @@ -4225,58 +4225,58 @@ 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(T) { - return Array.isArray(a.modelValue) && a.modelValue.indexOf(T) >= 0; + function u(V) { + return Array.isArray(a.modelValue) && a.modelValue.indexOf(V) >= 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), b = D(""), p = D(null), y = D(a.viewCount), k = D([]), A = v(() => b.value ? a.options.filter((te) => a.match(te, b.value)).slice(0, y.value) : a.options), I = ["Tab", "Escape", "ArrowDown", "ArrowUp", "Enter", "PageUp", "PageDown", "Home", "End"]; - function se(T) { - p.value = T, k.value.indexOf(T) > 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), w = D(""), p = D(null), y = D(a.viewCount), k = D([]), T = v(() => w.value ? a.options.filter((te) => a.match(te, w.value)).slice(0, y.value) : a.options), j = ["Tab", "Escape", "ArrowDown", "ArrowUp", "Enter", "PageUp", "PageDown", "Home", "End"]; + function se(V) { + p.value = V, k.value.indexOf(V) > Math.floor(y.value * 0.9) && (y.value += a.viewCount, Z()); } - const j = [",", ` + const F = [",", ` `, " "]; - function F(T) { - var w; - const te = (w = T.clipboardData) == null ? void 0 : w.getData("Text"); - M(te); + function I(V) { + var b; + const te = (b = V.clipboardData) == null ? void 0 : b.getData("Text"); + A(te); } - function M(T) { - if (!T) + function A(V) { + if (!V) return; - const te = j.some((w) => T.includes(w)); + const te = F.some((b) => V.includes(b)); if (!a.multiple || !te) { - const w = a.options.filter((N) => a.match(N, T)); - w.length == 1 && (ee(w[0]), n.value = !1, hs()); + const b = a.options.filter((N) => a.match(N, V)); + b.length == 1 && (Y(b[0]), n.value = !1, hs()); } else if (te) { - const w = new RegExp("\\r|\\n|\\t|,"), E = T.split(w).filter((g) => g.trim()).map((g) => a.options.find((C) => a.match(C, g))).filter((g) => !!g); - if (E.length > 0) { - b.value = "", n.value = !1, p.value = null; + const b = new RegExp("\\r|\\n|\\t|,"), z = V.split(b).filter((g) => g.trim()).map((g) => a.options.find((C) => a.match(C, g))).filter((g) => !!g); + if (z.length > 0) { + w.value = "", n.value = !1, p.value = null; let g = Array.from(a.modelValue || []); - E.forEach((C) => { - u(C) ? g = g.filter((Y) => Y != C) : g.push(C); + z.forEach((C) => { + u(C) ? g = g.filter((ee) => ee != C) : g.push(C); }), r("update:modelValue", g), hs(); } } } - function ie(T) { - I.indexOf(T.code) || W(); + function ie(V) { + j.indexOf(V.code) || J(); } - function L(T) { - if (!(T.shiftKey || T.ctrlKey || T.altKey)) { + function L(V) { + if (!(V.shiftKey || V.ctrlKey || V.altKey)) { if (!n.value) { - T.code == "ArrowDown" && (n.value = !0, p.value = k.value[0]); + V.code == "ArrowDown" && (n.value = !0, p.value = k.value[0]); return; } - if (T.code == "Escape") - n.value && (T.stopPropagation(), n.value = !1); - else if (T.code == "Tab") + if (V.code == "Escape") + n.value && (V.stopPropagation(), n.value = !1); + else if (V.code == "Tab") n.value = !1; - else if (T.code == "Home") - p.value = k.value[0], K(); - else if (T.code == "End") - p.value = k.value[k.value.length - 1], K(); - else if (T.code == "ArrowDown") { + else if (V.code == "Home") + p.value = k.value[0], Q(); + else if (V.code == "End") + p.value = k.value[k.value.length - 1], Q(); + else if (V.code == "ArrowDown") { if (!p.value) p.value = k.value[0]; else { @@ -4284,7 +4284,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ p.value = te + 1 < k.value.length ? k.value[te + 1] : k.value[0]; } le(); - } else if (T.code == "ArrowUp") { + } else if (V.code == "ArrowUp") { if (!p.value) p.value = k.value[k.value.length - 1]; else { @@ -4293,75 +4293,75 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ } le(); } else - T.code == "Enter" && (p.value ? (ee(p.value), a.multiple || (T.preventDefault(), hs())) : n.value = !1); + V.code == "Enter" && (p.value ? (Y(p.value), a.multiple || (V.preventDefault(), hs())) : n.value = !1); } } - const z = { behavior: "smooth", block: "nearest", inline: "nearest", scrollMode: "if-needed" }; - function K() { + const E = { behavior: "smooth", block: "nearest", inline: "nearest", scrollMode: "if-needed" }; + function Q() { setTimeout(() => { - let T = _s(`#${a.id}-autocomplete li.active`); - T && T.scrollIntoView(z); + let V = _s(`#${a.id}-autocomplete li.active`); + V && V.scrollIntoView(E); }, 0); } function le() { setTimeout(() => { - let T = _s(`#${a.id}-autocomplete li.active`); - T && ("scrollIntoViewIfNeeded" in T ? T.scrollIntoViewIfNeeded(z) : T.scrollIntoView(z)); + let V = _s(`#${a.id}-autocomplete li.active`); + V && ("scrollIntoViewIfNeeded" in V ? V.scrollIntoViewIfNeeded(E) : V.scrollIntoView(E)); }, 0); } - function R(T) { + function R(V) { var te; - n.value = T, T && (W(), (te = _.value) == null || te.focus()); + n.value = V, V && (J(), (te = _.value) == null || te.focus()); } - function W() { - n.value = !0, q(); + function J() { + n.value = !0, Z(); } - function ee(T) { - if (b.value = "", n.value = !1, a.multiple) { + function Y(V) { + if (w.value = "", n.value = !1, a.multiple) { let te = Array.from(a.modelValue || []); - u(T) ? te = te.filter((w) => w != T) : te.push(T), p.value = null, r("update:modelValue", te); + u(V) ? te = te.filter((b) => b != V) : te.push(V), p.value = null, r("update:modelValue", te); } else { - let te = T; - a.modelValue == T && (te = null), r("update:modelValue", te); + let te = V; + a.modelValue == V && (te = null), r("update:modelValue", te); } } - function q() { - k.value = A.value; + function Z() { + k.value = T.value; } - return bt(b, q), (T, te) => (o(), i("div", { - id: `${T.id}-autocomplete` + return bt(w, Z), (V, te) => (o(), i("div", { + id: `${V.id}-autocomplete` }, [ d.value ? (o(), i("label", { key: 0, - for: `${T.id}-text`, + for: `${V.id}-text`, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" }, O(d.value), 9, n0)) : x("", !0), l("div", o0, [ Mt(l("input", Te({ ref_key: "txtInput", ref: _, - id: `${T.id}-text`, + id: `${V.id}-text`, type: "text", role: "combobox", "aria-controls": "options", "aria-expanded": "false", autocomplete: "off", spellcheck: "false", - "onUpdate:modelValue": te[0] || (te[0] = (w) => b.value = w), + "onUpdate:modelValue": te[0] || (te[0] = (b) => w.value = b), class: m.value, - placeholder: T.multiple || !T.modelValue ? T.placeholder : "", - onFocus: W, + placeholder: V.multiple || !V.modelValue ? V.placeholder : "", + onFocus: J, onKeydown: L, onKeyup: ie, - onClick: W, - onPaste: F, + onClick: J, + onPaste: I, required: !1 - }, T.$attrs), null, 16, a0), [ - [ko, b.value] + }, V.$attrs), null, 16, a0), [ + [ko, w.value] ]), l("button", { type: "button", - onClick: te[1] || (te[1] = (w) => R(!n.value)), + onClick: te[1] || (te[1] = (b) => R(!n.value)), class: "absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none", tabindex: "-1" }, i0), @@ -4369,41 +4369,41 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ key: 0, class: "absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", onKeydown: L, - id: `${T.id}-options`, + id: `${V.id}-options`, role: "listbox" }, [ - (o(!0), i(Me, null, je(k.value, (w) => (o(), i("li", { - class: h([w === p.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: (N) => se(w), - onClick: (N) => ee(w), + (o(!0), i(Me, null, je(k.value, (b) => (o(), i("li", { + class: h([b === p.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: (N) => se(b), + onClick: (N) => Y(b), role: "option", tabindex: "-1" }, [ - U(T.$slots, "item", Rt(ks(w))), - u(w) ? (o(), i("span", { + U(V.$slots, "item", Et(ks(b))), + u(b) ? (o(), i("span", { key: 0, - class: h(["absolute inset-y-0 right-0 flex items-center pr-4", w === p.value ? "text-white" : "text-indigo-600"]) + class: h(["absolute inset-y-0 right-0 flex items-center pr-4", b === p.value ? "text-white" : "text-indigo-600"]) }, f0, 2)) : x("", !0) ], 42, d0))), 256)) - ], 40, u0)) : !T.multiple && T.modelValue ? (o(), i("div", { + ], 40, u0)) : !V.multiple && V.modelValue ? (o(), i("div", { key: 1, onKeydown: L, - onClick: te[2] || (te[2] = (w) => R(!n.value)), + onClick: te[2] || (te[2] = (b) => R(!n.value)), class: "h-8 -mt-8 ml-3 pt-0.5" }, [ - U(T.$slots, "item", Rt(ks(T.modelValue))) + U(V.$slots, "item", Et(ks(V.modelValue))) ], 32)) : x("", !0), f.value ? (o(), i("div", v0, m0)) : x("", !0) ]), f.value ? (o(), i("p", { key: 1, class: "mt-2 text-sm text-red-500", - id: `${T.id}-error` - }, O(f.value), 9, h0)) : T.help ? (o(), i("p", { + id: `${V.id}-error` + }, O(f.value), 9, h0)) : V.help ? (o(), i("p", { key: 2, class: "mt-2 text-sm text-gray-500", - id: `${T.id}-description` - }, O(T.help), 9, g0)) : x("", !0) + id: `${V.id}-description` + }, O(V.help), 9, g0)) : x("", !0) ], 8, l0)); } }), b0 = ["id", "name", "value"], w0 = { class: "block truncate" }, k0 = /* @__PURE__ */ de({ @@ -4439,15 +4439,15 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ p == null || p === "" ? m.value = u.value ? [] : null : typeof p == "string" ? m.value = f.value.find((y) => y.key === p) || null : Array.isArray(p) && (m.value = f.value.filter((y) => p.includes(y.key))); } Ye(_); - const b = v(() => m.value == null ? "" : Array.isArray(m.value) ? m.value.map((p) => encodeURIComponent(p.key)).join(",") : m.value.key); + const w = v(() => m.value == null ? "" : Array.isArray(m.value) ? m.value.map((p) => encodeURIComponent(p.key)).join(",") : m.value.key); return (p, y) => { - const k = Z("Autocomplete"); + const k = K("Autocomplete"); return o(), i(Me, null, [ l("input", { type: "hidden", id: p.id, name: p.id, - value: b.value + value: w.value }, null, 8, b0), ye(k, Te({ ref_key: "input", @@ -4459,12 +4459,12 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ }, p.$attrs, { modelValue: m.value, "onUpdate:modelValue": [ - y[0] || (y[0] = (A) => m.value = A), + y[0] || (y[0] = (T) => m.value = T), r ] }), { - item: xe(({ key: A, value: I }) => [ - l("span", w0, O(I), 1) + item: xe(({ key: T, value: j }) => [ + l("span", w0, O(j), 1) ]), _: 1 }, 16, ["id", "options", "multiple", "modelValue"]) @@ -4500,85 +4500,85 @@ 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, T, te, w, N, E, g, C, Y, X, ne, P, V, fe, pe, ue, me; - const _ = Z("SelectInput"), b = Z("CheckboxInput"), p = 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({ + var F, I, A, ie, L, E, Q, le, R, J, Y, Z, V, te, b, N, z, g, C, ee, X, ne, P, S, fe, pe, ue, me; + const _ = K("SelectInput"), w = K("CheckboxInput"), p = K("TagInput"), y = K("Combobox"), k = K("FileInput"), T = K("TextareaInput"), j = K("MarkdownInput"), se = K("TextInput"); + return W(G).component(a.value) ? (o(), ae(an(W(G).component(a.value)), Te({ key: 0, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[0] || (m[0] = (S) => d.value = S), - status: (j = f.api) == null ? void 0 : j.error, - "input-class": (F = f.input.css) == null ? void 0 : F.input, - "label-class": (M = f.input.css) == null ? void 0 : M.label + "onUpdate:modelValue": m[0] || (m[0] = (M) => d.value = M), + status: (F = f.api) == null ? void 0 : F.error, + "input-class": (I = f.input.css) == null ? void 0 : I.input, + "label-class": (A = f.input.css) == null ? void 0 : A.label }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class"])) : a.value == "select" ? (o(), ae(_, Te({ key: 1, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[1] || (m[1] = (S) => d.value = S), + "onUpdate:modelValue": m[1] || (m[1] = (M) => d.value = M), status: (ie = f.api) == null ? void 0 : ie.error, "input-class": (L = f.input.css) == null ? void 0 : L.input, - "label-class": (z = f.input.css) == null ? void 0 : z.label, + "label-class": (E = f.input.css) == null ? void 0 : E.label, entries: f.input.allowableEntries, values: f.input.allowableValues - }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class", "entries", "values"])) : a.value == "checkbox" ? (o(), ae(b, Te({ + }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class", "entries", "values"])) : a.value == "checkbox" ? (o(), ae(w, Te({ key: 2, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[2] || (m[2] = (S) => d.value = S), - status: (K = f.api) == null ? void 0 : K.error, + "onUpdate:modelValue": m[2] || (m[2] = (M) => d.value = M), + status: (Q = f.api) == null ? void 0 : Q.error, "input-class": (le = f.input.css) == null ? void 0 : le.input, "label-class": (R = f.input.css) == null ? void 0 : R.label }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class"])) : a.value == "tag" ? (o(), ae(p, Te({ key: 3, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[3] || (m[3] = (S) => d.value = S), - status: (W = f.api) == null ? void 0 : W.error, - "input-class": (ee = f.input.css) == null ? void 0 : ee.input, - "label-class": (q = f.input.css) == null ? void 0 : q.label, + "onUpdate:modelValue": m[3] || (m[3] = (M) => d.value = M), + status: (J = f.api) == null ? void 0 : J.error, + "input-class": (Y = f.input.css) == null ? void 0 : Y.input, + "label-class": (Z = f.input.css) == null ? void 0 : Z.label, allowableValues: f.input.allowableValues, - string: ((T = f.input.prop) == null ? void 0 : T.type) == "String" + string: ((V = f.input.prop) == null ? void 0 : V.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, modelValue: d.value, - "onUpdate:modelValue": m[4] || (m[4] = (S) => d.value = S), + "onUpdate:modelValue": m[4] || (m[4] = (M) => d.value = M), status: (te = f.api) == null ? void 0 : te.error, - "input-class": (w = f.input.css) == null ? void 0 : w.input, + "input-class": (b = f.input.css) == null ? void 0 : b.input, "label-class": (N = f.input.css) == null ? void 0 : N.label, entries: f.input.allowableEntries, values: f.input.allowableValues }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class", "entries", "values"])) : a.value == "file" ? (o(), ae(k, Te({ key: 5, id: f.input.id, - status: (E = f.api) == null ? void 0 : E.error, + status: (z = f.api) == null ? void 0 : z.error, modelValue: d.value, - "onUpdate:modelValue": m[5] || (m[5] = (S) => d.value = S), + "onUpdate:modelValue": m[5] || (m[5] = (M) => d.value = M), "input-class": (g = f.input.css) == null ? void 0 : g.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(A, Te({ + }, u.value), null, 16, ["id", "status", "modelValue", "input-class", "label-class", "files"])) : a.value == "textarea" ? (o(), ae(T, Te({ key: 6, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[6] || (m[6] = (S) => d.value = S), - status: (Y = f.api) == null ? void 0 : Y.error, + "onUpdate:modelValue": m[6] || (m[6] = (M) => d.value = M), + status: (ee = f.api) == null ? void 0 : ee.error, "input-class": (X = f.input.css) == null ? void 0 : X.input, "label-class": (ne = f.input.css) == null ? void 0 : ne.label - }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class"])) : a.value == "MarkdownInput" ? (o(), ae(I, Te({ + }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class"])) : a.value == "MarkdownInput" ? (o(), ae(j, Te({ key: 7, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[7] || (m[7] = (S) => d.value = S), + "onUpdate:modelValue": m[7] || (m[7] = (M) => d.value = M), status: (P = f.api) == null ? void 0 : P.error, - "input-class": (V = f.input.css) == null ? void 0 : V.input, + "input-class": (S = f.input.css) == null ? void 0 : S.input, "label-class": (fe = f.input.css) == null ? void 0 : fe.label }, u.value), null, 16, ["id", "modelValue", "status", "input-class", "label-class"])) : (o(), ae(se, Te({ key: 8, type: a.value, id: f.input.id, modelValue: d.value, - "onUpdate:modelValue": m[8] || (m[8] = (S) => d.value = S), + "onUpdate:modelValue": m[8] || (m[8] = (M) => d.value = M), status: (pe = f.api) == null ? void 0 : pe.error, "input-class": (ue = f.input.css) == null ? void 0 : ue.input, "label-class": (me = f.input.css) == null ? void 0 : me.label @@ -4641,23 +4641,23 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ setup(e, { emit: t }) { const { config: s } = It(), { metadataApi: n } = lt(), a = e, r = t, u = v(() => a.id || a.input.id), d = v(() => a.label ?? Pe(at(u.value))); let c = Qe("ApiState", void 0); - const f = Qe("client"), m = v(() => mt.call({ responseStatus: a.status ?? (c == null ? void 0 : c.error.value) }, u.value)), _ = D(""), b = D(""), p = v(() => _e(a.modelValue, u.value)), y = v(() => st(a.metadataType).find((j) => j.name.toLowerCase() == u.value.toLowerCase())), k = v(() => { - 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; + const f = Qe("client"), m = v(() => mt.call({ responseStatus: a.status ?? (c == null ? void 0 : c.error.value) }, u.value)), _ = D(""), w = D(""), p = v(() => _e(a.modelValue, u.value)), y = v(() => st(a.metadataType).find((F) => F.name.toLowerCase() == u.value.toLowerCase())), k = v(() => { + var F, I, A; + return ((A = rt((I = (F = y.value) == null ? void 0 : F.ref) == null ? void 0 : I.model)) == null ? void 0 : A.icon) || s.value.tableIcon; }); - let A; - function I(j) { - if (j) { - if (A == null) { + let T; + function j(F) { + if (F) { + if (T == null) { console.warn("No ModalProvider required by LookupInput"); return; } - 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; - const ie = G(a.modelValue); - ie[u.value] = M, r("update:modelValue", ie); + T.openModal({ name: "ModalLookup", ref: F }, (I) => { + if (console.debug("openModal", _.value, " -> ", I, Pt.setRefValue(F, I), F), I) { + const A = _e(I, F.refId); + _.value = Pt.setRefValue(F, I) || A; + const ie = W(a.modelValue); + ie[u.value] = A, r("update:modelValue", ie); } }); } @@ -4666,43 +4666,45 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ a.modelValue[u.value] = null, _.value = ""; } return Ye(async () => { - var K, le; - A = Qe("ModalProvider", void 0); - const j = a.modelValue; + var Q, le; + T = Qe("ModalProvider", void 0); + const F = a.modelValue; a.modelValue[u.value] || (a.modelValue[u.value] = null); - const F = y.value, M = F == null ? void 0 : F.ref; - if (!M) { + const I = y.value, A = I == null ? void 0 : I.ref; + if (!A) { console.warn(`No RefInfo for property '${u.value}'`); return; } _.value = ""; - let ie = M.selfId == null ? _e(j, F.name) : _e(j, M.selfId); - if (Xt(ie) && (ie = _e(j, M.refId)), ie == null) + let ie = A.selfId == null ? _e(F, I.name) : _e(F, A.selfId); + const L = Rt(ie); + if (console.log("refIdValue", ie, Rt(ie), F, A), L && (ie = _e(F, A.refId)), ie == null) return; - if (((K = n.value) == null ? void 0 : K.operations.find((R) => { - var W; - return ((W = R.dataModel) == null ? void 0 : W.name) == M.model; - })) != null) { - const R = _e(j, F.name); - if (Xt(R)) + const E = (Q = n.value) == null ? void 0 : Q.operations.find((R) => { + var J; + return ((J = R.dataModel) == null ? void 0 : J.name) == A.model; + }); + if (console.debug("LookupInput queryOp", E), E != null) { + const R = _e(F, I.name); + if (Rt(R)) return; - if (_.value = `${R}`, b.value = F.name, M.refLabel != null) { - const W = st(a.metadataType).find((q) => q.type == M.model); - W == null && console.warn(`Could not find ${M.model} Property on ${a.metadataType.name}`); - const ee = W != null ? _e(j, W.name) : null; - if (ee != null) { - let q = _e(ee, M.refLabel); - q && (_.value = `${q}`, Pt.setValue(M.model, ie, M.refLabel, q)); + if (_.value = `${R}`, w.value = I.name, A.refLabel != null) { + const J = st(a.metadataType).filter((V) => V.type == A.model); + J.length || console.warn(`Could not find ${A.model} Property on ${a.metadataType.name}`); + const Y = J.map((V) => _e(F, V.name)).filter((V) => !!V), Z = Y.length <= 1 ? Y[0] : Y.find((V) => V[A.refId ?? "id"] == ie); + if (Z != null) { + let V = _e(Z, A.refLabel); + V && (_.value = `${V}`, Pt.setValue(A.model, ie, A.refLabel, V)); } else { - const q = ((le = F.attributes) == null ? void 0 : le.some((te) => te.name == "Computed")) == !0; - let T = await Pt.getOrFetchValue(f, n.value, M.model, M.refId, M.refLabel, q, ie); - _.value = T || `${M.model}: ${_.value}`; + const V = ((le = I.attributes) == null ? void 0 : le.some((b) => b.name == "Computed")) == !0; + let te = await Pt.getOrFetchValue(f, n.value, A.model, A.refId, A.refLabel, V, ie); + _.value = te || `${A.model}: ${_.value}`; } } } - }), (j, F) => { + }), (F, I) => { var ie; - const M = Z("Icon"); + const A = K("Icon"); return o(), i("div", $0, [ l("input", { type: "hidden", @@ -4712,7 +4714,7 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ d.value ? (o(), i("div", x0, [ l("label", { for: u.value, - class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${j.labelClass ?? ""}`) + class: h(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${F.labelClass ?? ""}`) }, O(d.value), 11, L0), p.value ? (o(), i("div", V0, [ l("span", S0, O(p.value), 1), @@ -4728,14 +4730,14 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ 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: F[0] || (F[0] = (L) => I(y.value.ref)), + onClick: I[0] || (I[0] = (L) => j(y.value.ref)), "aria-haspopup": "listbox", "aria-expanded": "true", "aria-labelledby": "listbox-label" }, [ l("span", I0, [ l("span", j0, [ - ye(M, { + ye(A, { class: "mr-1 w-5 h-5", image: k.value }, null, 8, ["image"]), @@ -4749,11 +4751,11 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ key: 2, class: "mt-2 text-sm text-red-500", id: `${u.value}-error` - }, O(m.value), 9, D0)) : j.help ? (o(), i("p", { + }, O(m.value), 9, D0)) : F.help ? (o(), i("p", { key: 3, class: "mt-2 text-sm text-gray-500", id: `${u.value}-description` - }, O(j.help), 9, P0)) : x("", !0) + }, O(F.help), 9, P0)) : x("", !0) ]); }; } @@ -4778,90 +4780,90 @@ const ti = { key: 0 }, si = { class: "md:p-4" }, lo = /* @__PURE__ */ de({ const n = e, a = s; t({ forceUpdate: r, props: n, updateValue: d }); function r() { - var F; - const j = Be(); - (F = j == null ? void 0 : j.proxy) == null || F.$forceUpdate(); + var I; + const F = Be(); + (I = F == null ? void 0 : F.proxy) == null || I.$forceUpdate(); } - function u(j, F) { - d(j.id, _e(F, j.id)); + function u(F, I) { + d(F.id, _e(I, F.id)); } - function d(j, F) { - n.modelValue[j] = F, a("update:modelValue", n.modelValue), r(); + function d(F, I) { + n.modelValue[F] = I, a("update:modelValue", n.modelValue), r(); } - const { metadataApi: c, apiOf: f, typeOf: m, typeOfRef: _, createFormLayout: b, Crud: p } = 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; + const { metadataApi: c, apiOf: f, typeOf: m, typeOfRef: _, createFormLayout: w, Crud: p } = lt(), y = v(() => n.type || Qt(n.modelValue)), k = v(() => n.metaType ?? m(y.value)), T = v(() => { + var F, I; + return _((I = (F = c.value) == null ? void 0 : F.operations.find((A) => A.request.name == y.value)) == null ? void 0 : I.dataModel) || k.value; }); - function I() { - const j = k.value; - if (!j) { + function j() { + const F = k.value; + if (!F) { if (n.formLayout) { - const K = n.formLayout.map((le) => { - const R = { name: le.id, type: Ia(le.type) }, W = Object.assign({ prop: R }, le); - return n.configureField && n.configureField(W), W; + const Q = n.formLayout.map((le) => { + const R = { name: le.id, type: Ia(le.type) }, J = Object.assign({ prop: R }, le); + return n.configureField && n.configureField(J), J; }); - return n.configureFormLayout && n.configureFormLayout(K), K; + return n.configureFormLayout && n.configureFormLayout(Q), Q; } throw new Error(`MetadataType for ${y.value} not found`); } - const F = st(j), M = A.value, ie = n.formLayout ? Array.from(n.formLayout) : b(j), L = [], z = f(j.name); - return ie.forEach((K) => { - var ee; - const le = F.find((q) => q.name == K.name); - if (K.ignore) + const I = st(F), A = T.value, ie = n.formLayout ? Array.from(n.formLayout) : w(F), L = [], E = f(F.name); + return ie.forEach((Q) => { + var Y; + const le = I.find((Z) => Z.name == Q.name); + if (Q.ignore) return; - const R = ((ee = M == null ? void 0 : M.properties) == null ? void 0 : ee.find((q) => { - 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); + const R = ((Y = A == null ? void 0 : A.properties) == null ? void 0 : Y.find((Z) => { + var V; + return Z.name.toLowerCase() == ((V = Q.name) == null ? void 0 : V.toLowerCase()); + })) ?? le, J = Object.assign({ prop: R, op: E }, Q); + n.configureField && n.configureField(J), L.push(J); }), n.configureFormLayout && n.configureFormLayout(L), L; } - const se = () => I().filter((j) => j.type != "hidden").map((j) => j.id); - return (j, F) => { - var z; - const M = Z("ErrorSummary"), ie = Z("LookupInput"), L = Z("DynamicInput"); + const se = () => j().filter((F) => F.type != "hidden").map((F) => F.id); + return (F, I) => { + var E; + const A = K("ErrorSummary"), ie = K("LookupInput"), L = K("DynamicInput"); return o(), i(Me, null, [ - j.hideSummary ? x("", !0) : (o(), ae(M, { + F.hideSummary ? x("", !0) : (o(), ae(A, { key: 0, - status: (z = j.api) == null ? void 0 : z.error, + status: (E = F.api) == null ? void 0 : E.error, except: se() }, null, 8, ["status", "except"])), l("div", { - class: h(j.flexClass) + class: h(F.flexClass) }, [ l("div", { - class: h(j.divideClass) + class: h(F.divideClass) }, [ l("div", { - class: h(j.spaceClass) + class: h(F.spaceClass) }, [ l("fieldset", { - class: h(j.fieldsetClass) + class: h(F.fieldsetClass) }, [ - (o(!0), i(Me, null, je(I(), (K) => { - var le, R, W; + (o(!0), i(Me, null, je(j(), (Q) => { + var le, R, J; return o(), i("div", { - key: K.id, + key: Q.id, class: h([ "w-full", - ((le = K.css) == null ? void 0 : le.field) ?? (K.type == "textarea" ? "col-span-12" : "col-span-12 xl:col-span-6" + (K.type == "checkbox" ? " flex items-center" : "")), - K.type == "hidden" ? "hidden" : "" + ((le = Q.css) == null ? void 0 : le.field) ?? (Q.type == "textarea" ? "col-span-12" : "col-span-12 xl:col-span-6" + (Q.type == "checkbox" ? " flex items-center" : "")), + Q.type == "hidden" ? "hidden" : "" ]) }, [ - ((R = K.prop) == null ? void 0 : R.ref) != null && K.type != "file" && !K.prop.isPrimaryKey ? (o(), ae(ie, { + ((R = Q.prop) == null ? void 0 : R.ref) != null && Q.type != "file" && !Q.prop.isPrimaryKey ? (o(), ae(ie, { key: 0, - metadataType: A.value, - input: K, - modelValue: j.modelValue, - "onUpdate:modelValue": (ee) => u(K, ee), - status: (W = j.api) == null ? void 0 : W.error + metadataType: T.value, + input: Q, + modelValue: F.modelValue, + "onUpdate:modelValue": (Y) => u(Q, Y), + status: (J = F.api) == null ? void 0 : J.error }, null, 8, ["metadataType", "input", "modelValue", "onUpdate:modelValue", "status"])) : (o(), ae(L, { key: 1, - input: K, - modelValue: j.modelValue, - "onUpdate:modelValue": F[0] || (F[0] = (ee) => j.$emit("update:modelValue", ee)), - api: j.api + input: Q, + modelValue: F.modelValue, + "onUpdate:modelValue": I[0] || (I[0] = (Y) => F.$emit("update:modelValue", Y)), + api: F.api }, null, 8, ["input", "modelValue", "api"])) ], 2); }), 128)) @@ -4875,60 +4877,60 @@ 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: A, errors: I }) { - return k || (k = "Exception"), I || (I = []), s.value = A ? new qs({ + function r({ message: y, errorCode: k, fieldName: T, errors: j }) { + return k || (k = "Exception"), j || (j = []), s.value = T ? new qs({ errorCode: k, message: y, - errors: [new Gl({ fieldName: A, errorCode: k, message: y })] - }) : new qs({ errorCode: k, message: y, errors: I }); + errors: [new Gl({ fieldName: T, errorCode: k, message: y })] + }) : new qs({ errorCode: k, message: y, errors: j }); } - function u({ fieldName: y, message: k, errorCode: A }) { - if (A || (A = "Exception"), !s.value) - r({ fieldName: y, message: k, errorCode: A }); + function u({ fieldName: y, message: k, errorCode: T }) { + if (T || (T = "Exception"), !s.value) + r({ fieldName: y, message: k, errorCode: T }); else { - let I = new qs(s.value); - I.errors = [ - ...(I.errors || []).filter((se) => { - var j; - return ((j = se.fieldName) == null ? void 0 : j.toLowerCase()) !== (y == null ? void 0 : y.toLowerCase()); + let j = new qs(s.value); + j.errors = [ + ...(j.errors || []).filter((se) => { + var F; + return ((F = se.fieldName) == null ? void 0 : F.toLowerCase()) !== (y == null ? void 0 : y.toLowerCase()); }), - new Gl({ fieldName: y, message: k, errorCode: A }) - ], s.value = I; + new Gl({ fieldName: y, message: k, errorCode: T }) + ], s.value = j; } } - async function d(y, k, A) { + async function d(y, k, T) { t.value = !0; - let I = await a.api(Dt(y), k, A); - return t.value = !1, n.value = I.response, s.value = I.error, I; + let j = await a.api(Dt(y), k, T); + return t.value = !1, n.value = j.response, s.value = j.error, j; } - async function c(y, k, A) { + async function c(y, k, T) { t.value = !0; - let I = await a.apiVoid(Dt(y), k, A); - return t.value = !1, n.value = I.response, s.value = I.error, I; + let j = await a.apiVoid(Dt(y), k, T); + return t.value = !1, n.value = j.response, s.value = j.error, j; } - async function f(y, k, A, I) { + async function f(y, k, T, j) { t.value = !0; - let se = await a.apiForm(Dt(y), k, A, I); + let se = await a.apiForm(Dt(y), k, T, j); return t.value = !1, n.value = se.response, s.value = se.error, se; } - async function m(y, k, A, I) { + async function m(y, k, T, j) { t.value = !0; - let se = await a.apiFormVoid(Dt(y), k, A, I); + let se = await a.apiFormVoid(Dt(y), k, T, j); return t.value = !1, n.value = se.response, s.value = se.error, se; } - async function _(y, k, A, I) { - return gn(a, y, k, A, I); + async function _(y, k, T, j) { + return gn(a, y, k, T, j); } - function b(y, k) { - const A = D(new Xe()), I = yn(async (se) => { - A.value = await a.api(se); + function w(y, k) { + const T = D(new Xe()), j = yn(async (se) => { + T.value = await a.api(se); }, k == null ? void 0 : k.delayMs); return ws(async () => { - const se = y(), j = cl(Ts(se)); - 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; + const se = y(), F = cl(Ts(se)); + F && (T.value = new Xe({ response: F })), (k == null ? void 0 : k.delayMs) === 0 ? T.value = await a.api(se) : j(se); + }), (async () => T.value = await a.api(y(), k == null ? void 0 : k.args, k == null ? void 0 : k.method))(), T; } - let p = { setError: r, addFieldError: u, loading: t, error: s, api: d, apiVoid: c, apiForm: f, apiFormVoid: m, swr: _, swrEffect: b, unRefs: Dt, setRef: mn }; + let p = { setError: r, addFieldError: u, loading: t, error: s, api: d, apiVoid: c, apiForm: f, apiFormVoid: m, swr: _, swrEffect: w, unRefs: Dt, setRef: mn }; return ss("ApiState", p), p; } const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b", null, "type", -1), N0 = { key: 0 }, U0 = { key: 2 }, q0 = ["innerHTML"], Q0 = /* @__PURE__ */ l("input", { @@ -4969,160 +4971,160 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b const n = e, a = s, r = D(), u = D(1), d = D(); function c() { var fe; - u.value++, ee.value = W(); - const V = Be(); - (fe = V == null ? void 0 : V.proxy) == null || fe.$forceUpdate(); + u.value++, Y.value = J(); + const S = Be(); + (fe = S == null ? void 0 : S.proxy) == null || fe.$forceUpdate(); } - async function f(V) { - Object.assign(ee.value, V), c(), await St(() => null); + async function f(S) { + Object.assign(Y.value, S), c(), await St(() => null); } ss("ModalProvider", { openModal: p }); - const _ = D(), b = D(); - function p(V, fe) { - _.value = V, b.value = fe; - } - async function y(V) { - b.value && b.value(V), _.value = void 0, b.value = void 0; - } - 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 ? 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); + const _ = D(), w = D(); + function p(S, fe) { + _.value = S, w.value = fe; + } + async function y(S) { + w.value && w.value(S), _.value = void 0, w.value = void 0; + } + const k = Ps(), { getTypeName: T } = bn(), { typeOf: j, Crud: se, createDto: F } = lt(), I = D(new Xe()), A = 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)), E = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), Q = v(() => typeof n.buttonsClass == "string" ? n.buttonsClass : Ee.buttonsClass), le = v(() => { + var S; + return n.type ? T(n.type) : (S = n.modelValue) != null && S.getTypeName ? n.modelValue.getTypeName() : null; + }), R = v(() => n.metaType ?? j(le.value)), J = () => n.modelValue || te(), Y = D(J()), Z = v(() => k.loading.value), V = v(() => { + var S; + return n.heading != null ? n.heading : ((S = R.value) == null ? void 0 : S.description) || Pe(le.value); }); - t({ forceUpdate: c, props: n, setModel: f, formFields: r, submit: N, close: ne, model: ee }); + t({ forceUpdate: c, props: n, setModel: f, formFields: r, submit: N, close: ne, model: Y }); function te() { - return typeof n.type == "string" ? j(n.type) : n.type ? new n.type() : n.modelValue; + return typeof n.type == "string" ? F(n.type) : n.type ? new n.type() : n.modelValue; } - async function w(V) { - if (!V || V.tagName != "FORM") { - console.error("Not a valid form", V); + async function b(S) { + if (!S || S.tagName != "FORM") { + console.error("Not a valid form", S); return; } const fe = te(); - let pe = Ze(fe == null ? void 0 : fe.getMethod, (S) => typeof S == "function" ? S() : null) || "POST", ue = Ze(fe == null ? void 0 : fe.createResponse, (S) => typeof S == "function" ? S() : null) == null; + let pe = Ze(fe == null ? void 0 : fe.getMethod, (M) => typeof M == "function" ? M() : null) || "POST", ue = Ze(fe == null ? void 0 : fe.createResponse, (M) => typeof M == "function" ? M() : null) == null; const me = n.jsconfig; if (il.hasRequestBody(pe)) { - let S = new fe.constructor(), ce = new FormData(V); - ue ? F.value = await k.apiFormVoid(S, ce, { jsconfig: me }) : F.value = await k.apiForm(S, ce, { jsconfig: me }); + let M = new fe.constructor(), ce = new FormData(S); + ue ? I.value = await k.apiFormVoid(M, ce, { jsconfig: me }) : I.value = await k.apiForm(M, ce, { jsconfig: me }); } else { - let S = new fe.constructor(Bo(ee.value)); - console.debug("AutoForm.submit", S), ue ? F.value = await k.apiVoid(S, { jsconfig: me }) : F.value = await k.api(S, { jsconfig: me }); + let M = new fe.constructor(Bo(Y.value)); + console.debug("AutoForm.submit", M), ue ? I.value = await k.apiVoid(M, { jsconfig: me }) : I.value = await k.api(M, { jsconfig: me }); } - F.value.succeeded ? (a("success", F.value.response), ne()) : a("error", F.value.error); + I.value.succeeded ? (a("success", I.value.response), ne()) : a("error", I.value.error); } async function N() { - w(d.value); + b(d.value); } - function E(V) { - a("update:modelValue", V); + function z(S) { + a("update:modelValue", S); } function g() { a("done"); } - const C = D(!1), Y = D(""), X = { + const C = D(!1), ee = D(""), X = { 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" } }; bt(C, () => { - yt(X, Y, C.value), C.value || setTimeout(g, 700); + yt(X, ee, C.value), C.value || setTimeout(g, 700); }), C.value = !0; function ne() { n.formStyle == "slideOver" ? C.value = !1 : g(); } - const P = (V) => { - V.key === "Escape" && ne(); + const P = (S) => { + S.key === "Escape" && ne(); }; - return Ye(() => window.addEventListener("keydown", P)), Ft(() => window.removeEventListener("keydown", P)), (V, fe) => { - var Se, ge, H, Q, oe, be, $e, Ae, He, Fe, De; - const pe = Z("AutoFormFields"), ue = Z("FormLoading"), me = Z("PrimaryButton"), S = Z("CloseButton"), ce = Z("SecondaryButton"), Ve = Z("ModalLookup"); + return Ye(() => window.addEventListener("keydown", P)), Ft(() => window.removeEventListener("keydown", P)), (S, fe) => { + var Se, ge, H, q, oe, be, $e, Ae, He, Fe, De; + const pe = K("AutoFormFields"), ue = K("FormLoading"), me = K("PrimaryButton"), M = K("CloseButton"), ce = K("SecondaryButton"), Ve = K("ModalLookup"); return o(), i("div", null, [ - R.value ? V.formStyle == "card" ? (o(), i("div", { + R.value ? S.formStyle == "card" ? (o(), i("div", { key: 1, - class: h(M.value) + class: h(A.value) }, [ l("form", { ref_key: "elForm", ref: d, - onSubmit: fe[0] || (fe[0] = Ue((Oe) => w(Oe.target), ["prevent"])), + onSubmit: fe[0] || (fe[0] = Ue((Oe) => b(Oe.target), ["prevent"])), autocomplete: "off", - class: h(V.innerFormClass) + class: h(S.innerFormClass) }, [ l("div", { - class: h(V.bodyClass) + class: h(S.bodyClass) }, [ l("div", { - class: h(V.headerClass) + class: h(S.headerClass) }, [ - V.$slots.heading ? (o(), i("div", N0, [ - U(V.$slots, "heading") + S.$slots.heading ? (o(), i("div", N0, [ + U(S.$slots, "heading") ])) : (o(), i("h3", { key: 1, class: h(L.value) - }, O(T.value), 3)), - V.$slots.subheading ? (o(), i("div", U0, [ - U(V.$slots, "subheading") - ])) : V.subHeading ? (o(), i("p", { + }, O(V.value), 3)), + S.$slots.subheading ? (o(), i("div", U0, [ + U(S.$slots, "subheading") + ])) : S.subHeading ? (o(), i("p", { key: 3, - class: h(z.value) - }, O(V.subHeading), 3)) : (Se = R.value) != null && Se.notes ? (o(), i("p", { + class: h(E.value) + }, O(S.subHeading), 3)) : (Se = R.value) != null && Se.notes ? (o(), i("p", { key: 4, - class: h(["notes", z.value]), + class: h(["notes", E.value]), innerHTML: (ge = R.value) == null ? void 0 : ge.notes }, null, 10, q0)) : x("", !0) ], 2), - U(V.$slots, "header", { + U(S.$slots, "header", { instance: (H = Be()) == null ? void 0 : H.exposed, - model: ee.value + model: Y.value }), Q0, (o(), ae(pe, { ref_key: "formFields", ref: r, key: u.value, - type: V.type, - modelValue: ee.value, - "onUpdate:modelValue": E, - api: F.value, - configureField: V.configureField, - configureFormLayout: V.configureFormLayout + type: S.type, + modelValue: Y.value, + "onUpdate:modelValue": z, + api: I.value, + configureField: S.configureField, + configureFormLayout: S.configureFormLayout }, null, 8, ["type", "modelValue", "api", "configureField", "configureFormLayout"])), - U(V.$slots, "footer", { - instance: (Q = Be()) == null ? void 0 : Q.exposed, - model: ee.value + U(S.$slots, "footer", { + instance: (q = Be()) == null ? void 0 : q.exposed, + model: Y.value }) ], 2), - U(V.$slots, "buttons", {}, () => { + U(S.$slots, "buttons", {}, () => { var Oe, We; return [ l("div", { - class: h(K.value) + class: h(Q.value) }, [ l("div", null, [ - U(V.$slots, "leftbuttons", { + U(S.$slots, "leftbuttons", { instance: (Oe = Be()) == null ? void 0 : Oe.exposed, - model: ee.value + model: Y.value }) ]), l("div", null, [ - V.showLoading && q.value ? (o(), ae(ue, { key: 0 })) : x("", !0) + S.showLoading && Z.value ? (o(), ae(ue, { key: 0 })) : x("", !0) ]), l("div", K0, [ Z0, ye(me, { - disabled: V.allowSubmit ? !V.allowSubmit(ee.value) : !1 + disabled: S.allowSubmit ? !S.allowSubmit(Y.value) : !1 }, { default: xe(() => [ - ke(O(V.submitLabel), 1) + ke(O(S.submitLabel), 1) ]), _: 1 }, 8, ["disabled"]), - U(V.$slots, "rightbuttons", { + U(S.$slots, "rightbuttons", { instance: (We = Be()) == null ? void 0 : We.exposed, - model: ee.value + model: Y.value }) ]) ], 2) @@ -5142,81 +5144,81 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: "pointer-events-none fixed inset-y-0 right-0 flex pl-10" }, [ l("div", { - class: h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg", Y.value]) + class: h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg", ee.value]) }, [ l("form", { ref_key: "elForm", ref: d, class: h(ie.value), - onSubmit: fe[1] || (fe[1] = Ue((Oe) => w(Oe.target), ["prevent"])) + onSubmit: fe[1] || (fe[1] = Ue((Oe) => b(Oe.target), ["prevent"])) }, [ l("div", X0, [ l("div", Y0, [ l("div", ef, [ l("div", tf, [ l("div", sf, [ - V.$slots.heading ? (o(), i("div", lf, [ - U(V.$slots, "heading") + S.$slots.heading ? (o(), i("div", lf, [ + U(S.$slots, "heading") ])) : (o(), i("h3", { key: 1, class: h(L.value) - }, O(T.value), 3)), - V.$slots.subheading ? (o(), i("div", nf, [ - U(V.$slots, "subheading") - ])) : V.subHeading ? (o(), i("p", { + }, O(V.value), 3)), + S.$slots.subheading ? (o(), i("div", nf, [ + U(S.$slots, "subheading") + ])) : S.subHeading ? (o(), i("p", { key: 3, - class: h(z.value) - }, O(V.subHeading), 3)) : (oe = R.value) != null && oe.notes ? (o(), i("p", { + class: h(E.value) + }, O(S.subHeading), 3)) : (oe = R.value) != null && oe.notes ? (o(), i("p", { key: 4, - class: h(["notes", z.value]), + class: h(["notes", E.value]), innerHTML: (be = R.value) == null ? void 0 : be.notes }, null, 10, of)) : x("", !0) ]), l("div", af, [ - ye(S, { + ye(M, { "button-class": "bg-gray-50 dark:bg-gray-900", onClose: ne }) ]) ]) ]), - U(V.$slots, "header", { + U(S.$slots, "header", { instance: ($e = Be()) == null ? void 0 : $e.exposed, - model: ee.value + model: Y.value }), (o(), ae(pe, { ref_key: "formFields", ref: r, key: u.value, - type: V.type, - modelValue: ee.value, - "onUpdate:modelValue": E, - api: F.value, - configureField: V.configureField, - configureFormLayout: V.configureFormLayout + type: S.type, + modelValue: Y.value, + "onUpdate:modelValue": z, + api: I.value, + configureField: S.configureField, + configureFormLayout: S.configureFormLayout }, null, 8, ["type", "modelValue", "api", "configureField", "configureFormLayout"])), - U(V.$slots, "footer", { + U(S.$slots, "footer", { instance: (Ae = Be()) == null ? void 0 : Ae.exposed, - model: ee.value + model: Y.value }) ]) ]), l("div", { - class: h(K.value) + class: h(Q.value) }, [ l("div", null, [ - U(V.$slots, "leftbuttons", { + U(S.$slots, "leftbuttons", { instance: (He = Be()) == null ? void 0 : He.exposed, - model: ee.value + model: Y.value }) ]), l("div", null, [ - V.showLoading && q.value ? (o(), ae(ue, { key: 0 })) : x("", !0) + S.showLoading && Z.value ? (o(), ae(ue, { key: 0 })) : x("", !0) ]), l("div", rf, [ ye(ce, { onClick: ne, - disabled: q.value + disabled: Z.value }, { default: xe(() => [ ke("Cancel") @@ -5225,16 +5227,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, 8, ["disabled"]), ye(me, { class: "ml-4", - disabled: V.allowSubmit ? !V.allowSubmit(ee.value) : !1 + disabled: S.allowSubmit ? !S.allowSubmit(Y.value) : !1 }, { default: xe(() => [ - ke(O(V.submitLabel), 1) + ke(O(S.submitLabel), 1) ]), _: 1 }, 8, ["disabled"]), - U(V.$slots, "rightbuttons", { + U(S.$slots, "rightbuttons", { instance: (Fe = Be()) == null ? void 0 : Fe.exposed, - model: ee.value + model: Y.value }) ]) ], 2) @@ -5286,8 +5288,8 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b setup(e, { expose: t, emit: s }) { const n = e, a = s, r = D(), u = D(1); function d() { - var V, fe; - u.value++, (V = r.value) == null || V.forceUpdate(); + var S, fe; + u.value++, (S = r.value) == null || S.forceUpdate(); const P = Be(); (fe = P == null ? void 0 : P.proxy) == null || fe.$forceUpdate(); } @@ -5299,67 +5301,67 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ss("ModalProvider", { openModal: p }); - const _ = D(), b = D(); - function p(P, V) { - _.value = P, b.value = V; + const _ = D(), w = D(); + function p(P, S) { + _.value = P, w.value = S; } async function y(P) { - b.value && b.value(P), _.value = void 0, b.value = void 0; + w.value && w.value(P), _.value = void 0, w.value = void 0; } - 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)()); + const { typeOf: k, typeProperties: T, Crud: j, createDto: se, formValues: F } = lt(), I = v(() => Qt(n.type)), A = v(() => k(I.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(() => { + const E = v(() => n.panelClass || Ee.panelClass(n.formStyle)), Q = v(() => n.formClass || Ee.formClass(n.formStyle)), le = v(() => n.headingClass || Ee.headingClass(n.formStyle)), R = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), J = v(() => n.buttonsClass || Ee.buttonsClass), Y = v(() => j.model(A.value)), Z = v(() => { var P; - return n.heading || ((P = k(F.value)) == null ? void 0 : P.description) || (ee.value ? `New ${Pe(ee.value)}` : Pe(F.value)); - }), T = D(new Xe()); - let te = Ps(), w = v(() => te.loading.value); - J.interceptors.has("AutoCreateForm.new") && J.interceptors.invoke("AutoCreateForm.new", { props: n, model: L }); + return n.heading || ((P = k(I.value)) == null ? void 0 : P.description) || (Y.value ? `New ${Pe(Y.value)}` : Pe(I.value)); + }), V = D(new Xe()); + let te = Ps(), b = v(() => te.loading.value); + G.interceptors.has("AutoCreateForm.new") && G.interceptors.invoke("AutoCreateForm.new", { props: n, model: L }); async function N(P) { var ue, me; - let V = P.target; + let S = P.target; if (!n.autosave) { - a("save", new L.value.constructor(j(V, A(M.value)))); + a("save", new L.value.constructor(F(S, T(A.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; + let fe = Ze((ue = L.value) == null ? void 0 : ue.getMethod, (M) => typeof M == "function" ? M() : null) || "POST", pe = Ze((me = L.value) == null ? void 0 : me.createResponse, (M) => typeof M == "function" ? M() : null) == null; if (il.hasRequestBody(fe)) { - let S = new L.value.constructor(), ce = new FormData(V); - pe ? T.value = await te.apiFormVoid(S, ce, { jsconfig: "eccn" }) : T.value = await te.apiForm(S, ce, { jsconfig: "eccn" }); + let M = new L.value.constructor(), ce = new FormData(S); + pe ? V.value = await te.apiFormVoid(M, ce, { jsconfig: "eccn" }) : V.value = await te.apiForm(M, ce, { jsconfig: "eccn" }); } else { - 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" }); + let M = F(S, T(A.value)), ce = new L.value.constructor(M); + pe ? V.value = await te.apiVoid(ce, { jsconfig: "eccn" }) : V.value = await te.api(ce, { jsconfig: "eccn" }); } - T.value.succeeded ? (V.reset(), a("save", T.value.response)) : a("error", T.value.error); + V.value.succeeded ? (S.reset(), a("save", V.value.response)) : a("error", V.value.error); } - function E() { + function z() { a("done"); } - const g = D(!1), C = D(""), Y = { + const g = D(!1), C = 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" } }; bt(g, () => { - yt(Y, C, g.value), g.value || setTimeout(E, 700); + yt(ee, C, g.value), g.value || setTimeout(z, 700); }), g.value = !0; function X() { - n.formStyle == "slideOver" ? g.value = !1 : E(); + n.formStyle == "slideOver" ? g.value = !1 : z(); } const ne = (P) => { P.key === "Escape" && X(); }; - return Ye(() => window.addEventListener("keydown", ne)), Ft(() => window.removeEventListener("keydown", ne)), (P, V) => { - var Ve, Se, ge, H, Q, oe, be, $e, Ae; - const fe = Z("AutoFormFields"), pe = Z("FormLoading"), ue = Z("SecondaryButton"), me = Z("PrimaryButton"), S = Z("CloseButton"), ce = Z("ModalLookup"); + return Ye(() => window.addEventListener("keydown", ne)), Ft(() => window.removeEventListener("keydown", ne)), (P, S) => { + var Ve, Se, ge, H, q, oe, be, $e, Ae; + const fe = K("AutoFormFields"), pe = K("FormLoading"), ue = K("SecondaryButton"), me = K("PrimaryButton"), M = K("CloseButton"), ce = K("ModalLookup"); return o(), i("div", null, [ - M.value ? P.formStyle == "card" ? (o(), i("div", { + A.value ? P.formStyle == "card" ? (o(), i("div", { key: 1, - class: h(z.value) + class: h(E.value) }, [ l("form", { onSubmit: Ue(N, ["prevent"]) }, [ l("div", { - class: h(K.value) + class: h(Q.value) }, [ l("div", null, [ P.$slots.heading ? (o(), i("div", vf, [ @@ -5367,16 +5369,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ])) : (o(), i("h3", { key: 1, class: h(le.value) - }, O(q.value), 3)), + }, O(Z.value), 3)), P.$slots.subheading ? (o(), i("div", pf, [ U(P.$slots, "subheading") ])) : P.subHeading ? (o(), i("p", { key: 3, class: h(R.value) - }, O(P.subHeading), 3)) : (Ve = M.value) != null && Ve.notes ? (o(), i("p", { + }, O(P.subHeading), 3)) : (Ve = A.value) != null && Ve.notes ? (o(), i("p", { key: 4, class: h(["notes", R.value]), - innerHTML: (Se = M.value) == null ? void 0 : Se.notes + innerHTML: (Se = A.value) == null ? void 0 : Se.notes }, null, 10, mf)) : x("", !0) ]), U(P.$slots, "header", { @@ -5389,7 +5391,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b key: u.value, modelValue: L.value, "onUpdate:modelValue": f, - api: T.value, + api: V.value, configureField: P.configureField, configureFormLayout: P.configureFormLayout }, null, 8, ["modelValue", "api", "configureField", "configureFormLayout"])), @@ -5399,16 +5401,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }) ], 2), l("div", { - class: h(W.value) + class: h(J.value) }, [ l("div", null, [ - P.showLoading && G(w) ? (o(), ae(pe, { key: 0 })) : x("", !0) + P.showLoading && W(b) ? (o(), ae(pe, { key: 0 })) : x("", !0) ]), l("div", hf, [ P.showCancel ? (o(), ae(ue, { key: 0, onClick: X, - disabled: G(w) + disabled: W(b) }, { default: xe(() => [ ke("Cancel") @@ -5418,7 +5420,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ye(me, { type: "submit", class: "ml-4", - disabled: G(w) + disabled: W(b) }, { default: xe(() => [ ke("Save") @@ -5436,7 +5438,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: "absolute inset-0 overflow-hidden" }, [ l("div", { - onMousedown: V[0] || (V[0] = Ue(() => { + onMousedown: S[0] || (S[0] = Ue(() => { }, ["stop"])), class: "pointer-events-none fixed inset-y-0 right-0 flex pl-10" }, [ @@ -5444,7 +5446,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg", C.value]) }, [ l("form", { - class: h(K.value), + class: h(Q.value), onSubmit: Ue(N, ["prevent"]) }, [ l("div", wf, [ @@ -5457,20 +5459,20 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ])) : (o(), i("h3", { key: 1, class: h(le.value) - }, O(q.value), 3)), + }, O(Z.value), 3)), P.$slots.subheading ? (o(), i("div", Lf, [ U(P.$slots, "subheading") ])) : P.subHeading ? (o(), i("p", { key: 3, class: h(R.value) - }, O(P.subHeading), 3)) : (Q = M.value) != null && Q.notes ? (o(), i("p", { + }, O(P.subHeading), 3)) : (q = A.value) != null && q.notes ? (o(), i("p", { key: 4, class: h(["notes", R.value]), - innerHTML: (oe = M.value) == null ? void 0 : oe.notes + innerHTML: (oe = A.value) == null ? void 0 : oe.notes }, null, 10, Vf)) : x("", !0) ]), l("div", Sf, [ - ye(S, { + ye(M, { "button-class": "bg-gray-50 dark:bg-gray-900", onClose: X }) @@ -5487,7 +5489,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b key: u.value, modelValue: L.value, "onUpdate:modelValue": f, - api: T.value, + api: V.value, configureField: P.configureField, configureFormLayout: P.configureFormLayout }, null, 8, ["modelValue", "api", "configureField", "configureFormLayout"])), @@ -5498,16 +5500,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ]) ]), l("div", { - class: h(W.value) + class: h(J.value) }, [ l("div", null, [ - P.showLoading && G(w) ? (o(), ae(pe, { key: 0 })) : x("", !0) + P.showLoading && W(b) ? (o(), ae(pe, { key: 0 })) : x("", !0) ]), l("div", Mf, [ P.showCancel ? (o(), ae(ue, { key: 0, onClick: X, - disabled: G(w) + disabled: W(b) }, { default: xe(() => [ ke("Cancel") @@ -5517,7 +5519,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ye(me, { type: "submit", class: "ml-4", - disabled: G(w) + disabled: W(b) }, { default: xe(() => [ ke("Save") @@ -5535,7 +5537,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("p", cf, [ ke("Could not create form for unknown "), ff, - ke(" " + O(F.value), 1) + ke(" " + O(I.value), 1) ]) ])), ((Ae = _.value) == null ? void 0 : Ae.name) == "ModalLookup" && _.value.ref ? (o(), ae(ce, { @@ -5575,108 +5577,108 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b const n = e, a = s, r = D(), u = D(1); function d() { var ce; - u.value++, le.value = K(); - const S = Be(); - (ce = S == null ? void 0 : S.proxy) == null || ce.$forceUpdate(); + u.value++, le.value = Q(); + const M = Be(); + (ce = M == null ? void 0 : M.proxy) == null || ce.$forceUpdate(); } - function c(S) { - Object.assign(le.value, S); + function c(M) { + Object.assign(le.value, M); } - function f(S) { + function f(M) { } ss("ModalProvider", { openModal: p }); - const _ = D(), b = D(); - function p(S, ce) { - _.value = S, b.value = ce; + const _ = D(), w = D(); + function p(M, ce) { + _.value = M, w.value = ce; } - async function y(S) { - b.value && b.value(S), _.value = void 0, b.value = void 0; + async function y(M) { + w.value && w.value(M), _.value = void 0, w.value = void 0; } - 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()); + const { typeOf: k, apiOf: T, typeProperties: j, createFormLayout: se, getPrimaryKey: F, Crud: I, createDto: A, formValues: ie } = lt(), L = v(() => Qt(n.type)), E = v(() => k(L.value)), Q = () => typeof n.type == "string" ? A(n.type, ys(n.modelValue)) : n.type ? new n.type(ys(n.modelValue)) : null, le = D(Q()); 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)), T = v(() => F.model(z.value)), te = v(() => { - var S; - return n.heading || ((S = k(L.value)) == null ? void 0 : S.description) || (T.value ? `Update ${Pe(T.value)}` : Pe(L.value)); - }), w = D(new Xe()); + const R = v(() => n.panelClass || Ee.panelClass(n.formStyle)), J = v(() => n.formClass || Ee.formClass(n.formStyle)), Y = v(() => n.headingClass || Ee.headingClass(n.formStyle)), Z = v(() => n.subHeadingClass || Ee.subHeadingClass(n.formStyle)), V = v(() => I.model(E.value)), te = v(() => { + var M; + return n.heading || ((M = k(L.value)) == null ? void 0 : M.description) || (V.value ? `Update ${Pe(V.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 }); - let E = Ps(), g = v(() => E.loading.value); - const C = () => Ze(k(F.model(z.value)), (S) => j(S)); - function Y(S) { - const { op: ce, prop: Ve } = S; - ce && (F.isPatch(ce) || F.isUpdate(ce)) && (S.disabled = Ve == null ? void 0 : Ve.isPrimaryKey), n.configureField && n.configureField(S); - } - async function X(S) { - var H, Q; - let ce = S.target; + G.interceptors.has("AutoEditForm.new") && G.interceptors.invoke("AutoEditForm.new", { props: n, model: le, origModel: N }); + let z = Ps(), g = v(() => z.loading.value); + const C = () => Ze(k(I.model(E.value)), (M) => F(M)); + function ee(M) { + const { op: ce, prop: Ve } = M; + ce && (I.isPatch(ce) || I.isUpdate(ce)) && (M.disabled = Ve == null ? void 0 : Ve.isPrimaryKey), n.configureField && n.configureField(M); + } + async function X(M) { + var H, q; + let ce = M.target; if (!n.autosave) { - a("save", new le.value.constructor(ie(ce, I(z.value)))); + a("save", new le.value.constructor(ie(ce, j(E.value)))); return; } - let Ve = Ze((H = le.value) == null ? void 0 : H.getMethod, (oe) => typeof oe == "function" ? oe() : null) || "POST", Se = Ze((Q = le.value) == null ? void 0 : Q.createResponse, (oe) => typeof oe == "function" ? oe() : null) == null, ge = C(); + let Ve = Ze((H = le.value) == null ? void 0 : H.getMethod, (oe) => typeof oe == "function" ? oe() : null) || "POST", Se = Ze((q = le.value) == null ? void 0 : q.createResponse, (oe) => typeof oe == "function" ? oe() : null) == null, ge = C(); if (il.hasRequestBody(Ve)) { 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 && A(L.value); - if (He && F.isPatch(He)) { - let De = se(z.value), Oe = {}; + const He = L.value && T(L.value); + if (He && I.isPatch(He)) { + let De = se(E.value), Oe = {}; if (ge && (Oe[ge.name] = be), De.forEach((Re) => { let it = Re.id, jt = _e(N, it); if (ge && ge.name.toLowerCase() === it.toLowerCase()) return; let ht = $e.get(it); - J.interceptors.has("AutoEditForm.save.formLayout") && J.interceptors.invoke("AutoEditForm.save.formLayout", { origValue: jt, formLayout: De, input: Re, newValue: ht }); + G.interceptors.has("AutoEditForm.save.formLayout") && G.interceptors.invoke("AutoEditForm.save.formLayout", { origValue: jt, formLayout: De, input: Re, newValue: ht }); let as = ht != null, rs = Re.type === "checkbox" ? as !== !!jt : Re.type === "file" ? as : ht != jt; !ht && !jt && (rs = !1), rs && (ht ? Oe[it] = ht : Re.type !== "file" && Ae.push(it)); - }), J.interceptors.has("AutoEditForm.save") && J.interceptors.invoke("AutoEditForm.save", { origModel: N, formLayout: De, dirtyValues: Oe }), Array.from($e.keys()).filter((Re) => !Oe[Re]).forEach((Re) => $e.delete(Re)), Array.from($e.keys()).filter((Re) => Re.toLowerCase() != ge.name.toLowerCase()).length == 0 && Ae.length == 0) { + }), G.interceptors.has("AutoEditForm.save") && G.interceptors.invoke("AutoEditForm.save", { origModel: N, formLayout: De, dirtyValues: Oe }), Array.from($e.keys()).filter((Re) => !Oe[Re]).forEach((Re) => $e.delete(Re)), Array.from($e.keys()).filter((Re) => Re.toLowerCase() != ge.name.toLowerCase()).length == 0 && Ae.length == 0) { ue(); return; } } const Fe = Ae.length > 0 ? { jsconfig: "eccn", reset: Ae } : { jsconfig: "eccn" }; - Se ? w.value = await E.apiFormVoid(oe, $e, Fe) : w.value = await E.apiForm(oe, $e, Fe); + Se ? b.value = await z.apiFormVoid(oe, $e, Fe) : b.value = await z.apiForm(oe, $e, Fe); } else { - let oe = ie(ce, I(z.value)); + let oe = ie(ce, j(E.value)); ge && !_e(oe, ge.name) && (oe[ge.name] = _e(n.modelValue, ge.name)); let be = new le.value.constructor(oe); - Se ? w.value = await E.apiVoid(be, { jsconfig: "eccn" }) : w.value = await E.api(be, { jsconfig: "eccn" }); + Se ? b.value = await z.apiVoid(be, { jsconfig: "eccn" }) : b.value = await z.api(be, { jsconfig: "eccn" }); } - w.value.succeeded ? (ce.reset(), a("save", w.value.response)) : a("error", w.value.error); + b.value.succeeded ? (ce.reset(), a("save", b.value.response)) : a("error", b.value.error); } - async function ne(S) { + async function ne(M) { 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} (${T.value})`); + console.error(`Could not find Primary Key for Type ${L.value} (${V.value})`); return; } - const Se = { [ce.name]: Ve }, ge = typeof n.deleteType == "string" ? M(n.deleteType, Se) : n.deleteType ? new n.deleteType(Se) : null; - Ze(ge.createResponse, (Q) => typeof Q == "function" ? Q() : null) == null ? w.value = await E.apiVoid(ge) : w.value = await E.api(ge), w.value.succeeded ? a("delete", w.value.response) : a("error", w.value.error); + const Se = { [ce.name]: Ve }, ge = typeof n.deleteType == "string" ? A(n.deleteType, Se) : n.deleteType ? new n.deleteType(Se) : null; + Ze(ge.createResponse, (q) => typeof q == "function" ? q() : null) == null ? b.value = await z.apiVoid(ge) : b.value = await z.api(ge), b.value.succeeded ? a("delete", b.value.response) : a("error", b.value.error); } function P() { a("done"); } - const V = D(!1), fe = D(""), pe = { + const S = D(!1), fe = D(""), pe = { 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" } }; - bt(V, () => { - yt(pe, fe, V.value), V.value || setTimeout(P, 700); - }), V.value = !0; + bt(S, () => { + yt(pe, fe, S.value), S.value || setTimeout(P, 700); + }), S.value = !0; function ue() { - n.formStyle == "slideOver" ? V.value = !1 : P(); + n.formStyle == "slideOver" ? S.value = !1 : P(); } - const me = (S) => { - S.key === "Escape" && ue(); + const me = (M) => { + M.key === "Escape" && ue(); }; - return Ye(() => window.addEventListener("keydown", me)), Ft(() => window.removeEventListener("keydown", me)), (S, ce) => { + return Ye(() => window.addEventListener("keydown", me)), Ft(() => window.removeEventListener("keydown", me)), (M, ce) => { var $e, Ae, He, Fe, De, Oe, We, Re, it; - const Ve = Z("AutoFormFields"), Se = Z("ConfirmDelete"), ge = Z("FormLoading"), H = Z("SecondaryButton"), Q = Z("PrimaryButton"), oe = Z("CloseButton"), be = Z("ModalLookup"); + const Ve = K("AutoFormFields"), Se = K("ConfirmDelete"), ge = K("FormLoading"), H = K("SecondaryButton"), q = K("PrimaryButton"), oe = K("CloseButton"), be = K("ModalLookup"); return o(), i("div", null, [ - z.value ? S.formStyle == "card" ? (o(), i("div", { + E.value ? M.formStyle == "card" ? (o(), i("div", { key: 1, class: h(R.value) }, [ @@ -5684,27 +5686,27 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b onSubmit: Ue(X, ["prevent"]) }, [ l("div", { - class: h(W.value) + class: h(J.value) }, [ l("div", null, [ - S.$slots.heading ? (o(), i("div", jf, [ - U(S.$slots, "heading") + M.$slots.heading ? (o(), i("div", jf, [ + U(M.$slots, "heading") ])) : (o(), i("h3", { key: 1, - class: h(ee.value) + class: h(Y.value) }, O(te.value), 3)), - S.$slots.subheading ? (o(), i("div", Of, [ - U(S.$slots, "subheading") - ])) : S.subHeading ? (o(), i("p", { + M.$slots.subheading ? (o(), i("div", Of, [ + U(M.$slots, "subheading") + ])) : M.subHeading ? (o(), i("p", { key: 3, - class: h(q.value) - }, O(S.subHeading), 3)) : ($e = z.value) != null && $e.notes ? (o(), i("p", { + class: h(Z.value) + }, O(M.subHeading), 3)) : ($e = E.value) != null && $e.notes ? (o(), i("p", { key: 4, - class: h(["notes", q.value]), - innerHTML: (Ae = z.value) == null ? void 0 : Ae.notes + class: h(["notes", Z.value]), + innerHTML: (Ae = E.value) == null ? void 0 : Ae.notes }, null, 10, Df)) : x("", !0) ]), - U(S.$slots, "header", { + U(M.$slots, "header", { formInstance: (He = Be()) == null ? void 0 : He.exposed, model: le.value }), @@ -5714,41 +5716,41 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b key: u.value, modelValue: le.value, "onUpdate:modelValue": f, - api: w.value, - configureField: S.configureField, - configureFormLayout: S.configureFormLayout + api: b.value, + configureField: M.configureField, + configureFormLayout: M.configureFormLayout }, null, 8, ["modelValue", "api", "configureField", "configureFormLayout"])), - U(S.$slots, "footer", { + U(M.$slots, "footer", { formInstance: (Fe = Be()) == null ? void 0 : Fe.exposed, model: le.value }) ], 2), l("div", { - class: h(G(Ee).buttonsClass) + class: h(W(Ee).buttonsClass) }, [ l("div", null, [ - S.deleteType ? (o(), ae(Se, { + M.deleteType ? (o(), ae(Se, { key: 0, onDelete: ne })) : x("", !0) ]), l("div", null, [ - S.showLoading && G(g) ? (o(), ae(ge, { key: 0 })) : x("", !0) + M.showLoading && W(g) ? (o(), ae(ge, { key: 0 })) : x("", !0) ]), l("div", Pf, [ ye(H, { onClick: ue, - disabled: G(g) + disabled: W(g) }, { default: xe(() => [ ke("Cancel") ]), _: 1 }, 8, ["disabled"]), - ye(Q, { + ye(q, { type: "submit", class: "ml-4", - disabled: G(g) + disabled: W(g) }, { default: xe(() => [ ke("Save") @@ -5774,7 +5776,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg", fe.value]) }, [ l("form", { - class: h(W.value), + class: h(J.value), onSubmit: Ue(X, ["prevent"]) }, [ l("div", Ef, [ @@ -5782,21 +5784,21 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("div", Nf, [ l("div", Uf, [ l("div", qf, [ - S.$slots.heading ? (o(), i("div", Qf, [ - U(S.$slots, "heading") + M.$slots.heading ? (o(), i("div", Qf, [ + U(M.$slots, "heading") ])) : (o(), i("h3", { key: 1, - class: h(ee.value) + class: h(Y.value) }, O(te.value), 3)), - S.$slots.subheading ? (o(), i("div", Kf, [ - U(S.$slots, "subheading") - ])) : S.subHeading ? (o(), i("p", { + M.$slots.subheading ? (o(), i("div", Kf, [ + U(M.$slots, "subheading") + ])) : M.subHeading ? (o(), i("p", { key: 3, - class: h(q.value) - }, O(S.subHeading), 3)) : (De = z.value) != null && De.notes ? (o(), i("p", { + class: h(Z.value) + }, O(M.subHeading), 3)) : (De = E.value) != null && De.notes ? (o(), i("p", { key: 4, - class: h(["notes", q.value]), - innerHTML: (Oe = z.value) == null ? void 0 : Oe.notes + class: h(["notes", Z.value]), + innerHTML: (Oe = E.value) == null ? void 0 : Oe.notes }, null, 10, Zf)) : x("", !0) ]), l("div", Wf, [ @@ -5807,7 +5809,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ]) ]) ]), - U(S.$slots, "header", { + U(M.$slots, "header", { formInstance: (We = Be()) == null ? void 0 : We.exposed, model: le.value }), @@ -5817,42 +5819,42 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b key: u.value, modelValue: le.value, "onUpdate:modelValue": f, - api: w.value, - configureField: Y, - configureFormLayout: S.configureFormLayout + api: b.value, + configureField: ee, + configureFormLayout: M.configureFormLayout }, null, 8, ["modelValue", "api", "configureFormLayout"])), - U(S.$slots, "footer", { + U(M.$slots, "footer", { formInstance: (Re = Be()) == null ? void 0 : Re.exposed, model: le.value }) ]) ]), l("div", { - class: h(G(Ee).buttonsClass) + class: h(W(Ee).buttonsClass) }, [ l("div", null, [ - S.deleteType ? (o(), ae(Se, { + M.deleteType ? (o(), ae(Se, { key: 0, onDelete: ne })) : x("", !0) ]), l("div", null, [ - S.showLoading && G(g) ? (o(), ae(ge, { key: 0 })) : x("", !0) + M.showLoading && W(g) ? (o(), ae(ge, { key: 0 })) : x("", !0) ]), l("div", Gf, [ ye(H, { onClick: ue, - disabled: G(g) + disabled: W(g) }, { default: xe(() => [ ke("Cancel") ]), _: 1 }, 8, ["disabled"]), - ye(Q, { + ye(q, { type: "submit", class: "ml-4", - disabled: G(g) + disabled: W(g) }, { default: xe(() => [ ke("Save") @@ -5905,31 +5907,31 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b emits: ["done"], setup(e, { emit: t }) { const s = e, { typeOf: n } = lt(), a = v(() => s.typeName ?? s.apis.dataModel.name), r = v(() => n(a.value)), u = v(() => s.panelClass || Ee.panelClass(s.formStyle)), d = v(() => s.formClass || Ee.formClass(s.formStyle)), c = v(() => s.headingClass || Ee.headingClass(s.formStyle)), f = v(() => s.subHeadingClass || Ee.subHeadingClass(s.formStyle)), m = v(() => { - var I, se; - return s.heading || ((I = n(a.value)) == null ? void 0 : I.description) || ((se = s.model) != null && se.id ? `${Pe(a.value)} ${s.model.id}` : "View " + Pe(a.value)); + var j, se; + return s.heading || ((j = n(a.value)) == null ? void 0 : j.description) || ((se = s.model) != null && se.id ? `${Pe(a.value)} ${s.model.id}` : "View " + Pe(a.value)); }); - J.interceptors.has("AutoViewForm.new") && J.interceptors.invoke("AutoViewForm.new", { props: s }); + G.interceptors.has("AutoViewForm.new") && G.interceptors.invoke("AutoViewForm.new", { props: s }); function _() { s.done && s.done(); } - const b = D(!1), p = D(""), y = { + const w = D(!1), p = D(""), y = { entering: { cls: "transform transition ease-in-out duration-500 sm:duration-700", from: "translate-x-full", to: "translate-x-0" }, leaving: { cls: "transform transition ease-in-out duration-500 sm:duration-700", from: "translate-x-0", to: "translate-x-full" } }; - bt(b, () => { - yt(y, p, b.value), b.value || setTimeout(_, 700); - }), b.value = !0; + bt(w, () => { + yt(y, p, w.value), w.value || setTimeout(_, 700); + }), w.value = !0; function k() { - s.formStyle == "slideOver" ? b.value = !1 : _(); + s.formStyle == "slideOver" ? w.value = !1 : _(); } - const A = (I) => { - I.key === "Escape" && k(); + const T = (j) => { + j.key === "Escape" && k(); }; - 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 Ye(() => window.addEventListener("keydown", T)), Ft(() => window.removeEventListener("keydown", T)), (j, se) => { + var A, ie, L, E; + const F = K("MarkupModel"), I = K("CloseButton"); return o(), i("div", null, [ - a.value ? I.formStyle == "card" ? (o(), i("div", { + a.value ? j.formStyle == "card" ? (o(), i("div", { key: 1, class: h(u.value) }, [ @@ -5937,24 +5939,24 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(d.value) }, [ l("div", null, [ - I.$slots.heading ? (o(), i("div", tv, [ - U(I.$slots, "heading") + j.$slots.heading ? (o(), i("div", tv, [ + U(j.$slots, "heading") ])) : (o(), i("h3", { key: 1, class: h(c.value) }, O(m.value), 3)), - I.$slots.subheading ? (o(), i("div", sv, [ - U(I.$slots, "subheading") - ])) : I.subHeading ? (o(), i("p", { + j.$slots.subheading ? (o(), i("div", sv, [ + U(j.$slots, "subheading") + ])) : j.subHeading ? (o(), i("p", { key: 3, class: h(f.value) - }, O(I.subHeading), 3)) : (M = r.value) != null && M.notes ? (o(), i("p", { + }, O(j.subHeading), 3)) : (A = r.value) != null && A.notes ? (o(), i("p", { key: 4, class: h(["notes", f.value]), innerHTML: (ie = r.value) == null ? void 0 : ie.notes }, null, 10, lv)) : x("", !0) ]), - ye(j, { value: I.model }, null, 8, ["value"]) + ye(F, { value: j.model }, null, 8, ["value"]) ], 2) ], 2)) : (o(), i("div", nv, [ ov, @@ -5979,32 +5981,32 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("div", uv, [ l("div", dv, [ l("div", cv, [ - I.$slots.heading ? (o(), i("div", fv, [ - U(I.$slots, "heading") + j.$slots.heading ? (o(), i("div", fv, [ + U(j.$slots, "heading") ])) : (o(), i("h3", { key: 1, class: h(c.value) }, O(m.value), 3)), - I.$slots.subheading ? (o(), i("div", vv, [ - U(I.$slots, "subheading") - ])) : I.subHeading ? (o(), i("p", { + j.$slots.subheading ? (o(), i("div", vv, [ + U(j.$slots, "subheading") + ])) : j.subHeading ? (o(), i("p", { key: 3, class: h(f.value) - }, O(I.subHeading), 3)) : (L = r.value) != null && L.notes ? (o(), i("p", { + }, O(j.subHeading), 3)) : (L = r.value) != null && L.notes ? (o(), i("p", { key: 4, class: h(["notes", f.value]), - innerHTML: (z = r.value) == null ? void 0 : z.notes + innerHTML: (E = r.value) == null ? void 0 : E.notes }, null, 10, pv)) : x("", !0) ]), l("div", mv, [ - ye(F, { + ye(I, { "button-class": "bg-gray-50 dark:bg-gray-900", onClose: k }) ]) ]) ]), - ye(j, { value: I.model }, null, 8, ["value"]) + ye(F, { value: j.model }, null, 8, ["value"]) ]) ]) ], 2) @@ -6043,7 +6045,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b 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": d[0] || (d[0] = (c) => nn(s) ? s.value = c : s = c) }, null, 512), [ - [al, G(s)] + [al, W(s)] ]), gv, l("span", Te({ @@ -6110,20 +6112,20 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__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((g) => g.toLowerCase() == E.toLowerCase() + "-header"), f = (E) => Object.keys(d).find((g) => g.toLowerCase() == E.toLowerCase()), m = v(() => Gs(s.items).filter((E) => !!(d[E] || d[E + "-header"]))), { typeOf: _, typeProperties: b } = lt(), p = v(() => qt(s.type)), y = v(() => _(p.value)), k = v(() => b(y.value)); - function A(E) { - const g = s.headerTitles && _e(s.headerTitles, E) || E; + const s = e, n = t, a = D(), r = D(null), u = (z) => r.value === z, d = Ls(), c = (z) => Object.keys(d).find((g) => g.toLowerCase() == z.toLowerCase() + "-header"), f = (z) => Object.keys(d).find((g) => g.toLowerCase() == z.toLowerCase()), m = v(() => Gs(s.items).filter((z) => !!(d[z] || d[z + "-header"]))), { typeOf: _, typeProperties: w } = lt(), p = v(() => Qt(s.type)), y = v(() => _(p.value)), k = v(() => w(y.value)); + function T(z) { + const g = s.headerTitles && _e(s.headerTitles, z) || z; return s.headerTitle ? s.headerTitle(g) : cn(g); } - function I(E) { - const g = E.toLowerCase(); + function j(z) { + const g = z.toLowerCase(); return k.value.find((C) => C.name.toLowerCase() == g); } - function se(E) { - const g = I(E); + function se(z) { + const g = j(z); return g != null && g.format ? g.format : (g == null ? void 0 : g.type) == "TimeSpan" || (g == null ? void 0 : g.type) == "TimeOnly" ? { method: "time" } : null; } - const j = { + const F = { xs: "xs:table-cell", sm: "sm:table-cell", md: "md:table-cell", @@ -6132,37 +6134,37 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b "2xl": "2xl:table-cell", never: "" }; - function F(E) { - const g = s.visibleFrom && _e(s.visibleFrom, E); - return g && Ze(j[g], (C) => `hidden ${C}`); + function I(z) { + const g = s.visibleFrom && _e(s.visibleFrom, z); + return g && Ze(F[g], (C) => `hidden ${C}`); } - const M = v(() => s.gridClass ?? he.getGridClass(s.tableStyle)), ie = v(() => s.grid2Class ?? he.getGrid2Class(s.tableStyle)), L = v(() => s.grid3Class ?? he.getGrid3Class(s.tableStyle)), z = v(() => s.grid4Class ?? he.getGrid4Class(s.tableStyle)), K = v(() => s.tableClass ?? he.getTableClass(s.tableStyle)), le = v(() => s.tbodyClass ?? he.getTbodyClass(s.tbodyClass)), R = v(() => s.theadClass ?? he.getTheadClass(s.tableStyle)), W = v(() => s.theadRowClass ?? he.getTheadRowClass(s.tableStyle)), ee = v(() => s.theadCellClass ?? he.getTheadCellClass(s.tableStyle)); - function q(E, g) { - return s.rowClass ? s.rowClass(E, g) : he.getTableRowClass(s.tableStyle, g, !!(s.isSelected && s.isSelected(E)), s.isSelected != null); + const A = v(() => s.gridClass ?? he.getGridClass(s.tableStyle)), ie = v(() => s.grid2Class ?? he.getGrid2Class(s.tableStyle)), L = v(() => s.grid3Class ?? he.getGrid3Class(s.tableStyle)), E = v(() => s.grid4Class ?? he.getGrid4Class(s.tableStyle)), Q = v(() => s.tableClass ?? he.getTableClass(s.tableStyle)), le = v(() => s.tbodyClass ?? he.getTbodyClass(s.tbodyClass)), R = v(() => s.theadClass ?? he.getTheadClass(s.tableStyle)), J = v(() => s.theadRowClass ?? he.getTheadRowClass(s.tableStyle)), Y = v(() => s.theadCellClass ?? he.getTheadCellClass(s.tableStyle)); + function Z(z, g) { + return s.rowClass ? s.rowClass(z, g) : he.getTableRowClass(s.tableStyle, g, !!(s.isSelected && s.isSelected(z)), s.isSelected != null); } - function T(E, g) { - return s.rowStyle ? s.rowStyle(E, g) : void 0; + function V(z, g) { + return s.rowStyle ? s.rowStyle(z, g) : void 0; } const te = v(() => { - const E = (typeof s.selectedColumns == "string" ? s.selectedColumns.split(",") : s.selectedColumns) || (m.value.length > 0 ? m.value : Gs(s.items)), g = k.value.reduce((C, Y) => (C[Y.name.toLowerCase()] = Y.format, C), {}); - return E.filter((C) => { - var Y; - return ((Y = g[C.toLowerCase()]) == null ? void 0 : Y.method) != "hidden"; + const z = (typeof s.selectedColumns == "string" ? s.selectedColumns.split(",") : s.selectedColumns) || (m.value.length > 0 ? m.value : Gs(s.items)), g = k.value.reduce((C, ee) => (C[ee.name.toLowerCase()] = ee.format, C), {}); + return z.filter((C) => { + var ee; + return ((ee = g[C.toLowerCase()]) == null ? void 0 : ee.method) != "hidden"; }); }); - function w(E, g) { - n("headerSelected", g, E); + function b(z, g) { + n("headerSelected", g, z); } - function N(E, g, C) { - n("rowSelected", C, E); + function N(z, g, C) { + n("rowSelected", C, z); } - return (E, g) => { - const C = Z("CellFormat"), Y = Z("PreviewFormat"); - return E.items.length ? (o(), i("div", { + return (z, g) => { + const C = K("CellFormat"), ee = K("PreviewFormat"); + return z.items.length ? (o(), i("div", { key: 0, ref_key: "refResults", ref: a, - class: h(M.value) + class: h(A.value) }, [ l("div", { class: h(ie.value) @@ -6171,35 +6173,35 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(L.value) }, [ l("div", { - class: h(z.value) + class: h(E.value) }, [ l("table", { - class: h(K.value) + class: h(Q.value) }, [ l("thead", { class: h(R.value) }, [ l("tr", { - class: h(W.value) + class: h(J.value) }, [ (o(!0), i(Me, null, je(te.value, (X) => (o(), i("td", { - class: h([F(X), ee.value, u(X) ? "text-gray-900 dark:text-gray-50" : "text-gray-500 dark:text-gray-400"]) + class: h([I(X), Y.value, u(X) ? "text-gray-900 dark:text-gray-50" : "text-gray-500 dark:text-gray-400"]) }, [ l("div", { - onClick: (ne) => w(ne, X) + onClick: (ne) => b(ne, X) }, [ - G(d)[X + "-header"] ? U(E.$slots, X + "-header", { + W(d)[X + "-header"] ? U(z.$slots, X + "-header", { key: 0, column: X - }) : c(X) ? U(E.$slots, c(X), { + }) : c(X) ? U(z.$slots, c(X), { key: 1, column: X - }) : G(d).header ? U(E.$slots, "header", { + }) : W(d).header ? U(z.$slots, "header", { key: 2, column: X, - label: A(X) + label: T(X) }) : (o(), i("div", Lv, [ - l("span", Vv, O(A(X)), 1) + l("span", Vv, O(T(X)), 1) ])) ], 8, xv) ], 2))), 256)) @@ -6208,22 +6210,22 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("tbody", { class: h(le.value) }, [ - (o(!0), i(Me, null, je(E.items, (X, ne) => (o(), i("tr", { - class: h(q(X, ne)), - style: ol(T(X, ne)), + (o(!0), i(Me, null, je(z.items, (X, ne) => (o(), i("tr", { + class: h(Z(X, ne)), + style: ol(V(X, ne)), onClick: (P) => N(P, ne, X) }, [ (o(!0), i(Me, null, je(te.value, (P) => (o(), i("td", { - class: h([F(P), G(he).tableCellClass]) + class: h([I(P), W(he).tableCellClass]) }, [ - G(d)[P] ? U(E.$slots, P, Rt(Te({ key: 0 }, X))) : f(P) ? U(E.$slots, f(P), Rt(Te({ key: 1 }, X))) : I(P) ? (o(), ae(C, { + W(d)[P] ? U(z.$slots, P, Et(Te({ key: 0 }, X))) : f(P) ? U(z.$slots, f(P), Et(Te({ key: 1 }, X))) : j(P) ? (o(), ae(C, { key: 2, type: y.value, - propType: I(P), + propType: j(P), modelValue: X - }, null, 8, ["type", "propType", "modelValue"])) : (o(), ae(Y, { + }, null, 8, ["type", "propType", "modelValue"])) : (o(), ae(ee, { key: 3, - value: G(_e)(X, P), + value: W(_e)(X, P), format: se(P) }, null, 8, ["value", "format"])) ], 2))), 256)) @@ -6248,22 +6250,22 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b return a != null && a.format ? a.format : (a == null ? void 0 : a.type) == "TimeSpan" || (a == null ? void 0 : a.type) == "TimeOnly" ? { method: "time" } : null; } return () => { - var I; - const a = n(e.propType), r = _e(e.modelValue, e.propType.name), u = Object.assign({}, e, t), d = $t("span", { innerHTML: ts(r, a, u) }), c = Xt(r) && Array.isArray(r) ? $t("span", {}, [ + var j; + const a = n(e.propType), r = _e(e.modelValue, e.propType.name), u = Object.assign({}, e, t), d = $t("span", { innerHTML: ts(r, a, u) }), c = Rt(r) && Array.isArray(r) ? $t("span", {}, [ $t("span", { class: "mr-2" }, `${r.length}`), d - ]) : d, f = (I = e.propType) == null ? void 0 : I.ref; + ]) : d, f = (j = e.propType) == null ? void 0 : j.ref; if (!f) return c; const _ = st(e.type).find((se) => se.type === f.model); if (!_) return c; - const b = _e(e.modelValue, _.name), p = b && f.refLabel && _e(b, f.refLabel); + const w = _e(e.modelValue, _.name), p = w && f.refLabel && _e(w, f.refLabel); if (!p) return c; - 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; + 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; return $t("span", { class: "flex", title: `${f.model} ${r}` }, [ - A, + T, p ]); }; @@ -6287,14 +6289,14 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, setup(e) { const t = e, s = v(() => Array.isArray(t.value)); - return (n, a) => G(Xt)(n.value) ? (o(), i("span", Tv, [ + return (n, a) => W(Rt)(n.value) ? (o(), i("span", Tv, [ n.includeCount && s.value ? (o(), i("span", Fv, O(n.value.length), 1)) : x("", !0), l("span", { - innerHTML: G(ts)(n.value, n.format, n.$attrs) + innerHTML: W(ts)(n.value, n.format, n.$attrs) }, null, 8, Iv) ])) : (o(), i("span", { key: 1, - innerHTML: G(ts)(n.value, n.format, n.$attrs) + innerHTML: W(ts)(n.value, n.format, n.$attrs) }, null, 8, jv)); } }), Pv = ["innerHTML"], Bv = { key: 0 }, Hv = /* @__PURE__ */ l("b", null, null, -1), Rv = { key: 2 }, Ev = /* @__PURE__ */ de({ @@ -6308,36 +6310,36 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b setup(e) { const t = e, s = v(() => Tt(t.value)), n = v(() => Array.isArray(t.value)), a = (c) => cn(c), r = (c) => t.fieldAttrs ? t.fieldAttrs(c) : null, u = v(() => Gs(t.value)), d = (c) => c ? Object.keys(c).map((f) => ({ key: a(f), val: c[f] })) : []; return (c, f) => { - const m = Z("HtmlFormat", !0); + const m = K("HtmlFormat", !0); return o(), i("div", { class: h(c.depth == 0 ? "prose html-format" : "") }, [ s.value ? (o(), i("div", { key: 0, - innerHTML: G(ts)(c.value) + innerHTML: W(ts)(c.value) }, null, 8, Pv)) : n.value ? (o(), i("div", { key: 1, - class: h(c.classes("array", "div", c.depth, G(he).gridClass)) + class: h(c.classes("array", "div", c.depth, W(he).gridClass)) }, [ - G(Tt)(c.value[0]) ? (o(), i("div", Bv, "[ " + O(c.value.join(", ")) + " ]", 1)) : (o(), i("div", { + W(Tt)(c.value[0]) ? (o(), i("div", Bv, "[ " + O(c.value.join(", ")) + " ]", 1)) : (o(), i("div", { key: 1, - class: h(c.classes("array", "div", c.depth, G(he).grid2Class)) + class: h(c.classes("array", "div", c.depth, W(he).grid2Class)) }, [ l("div", { - class: h(c.classes("array", "div", c.depth, G(he).grid3Class)) + class: h(c.classes("array", "div", c.depth, W(he).grid3Class)) }, [ l("div", { - class: h(c.classes("array", "div", c.depth, G(he).grid4Class)) + class: h(c.classes("array", "div", c.depth, W(he).grid4Class)) }, [ l("table", { - class: h(c.classes("object", "table", c.depth, G(he).tableClass)) + class: h(c.classes("object", "table", c.depth, W(he).tableClass)) }, [ l("thead", { - class: h(c.classes("array", "thead", c.depth, G(he).theadClass)) + class: h(c.classes("array", "thead", c.depth, W(he).theadClass)) }, [ l("tr", null, [ (o(!0), i(Me, null, je(u.value, (_) => (o(), i("th", { - class: h(c.classes("array", "th", c.depth, G(he).theadCellClass + " whitespace-nowrap")) + class: h(c.classes("array", "th", c.depth, W(he).theadCellClass + " whitespace-nowrap")) }, [ Hv, ke(O(a(_)), 1) @@ -6345,11 +6347,11 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ]) ], 2), l("tbody", null, [ - (o(!0), i(Me, null, je(c.value, (_, b) => (o(), i("tr", { - class: h(c.classes("array", "tr", c.depth, b % 2 == 0 ? "bg-white" : "bg-gray-50", b)) + (o(!0), i(Me, null, je(c.value, (_, w) => (o(), i("tr", { + class: h(c.classes("array", "tr", c.depth, w % 2 == 0 ? "bg-white" : "bg-gray-50", w)) }, [ (o(!0), i(Me, null, je(u.value, (p) => (o(), i("td", { - class: h(c.classes("array", "td", c.depth, G(he).tableCellClass)) + class: h(c.classes("array", "td", c.depth, W(he).tableCellClass)) }, [ ye(m, Te({ value: _[p], @@ -6405,12 +6407,12 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b (u || n[0] === "/") && (r != null && r.startsWith("image/")) ? a = "image" : u && (a = "link"); } return (u, d) => { - const c = Z("Icon"), f = Z("HtmlFormat"); - return G(a) == "link" ? (o(), i("a", { + const c = K("Icon"), f = K("HtmlFormat"); + return W(a) == "link" ? (o(), i("a", { key: 0, href: u.value, class: "text-indigo-600" - }, O(u.value), 9, zv)) : G(a) == "image" ? (o(), i("a", { + }, O(u.value), 9, zv)) : W(a) == "image" ? (o(), i("a", { key: 1, href: u.value, title: u.value, @@ -6444,17 +6446,17 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b const u = t.value[r], d = typeof u; u == null || d === "function" || d === "symbol" ? n[r] = `(${u == null ? "null" : "t"})` : d === "object" ? a[r] = u : n[r] = u; }), (r, u) => { - const d = Z("MarkupFormat"); + const d = K("MarkupFormat"); return o(), i("table", qv, [ (o(), i(Me, null, je(n, (c, f) => l("tr", Qv, [ - l("th", Kv, O(G(Pe)(f)), 1), + l("th", Kv, O(W(Pe)(f)), 1), l("td", Zv, [ ye(d, { value: c }, null, 8, ["value"]) ]) ])), 64)), (o(), i(Me, null, je(a, (c, f) => (o(), i(Me, null, [ l("tr", Wv, [ - l("td", Gv, O(G(Pe)(f)), 1) + l("td", Gv, O(W(Pe)(f)), 1) ]), l("tr", Jv, [ l("td", Xv, [ @@ -6523,7 +6525,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b c.key === "Escape" && u(); }; return Ye(() => window.addEventListener("keydown", d)), Ft(() => window.removeEventListener("keydown", d)), (c, f) => { - const m = Z("CloseButton"); + const m = K("CloseButton"); return o(), i("div", { id: c.id, class: "relative z-10", @@ -6633,25 +6635,25 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b ss("ModalProvider", { openModal: p }); - const _ = D(), b = D(); - function p(A, I) { - _.value = A, b.value = I; + const _ = D(), w = D(); + function p(T, j) { + _.value = T, w.value = j; } - async function y(A) { - b.value && b.value(A), _.value = void 0, b.value = void 0; + async function y(T) { + w.value && w.value(T), _.value = void 0, w.value = void 0; } - const k = (A) => { - A.key === "Escape" && f(); + const k = (T) => { + T.key === "Escape" && f(); }; - return Ye(() => window.addEventListener("keydown", k)), Ft(() => window.removeEventListener("keydown", k)), (A, I) => { - var j; - const se = Z("ModalLookup"); + return Ye(() => window.addEventListener("keydown", k)), Ft(() => window.removeEventListener("keydown", k)), (T, j) => { + var F; + const se = K("ModalLookup"); return o(), i("div", { - id: A.id, - "data-transition-for": A.id, + id: T.id, + "data-transition-for": T.id, onMousedown: f, class: "relative z-10", - "aria-labelledby": `${A.id}-title`, + "aria-labelledby": `${T.id}-title`, role: "dialog", "aria-modal": "true" }, [ @@ -6661,25 +6663,25 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("div", kp, [ l("div", _p, [ l("div", { - class: h([A.modalClass, A.sizeClass, d.value]), - onMousedown: I[0] || (I[0] = Ue(() => { + class: h([T.modalClass, T.sizeClass, d.value]), + onMousedown: j[0] || (j[0] = Ue(() => { }, ["stop"])) }, [ l("div", null, [ - G(s).closebutton ? U(A.$slots, "createform", { key: 0 }) : (o(), i("div", $p, [ + W(s).closebutton ? U(T.$slots, "createform", { key: 0 }) : (o(), i("div", $p, [ l("button", { type: "button", onClick: f, - class: h(A.closeButtonClass) + class: h(T.closeButtonClass) }, Lp, 2) ])), - U(A.$slots, "default") + U(T.$slots, "default") ]) ], 34), - U(A.$slots, "bottom") + U(T.$slots, "bottom") ]) ]), - ((j = _.value) == null ? void 0 : j.name) == "ModalLookup" && _.value.ref ? (o(), ae(se, { + ((F = _.value) == null ? void 0 : F.name) == "ModalLookup" && _.value.ref ? (o(), ae(se, { key: 0, "ref-info": _.value.ref, onDone: y @@ -6834,49 +6836,49 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__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), b = D({ take: ln }), p = 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); + 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), w = D({ take: ln }), p = D(new Xe()), y = D(s.skip), k = D(!1), T = D(), j = (H) => typeof H == "string" ? H.split(",") : H || []; + function se(H, q) { + return he.getTableRowClass("fullWidth", q, !1, !0); } - function j() { - let H = I(s.selectedColumns); + function F() { + let H = j(s.selectedColumns); return H.length > 0 ? H : []; } - const F = v(() => rt(s.refInfo.model)), M = v(() => { - let Q = j().map((be) => be.toLowerCase()); - const oe = st(F.value); - return Q.length > 0 ? Q.map((be) => oe.find(($e) => $e.name.toLowerCase() === be)).filter((be) => be != null) : oe; + const I = v(() => rt(s.refInfo.model)), A = v(() => { + let q = F().map((be) => be.toLowerCase()); + const oe = st(I.value); + return q.length > 0 ? q.map((be) => oe.find(($e) => $e.name.toLowerCase() === be)).filter((be) => be != null) : oe; }), ie = v(() => { - let H = M.value.map((oe) => oe.name), Q = I(b.value.selectedColumns).map((oe) => oe.toLowerCase()); - return Q.length > 0 ? H.filter((oe) => Q.includes(oe.toLowerCase())) : H; - }), L = v(() => b.value.take ?? ln), z = v(() => p.value.response ? _e(p.value.response, "results") : []), K = v(() => { + let H = A.value.map((oe) => oe.name), q = j(w.value.selectedColumns).map((oe) => oe.toLowerCase()); + return q.length > 0 ? H.filter((oe) => q.includes(oe.toLowerCase())) : H; + }), L = v(() => w.value.take ?? ln), E = v(() => p.value.response ? _e(p.value.response, "results") : []), Q = v(() => { var H; - return ((H = p.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([]), 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)), w = v(() => ns(F.value)), N = v(() => { + return ((H = p.value.response) == null ? void 0 : H.total) ?? E.value.length ?? 0; + }), le = v(() => y.value > 0), R = v(() => y.value > 0), J = v(() => E.value.length >= L.value), Y = v(() => E.value.length >= L.value), Z = D([]), V = v(() => Z.value.some((H) => H.settings.filters.length > 0 || !!H.settings.sort)), te = v(() => Z.value.map((H) => H.settings.filters.length).reduce((H, q) => H + q, 0)), b = v(() => ns(I.value)), N = v(() => { var H; - return (H = u.value) == null ? void 0 : H.operations.find((Q) => { + return (H = u.value) == null ? void 0 : H.operations.find((q) => { var oe; - return ((oe = Q.dataModel) == null ? void 0 : oe.name) == s.refInfo.model && qe.isAnyQuery(Q); + return ((oe = q.dataModel) == null ? void 0 : oe.name) == s.refInfo.model && qe.isAnyQuery(q); }); - }), E = D(), g = D(!1), C = D(), Y = () => `${s.id}/ApiPrefs/${s.refInfo.model}`, X = (H) => `Column/${s.id}:${s.refInfo.model}.${H}`; + }), z = D(), g = D(!1), C = D(), ee = () => `${s.id}/ApiPrefs/${s.refInfo.model}`, X = (H) => `Column/${s.id}:${s.refInfo.model}.${H}`; async function ne(H) { y.value += H, y.value < 0 && (y.value = 0); - var Q = Math.floor(K.value / L.value) * L.value; - y.value > Q && (y.value = Q), await ce(); + var q = Math.floor(Q.value / L.value) * L.value; + y.value > q && (y.value = q), await ce(); } - async function P(H, Q) { + async function P(H, q) { n("done", H); } - function V() { + function S() { n("done", null); } - function fe(H, Q) { + function fe(H, q) { var be, $e, Ae; - let oe = Q.target; + let oe = q.target; if ((oe == null ? void 0 : oe.tagName) !== "TD") { - let He = (be = oe == null ? void 0 : oe.closest("TABLE")) == null ? void 0 : be.getBoundingClientRect(), Fe = q.value.find((De) => De.name.toLowerCase() == H.toLowerCase()); + let He = (be = oe == null ? void 0 : oe.closest("TABLE")) == null ? void 0 : be.getBoundingClientRect(), Fe = Z.value.find((De) => De.name.toLowerCase() == H.toLowerCase()); if (Fe && He) { - let De = 318, We = ((($e = Q.target) == null ? void 0 : $e.tagName) === "DIV" ? Q.target : (Ae = Q.target) == null ? void 0 : Ae.closest("DIV")).getBoundingClientRect(), Re = De + 25; + let De = 318, We = ((($e = q.target) == null ? void 0 : $e.tagName) === "DIV" ? q.target : (Ae = q.target) == null ? void 0 : Ae.closest("DIV")).getBoundingClientRect(), Re = De + 25; C.value = { column: Fe, topLeft: { @@ -6892,25 +6894,25 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b } async function ue(H) { var oe; - let Q = (oe = C.value) == null ? void 0 : oe.column; - Q && (Q.settings = H, f.setItem(X(Q.name), JSON.stringify(Q.settings)), await ce()), C.value = null; + let q = (oe = C.value) == null ? void 0 : oe.column; + q && (q.settings = H, f.setItem(X(q.name), JSON.stringify(q.settings)), await ce()), C.value = null; } async function me(H) { f.setItem(X(H.name), JSON.stringify(H.settings)), await ce(); } - async function S(H) { - g.value = !1, b.value = H, f.setItem(Y(), JSON.stringify(H)), await ce(); + async function M(H) { + g.value = !1, w.value = H, f.setItem(ee(), JSON.stringify(H)), await ce(); } async function ce() { await Ve(Se()); } async function Ve(H) { - const Q = N.value; - if (!Q) { + const q = N.value; + if (!q) { console.error(`No Query API was found for ${s.refInfo.model}`); return; } - let oe = Yt(Q, H), be = dn((He) => { + let oe = Yt(q, H), be = dn((He) => { p.value.response = p.value.error = void 0, k.value = He; }), $e = await c.api(oe); be(), St(() => p.value = $e); @@ -6921,13 +6923,13 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b let H = { include: "total", take: L.value - }, Q = I(b.value.selectedColumns || s.selectedColumns); - if (Q.length > 0) { - let be = w.value; - be && Q.includes(be.name) && (Q = [be.name, ...Q]), H.fields = Q.join(","); + }, q = j(w.value.selectedColumns || s.selectedColumns); + if (q.length > 0) { + let be = b.value; + be && q.includes(be.name) && (q = [be.name, ...q]), H.fields = q.join(","); } let oe = []; - return q.value.forEach((be) => { + return Z.value.forEach((be) => { be.settings.sort && oe.push((be.settings.sort === "DESC" ? "-" : "") + be.name), be.settings.filters.forEach(($e) => { let Ae = $e.key.replace("%", be.name); H[Ae] = $e.value; @@ -6935,39 +6937,39 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }), typeof H.skip > "u" && y.value > 0 && (H.skip = y.value), oe.length > 0 && (H.orderBy = oe.join(",")), H; } async function ge() { - q.value.forEach((H) => { + Z.value.forEach((H) => { H.settings = { filters: [] }, f.removeItem(X(H.name)); }), await ce(); } return Ye(async () => { - const H = s.prefs || $s(f.getItem(Y())); - H && (b.value = H), q.value = M.value.map((Q) => ({ - name: Q.name, - type: Q.type, - meta: Q, + const H = s.prefs || $s(f.getItem(ee())); + H && (w.value = H), Z.value = A.value.map((q) => ({ + name: q.name, + type: q.type, + meta: q, settings: Object.assign( { filters: [] }, - $s(f.getItem(X(Q.name))) + $s(f.getItem(X(q.name))) ) })), isNaN(s.skip) || (y.value = s.skip), await ce(); - }), (H, Q) => { - const oe = Z("ErrorSummary"), be = Z("Loading"), $e = Z("SettingsIcons"), Ae = Z("DataGrid"), He = Z("ModalDialog"); + }), (H, q) => { + const oe = K("ErrorSummary"), be = K("Loading"), $e = K("SettingsIcons"), Ae = K("DataGrid"), He = K("ModalDialog"); return o(), i(Me, null, [ H.refInfo ? (o(), ae(He, { key: 0, ref_key: "modalDialog", - ref: E, + ref: z, id: H.id, - onDone: V + onDone: S }, { default: xe(() => [ l("div", Sp, [ l("div", Mp, [ l("h3", Ap, [ ke(" Select "), - l("span", Tp, O(G(Pe)(H.refInfo.model)), 1) + l("span", Tp, O(W(Pe)(H.refInfo.model)), 1) ]), l("div", Fp, [ H.showPreferences ? (o(), i("button", { @@ -6975,7 +6977,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b type: "button", class: "pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400", title: `${H.refInfo.model} Preferences`, - onClick: Q[0] || (Q[0] = (Fe) => g.value = !g.value) + onClick: q[0] || (q[0] = (Fe) => g.value = !g.value) }, Op, 8, Ip)) : x("", !0), H.showPagingNav ? (o(), i("button", { key: 1, @@ -6983,7 +6985,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(["pl-2", le.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: !le.value, - onClick: Q[1] || (Q[1] = (Fe) => ne(-K.value)) + onClick: q[1] || (q[1] = (Fe) => ne(-Q.value)) }, Bp, 10, Dp)) : x("", !0), H.showPagingNav ? (o(), i("button", { key: 2, @@ -6991,36 +6993,36 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b class: h(["pl-2", R.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: !R.value, - onClick: Q[2] || (Q[2] = (Fe) => ne(-L.value)) + onClick: q[2] || (q[2] = (Fe) => ne(-L.value)) }, Ep, 10, Hp)) : x("", !0), H.showPagingNav ? (o(), i("button", { key: 3, type: "button", - class: h(["pl-2", W.value ? "text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400" : "text-gray-400 dark:text-gray-500"]), + class: h(["pl-2", J.value ? "text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400" : "text-gray-400 dark:text-gray-500"]), title: "Next page", - disabled: !W.value, - onClick: Q[3] || (Q[3] = (Fe) => ne(L.value)) + disabled: !J.value, + onClick: q[3] || (q[3] = (Fe) => ne(L.value)) }, Up, 10, zp)) : x("", !0), H.showPagingNav ? (o(), i("button", { key: 4, type: "button", - class: h(["pl-2", ee.value ? "text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400" : "text-gray-400 dark:text-gray-500"]), + class: h(["pl-2", Y.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: !ee.value, - onClick: Q[4] || (Q[4] = (Fe) => ne(K.value)) + disabled: !Y.value, + onClick: q[4] || (q[4] = (Fe) => ne(Q.value)) }, Kp, 10, qp)) : x("", !0) ]), H.showPagingInfo ? (o(), i("div", Zp, [ l("div", Wp, [ k.value ? (o(), i("span", Gp, "Querying...")) : x("", !0), - z.value.length ? (o(), i("span", Jp, [ + E.value.length ? (o(), i("span", Jp, [ Xp, - ke(" " + O(y.value + 1) + " - " + O(Math.min(y.value + z.value.length, K.value)) + " ", 1), - l("span", null, " of " + O(K.value), 1) + ke(" " + O(y.value + 1) + " - " + O(Math.min(y.value + E.value.length, Q.value)) + " ", 1), + l("span", null, " of " + O(Q.value), 1) ])) : p.value.completed ? (o(), i("span", Yp, "No Results")) : x("", !0) ]) ])) : x("", !0), - T.value && H.showResetPreferences ? (o(), i("div", em, [ + V.value && H.showResetPreferences ? (o(), i("div", em, [ l("button", { type: "button", onClick: ge, @@ -7032,23 +7034,23 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b H.showFiltersView && te.value > 0 ? (o(), i("div", nm, [ l("button", { type: "button", - onClick: Q[5] || (Q[5] = (Fe) => A.value = A.value == "filters" ? null : "filters"), + onClick: q[5] || (q[5] = (Fe) => T.value = T.value == "filters" ? null : "filters"), class: h(m.value), "aria-expanded": "false" }, [ om, l("span", am, O(te.value) + " " + O(te.value == 1 ? "Filter" : "Filters"), 1), - A.value != "filters" ? (o(), i("svg", rm, um)) : (o(), i("svg", dm, fm)) + T.value != "filters" ? (o(), i("svg", rm, um)) : (o(), i("svg", dm, fm)) ], 2) ])) : x("", !0) ]) ]), - A.value == "filters" ? (o(), ae(Il, { + T.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) => A.value = null), + columns: Z.value, + onDone: q[6] || (q[6] = (Fe) => T.value = null), onChange: me }, null, 8, ["definitions", "columns"])) : x("", !0), C.value ? (o(), i("div", vm, [ @@ -7064,10 +7066,10 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b key: 2, status: p.value.error }, null, 8, ["status"])) : k.value ? (o(), ae(be, { key: 3 })) : (o(), i("div", pm, [ - z.value.length ? (o(), i("div", mm, [ + E.value.length ? (o(), i("div", mm, [ ye(Ae, { id: H.id, - items: z.value, + items: E.value, type: H.refInfo.model, "selected-columns": ie.value, onFiltersChanged: ce, @@ -7082,7 +7084,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b H.allowFiltering && (!s.canFilter || s.canFilter(Fe)) ? (o(), i("div", hm, [ l("span", gm, O(De), 1), ye($e, { - column: q.value.find((We) => We.name.toLowerCase() === Fe.toLowerCase()), + column: Z.value.find((We) => We.name.toLowerCase() === Fe.toLowerCase()), "is-open": ((Oe = C.value) == null ? void 0 : Oe.column.name) === Fe }, null, 8, ["column", "is-open"]) ])) : (o(), i("div", ym, [ @@ -7092,10 +7094,10 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }), _: 2 }, [ - je(Object.keys(G(a)), (Fe) => ({ + je(Object.keys(W(a)), (Fe) => ({ name: Fe, fn: xe((De) => [ - U(H.$slots, Fe, Rt(ks(De))) + U(H.$slots, Fe, Et(ks(De))) ]) })) ]), 1032, ["id", "items", "type", "selected-columns"]) @@ -7107,10 +7109,10 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, 8, ["id"])) : x("", !0), g.value ? (o(), ae(jl, { key: 1, - columns: M.value, - prefs: b.value, - onDone: Q[7] || (Q[7] = (Fe) => g.value = !1), - onSave: S + columns: A.value, + prefs: w.value, + onDone: q[7] || (q[7] = (Fe) => g.value = !1), + onSave: M }, null, 8, ["columns", "prefs"])) : x("", !0) ], 64); }; @@ -7145,8 +7147,8 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b const f = v(() => `${100 / Object.keys(t.tabs).length}%`); return Ye(() => { if (u.value = t.selected || Object.keys(t.tabs)[0], t.url) { - const m = location.search ? location.search : location.hash.includes("?") ? "?" + ms(location.hash, "?") : "", b = Ws(m)[r.value]; - b && (u.value = b); + const m = location.search ? location.search : location.hash.includes("?") ? "?" + ms(location.hash, "?") : "", w = Ws(m)[r.value]; + w && (u.value = w); } }), (m, _) => (o(), i("div", null, [ l("div", km, [ @@ -7158,26 +7160,26 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b id: a.value, name: a.value, class: "block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500", - onChange: _[0] || (_[0] = (b) => { + onChange: _[0] || (_[0] = (w) => { var p; - return d((p = b.target) == null ? void 0 : p.value); + return d((p = w.target) == null ? void 0 : p.value); }) }, [ - (o(!0), i(Me, null, je(s.value, (b) => (o(), i("option", { - key: b, - value: b - }, O(n(b)), 9, Cm))), 128)) + (o(!0), i(Me, null, je(s.value, (w) => (o(), i("option", { + key: w, + value: w + }, O(n(w)), 9, Cm))), 128)) ], 40, $m) ]), l("div", xm, [ l("div", Lm, [ l("nav", Vm, [ - (o(!0), i(Me, null, je(s.value, (b) => (o(), i("a", { + (o(!0), i(Me, null, je(s.value, (w) => (o(), i("a", { href: "#", - onClick: Ue((p) => d(b), ["prevent"]), + onClick: Ue((p) => d(w), ["prevent"]), style: ol({ width: f.value }), - class: h([c(b) ? "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", m.tabClass]) - }, O(n(b)), 15, Sm))), 256)) + class: h([c(w) ? "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", m.tabClass]) + }, O(n(w)), 15, Sm))), 256)) ]) ]) ]), @@ -7273,80 +7275,80 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, emits: ["login"], setup(e, { emit: t }) { - const s = e, n = t, { getMetadata: a, createDto: r } = lt(), u = Ps(), d = Qe("client"), { signIn: c } = Tl(), f = a({ assert: !0 }), m = f.plugins.auth, _ = document.baseURI, b = f.app.baseUrl, p = D(r("Authenticate")), y = D(new Xe()), k = D(s.provider); + const s = e, n = t, { getMetadata: a, createDto: r } = lt(), u = Ps(), d = Qe("client"), { signIn: c } = Tl(), f = a({ assert: !0 }), m = f.plugins.auth, _ = document.baseURI, w = f.app.baseUrl, p = D(r("Authenticate")), y = D(new Xe()), k = D(s.provider); Ye(() => { m == null || m.authProviders.map((R) => R.formLayout).filter((R) => R).forEach((R) => R.forEach( - (W) => p.value[W.id] = W.type === "checkbox" ? !1 : "" + (J) => p.value[J.id] = J.type === "checkbox" ? !1 : "" )); }); - 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) { + const T = v(() => (m == null ? void 0 : m.authProviders.filter((R) => R.formLayout)) || []), j = v(() => T.value[0] || {}), se = v(() => T.value[Math.max(T.value.length - 1, 0)] || {}), F = v(() => (k.value ? m == null ? void 0 : m.authProviders.find((R) => R.name === k.value) : null) ?? j.value), I = (R) => R === !1 || R === "false"; + function A(R) { return R.label || R.navItem && R.navItem.label; } const ie = v(() => { var R; - return (((R = j.value) == null ? void 0 : R.formLayout) || []).map((W) => { - var ee, q; - return Object.assign({}, W, { - type: (ee = W.type) == null ? void 0 : ee.toLowerCase(), - autocomplete: W.autocomplete || (((q = W.type) == null ? void 0 : q.toLowerCase()) === "password" ? "current-password" : void 0) || (W.id.toLowerCase() === "username" ? "username" : void 0), - css: Object.assign({ field: "col-span-12" }, W.css) + return (((R = F.value) == null ? void 0 : R.formLayout) || []).map((J) => { + var Y, Z; + return Object.assign({}, J, { + type: (Y = J.type) == null ? void 0 : Y.toLowerCase(), + autocomplete: J.autocomplete || (((Z = J.type) == null ? void 0 : Z.toLowerCase()) === "password" ? "current-password" : void 0) || (J.id.toLowerCase() === "username" ? "username" : void 0), + css: Object.assign({ field: "col-span-12" }, J.css) }); }); - }), L = v(() => F(s.oauth) ? [] : (m == null ? void 0 : m.authProviders.filter((R) => R.type === "oauth")) || []), z = v(() => { + }), L = v(() => I(s.oauth) ? [] : (m == null ? void 0 : m.authProviders.filter((R) => R.type === "oauth")) || []), E = v(() => { let R = Ho( - m == null ? void 0 : m.authProviders.filter((ee) => ee.formLayout && ee.formLayout.length > 0), - (ee, q) => { - let T = M(q) || at(q.name); - ee[T] = q.name === I.value.name ? "" : q.name; + m == null ? void 0 : m.authProviders.filter((Y) => Y.formLayout && Y.formLayout.length > 0), + (Y, Z) => { + let V = A(Z) || at(Z.name); + Y[V] = Z.name === j.value.name ? "" : Z.name; } ); - const W = j.value; - return W && F(s.tabs) && (R = { [M(W) || at(W.name)]: W }), R; - }), K = v(() => { - let R = ie.value.map((W) => W.id).filter((W) => W); + const J = F.value; + return J && I(s.tabs) && (R = { [A(J) || at(J.name)]: J }), R; + }), Q = v(() => { + let R = ie.value.map((J) => J.id).filter((J) => J); return y.value.summaryMessage(R); }); async function le() { - if (p.value.provider = j.value.name, j.value.name === "authsecret" ? (d.headers.set("authsecret", p.value.authsecret), p.value = r("Authenticate")) : j.value.name === "basic" ? (d.setCredentials(p.value.UserName, p.value.Password), p.value = r("Authenticate"), p.value.UserName = null, p.value.Password = null) : (j.value.type === "Bearer" || j.value.name === "jwt") && (d.bearerToken = p.value.BearerToken, p.value = r("Authenticate")), y.value = await u.api(p.value), y.value.succeeded) { + if (p.value.provider = F.value.name, F.value.name === "authsecret" ? (d.headers.set("authsecret", p.value.authsecret), p.value = r("Authenticate")) : F.value.name === "basic" ? (d.setCredentials(p.value.UserName, p.value.Password), p.value = r("Authenticate"), p.value.UserName = null, p.value.Password = null) : (F.value.type === "Bearer" || F.value.name === "jwt") && (d.bearerToken = p.value.BearerToken, p.value = r("Authenticate")), y.value = await u.api(p.value), y.value.succeeded) { const R = y.value.response; c(R), n("login", R), y.value = new Xe(), p.value = r("Authenticate"); } } - return (R, W) => { - const ee = Z("ErrorSummary"), q = Z("AutoFormFields"), T = Z("PrimaryButton"), te = Z("Icon"), w = _o("href"); - return G(m) ? (o(), i("div", Dm, [ + return (R, J) => { + const Y = K("ErrorSummary"), Z = K("AutoFormFields"), V = K("PrimaryButton"), te = K("Icon"), b = _o("href"); + return W(m) ? (o(), i("div", Dm, [ l("div", Pm, [ l("h2", Bm, O(R.title), 1), - Object.keys(z.value).length > 1 ? (o(), i("p", Hm, [ + Object.keys(E.value).length > 1 ? (o(), i("p", Hm, [ l("span", Rm, [ - (o(!0), i(Me, null, je(z.value, (N, E) => Mt((o(), i("a", { + (o(!0), i(Me, null, je(E.value, (N, z) => Mt((o(), i("a", { onClick: (g) => k.value = N, class: h([ - N === "" || N === I.value.name ? "rounded-l-md" : N === se.value.name ? "rounded-r-md -ml-px" : "-ml-px", + N === "" || N === j.value.name ? "rounded-l-md" : N === se.value.name ? "rounded-r-md -ml-px" : "-ml-px", k.value === N ? "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) + ke(O(z), 1) ], 10, Em)), [ - [w, { provider: N }] + [b, { provider: N }] ])), 256)) ]) ])) : x("", !0) ]), l("div", zm, [ - K.value ? (o(), ae(ee, { + Q.value ? (o(), ae(Y, { key: 0, class: "mb-3", - errorSummary: K.value + errorSummary: Q.value }, null, 8, ["errorSummary"])) : x("", !0), l("div", Nm, [ ie.value.length ? (o(), i("form", { key: 0, onSubmit: Ue(le, ["prevent"]) }, [ - ye(q, { + ye(Z, { modelValue: p.value, formLayout: ie.value, api: y.value, @@ -7355,7 +7357,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b "space-class": "space-y-6" }, null, 8, ["modelValue", "formLayout", "api"]), l("div", Um, [ - ye(T, { class: "w-full" }, { + ye(V, { class: "w-full" }, { default: xe(() => [ ke("Sign In") ]), @@ -7368,8 +7370,8 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b l("div", Km, [ (o(!0), i(Me, null, je(L.value, (N) => (o(), i("div", null, [ l("a", { - href: G(b) + N.navItem.href + "?continue=" + G(_), - title: M(N), + href: W(w) + N.navItem.href + "?continue=" + W(_), + title: A(N), 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" }, [ N.icon ? (o(), ae(te, { @@ -7494,182 +7496,182 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b const n = e, a = s; let r = [], u = [], d = Qe("ApiState", void 0); const c = v(() => mt.call({ responseStatus: n.status ?? (d == null ? void 0 : d.error.value) }, n.id)), f = v(() => n.label ?? Pe(at(n.id))), m = "bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","), _ = v(() => n.hide ? Vt(m, n.hide) : Vt(m, [])); - function b(g) { + function w(g) { return _.value[g]; } const p = 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: A, selectionInfo: se, insert: F, replace: j }); + t({ props: n, textarea: y, updateModelValue: k, selection: j, hasSelection: T, selectionInfo: se, insert: I, replace: F }); function k(g) { a("update:modelValue", g); } - function A() { + function T() { return y.value.selectionStart !== y.value.selectionEnd; } - function I() { + function j() { const g = y.value; return g.value.substring(g.selectionStart, g.selectionEnd) || ""; } function se() { - const g = y.value, C = g.value, Y = g.selectionStart, X = C.substring(Y, g.selectionEnd) || "", ne = C.substring(0, Y), P = ne.lastIndexOf(` + const g = y.value, C = g.value, ee = g.selectionStart, X = C.substring(ee, g.selectionEnd) || "", ne = C.substring(0, ee), P = ne.lastIndexOf(` `); return { value: C, sel: X, - selPos: Y, + selPos: ee, beforeSel: ne, - afterSel: C.substring(Y), + afterSel: C.substring(ee), prevCRPos: P, beforeCR: P >= 0 ? ne.substring(0, P + 1) : "", afterCR: P >= 0 ? ne.substring(P + 1) : "" }; } - function j({ value: g, selectionStart: C, selectionEnd: Y }) { - Y == null && (Y = C), k(g), St(() => { - y.value.focus(), y.value.setSelectionRange(C, Y); + function F({ value: g, selectionStart: C, selectionEnd: ee }) { + ee == null && (ee = C), k(g), St(() => { + y.value.focus(), y.value.setSelectionRange(C, ee); }); } - function F(g, C, Y = "", { selectionAtEnd: X, offsetStart: ne, offsetEnd: P, filterValue: V, filterSelection: fe } = {}) { + function I(g, C, ee = "", { selectionAtEnd: X, offsetStart: ne, offsetEnd: P, filterValue: S, filterSelection: fe } = {}) { const pe = y.value; let ue = pe.value, me = pe.selectionEnd; r.push({ value: ue, selectionStart: pe.selectionStart, selectionEnd: pe.selectionEnd }), u = []; - const S = pe.selectionStart, ce = pe.selectionEnd; - let Ve = ue.substring(0, S), Se = ue.substring(ce); + const M = pe.selectionStart, ce = pe.selectionEnd; + let Ve = ue.substring(0, M), Se = ue.substring(ce); const ge = g && Ve.endsWith(g) && Se.startsWith(C); - if (S == ce) { - if (ge ? (ue = Ve.substring(0, Ve.length - g.length) + Se.substring(C.length), me += -C.length) : (ue = Ve + g + Y + C + Se, me += g.length, ne = 0, P = (Y == null ? void 0 : Y.length) || 0, X && (me += P, P = 0)), V) { - var Q = { pos: me }; - ue = V(ue, Q), me = Q.pos; + if (M == ce) { + if (ge ? (ue = Ve.substring(0, Ve.length - g.length) + Se.substring(C.length), me += -C.length) : (ue = Ve + g + ee + C + Se, me += g.length, ne = 0, P = (ee == null ? void 0 : ee.length) || 0, X && (me += P, P = 0)), S) { + var q = { pos: me }; + ue = S(ue, q), me = q.pos; } } else { - var oe = ue.substring(S, ce); - fe && (oe = fe(oe)), ge ? (ue = Ve.substring(0, Ve.length - g.length) + oe + Se.substring(C.length), ne = -oe.length - g.length, P = oe.length) : (ue = Ve + g + oe + C + Se, ne ? me += (g + C).length : (me = S, ne = g.length, P = oe.length)); + var oe = ue.substring(M, ce); + fe && (oe = fe(oe)), ge ? (ue = Ve.substring(0, Ve.length - g.length) + oe + Se.substring(C.length), ne = -oe.length - g.length, P = oe.length) : (ue = Ve + g + oe + C + Se, ne ? me += (g + C).length : (me = M, ne = g.length, P = oe.length)); } k(ue), St(() => { pe.focus(), ne = me + (ne || 0), P = (ne || 0) + (P || 0), pe.setSelectionRange(ne, P); }); } - const M = () => F("**", "**", "bold"), ie = () => F("_", "_", "italics"), L = () => F("~~", "~~", "strikethrough"), z = () => F("[", "](https://)", "", { offsetStart: -9, offsetEnd: 8 }), K = () => F(` + const A = () => I("**", "**", "bold"), ie = () => I("_", "_", "italics"), L = () => I("~~", "~~", "strikethrough"), E = () => I("[", "](https://)", "", { offsetStart: -9, offsetEnd: 8 }), Q = () => I(` > `, ` -`, "Blockquote", {}), le = () => F("![](", ")"); +`, "Blockquote", {}), le = () => I("![](", ")"); function R(g) { - const C = I(); + const C = j(); if (C && !g.shiftKey) - F("`", "`", "code"); + I("`", "`", "code"); else { - const Y = n.lang || "js"; + const ee = n.lang || "js"; C.indexOf(` -`) === -1 ? F("\n```" + Y + ` -`, "\n```\n", "// code") : F("```" + Y + ` +`) === -1 ? I("\n```" + ee + ` +`, "\n```\n", "// code") : I("```" + ee + ` `, "```\n", ""); } } - function W() { - if (A()) { - let { sel: g, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); + function J() { + if (T()) { + let { sel: g, selPos: C, beforeSel: ee, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: S } = se(); if (g.indexOf(` `) === -1) - F(` + I(` 1. `, ` `); else if (!g.startsWith(" 1. ")) { let ue = 1; - F("", "", " - ", { + I("", "", " - ", { selectionAtEnd: !0, - filterSelection: (me) => " 1. " + me.replace(/\n$/, "").replace(/\n/g, (S) => ` + filterSelection: (me) => " 1. " + me.replace(/\n$/, "").replace(/\n/g, (M) => ` ${++ue}. `) + ` ` }); } else - F("", "", "", { + I("", "", "", { filterValue: (ue, me) => { if (ne >= 0) { - let S = V.replace(/^ - /, ""); - Y = P + S, me.pos -= V.length - S.length; + let M = S.replace(/^ - /, ""); + ee = P + M, me.pos -= S.length - M.length; } - return Y + X; + return ee + X; }, filterSelection: (ue) => ue.replace(/^ 1. /g, "").replace(/\n \d+. /g, ` `) }); } else - F(` + I(` 1. `, ` `, "List Item", { offsetStart: -10, offsetEnd: 9 }); } - function ee() { - if (A()) { - let { sel: g, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); + function Y() { + if (T()) { + let { sel: g, selPos: C, beforeSel: ee, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: S } = se(); g.indexOf(` -`) === -1 ? F(` +`) === -1 ? I(` - `, ` -`) : !g.startsWith(" - ") ? F("", "", " - ", { +`) : !g.startsWith(" - ") ? I("", "", " - ", { selectionAtEnd: !0, filterSelection: (ue) => " - " + ue.replace(/\n$/, "").replace(/\n/g, ` - `) + ` ` - }) : F("", "", "", { + }) : I("", "", "", { filterValue: (ue, me) => { if (ne >= 0) { - let S = V.replace(/^ - /, ""); - Y = P + S, me.pos -= V.length - S.length; + let M = S.replace(/^ - /, ""); + ee = P + M, me.pos -= S.length - M.length; } - return Y + X; + return ee + X; }, filterSelection: (ue) => ue.replace(/^ - /g, "").replace(/\n - /g, ` `) }); } else - F(` + I(` - `, ` `, "List Item", { offsetStart: -10, offsetEnd: 9 }); } - function q() { - const g = I(), C = g.indexOf(` + function Z() { + const g = j(), C = g.indexOf(` `) === -1; - g ? C ? F(` + g ? C ? I(` ## `, ` -`, "") : F("## ", "", "") : F(` +`, "") : I("## ", "", "") : I(` ## `, ` `, "Heading", { offsetStart: -8, offsetEnd: 7 }); } - function T() { - let { sel: g, selPos: C, beforeSel: Y, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: V } = se(); - !g.startsWith("//") && !V.startsWith("//") ? g ? F("", "", "//", { + function V() { + let { sel: g, selPos: C, beforeSel: ee, afterSel: X, prevCRPos: ne, beforeCR: P, afterCR: S } = se(); + !g.startsWith("//") && !S.startsWith("//") ? g ? I("", "", "//", { selectionAtEnd: !0, filterSelection: (pe) => "//" + pe.replace(/\n$/, "").replace(/\n/g, ` //`) + ` ` - }) : j({ - value: P + "//" + V + X, + }) : F({ + value: P + "//" + S + X, selectionStart: C + 2 - }) : F("", "", "", { + }) : I("", "", "", { filterValue: (pe, ue) => { if (ne >= 0) { - let me = V.replace(/^\/\//, ""); - Y = P + me, ue.pos -= V.length - me.length; + let me = S.replace(/^\/\//, ""); + ee = P + me, ue.pos -= S.length - me.length; } - return Y + X; + return ee + X; }, filterSelection: (pe) => pe.replace(/^\/\//g, "").replace(/\n\/\//g, ` `) }); } - const te = () => F(`/* + const te = () => I(`/* `, `*/ `, ""); - function w() { + function b() { if (r.length === 0) return !1; const g = y.value, C = r.pop(); - return u.push({ value: g.value, selectionStart: g.selectionStart, selectionEnd: g.selectionEnd }), j(C), !0; + return u.push({ value: g.value, selectionStart: g.selectionStart, selectionEnd: g.selectionEnd }), F(C), !0; } function N() { if (u.length === 0) return !1; const g = y.value, C = u.pop(); - return r.push({ value: g.value, selectionStart: g.selectionStart, selectionEnd: g.selectionEnd }), j(C), !0; + return r.push({ value: g.value, selectionStart: g.selectionStart, selectionEnd: g.selectionEnd }), F(C), !0; } - const E = () => null; + const z = () => null; return Ye(() => { r = [], u = []; const g = y.value; @@ -7678,27 +7680,27 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b a("close"); return; } - const Y = String.fromCharCode(C.keyCode).toLowerCase(); - Y === " " ? (!C.shiftKey ? F("", "", " ", { + const ee = String.fromCharCode(C.keyCode).toLowerCase(); + ee === " " ? (!C.shiftKey ? I("", "", " ", { selectionAtEnd: !0, filterSelection: (ne) => " " + ne.replace(/\n$/, "").replace(/\n/g, ` `) + ` ` - }) : F("", "", "", { + }) : I("", "", "", { filterValue: (ne, P) => { - let { selPos: V, beforeSel: fe, afterSel: pe, prevCRPos: ue, beforeCR: me, afterCR: S } = se(); + let { selPos: S, beforeSel: fe, afterSel: pe, prevCRPos: ue, beforeCR: me, afterCR: M } = se(); if (ue >= 0) { - let ce = S.replace(/\t/g, " ").replace(/^ ? ? ? ?/, ""); - fe = me + ce, P.pos -= S.length - ce.length; + let ce = M.replace(/\t/g, " ").replace(/^ ? ? ? ?/, ""); + fe = me + ce, P.pos -= M.length - ce.length; } return fe + pe; }, filterSelection: (ne) => ne.replace(/\t/g, " ").replace(/^ ? ? ? ?/g, "").replace(/\n /g, ` `) - }), C.preventDefault()) : C.ctrlKey ? Y === "z" ? C.shiftKey ? N() && C.preventDefault() : w() && 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())); + }), C.preventDefault()) : C.ctrlKey ? ee === "z" ? C.shiftKey ? N() && C.preventDefault() : b() && C.preventDefault() : ee === "b" && !C.shiftKey ? (A(), C.preventDefault()) : ee === "h" && !C.shiftKey ? (Z(), C.preventDefault()) : ee === "i" && !C.shiftKey ? (ie(), C.preventDefault()) : ee === "q" && !C.shiftKey ? (Q(), C.preventDefault()) : ee === "k" ? C.shiftKey ? (le(), C.preventDefault()) : (E(), C.preventDefault()) : ee === "," || C.key === "<" || C.key === ">" || C.keyCode === 188 ? (R(C), C.preventDefault()) : ee === "/" || C.key === "/" ? (V(), C.preventDefault()) : (ee === "?" || C.key === "?") && C.shiftKey && (te(), C.preventDefault()) : C.altKey && (C.key === "1" || C.key === "0" ? (J(), C.preventDefault()) : C.key === "-" ? (Y(), C.preventDefault()) : C.key === "s" && (L(), C.preventDefault())); }; }), (g, C) => { - var Y; + var ee; return o(), i("div", null, [ U(g.$slots, "header", Te({ inputElement: y.value, @@ -7713,16 +7715,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, O(f.value), 11, e1)) : x("", !0), g.disabled ? x("", !0) : (o(), i("div", t1, [ l("div", s1, [ - b("bold") ? (o(), i("svg", { + w("bold") ? (o(), i("svg", { key: 0, class: h(Je), - onClick: M, + onClick: A, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, o1)) : x("", !0), - b("italics") ? (o(), i("svg", { + w("italics") ? (o(), i("svg", { key: 1, class: h(Je), onClick: ie, @@ -7731,25 +7733,25 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b height: "24", viewBox: "0 0 24 24" }, i1)) : x("", !0), - b("link") ? (o(), i("svg", { + w("link") ? (o(), i("svg", { key: 2, class: h(Je), - onClick: z, + onClick: E, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, c1)) : x("", !0), - b("blockquote") ? (o(), i("svg", { + w("blockquote") ? (o(), i("svg", { key: 3, class: h(Je), - onClick: K, + onClick: Q, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, p1)) : x("", !0), - b("image") ? (o(), i("svg", { + w("image") ? (o(), i("svg", { key: 4, class: h(Je), onClick: le, @@ -7758,7 +7760,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b height: "24", viewBox: "0 0 24 24" }, g1)) : x("", !0), - b("code") ? (o(), i("svg", { + w("code") ? (o(), i("svg", { key: 5, class: h(Je), onClick: R, @@ -7767,35 +7769,35 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b height: "24", viewBox: "0 0 24 24" }, w1)) : x("", !0), - b("heading") ? (o(), i("svg", { + w("heading") ? (o(), i("svg", { key: 6, class: h(Je), - onClick: q, + onClick: Z, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, $1)) : x("", !0), - b("orderedList") ? (o(), i("svg", { + w("orderedList") ? (o(), i("svg", { key: 7, class: h(Je), icon: "", - onClick: W, + onClick: J, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, L1)) : x("", !0), - b("unorderedList") ? (o(), i("svg", { + w("unorderedList") ? (o(), i("svg", { key: 8, class: h(Je), - onClick: ee, + onClick: Y, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, M1)) : x("", !0), - b("strikethrough") ? (o(), i("svg", { + w("strikethrough") ? (o(), i("svg", { key: 9, class: h(Je), onClick: L, @@ -7804,16 +7806,16 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b height: "24", viewBox: "0 0 24 24" }, F1)) : x("", !0), - b("undo") ? (o(), i("svg", { + w("undo") ? (o(), i("svg", { key: 10, class: h(Je), - onClick: w, + onClick: b, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, O1)) : x("", !0), - b("redo") ? (o(), i("svg", { + w("redo") ? (o(), i("svg", { key: 11, class: h(Je), onClick: N, @@ -7823,10 +7825,10 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b viewBox: "0 0 24 24" }, B1)) : x("", !0), U(g.$slots, "toolbarbuttons", { - instance: (Y = Be()) == null ? void 0 : Y.exposed + instance: (ee = Be()) == null ? void 0 : ee.exposed }) ]), - b("help") && g.helpUrl ? (o(), i("div", H1, [ + w("help") && g.helpUrl ? (o(), i("div", H1, [ l("a", { title: "formatting help", target: "_blank", @@ -7858,7 +7860,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b var ne; return k(((ne = X.target) == null ? void 0 : ne.value) || ""); }), - onKeydown: on(E, ["tab"]) + onKeydown: on(z, ["tab"]) }, null, 42, U1) ]), c.value ? (o(), i("p", { @@ -7937,10 +7939,10 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b function _() { m(!0); } - function b() { + function w() { m(!1); } - return t({ show: _, hide: b, toggle: m }), (p, y) => (o(), i("div", null, [ + return t({ show: _, hide: w, toggle: m }), (p, y) => (o(), i("div", null, [ n.value ? (o(), i("div", Z1, [ l("div", { class: h(["fixed inset-0 bg-gray-900/80", a.value]) @@ -7954,7 +7956,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }, [ l("button", { type: "button", - onClick: b, + onClick: w, class: "-m-2.5 p-2.5" }, X1) ], 2), @@ -8049,7 +8051,7 @@ const R0 = { key: 0 }, E0 = { class: "text-red-700" }, z0 = /* @__PURE__ */ l("b }); }, component(e, t) { - return e ? t ? J.components[e] = t : J.components[e] || Ks[e] || null : null; + return e ? t ? G.components[e] = t : G.components[e] || Ks[e] || null : null; } }; export {