llms-py 2.0.9__py3-none-any.whl → 2.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llms.py +14 -7
- llms_py-2.0.10.data/data/index.html +80 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/llms.json +1 -4
- llms_py-2.0.10.data/data/ui/Avatar.mjs +28 -0
- llms_py-2.0.10.data/data/ui/Brand.mjs +23 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/ChatPrompt.mjs +101 -69
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Main.mjs +43 -183
- llms_py-2.0.10.data/data/ui/ModelSelector.mjs +29 -0
- llms_py-2.0.10.data/data/ui/ProviderStatus.mjs +105 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Recents.mjs +2 -1
- llms_py-2.0.10.data/data/ui/SettingsDialog.mjs +374 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/Sidebar.mjs +11 -27
- llms_py-2.0.10.data/data/ui/SignIn.mjs +64 -0
- llms_py-2.0.10.data/data/ui/SystemPromptEditor.mjs +31 -0
- llms_py-2.0.10.data/data/ui/SystemPromptSelector.mjs +36 -0
- llms_py-2.0.10.data/data/ui/Welcome.mjs +8 -0
- llms_py-2.0.10.data/data/ui/ai.mjs +80 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/app.css +76 -10
- llms_py-2.0.10.data/data/ui/lib/servicestack-vue.mjs +37 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/markdown.mjs +9 -2
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/tailwind.input.css +13 -4
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/threadStore.mjs +2 -2
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/typography.css +109 -1
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/utils.mjs +8 -2
- {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/METADATA +1 -1
- llms_py-2.0.10.dist-info/RECORD +40 -0
- llms_py-2.0.9.data/data/index.html +0 -64
- llms_py-2.0.9.data/data/ui/lib/servicestack-vue.min.mjs +0 -37
- llms_py-2.0.9.dist-info/RECORD +0 -30
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/requirements.txt +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/App.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/fav.svg +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/highlight.min.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/idb.min.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/marked.min.mjs +0 -0
- /llms_py-2.0.9.data/data/ui/lib/servicestack-client.min.mjs → /llms_py-2.0.10.data/data/ui/lib/servicestack-client.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/vue-router.min.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui/lib/vue.min.mjs +0 -0
- {llms_py-2.0.9.data → llms_py-2.0.10.data}/data/ui.json +0 -0
- {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/WHEEL +0 -0
- {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/entry_points.txt +0 -0
- {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/licenses/LICENSE +0 -0
- {llms_py-2.0.9.dist-info → llms_py-2.0.10.dist-info}/top_level.txt +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
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{computed as v,inject as Je,defineComponent as ue,openBlock as o,createElementBlock as r,mergeProps as Se,withModifiers as Ue,renderSlot as z,ref as I,nextTick as Ot,isRef as un,unref as J,provide as ms,watchEffect as Ss,normalizeClass as g,createElementVNode as l,createCommentVNode as L,toDisplayString as F,h as Tt,resolveComponent as Q,createBlock as ne,withCtx as $e,useAttrs as yo,createVNode as we,createTextVNode as _e,normalizeStyle as vl,Fragment as Me,renderList as Ie,withDirectives as Pt,vModelCheckbox as pl,withKeys as dn,createStaticVNode as Ds,vModelSelect as bo,useSlots as js,getCurrentInstance as He,onMounted as at,createSlots as ml,normalizeProps as Xt,guardReactiveProps as As,vModelDynamic as wo,onUnmounted as Et,watch as Lt,vModelText as ko,resolveDynamicComponent as cn,resolveDirective as _o}from"vue";import{lastRightPart as Bt,leftPart as Os,map as Ge,toDate as kt,toDateTime as $o,toCamelCase as Co,mapGet as ke,chop as xo,enc as sl,omit as gt,appendQueryString as Yt,fromXsdDuration as fn,isDate as Ps,timeFmt12 as Lo,dateFmt as Vo,apiValue as Mo,indexOfAny as So,createBus as Ao,toKebabCase as Yl,toTime as To,lastLeftPart as vn,setQueryString as Fo,nameOf as Io,ApiResult as tt,ResponseStatus as Ys,ResponseError as en,sanitize as Do,errorResponseExcept as jo,humanize as Re,delaySet as pn,rightPart as xs,queryString as ll,combinePaths as Oo,toPascalCase as ft,errorResponse as _t,trimEnd as Po,$1 as Ts,HttpMethods as hl,omitEmpty as Bo,uniqueKeys as nl,humanify as mn,each as Ho}from"@servicestack/client";let hn="png,jpg,jpeg,jfif,gif,svg,webp".split(","),gn={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(",")},tn=Object.keys(gn),wt=(e,l)=>`<svg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' role='img' preserveAspectRatio='xMidYMid meet' viewBox='${e}'>${l}</svg>`,Ls={img:wt("4 4 16 16","<path fill='currentColor' d='M20 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2zm-2 0H6v6.38l2.19-2.19l5.23 5.23l1-1a1.59 1.59 0 0 1 2.11.11L18 16V6zm-5 3.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z'/>"),vid:wt("0 0 24 24","<path fill='currentColor' d='m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 18V9h-5V4H6v16h12m-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13v5Z'/>"),aud:wt("0 0 24 24","<path fill='currentColor' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm10-9h-4v3.88a2.247 2.247 0 0 0-3.5 1.87c0 1.24 1.01 2.25 2.25 2.25S13 17.99 13 16.75V13h3v-2z'/>"),ppt:wt("0 0 48 48","<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'><path d='M4 8h40'/><path d='M8 8h32v26H8V8Z' clip-rule='evenodd'/><path d='m22 16l5 5l-5 5m-6 16l8-8l8 8'/></g>"),xls:wt("0 0 256 256","<path fill='currentColor' d='M200 26H72a14 14 0 0 0-14 14v26H40a14 14 0 0 0-14 14v96a14 14 0 0 0 14 14h18v26a14 14 0 0 0 14 14h128a14 14 0 0 0 14-14V40a14 14 0 0 0-14-14Zm-42 76h44v52h-44Zm44-62v50h-44V80a14 14 0 0 0-14-14h-2V38h58a2 2 0 0 1 2 2ZM70 40a2 2 0 0 1 2-2h58v28H70ZM38 176V80a2 2 0 0 1 2-2h104a2 2 0 0 1 2 2v96a2 2 0 0 1-2 2H40a2 2 0 0 1-2-2Zm32 40v-26h60v28H72a2 2 0 0 1-2-2Zm130 2h-58v-28h2a14 14 0 0 0 14-14v-10h44v50a2 2 0 0 1-2 2ZM69.2 148.4L84.5 128l-15.3-20.4a6 6 0 1 1 9.6-7.2L92 118l13.2-17.6a6 6 0 0 1 9.6 7.2L99.5 128l15.3 20.4a6 6 0 0 1-9.6 7.2L92 138l-13.2 17.6a6 6 0 1 1-9.6-7.2Z'/>"),doc:wt("0 0 32 32","<path fill='currentColor' d='M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2Z'/><path fill='currentColor' d='M17 10h7v2h-7zm-1 5h8v2h-8zm-1 5h9v2h-9zm-6-1a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z'/>"),zip:wt("0 0 16 16","<g fill='currentColor'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598l.93.62l.93-.62l-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></g>"),exe:wt("0 0 16 16","<path fill='currentColor' fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983l-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/>"),att:wt("0 0 24 24","<path fill='currentColor' d='M14 0a5 5 0 0 1 5 5v12a7 7 0 1 1-14 0V9h2v8a5 5 0 0 0 10 0V5a3 3 0 1 0-6 0v12a1 1 0 1 0 2 0V6h2v11a3 3 0 1 1-6 0V5a5 5 0 0 1 5-5Z'/>")},Ro=/[\r\n%#()<>?[\\\]^`{|}]/g,sn=1024,Eo=["Bytes","KB","MB","GB","TB"],No=(()=>{let l="application/",e=l+"vnd.openxmlformats-officedocument.",t="image/",a="text/",r="audio/",n="video/",s={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:r+"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 o(e,l){e.split(",").forEach(e=>s[e]=l)}function i(e,l){e.split(",").forEach(e=>s[e]=l(e))}return i("jpeg,gif,png,tiff,bmp,webp",e=>t+e),i("jsx,csv,css",e=>a+e),i("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>r+e),i("3gpp,avi,dv,divx,ogg,mp4,webm",e=>n+e),i("rtf,pdf",e=>l+e),o("htm,html,shtm",a+"html"),o("js,mjs,cjs",a+"javascript"),o("yml,yaml",l+"yaml"),o("bat,cmd",l+"bat"),o("xml,csproj,fsproj,vbproj",a+"xml"),o("txt,ps1",a+"plain"),o("qt,mov",n+"quicktime"),o("doc,dot",l+"msword"),o("xls,xlt,xla",l+"excel"),o("ppt,oit,pps,ppa",l+"vnd.ms-powerpoint"),o("cer,crt,der",l+"x-x509-ca-cert"),o("gz,tgz,zip,rar,lzh,z",l+"x-compressed"),o("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"),s})(),ol=[];function yn(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(Ro,encodeURIComponent)}function gl(e){return"data:image/svg+xml;utf8,"+yn(e)}function bn(e){var l=URL.createObjectURL(e);return ol.push(l),l}function wn(){ol.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),ol=[]}function yl(e){var l;return e?(l=Os(e,"?"),Bt(l,"/")):null}function hs(e){var l=yl(e);return null==l||-1===l.indexOf(".")?null:Bt(l,".").toLowerCase()}function bl(e){var l=hs(e.name);return l&&0<=hn.indexOf(l)?bn(e):Ft(e.name)}function wl(e){var l;return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(l=hs(e))&&0<=hn.indexOf(l))||!1}function Ft(e){var l;return e?null==(l=hs(e))||wl(e)?e:is(l)||gl(Ls.doc):null}function is(e){var l=kn(e);return l&&gl(l)||null}function kn(e){if(Ls[e])return Ls[e];for(let t=0;t<tn.length;t++){var l=tn[t];if(0<=gn[l].indexOf(e))return Ls[l]}return null}function kl(e,l=2){var t,a;return 0===e?"0 Bytes":(t=l<0?0:l,a=Math.floor(Math.log(e)/Math.log(sn)),parseFloat((e/Math.pow(sn,a)).toFixed(t))+" "+Eo[a])}function zo(e){return e.files&&Array.from(e.files).map(e=>({fileName:e.name,contentLength:e.size,filePath:bl(e)}))}function Bs(e,l){e.onerror=null,e.src=_l(e.src,l)||""}function _l(e,l){return is(Bt(e,".").toLowerCase())||(l?is(l)||l:null)||is("doc")}function al(e){var l;if(e)return l=Bt(e,".").toLowerCase(),No[l]||"application/"+l;throw new Error("fileNameOrExt required")}function Uo(){return{extSvg:kn,extSrc:is,getExt:hs,encodeSvg:yn,canPreview:wl,getFileName:yl,getMimeType:al,formatBytes:kl,filePathUri:Ft,svgToDataUri:gl,fileImageUri:bl,objectUrl:bn,flush:wn,inputFiles:zo,iconOnError:Bs,iconFallbackSrc:_l}}class qo{constructor(e){Le(this,"view"),Le(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}let es="/metadata/app.json",Qo={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"},Ko={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},rl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},Zo=([...Object.keys(rl),...Object.values(rl)],{String:"string",Boolean:"bool",...rl});function _s(e){return Zo[e]||e}function _n(e,l){return e?(l=l||[],"Nullable`1"===e?_s(l[0])+"?":e.endsWith("[]")?`List<${_s(e.substring(0,e.length-2))}>`:0===l.length?_s(e):Os(_s(e),"`")+"<"+l.join(",")+">"):""}function Wo(e){return e&&_n(e.name,e.genericArgs)}class Ht{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){We.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:We.isQuery(e)&&!this.Query?this.Query=e:We.isCreate(e)&&!this.Create?this.Create=e:We.isUpdate(e)&&!this.Update?this.Update=e:We.isPatch(e)&&!this.Patch?this.Patch=e:We.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){let l=new Ht;return e.forEach(e=>{l.add(e)}),l}static forType(t,e){let l,a=new Ht;var r;return X.config.apisResolver&&t&&(r=X.config.apisResolver(t,e))&&(a.Query=r.Query,a.QueryInto=r.QueryInto,a.Create=r.Create,a.Update=r.Update,a.Patch=r.Patch,a.Delete=r.Delete),t&&(null!=(e=e??(null==(l=X.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 We={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=>Ge(e.request.inherits,e=>0<=We.AnyRead.indexOf(e.name)),isQuery:e=>Ge(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>Ge(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{var l;return null==(l=e.request.implements)?void 0:l.some(e=>0<=We.AnyWrite.indexOf(e.name))},isCreate:e=>$s(e,We.Create),isUpdate:e=>$s(e,We.Update),isPatch:e=>$s(e,We.Patch),isDelete:e=>$s(e,We.Delete),model:e=>{var l;return e?Ge(e.inherits,e=>0<=We.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<=We.AnyWrite.indexOf(e.name)))?void 0:l.genericArgs[0]:null}};function Go(e){var l;return(null==(l=e.input)?void 0:l.type)||Hs($l(e))}function $n(e){return e.endsWith("?")?xo(e,1):e}function Hs(e){return Qo[$n(e)]}function Jo(e){return e&&Ko[e]||"String"}function $l(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function il(e){return e&&"number"==Hs(e)||!1}function Cn(e){return e&&"string"==e.toLowerCase()||!1}function Xo(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function xn(e){var l;return!(null==e||!e.type||(l=$l(e),e.isValueType&&-1==l.indexOf("`"))||e.isEnum||null!=Hs(e.type))}function Ln(e){var l;return!!(null!=e&&e.type&&(l=$l(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!=Hs(e.type)))}function cs(e,l){let t="string"==typeof e?Rs(e):e,a=(t||(console.warn("Metadata not found for: "+e),t={request:{name:e}}),function(e){Object.assign(this,e)}),r=(n.prototype.createResponse=function(){return t.returnsVoid?void 0:new a},n.prototype.getTypeName=function(){return t.request.name},n.prototype.getMethod=function(){return t.method||"POST"},n);function n(e){Object.assign(this,e)}return new r(l)}function Yo(e,l,t={}){let a=function(e){Object.assign(this,e)},r=(n.prototype.createResponse=function(){return"function"==typeof t.createResponse?t.createResponse():new a},n.prototype.getTypeName=function(){return e},n.prototype.getMethod=function(){return t.method||"POST"},n);function n(e){Object.assign(this,e)}return new r(l)}function us(t,e){return t?(Object.keys(t).forEach(e=>{var l=t[e];"string"==typeof l?l.startsWith("/Date")&&(t[e]=zs(kt(l))):null!=l&&"object"==typeof l&&(Array.isArray(l)?t[e]=Array.from(l):t[e]=Object.assign({},l))}),t):{}}function ea(e,o){let i={};return Array.from(e.elements).forEach(e=>{var n,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==(n=null==e?void 0:e.genericArgs)?void 0:n[0],r="checkbox"===s.type?s.checked:s.value;il(t)?r=Number(r):"List`1"===t&&"string"==typeof r&&(r=r.split(",").map(e=>il(a)?Number(e):e)),i[s.id]=r}}),i}function Cl(e){var l;return(null==(l=null==e?void 0:e.api)?void 0:l.operations)&&0<e.api.operations.length}function ta(e){if(xl()||null==e||!e.assert||X.metadata.value)return X.metadata.value;throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata")}function fs(e){return!(!e||!Cl(e)||(e.date=$o(new Date),X.metadata.value=e,typeof localStorage<"u"&&localStorage.setItem(es,JSON.stringify(e)),0))}function sa(){X.metadata.value=null,typeof localStorage<"u"&&localStorage.removeItem(es)}function xl(){if(null!=X.metadata.value)return!0;var e=globalThis.Server;if(Cl(e))fs(e);else{e=typeof localStorage<"u"?localStorage.getItem(es):null;if(e)try{fs(JSON.parse(e))}catch{console.error(`Could not JSON.parse ${es} from localStorage`)}}return null!=X.metadata.value}async function ln(e,l){var t,a=l?await l():await fetch(e);a.ok?(t=await a.text(),fs(JSON.parse(t))):console.error(`Could not download ${l?"AppMetadata":e}: `+a.statusText),Cl(X.metadata.value)||console.warn("AppMetadata is not available")}async function la(e){var{olderThan:l,resolvePath:t,resolve:a}=e||{};let r=xl()&&0!==l;if(!(r=r&&l&&(!(n=kt(null==(n=X.metadata.value)?void 0:n.date))||(new Date).getTime()-n.getTime()>l)?!1:r)){if((t||a)&&(await ln(t||es,a),null!=X.metadata.value))return;var n=Je("client");if(null!=n&&(l=await n.api(new qo)).succeeded&&fs(l.response),null!=X.metadata.value)return;await ln(es)}return X.metadata.value}function vt(l,t){if(X.config.typeResolver){var e=X.config.typeResolver(l,t);if(e)return e}var a,e=null==(e=X.metadata.value)?void 0:e.api;return e&&l?e.types.find(e=>e.name.toLowerCase()===l.toLowerCase()&&(!t||e.namespace==t))||((a=Rs(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 Rs(l){if(X.config.apiResolver){var e=X.config.apiResolver(l);if(e)return e}e=null==(e=X.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===l.toLowerCase()):null}function na({dataModel:e}){var l=null==(l=X.metadata.value)?void 0:l.api;if(!l)return[];let t=l.operations;if(e){let l="string"==typeof e?vt(e):e;t=t.filter(e=>Vn(e.dataModel,l))}return t}function Ll(e){return e?vt(e.name,e.namespace):null}function Vn(e,l){return e&&l&&e.name===l.name&&(!e.namespace||!l.namespace||e.namespace===l.namespace)}function oa(e,l){var t=vt(e);return t&&t.properties&&t.properties.find(e=>e.name.toLowerCase()===l.toLowerCase())}function Mn(e){return Sn(vt(e))}function Sn(l){if(l&&l.isEnum&&null!=l.enumNames){var t={};for(let e=0;e<l.enumNames.length;e++){var a=(l.enumDescriptions?l.enumDescriptions[e]:null)||l.enumNames[e];t[(null!=l.enumValues?l.enumValues[e]:null)||l.enumNames[e]]=a}return t}return null}function An(e){if(e){var l={},t=e.input&&e.input.allowableEntries;if(t){for(let e=0;e<t.length;e++){var a=t[e];l[a.key]=a.value}return l}var r=e.allowableValues||(e.input?e.input.allowableValues:null);if(r){for(let e=0;e<r.length;e++){var n=r[e];l[n]=n}return l}if(e.isEnum){var s=vt(e.genericArgs&&1==e.genericArgs.length?e.genericArgs[0]:e.type);if(s)return Sn(s)}}return null}function Vl(t){if(t){let l=[];return Object.keys(t).forEach(e=>l.push({key:e,value:t[e]})),l}}function aa(e,l){t=e.name,a=(null==l?void 0:l.type)||Go(e)||"text";var t,a,r=Object.assign({id:t,name:t,type:a},l);return e.isEnum&&(r.type="select",r.allowableEntries=Vl(An(e))),r}function ra(l){let n=[];if(l){let a=ot(l),e=Rs(l.name),r=Ll(null==e?void 0:e.dataModel);a.forEach(l=>{var e;if(Ln(l)){let t=aa(l,l.input);if(t.id=Co(t.id),"file"==t.type&&l.uploadTo&&!t.accept&&(e=null==(e=null==(e=X.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(",")),r&&(e=null==(e=r.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:r?ot(r).map(e=>e.name):[],...X.config.scopeWhitelist},l=qs(t.options,e);Object.keys(l).forEach(e=>{t[e]=l[e]})}catch{console.error(`failed to evaluate '${t.options}'`)}n.push(t)}})}return n}function Ml(e,l){if(!l.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+e];var t=vt(l.type);if(null==t||!t.enumValues)return console.error("Could not find metadata for "+l.type),[""+e];var a=[];for(let n=0;n<t.enumValues.length;n++){var r=parseInt(t.enumValues[n]);0<r&&(r&e)===r&&a.push((null==(r=t.enumDescriptions)?void 0:r[n])||(null==(r=t.enumNames)?void 0:r[n])||""+e)}return a}function Tn(l){return e=>"number"==typeof e?Ml(e,{type:l}):e}function ot(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?Ll(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 $s(e,l){var t;return(null==(t=e.request.implements)?void 0:t.some(e=>e.name===l))||!1}function ss(e){return e?Fn(e,ot(e)):null}function Fn(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=We.model(e);if(a)return Ge(vt(a),e=>ss(e));console.error("Primary Key not found in "+e.name)}return t||null}function ia(e,l){return Ge(ss(e),e=>ke(l,e.name))}function In(e,l,t){return e&&"none"===e.valueType?"":"%In"===t.key||"%Between"===t.key?`(${t.value})`:ua(l,t.value)}function ua(e,l){return!e||il(e=$n(e))||"Boolean"===e?l:Xo(e)?`[${l}]`:`'${l}'`}function Ct(e,l){return{name:e,value:l}}let da=[Ct("=","%"),Ct("!=","%!"),Ct(">=",">%"),Ct(">","%>"),Ct("<=","%<"),Ct("<","<%"),Ct("In","%In"),Ct("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 ut(){var e=v(()=>{var e;return(null==(e=X.metadata.value)?void 0:e.app)||null}),l=v(()=>{var e;return(null==(e=X.metadata.value)?void 0:e.api)||null}),t=v(()=>{var e;return(null==(e=null==(e=null==(e=X.metadata.value)?void 0:e.plugins)?void 0:e.autoQuery)?void 0:e.viewerConventions)||da});return xl(),{loadMetadata:la,getMetadata:ta,setMetadata:fs,clearMetadata:sa,metadataApp:e,metadataApi:l,filterDefinitions:t,typeOf:vt,typeOfRef:Ll,typeEquals:Vn,apiOf:Rs,findApis:na,typeName:Wo,typeName2:_n,property:oa,enumOptions:Mn,propertyOptions:An,createFormLayout:ra,typeProperties:ot,supportsProp:Ln,Crud:We,Apis:Ht,getPrimaryKey:ss,getPrimaryKeyByProps:Fn,getId:ia,createDto:cs,makeDto:Yo,toFormValues:us,formValues:ea,isComplexProp:xn,asKvps:Vl,expandEnumFlags:Ml,enumFlagsConverter:Tn}}let rt=class rt{static async getOrFetchValue(e,l,t,a,r,n,s){return rt.getValue(t,s,r)??(await rt.fetchLookupIds(e,l,t,a,r,n,[s]),rt.getValue(t,s,r))}static getValue(e,l,t){var a=rt.Lookup[e];if(a){a=a[l];if(a)return a[t=t.toLowerCase()]}}static setValue(e,l,t,a){var r=rt.Lookup[e]??(rt.Lookup[e]={});(r[l]??(r[l]={}))[t=t.toLowerCase()]=a}static setRefValue(e,l){var t,a=ke(l,e.refId);return null==a||null==e.refLabel?null:(t=ke(l,e.refLabel),rt.setValue(e.model,a,e.refLabel,t),t)}static async fetchLookupIds(e,l,r,n,s,o,i){var u=l.operations.find(e=>{var l;return We.isAnyQuery(e)&&(null==(l=e.dataModel)?void 0:l.name)==r});if(u){let a=rt.Lookup[r]??(rt.Lookup[r]={}),t=[];Object.keys(a).forEach(e=>{var l=a[e];ke(l,s)&&t.push(e)});var d,v=i.filter(e=>!t.includes(e));0!=v.length&&(d=o?null:n+","+s,v={[n+"In"]:v.join(",")},d&&(v.fields=d),d=cs(u,v),(v=await e.api(d,{jsconfig:"edv,eccn"})).succeeded?(ke(v.response,"results")||[]).forEach(e=>{var l,t;ke(e,n)?(l=""+ke(e,n),t=ke(e,s),s=s.toLowerCase(),(a[l]??(a[l]={}))[s]=""+t):console.error(`result[${n}] == null`,e)}):console.error("Failed to call "+u.request.name))}}},Wt=(Le(rt,"Lookup",{}),rt),ul=()=>(new Date).getTime(),ca=["/","T",":","-"],mt={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},fa=new Intl.RelativeTimeFormat(mt.locale,{}),nn=31536e6,el={year:nn,month:nn/12,day:864e5,hour:36e5,minute:6e4,second:1e3},It={currency:jn,bytes:On,link:Pn,linkTel:Bn,linkMailTo:Hn,icon:Rn,iconRounded:En,attachment:Nn,hidden:zn,time:Un,relativeTime:Al,relativeTimeFromMs:Es,enumFlags:Qn,formatDate:ls,formatNumber:Sl};"iconOnError"in globalThis||(globalThis.iconOnError=Bs);class Ye{}function va(e){mt=Object.assign({},mt,e)}function pa(l){Object.keys(l||{}).forEach(e=>{"function"==typeof l[e]&&(It[e]=l[e])})}function Dn(){return It}function gs(e,l){return l?ht("span",e,l):e}function jn(e,l){var t=gt(l,["currency"]);return gs(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==l?void 0:l.currency)||"USD"}).format(e),t)}function On(e,l){return gs(kl(e),l)}function Pn(e,l){return ht("a",e,Us({...l,href:e}))}function Bn(e,l){return ht("a",e,Us({...l,href:"tel:"+e}))}function Hn(e,l){var{subject:t,body:a}=l=l||{},r=gt(l,["subject","body"]),n={};return t&&(n.subject=t),a&&(n.body=a),ht("a",e,Us({...r,href:"mailto:"+Yt(e,n)}))}function Rn(e,l){return ht("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Jt(e),onerror:"iconOnError(this)"},l))}function En(e,l){return ht("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Jt(e),onerror:"iconOnError(this)"},l))}function Nn(e,l){var t=yl(e),a=(null==hs(t)||wl(e)?Jt:_l)(e),a=Jt(a),r=l&&(l["icon-class"]||l.iconClass),a=ht("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},r?{class:r}:null));return ht("a",a+`<span class="pl-1">${t}</span>`,Object.assign({class:"flex",href:Jt(e),title:e},l?gt(l,["icon-class","iconClass"]):null))}function zn(e){return""}function Un(e,l){var t="string"==typeof e?new Date(1e3*fn(e)):Ps(e)?kt(e):null;return gs(t?Lo(t):e,l)}function ls(e,l){var t,a;return null==e?"":(t="number"==typeof e?new Date(e):"string"==typeof e?kt(e):e,Ps(t)?gs(("function"==typeof(a=mt.date?Ns(mt.date):null)?a:Vo)(t),l):(console.warn(t+" is not a Date value"),null==e?"":""+e))}function Sl(e,l){if("number"!=typeof e)return e;let t=mt.number?Ns(mt.number):null,a="function"==typeof t?t(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,t),a=""+e),gs(a,l)}function Vs(e){var l=Math.floor(e/1e3),t=Math.floor(l/60),a=Math.floor(t/60),r=Math.floor(a/24);return 0<r?r+"d "+Vs(e-24*r*60*6e4):0<a?a+"h "+Vs(e-60*a*6e4):0<t?t+"m "+Vs(e-6e4*t):0<l?l+"s":e+"ms"}function ma(e){return 1e9<=e?(e/1e9).toFixed(1)+"b":1e6<=e?(e/1e6).toFixed(1)+"m":1e3<=e?(e/1e3).toFixed(1)+"k":e.toLocaleString()}function qn(l,t,a){var e=Mo(l),r=t?Ns(t):null;if("function"!=typeof r)return(null!=e?Ps(e)?ls(e,a):"number"==typeof e?Sl(e,a):e:null)??"";{let e=a;if(null!=t&&t.options)try{e=qs(t.options,a)}catch(e){console.error(`Could not evaluate '${t.options}'`,e,", with scope:",a)}return r(l,e)}}function vs(e,l,t){return(Rt(e)?qn:wa)(e,l,t)}function ha(e){if(null!=e){if("number"==typeof e)return e;if(Ps(e))return e.getTime()-ul();if("string"==typeof e){var l=Number(e);if(!isNaN(l))return l;if("P"===e[0]||e.startsWith("-P"))return 1e3*fn(e)*-1;if(0<=So(e,ca))return kt(e).getTime()-ul()}}return NaN}function Es(e,l){for(var t in el)if(Math.abs(e)>el[t]||"second"===t)return(l||fa).format(Math.round(e/el[t]),t)}function Al(e,l){var t=ha(e);return isNaN(t)?"":Es(t,l)}function ga(e,l){return Es(e.getTime()-(l?l.getTime():ul()))}function Qn(e,l){return Ml(e,l).join(", ")}function Ns(l){if(l){let{method:e,options:a}=l,r=e+`(${a})`,n=It[r]||It[e];if("function"==typeof n)return n;let s=l.locale||mt.locale;if(e.startsWith("Intl.")){var t=s?`'${s}'`:"undefined",t=`return new ${e}(${t},${a||"undefined"})`;try{let l=Function(t)();return n="Intl.DateTimeFormat"===e?e=>l.format(kt(e)):"Intl.NumberFormat"===e?e=>l.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>Al(e,l):e=>l.format(e),It[r]=n}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 n=e=>t(e,l,s),It[r]=n}console.error(`No '${e}' function exists`,Object.keys(It))}}return null}function Kn(e,l){return e?e.length>l?e.substring(0,l)+"...":e:""}function Zn(e){return"/Date("===e.substring(0,6)?ls(kt(e)):e}function ya(e){return Tl(ts(e)).replace(/"/g,"")}function Wn(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 Tl(e,l=4){return"object"!=typeof(e=Wn(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,l)}function ba(e){return"object"!=typeof(e=Wn(e))?"string"==typeof e?e:""+e:Tl(e=ts(e=Object.assign({},e)))}function ts(t){if(null==t)return null;if("string"==typeof t)return Zn(t);if(Rt(t))return t;if(t instanceof Date)return ls(t);if(Array.isArray(t))return t.map(ts);if("object"!=typeof t)return t;{let l={};return Object.keys(t).forEach(e=>{"__type"!=e&&(l[e]=ts(t[e]))}),l}}function wa(e,l,t){let a=e;if(Array.isArray(e)){if(Rt(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return ls(a,t);var r=Object.keys(a),n=[];for(let i=0;i<Math.min(mt.maxNestedFields,r.length);i++){var s=r[i],o=""+ts(a[s]);n.push(`<b class="font-medium">${s}</b>: `+sl(Kn(Zn(o),mt.maxNestedFieldLength)))}return 2<r.length&&n.push("..."),ht("span","{ "+n.join(", ")+" }",Object.assign({title:sl(ya(e))},t))}function yg(){return{Formats:Ye,setDefaultFormats:va,getFormatters:Dn,setFormatters:pa,formatValue:vs,formatter:Ns,dateInputFormat:zs,currency:jn,bytes:On,link:Pn,linkTel:Bn,linkMailTo:Hn,icon:Rn,iconRounded:En,attachment:Nn,hidden:zn,time:Un,relativeTime:Al,relativeTimeFromDate:ga,relativeTimeFromMs:Es,enumFlags:Qn,formatDate:ls,formatNumber:Sl,humanifyMs:Vs,humanifyNumber:ma,indentJson:Tl,prettyJson:ba,scrub:ts,truncate:Kn,apiValueFmt:qn,iconOnError:Bs}}Le(Ye,"currency",{method:"currency"}),Le(Ye,"bytes",{method:"bytes"}),Le(Ye,"link",{method:"link"}),Le(Ye,"linkTel",{method:"linkTel"}),Le(Ye,"linkMailTo",{method:"linkMailTo"}),Le(Ye,"icon",{method:"icon"}),Le(Ye,"iconRounded",{method:"iconRounded"}),Le(Ye,"attachment",{method:"attachment"}),Le(Ye,"time",{method:"time"}),Le(Ye,"relativeTime",{method:"relativeTime"}),Le(Ye,"relativeTimeFromMs",{method:"relativeTimeFromMs"}),Le(Ye,"date",{method:"formatDate"}),Le(Ye,"number",{method:"formatNumber"}),Le(Ye,"hidden",{method:"hidden"}),Le(Ye,"enumFlags",{method:"enumFlags"});let ka=["title"],_a=ue({__name:"RouterLink",props:{to:{}},setup(e){let l=e,t=Nt().config,a=()=>t.value.navigate(l.to??"/");return(e,l)=>(o(),r("a",Se({onClick:Ue(a,["prevent"]),title:e.to,href:"javascript:void(0)"},e.$attrs),[z(e.$slots,"default")],16,ka))}});class $a{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)}}class Ca{get length(){return"u"<typeof localStorage?0:localStorage.length}getItem(e){return"u"<typeof localStorage?null:localStorage.getItem(e)}setItem(e,l){"u"<typeof localStorage||localStorage.setItem(e,l)}removeItem(e){"u"<typeof localStorage||localStorage.removeItem(e)}clear(){"u"<typeof localStorage||localStorage.clear()}key(e){return"u"<typeof localStorage?null:localStorage.key(e)}}let it=class it{static component(e){var l=it.components[e];if(l)return l;let t=Yl(e),a=Object.keys(it.components).find(e=>Yl(e)===t);return a&&it.components[a]||null}},X=(Le(it,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new Ca,tableIcon:{svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g fill='none' stroke='currentColor' stroke-width='1.5'><path d='M5 12v6s0 3 7 3s7-3 7-3v-6'/><path d='M5 6v6s0 3 7 3s7-3 7-3V6'/><path d='M12 3c7 0 7 3 7 3s0 3-7 3s-7-3-7-3s0-3 7-3Z'/></g></svg>"},scopeWhitelist:{enumFlagsConverter:Tn,...Dn()}}),Le(it,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Le(it,"events",Ao()),Le(it,"user",I(null)),Le(it,"metadata",I(null)),Le(it,"components",{RouterLink:_a}),Le(it,"interceptors",new $a),it);function xa(e){X.config=Object.assign(X.config,e)}function La(e){X.autoQueryGridDefaults=Object.assign(X.autoQueryGridDefaults,e)}function Fl(e){return e&&X.config.assetsPathResolver?X.config.assetsPathResolver(e):e}function Va(e){return e&&X.config.fallbackPathResolver?X.config.fallbackPathResolver(e):e}function Ma(e,l){X.interceptors.register(e,l)}function Nt(){var e=v(()=>X.config),l=v(()=>X.autoQueryGridDefaults);return{config:e,setConfig:xa,events:X.events,autoQueryGridDefaults:l,setAutoQueryGridDefaults:La,assetsPathResolver:Fl,fallbackPathResolver:Va,registerInterceptor:Ma}}function zs(e){var l;return null==e||"object"==typeof e||null==(l=kt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,10)??""}function Gn(e){var l;return null==e||"object"==typeof e||null==(l=kt(e))||"Invalid Date"==l.toString()?"":l.toISOString().substring(0,19)??""}function Jn(e){return null==e?"":To(e)}function Xn(e,l){var t,a;return X.config.inputValue?X.config.inputValue(e,l):(t=typeof(a="date"===e?zs(l):"datetime-local"===e?Gn(l):"time"===e?Jn(l):l),null==a?"":"boolean"==t||"number"==t?""+a:a)}function Yn(e,l){e.value=null,Ot(()=>e.value=l)}function Zt(t){return Object.keys(t).forEach(e=>{var l=t[e];t[e]=un(l)?J(l):l}),t}function xt(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 Ms(t){if(!("u"<typeof document)){let l=(null==t?void 0:t.after)||document.activeElement,e=l&&l.form;var a,r;e&&(a=':not([disabled]):not([tabindex="-1"])',a=e.querySelectorAll(`a:not([disabled]), button${a}, input[type=text]${a}, [tabindex]`+a),-1<(r=(a=Array.prototype.filter.call(a,e=>0<e.offsetWidth||0<e.offsetHeight||e===l)).indexOf(l)))&&(a[r+1]||a[0]).focus()}}function zt(e){if(!e)return null;if("string"==typeof e)return e;var l="function"==typeof e?new e:"object"==typeof e?e:null;if(!l)throw new Error(`Invalid DTO Type '${typeof e}'`);if("function"!=typeof l.getTypeName)throw new Error(JSON.stringify(l)+" is not a Request DTO");l=l.getTypeName();if(l)return l;throw new Error("DTO Required")}function ht(e,l,t){var a=(t=t||{}).cls||t.className||t.class;return a&&((t=gt(t,["cls","class","className"])).class=a),null==l?"<"+e+dl(t)+"/>":"<"+e+dl(t)+`>${l||""}</${e}>`}function dl(t){return Object.keys(t).reduce((e,l)=>`${e} ${l}="${sl(t[l])}"`,"")}function Us(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Jt(e){return Fl(e)}let Sa=["string","number","boolean","null","undefined"];function Rt(e){return 0<=Sa.indexOf(typeof e)||e instanceof Date}function ps(e){return!Rt(e)}function Fs(e){return"string"==typeof e?JSON.parse(e):null}function Il(e,l){var t;typeof history<"u"&&(t=l?Yt(vn(location.href,"?"),e):Fo(location.href,e),history.pushState({},"",t))}function qs(l,e){if(["function","Function","eval","=>",";"].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 cl(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function Dl(e){var l=X.config.storage.getItem(e);return l?JSON.parse(l):null}function Qs(e,l){return Yt("swr."+Io(e),l?Object.assign({},e,l):e)}function Aa(e){var l;e.request&&(l=Qs(e.request,e.args),X.config.storage.removeItem(l))}async function eo(e,l,t,a,r){var n,s=Qs(l,a),o=(t(new tt({response:Dl(s)})),await e.api(l,a,r));return o.succeeded&&o.response&&(o.response._date=(new Date).valueOf(),n=JSON.stringify(o.response),X.config.storage.setItem(s,n),t(o)),o}function to(l,t){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{l(...e)},t||100)}}function Dt(e){return"string"==typeof e?e.split(","):e||[]}function jt(e,l){let t=Dt(l);return e.reduce((e,l)=>(e[l]=!t.includes(l),e),{})}function Ta(l){return new Promise(e=>setTimeout(e,l))}function so(){return{dateInputFormat:zs,dateTimeInputFormat:Gn,timeInputFormat:Jn,textInputValue:Xn,setRef:Yn,unRefs:Zt,transition:xt,focusNextElement:Ms,getTypeName:zt,htmlTag:ht,htmlAttrs:dl,linkAttrs:Us,toAppUrl:Jt,isPrimitive:Rt,isComplexType:ps,pushState:Il,scopedExpr:qs,copyText:cl,fromCache:Dl,swrCacheKey:Qs,swrClear:Aa,swrApi:eo,asStrings:Dt,asOptions:jt,createDebounce:to,delay:Ta}}function ys(e){let n=I(!1),s=I(),o=I(),i=e??Je("client");function r({message:e,errorCode:l,fieldName:t,errors:a}){return l=l||"Exception",a=a||[],s.value=new Ys(t?{errorCode:l,message:e,errors:[new en({fieldName:t,errorCode:l,message:e})]}:{errorCode:l,message:e,errors:a})}var l={setError:r,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",s.value?((a=new Ys(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 en({fieldName:t,message:e,errorCode:l})],s.value=a):r({fieldName:t,message:e,errorCode:l})},loading:n,error:s,api:async function(e,l,t){n.value=!0;var a=await i.api(Zt(e),l,t);return n.value=!1,o.value=a.response,s.value=a.error,a},apiVoid:async function(e,l,t){n.value=!0;var a=await i.apiVoid(Zt(e),l,t);return n.value=!1,o.value=a.response,s.value=a.error,a},apiForm:async function(e,l,t,a){n.value=!0;var r=await i.apiForm(Zt(e),l,t,a);return n.value=!1,o.value=r.response,s.value=r.error,r},apiFormVoid:async function(e,l,t,a){n.value=!0;var r=await i.apiFormVoid(Zt(e),l,t,a);return n.value=!1,o.value=r.response,s.value=r.error,r},swr:async function(e,l,t,a){return eo(i,e,l,t,a)},swrEffect:function(t,a){let r=I(new tt),n=to(async e=>{r.value=await i.api(e)},null==a?void 0:a.delayMs);return Ss(async()=>{var e=t(),l=Dl(Qs(e));l&&(r.value=new tt({response:l})),0===(null==a?void 0:a.delayMs)?r.value=await i.api(e):n(e)}),(async()=>r.value=await i.api(t(),null==a?void 0:a.args,null==a?void 0:a.method))(),r},unRefs:Zt,setRef:Yn};return ms("ApiState",l),l}function lo(e){return e&&e.SessionId?Do(e):e}function Fa(e){X.user.value=lo(e),X.events.publish("signIn",e)}function Ia(){X.user.value=null,X.events.publish("signOut",null)}let jl=e=>(null==e?void 0:e.roles)||[],Ol=e=>(null==e?void 0:e.permissions)||[];function no(e){return 0<=jl(X.user.value).indexOf(e)}function Da(e){return 0<=Ol(X.user.value).indexOf(e)}function Pl(){return no("Admin")}function ds(e){if(!e)return!1;if(!e.requiresAuth)return!0;var l=X.user.value;if(!l)return!1;if(Pl())return!0;let[t,a]=[jl(l),Ol(l)],[r,n,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!r.every(e=>0<=t.indexOf(e))||0<s.length&&!s.some(e=>0<=t.indexOf(e))||!n.every(e=>0<=a.indexOf(e))||0<o.length&&!o.every(e=>0<=a.indexOf(e)))}function ja(e){if(!e||!e.requiresAuth)return null;var l=X.user.value;if(!l)return`<b>${e.request.name}</b> requires Authentication`;if(Pl())return null;let[t,a]=[jl(l),Ol(l)],[r,n,s,o]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=r.filter(e=>t.indexOf(e)<0);return 0<i.length?`Requires ${i.map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<(l=n.filter(e=>a.indexOf(e)<0)).length?`Requires ${l.map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<l.length?"s":""):0<s.length&&!s.some(e=>0<=t.indexOf(e))?`Requires any ${s.filter(e=>t.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Role`+(1<i.length?"s":""):0<o.length&&!o.every(e=>0<=a.indexOf(e))?`Requires any ${o.filter(e=>a.indexOf(e)<0).map(e=>"<b>"+e+"</b>").join(", ")} Permission`+(1<l.length?"s":""):null}function Bl(){return{signIn:Fa,signOut:Ia,user:v(()=>X.user.value||null),toAuth:lo,isAuthenticated:v(()=>null!=X.user.value),hasRole:no,hasPermission:Da,isAdmin:Pl,canAccess:ds,invalidAccessMessage:ja}}function et(e,l){return Array.isArray(e)?0<=e.indexOf(l):e==l||e.includes(l)}let Is={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"},ct={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 dark:disabled:bg-slate-900 disabled:text-slate-500 disabled:border-slate-200 dark:disabled:border-slate-700 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"},rs={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"},Gt={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"},fl={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?rs:Gt).panelClass},formClass(e="slideOver"){return("card"==e?rs:Gt).formClass},headingClass(e="slideOver"){return("card"==e?rs:Gt).headingClass},subHeadingClass(e="slideOver"){return("card"==e?rs:Gt).subHeadingClass},buttonsClass:"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 et(e,"fullWidth")?"overflow-x-auto":he.grid2Class},getGrid3Class(e="stripedRows"){return et(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":he.grid3Class},getGrid4Class(e="stripedRows"){return et(e,"whiteBackground")?"":et(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black/5":he.grid4Class},getTableClass(e="stripedRows"){return et(e,"fullWidth")||et(e,"verticalLines")?"min-w-full divide-y divide-gray-300":he.tableClass},getTheadClass(e="stripedRows"){return et(e,"whiteBackground")?"":he.theadClass},getTheadRowClass(e="stripedRows"){return he.theadRowClass+(et(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return he.theadCellClass+(et(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(et(e,"whiteBackground")||et(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":he.tableClass)+(et(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 ":"")+(!et(e,"stripedRows")||l%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(et(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/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"},Oa={colspans:"col-span-3 sm:col-span-3"},bg=Object.freeze(Object.defineProperty({__proto__:null,a:Is,card:rs,dummy:Oa,form:Ee,grid:he,input:ct,modal:fl,slideOver:Gt},Symbol.toStringTag,{value:"Module"})),Pa={class:"flex items-center"},Ba={key:0,class:"flex-shrink-0 mr-3"},Ha={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"},Ra=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),Ea=[Ra],Na={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"},za=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),Ua=[za],qa={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"},Qa=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),Ka=[Qa],Za={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"},Wa=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),Ga=[Wa],Ja=ue({__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"),s=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(),r("div",{class:g([a.value,n.value,"border-l-4 p-4"])},[l("div",Pa,[e.hideIcon?L("",!0):(o(),r("div",Ba,["warn"==e.type?(o(),r("svg",Ha,Ea)):"error"==e.type?(o(),r("svg",Na,Ua)):"info"==e.type?(o(),r("svg",qa,Ka)):"success"==e.type?(o(),r("svg",Za,Ga)):L("",!0)])),l("div",null,[l("p",{class:g([s.value,"text-sm"])},[z(e.$slots,"default")],2)])])],2))}}),Xa={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},Ya={class:"flex"},er=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),tr={class:"ml-3"},sr={class:"text-sm font-medium text-green-800"},lr={key:0},nr={class:"ml-auto pl-3"},or={class:"-mx-1.5 -my-1.5"},ar=l("span",{class:"sr-only"},"Dismiss",-1),rr=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),ir=[ar,rr],ur=ue({__name:"AlertSuccess",props:{message:{}},setup(e){let a=I(!1);return(e,t)=>a.value?L("",!0):(o(),r("div",Xa,[l("div",Ya,[er,l("div",tr,[l("h3",sr,[e.message?(o(),r("span",lr,F(e.message),1)):z(e.$slots,"default",{key:1})])]),l("div",nr,[l("div",or,[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-800 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 dark:focus:ring-green-300 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-900",onClick:t[0]||(t[0]=e=>a.value=!0)},ir)])])])]))}}),dr={class:"flex"},cr=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),fr={class:"ml-3"},vr={class:"text-sm text-red-700 dark:text-red-200"},pr=ue({__name:"ErrorSummary",props:{status:{},except:{},class:{}},setup(e){let t=e,a=Je("ApiState",void 0),n=v(()=>t.status||null!=a&&a.error.value?jo.call({responseStatus:t.status??(null==a?void 0:a.error.value)},t.except??[]):null);return(e,t)=>n.value?(o(),r("div",{key:0,class:g("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[l("div",dr,[cr,l("div",fr,[l("p",vr,F(n.value),1)])])],2)):L("",!0)}}),mr=["id","aria-describedby"],hr=ue({__name:"InputDescription",props:{id:{},description:{}},setup(e){return(e,t)=>e.description?(o(),r("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:e.id+"-description","aria-describedby":e.id+"-description"},[l("div",null,F(e.description),1)],8,mr)):L("",!0)}}),oo=ue({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(r,{attrs:n}){return()=>{let e=r.image;var l,t;r.type&&(t=ut().typeOf,(t=t(r.type))||console.warn(`Type ${r.type} does not exist`),null!=t&&t.icon?e=null==t?void 0:t.icon:console.warn(`Type ${r.type} does not have a [Svg] icon`));let a=r.svg||(null==e?void 0:e.svg)||"";return a.startsWith("<svg ")?(t=Os(a,">").indexOf("class="),l=`${(null==e?void 0:e.cls)||""} `+(n.class||""),a=-1==t?`<svg class="${l}" `+a.substring(4):(t=t+6+1,a.substring(0,t)+l+" "+a.substring(t)),Tt("span",{innerHTML:a})):Tt("img",{class:[null==e?void 0:e.cls,n.class],src:Fl(r.src||(null==e?void 0:e.uri)),onError:e=>Bs(e.target)})}}}),gr={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},yr={class:"flex"},br=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),wr=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),kr=[br,wr],_r=ue({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(e){return(e,t)=>(o(),r("div",gr,[l("div",yr,[(o(),r("svg",{class:g(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",e.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},kr,2)),l("span",null,[z(e.$slots,"default")])])]))}}),$r=["href","onClick"],Cr=["type"],on="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",xr=ue({__name:"OutlineButton",props:{type:{default:"submit"},href:{}},setup(e){return(t,e)=>{var a=Q("router-link");return t.href?(o(),ne(a,{key:0,to:t.href},{default:$e(({navigate:e})=>[l("button",{class:g(on),href:t.href,onClick:e},[z(t.$slots,"default")],8,$r)]),_:3},8,["to"])):(o(),r("button",Se({key:1,type:t.type,class:on},t.$attrs),[z(t.$slots,"default")],16,Cr))}}}),Lr=["href","onClick"],Vr=["type"],Mr=ue({__name:"PrimaryButton",props:{type:{default:"submit"},href:{},color:{default:"indigo"}},setup(e){let t=e,a={blue:"focus:ring-blue-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-purple-500 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-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-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-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=Q("router-link");return t.href?(o(),ne(a,{key:0,to:t.href},{default:$e(({navigate:e})=>[l("button",{class:g(n.value),href:t.href,onClick:e},[z(t.$slots,"default")],10,Lr)]),_:3},8,["to"])):(o(),r("button",Se({key:1,type:t.type,class:n.value},t.$attrs),[z(t.$slots,"default")],16,Vr))}}}),Sr=["type","href","onClick"],Ar=["type"],an="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",Tr=ue({__name:"SecondaryButton",props:{type:{},href:{}},setup(e){return(t,e)=>{var a=Q("router-link");return t.href?(o(),ne(a,{key:0,to:t.href},{default:$e(({navigate:e})=>[l("button",{type:t.type??"button",class:g(an),href:t.href,onClick:e},[z(t.$slots,"default")],8,Sr)]),_:3},8,["to"])):(o(),r("button",Se({key:1,type:t.type??"button",class:an},t.$attrs),[z(t.$slots,"default")],16,Ar))}}}),Fr=ue({__name:"TextLink",props:{color:{default:"blue"}},setup(e){let l=yo(),t=e,a=v(()=>(Is[t.color]||Is.blue)+(l.href?"":" cursor-pointer"));return(e,l)=>(o(),r("a",{class:g(a.value)},[z(e.$slots,"default")],2))}}),Ir={class:"flex","aria-label":"Breadcrumb"},Dr={role:"list",class:"flex items-center space-x-4"},jr=["href","title"],Or=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),Pr={class:"sr-only"},Br=ue({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(e){return(e,t)=>(o(),r("nav",Ir,[l("ol",Dr,[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},[Or,l("span",Pr,F(e.homeLabel),1)],8,jr)])]),z(e.$slots,"default")])]))}}),Hr={class:"flex items-center"},Rr=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),Er=["href","title"],Nr=["title"],zr=ue({__name:"Breadcrumb",props:{href:{},title:{}},setup(e){return(e,t)=>(o(),r("li",null,[l("div",Hr,[Rr,e.href?(o(),r("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},[z(e.$slots,"default")],8,Er)):(o(),r("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:e.title},[z(e.$slots,"default")],8,Nr))])]))}}),Ur={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},qr={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"},Qr=ue({__name:"NavList",props:{title:{}},setup(e){return(e,t)=>(o(),r("div",null,[e.title?(o(),r("h2",Ur,F(e.title),1)):L("",!0),l("ul",qr,[z(e.$slots,"default")])]))}}),Kr={class:"relative flex items-start space-x-4 py-6"},Zr={class:"flex-shrink-0"},Wr={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Gr={class:"min-w-0 flex-1"},Jr={class:"text-base font-medium text-gray-900 dark:text-gray-100"},Xr={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Yr=["href"],ei=l("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),ti={class:"text-base text-gray-500"},si=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),li=ue({__name:"NavListItem",props:{title:{},href:{},icon:{},iconSvg:{},iconSrc:{},iconAlt:{}},setup(e){return(e,t)=>{var a=Q("Icon");return o(),r("li",Kr,[l("div",Zr,[l("span",Wr,[we(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",Gr,[l("h3",Jr,[l("span",Xr,[l("a",{href:e.href,class:"focus:outline-none"},[ei,_e(" "+F(e.title),1)],8,Yr)])]),l("p",ti,[z(e.$slots,"default")])]),si])}}}),ni={key:0},oi={class:"md:p-4"},ao=ue({__name:"EnsureAccess",props:{invalidAccess:{},alertClass:{}},emits:["done"],setup(e){let s=Bl().isAuthenticated,t=Nt().config,i=()=>{var e=location.href.substring(location.origin.length)||"/",e=Yt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},u=()=>{var e=location.href.substring(location.origin.length)||"/",e=Yt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var a=Q("Alert"),n=Q("SecondaryButton");return e.invalidAccess?(o(),r("div",ni,[we(a,{class:g(e.alertClass),innerHTML:e.invalidAccess},null,8,["class","innerHTML"]),l("div",oi,[J(s)?(o(),ne(n,{key:1,onClick:u},{default:$e(()=>[_e("Sign Out")]),_:1})):(o(),ne(n,{key:0,onClick:i},{default:$e(()=>[_e("Sign In")]),_:1}))])])):L("",!0)}}}),ai={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ri={class:"p-4"},ii=l("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),ui={class:"flex w-full justify-center"},di=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),ci=l("span",null,"ASC",-1),fi=[di,ci],vi=Ds('<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="currentColor"><path d="M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"></path><path fill-rule="evenodd" d="M10.082 12.629L9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"></path><path d="M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999l.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"></path></g></svg><span>DESC</span>',2),pi=[vi],mi=l("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),hi={key:0},gi=["id","value"],yi=["for"],bi={key:1},wi={class:"mb-2"},ki={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"},_i=["onClick"],$i=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),Ci=[$i],xi={class:"flex"},Li=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),Vi=[Li],Mi={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Hl=ue({__name:"FilterColumn",props:{definitions:{},column:{},topLeft:{}},emits:["done","save"],setup(e,{emit:t}){let u=e,a=t,d=I(),c=I(""),p=I(""),f=I([]),m=v(()=>1==u.column.meta.isEnum),s=v(()=>vt("Nullable`1"===u.column.meta.type?u.column.meta.genericArgs[0]:u.column.meta.type)),h=v(()=>1==u.column.meta.isEnum?Vl(Mn(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=I({filters:[]}),w=v(()=>b.value.filters);function n(e){let l=u.definitions;return l=Cn(e)?l:l.filter(e=>"string"!==e.types)}function x(e,l){return n(e).find(e=>e.value===l)}function k(){var e;c.value&&(e=null==(e=x(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 C(){a("done")}function M(){var e;c.value="%",null!=(e=d.value)&&e.focus()}function S(){var e,l;p.value&&k(),m.value&&(l=Object.values(f.value).filter(e=>e),b.value.filters=0<l.length?null!=(e=s.value)&&e.isEnumInt?[{key:"%HasAny",name:"HasAny",value:l.map(e=>parseInt(e)).reduce((e,l)=>e+l,0).toString()}]:[{key:"%In",name:"In",value:l.join(",")}]:[]),a("save",b.value),a("done")}function V(e){b.value.sort=e===b.value.sort?void 0:e,Ot(S)}return Ss(()=>b.value=Object.assign({},u.column.settings,{filters:Array.from(u.column.settings.filters)})),Ss(()=>{let e,l,t,a,r,n=(null==(t=null==(l=null==(e=u.column.settings.filters)?void 0:e[0])?void 0:l.value)?void 0:t.split(","))||[];if(0<n.length&&null!=(a=s.value)&&a.isEnumInt){let l=parseInt(n[0]);n=(null==(r=s.value.enumValues)?void 0:r.filter(e=>0<(l&parseInt(e))))||[]}f.value=n}),(a,t)=>{var e=Q("SelectInput"),n=Q("TextInput"),s=Q("PrimaryButton"),i=Q("SecondaryButton");return o(),r("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:C,onVnodeMounted:M},[l("div",{class:"absolute",style:vl(`top:${a.topLeft.y}px;left:${a.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[l("div",ai,[l("div",ri,[ii,l("div",ui,[l("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>V("ASC")),class:g(`${"ASC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},fi,2),l("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>V("DESC")),class:g(`${"DESC"===b.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},pi,2)]),mi,m.value?(o(),r("div",hi,[(o(!0),r(Me,null,Ie(h.value,e=>(o(),r("div",{key:e.key,class:"flex items-center"},[Pt(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,gi),[[pl,f.value]]),l("label",{for:e.key,class:"ml-3"},F(e.value),9,yi)]))),128))])):(o(),r("div",bi,[(o(!0),r(Me,null,Ie(w.value,(e,t)=>(o(),r("div",wi,[l("span",ki,[_e(F(a.column.name)+" "+F(e.name)+" "+F((e=e,In(x(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"},Ci,8,_i)])]))),256)),l("div",xi,[we(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=x(a.column.type,c.value))?void 0:e.valueType)?(o(),ne(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:dn(k,["enter"]),label:"",placeholder:""},null,8,["modelValue"])):L("",!0),l("div",{class:"pt-1"},[l("button",{type:"button",onClick:k,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"},Vi)])])]))]),l("div",Mi,[we(s,{onClick:S,color:"red",class:"ml-2"},{default:$e(()=>[_e(" Save ")]),_:1}),we(i,{onClick:C},{default:$e(()=>[_e(" Cancel ")]),_:1})])])],4)],512)}}}),Si={class:"px-4 sm:px-6 lg:px-8 text-sm"},Ai={class:"flex flex-wrap"},Ti={class:"group pr-4 sm:pr-6 lg:pr-8"},Fi={class:"flex justify-between w-full font-medium"},Ii={class:"w-6 flex justify-end"},Di={class:"hidden group-hover:inline"},ji=["onClick","title"],Oi=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),Pi=[Oi],Bi={key:0,class:"pt-2"},Hi={class:"ml-2"},Ri={key:1},Ei={class:"pt-2"},Ni={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"},zi=["onClick"],Ui=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),qi=[Ui],Qi=l("span",null,"Clear All",-1),Ki=[Qi],Rl=ue({__name:"FilterViews",props:{definitions:{},columns:{}},emits:["done","change"],setup(e,{emit:t}){let a=e,s=t,n=v(()=>a.columns.filter(e=>0<e.settings.filters.length));function i(e,l){return(e=>{let l=a.definitions;return l=Cn(e)?l:l.filter(e=>"string"!==e.types)})(e).find(e=>e.value===l)}function u(){a.columns.forEach(e=>{e.settings.filters=[],s("change",e)}),s("done")}return(e,t)=>(o(),r("div",Si,[l("div",Ai,[(o(!0),r(Me,null,Ie(n.value,n=>{return o(),r("fieldset",Ti,[l("legend",Fi,[l("span",null,F(J(Re)(n.name)),1),l("span",Ii,[l("span",Di,[l("button",{onClick:e=>{var l;(l=n).settings.filters=[],s("change",l)},title:`Clear all ${J(Re)(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"},Pi,8,ji)])])]),n.meta.isEnum?(o(),r("div",Bi,[(o(!0),r(Me,null,Ie((e=n.settings.filters,null==(t=null==(t=null==e?void 0:e[0])?void 0:t.value)?void 0:t.split(",")),e=>(o(),r("div",{key:e,class:"flex items-center"},[l("label",Hi,F(e),1)]))),128))])):(o(),r("div",Ri,[(o(!0),r(Me,null,Ie(n.settings.filters,(e,t)=>{return o(),r("div",Ei,[l("span",Ni,[_e(F(n.name)+" "+F(e.name)+" "+F((e=e,In(i((a=n).type,e.value),a.type,e)))+" ",1),l("button",{type:"button",onClick:e=>{var l;(l=n).settings.filters.splice(t,1),s("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"},qi,8,zi)])]);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"},Ki)])]))}}),Zi={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Wi={class:""},Gi={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Ji=l("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Xi={class:"mt-4"},Yi=["for"],eu=["id"],tu=["value","selected"],su={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},lu=["id","checked"],nu=["for"],ou={class:"mt-4"},au={class:"pb-2 px-4"},ru={class:""},iu=["id","value"],uu=["for"],du={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},El=ue({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:{},prefs:{},maxLimit:{}},emits:["done","save"],setup(e,{emit:t}){let a=Nt().autoQueryGridDefaults,i=e,n=t,u=I({}),d=(Ss(()=>u.value=Object.assign({take:a.value.take,selectedColumns:[]},i.prefs)),[10,25,50,100,250,500,1e3]);function v(){n("done")}function c(){n("save",u.value)}return(e,t)=>{let a=Q("PrimaryButton"),n=Q("SecondaryButton"),s=Q("ModalDialog");return o(),ne(s,{id:e.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:$e(()=>[l("div",Zi,[l("div",Wi,[l("div",Gi,[Ji,l("div",Xi,[l("label",{for:e.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,Yi),Pt(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),r(Me,null,Ie(d.filter(e=>null==i.maxLimit||e<=i.maxLimit),e=>(o(),r("option",{value:e,selected:e===u.value.take},F(e),9,tu))),256))],8,eu),[[bo,u.value.take]])]),l("div",su,[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,lu),l("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:e.id+"-allColumns"},"View all columns",8,nu)]),l("div",ou,[l("div",au,[l("div",ru,[(o(!0),r(Me,null,Ie(e.columns,e=>(o(),r("div",{key:e.name,class:"flex items-center"},[Pt(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,iu),[[pl,u.value.selectedColumns]]),l("label",{for:e.name,class:"ml-3"},F(e.name),9,uu)]))),128))])])])])])]),l("div",du,[we(a,{onClick:c,color:"red",class:"ml-2"},{default:$e(()=>[_e(" Save ")]),_:1}),we(n,{onClick:v},{default:$e(()=>[_e(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),cu={key:0},fu={key:1},vu={key:2,class:"pt-1"},pu={key:0},mu={key:1},hu={key:2},gu={key:4},yu={class:"pl-1 pt-1 flex flex-wrap"},bu={class:"flex mt-1"},wu=["title"],ku=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),_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:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",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:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Mu=[Vu],Su=["disabled"],Au=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),Tu=[Au],Fu=["disabled"],Iu=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),Du=[Iu],ju={key:0,class:"flex mt-1"},Ou={class:"px-4 text-lg text-black dark:text-white"},Pu={key:0},Bu={key:1},Hu=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),Ru={key:2},Eu={class:"flex flex-wrap"},Nu={key:0,class:"pl-2 mt-1"},zu=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),Uu=[zu],qu={key:1,class:"pl-2 mt-1"},Qu=Ds('<svg class="w-5 h-5 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M28.781 4.405h-10.13V2.018L2 4.588v22.527l16.651 2.868v-3.538h10.13A1.162 1.162 0 0 0 30 25.349V5.5a1.162 1.162 0 0 0-1.219-1.095zm.16 21.126H18.617l-.017-1.889h2.487v-2.2h-2.506l-.012-1.3h2.518v-2.2H18.55l-.012-1.3h2.549v-2.2H18.53v-1.3h2.557v-2.2H18.53v-1.3h2.557v-2.2H18.53v-2h10.411z" fill="#20744a" fill-rule="evenodd"></path><path fill="#20744a" d="M22.487 7.439h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 10.94h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 14.441h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 17.942h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 21.443h4.323v2.2h-4.323z"></path><path fill="#fff" fill-rule="evenodd" d="M6.347 10.673l2.146-.123l1.349 3.709l1.594-3.862l2.146-.123l-2.606 5.266l2.606 5.279l-2.269-.153l-1.532-4.024l-1.533 3.871l-2.085-.184l2.422-4.663l-2.238-4.993z"></path></svg><span class="text-green-900 dark:text-green-100">Excel</span>',2),Ku=[Qu],Zu={key:2,class:"pl-2 mt-1"},Wu={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"},Gu=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Ju=[Gu],Xu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Yu=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),ed=[Yu],td=l("span",{class:"whitespace-nowrap"},"Copy URL",-1),sd={key:3,class:"pl-2 mt-1"},ld=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),nd=[ld],od={key:4,class:"pl-2 mt-1"},ad=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),rd={class:"mr-1"},id={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"},ud=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),dd=[ud],cd={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"},fd=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),vd=[fd],pd={key:5,class:"pl-2 mt-1"},md=["title"],hd=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),gd={class:"whitespace-nowrap"},yd={key:8},bd={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},wd={class:"mr-1 select-none"},kd={key:1,class:"flex justify-between items-center"},_d={class:"mr-1 select-none"},Cs=25,$d=ue({__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:u,emit:d}){let{config:c,autoQueryGridDefaults:p}=Nt(),Y=p,t=c.value.storage,s=e,ee=d,le=Je("client"),te="filtering,queryString,queryFilters".split(","),ae="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar,forms".split(","),re=v(()=>s.deny?jt(te,s.deny):jt(te,Y.value.deny)),se=v(()=>s.hide?jt(ae,s.hide):jt(ae,Y.value.hide));function f(e){return re.value[e]}function m(e){return se.value[e]}let h=v(()=>s.tableStyle??Y.value.tableStyle),oe=v(()=>s.gridClass??he.getGridClass(h.value)),ie=v(()=>s.grid2Class??he.getGrid2Class(h.value)),ue=v(()=>s.grid3Class??he.getGrid3Class(h.value)),de=v(()=>s.grid4Class??he.getGrid4Class(h.value)),ve=v(()=>s.tableClass??he.getTableClass(h.value)),ce=v(()=>s.theadClass??he.getTheadClass(h.value)),pe=v(()=>s.theadRowClass??he.getTheadRowClass(h.value)),fe=v(()=>s.theadCellClass??he.getTheadCellClass(h.value)),y=v(()=>s.toolbarButtonClass??he.toolbarButtonClass);function me(e,l){var t,a;return s.rowClass?s.rowClass(e,l):(t=!!W.value.AnyUpdate,a=(null!=(a=i.value)&&a.name?ke(e,i.value.name):null)==S.value,he.getTableRowClass(s.tableStyle,l,a,t))}let b=js(),ge=v(()=>{var e;return ol((null==(e=W.value.AnyQuery.viewModel)?void 0:e.name)||W.value.AnyQuery.dataModel.name)}),ye=v(()=>{let l=Object.keys(b).map(e=>e.toLowerCase());return ot(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=Dt(s.selectedColumns)).length?e:0<ye.value.length?ye.value:[]).map(e=>e.toLowerCase());let t=ot(ge.value);return 0<e.length?e.map(l=>t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),be=v(()=>{let e=w.value.map(e=>e.name),l=Dt(O.value.selectedColumns).map(e=>e.toLowerCase());return 0<l.length?e.filter(e=>l.includes(e.toLowerCase())):e}),x=I([]),k=I(new tt),xe=I(new tt),C=I(),M=I(!1),S=I(),V=I(),T=I(!1),A=I(),$=I(s.skip),j=I(!1),O=I({take:Cs}),E=I(!1),Ce=v(()=>x.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)||O.value.selectedColumns),Le=v(()=>x.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),Fe=v(()=>{var e;return ot(ol(a.value||(null==(e=W.value.AnyQuery)?void 0:e.dataModel.name)))}),i=v(()=>{var e;return ss(ol(a.value||(null==(e=W.value.AnyQuery)?void 0:e.dataModel.name)))}),H=v(()=>O.value.take??Cs),B=v(()=>k.value.response?ke(k.value.response,"results"):[]),_=v(()=>{var e;return((null==(e=k.value.response)?void 0:e.total)||B.value.length)??0}),Me=v(()=>0<$.value),Se=v(()=>0<$.value),Ve=v(()=>B.value.length>=H.value),Te=v(()=>B.value.length>=H.value),D=I(),R=I(),Ae={NoQuery:"No Query API was found"};function ze(l){if(l){if(s.canFilter)return s.canFilter(l);var e=Fe.value.find(e=>e.name.toLowerCase()==l.toLowerCase());if(e)return!xn(e)}}function n(e){ee("nav",e),f("queryString")&&Il(e)}async function P(e){$.value+=e,$.value<0&&($.value=0);var l=Math.floor(_.value/H.value)*H.value;$.value>l&&($.value=l),n({skip:$.value||void 0}),await N()}async function je(e,l){var t,a;V.value=null,S.value=l,e&&l&&(a=cs(W.value.AnyQuery,{[e]:l}),(a=await le.api(a)).succeeded)&&((a=null==(a=ke(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(t=W.value.AnyQuery)?void 0:t.request.name}(${e}:${l}) returned no results`),V.value=a)}async function Oe(e,l){ee("rowSelected",e,l);var t=null==(t=i.value)?void 0:t.name,a=t?ke(e,t):null;t&&a&&(n({edit:a}),je(t,a))}function Ee(l,e){var t,a,r;f("filtering")&&(t=e.target,ze(l)&&"TD"!==(null==t?void 0:t.tagName)&&(t=null==(t=null==t?void 0:t.closest("TABLE"))?void 0:t.getBoundingClientRect(),a=x.value.find(e=>e.name.toLowerCase()==l.toLowerCase()))&&t&&(r=t.x+318+10,A.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),r),y:t.y+45}}),ee("headerSelected",l,e))}function Be(){A.value=null}async function De(e){var l=null==(l=A.value)?void 0:l.column;l&&(l.settings=e,t.setItem(nl(l.name),JSON.stringify(l.settings)),await N()),A.value=null}async function Re(e){t.setItem(nl(e.name),JSON.stringify(e.settings)),await N()}async function Pe(e){T.value=!1,O.value=e,t.setItem(rl(),JSON.stringify(e)),await N()}function Ne(e){var l;D.value&&(Object.assign(null==(l=D.value)?void 0:l.model,e),Ue())}function Qe(e){Object.assign(V.value,e),Ue()}function Ue(){null!=(e=D.value)&&e.forceUpdate(),null!=(e=R.value)&&e.forceUpdate();var e=He();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function N(){await We(Ge())}async function qe(){await N()}u({update:N,search:We,createRequestArgs:Ge,reset:kl,createDone:Z,createSave:xl,editDone:G,editSave:K,forceUpdate:Ue,setEdit:Qe,edit:V,createForm:D,editForm:R,apiPrefs:O,results:B,skip:$,take:H,total:_}),X.interceptors.has("AutoQueryGrid.new")&&X.interceptors.invoke("AutoQueryGrid.new",{props:s});let Xe=/iPad|iPhone|iPod/.test(navigator.userAgent);async function We(t){var a=W.value.AnyQuery;if(a){let e=cs(a,t),l=await le.api(e);pn(e=>{k.value.response=k.value.error=void 0,E.value=e,Xe?Ot(()=>k.value=l):k.value=l})();a=ke(l.response,"results")||[];l.succeeded&&a.label}else console.error(Ae.NoQuery)}function Ge(){let n={include:"total",take:H.value},l=Dt(O.value.selectedColumns||s.selectedColumns);if(0<l.length){var t=i.value;t&&!l.includes(t.name)&&(l=[t.name,...l]);let a=Fe.value,r=[];l.forEach(t=>{var e,l=a.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&r.push(l.ref.selfId),ke(b,t)&&r.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))}),r.forEach(e=>{l.includes(e)||l.push(e)}),n.fields=l.join(",")}let e=[];if(x.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);n[l]=e.value})}),s.filters&&Object.keys(s.filters).forEach(e=>{n[e]=s.filters[e]}),f("queryString")&&f("queryFilters")){var t=location.search||(location.hash.includes("?")?"?"+xs(location.hash,"?"):"");let e=ll(t);Object.keys(e).forEach(l=>{w.value.find(e=>e.name.toLowerCase()===l.toLowerCase())&&(n[l]=e[l])}),typeof e.skip<"u"&&(t=parseInt(e.skip),isNaN(t)||($.value=n.skip=t))}return"u"<typeof n.skip&&0<$.value&&(n.skip=$.value),0<e.length&&(n.orderBy=e.join(",")),n}function Ze(){var e=Ye("csv");cl(e),typeof window<"u"&&window.open(e)}function Ke(){cl(Ye("json")),j.value=!0,setTimeout(()=>j.value=!1,3e3)}function Ye(e="json"){var l=Ge(),t="/api/"+(null==(t=W.value.AnyQuery)?void 0:t.request.name),t=Oo(le.baseUrl,Yt(t,{...l,jsconfig:"edv"}));return 0<=t.indexOf("?")?Os(t,"?")+"."+e+"?"+xs(t,"?"):t+".json"}async function el(){x.value.forEach(e=>{e.settings={filters:[]},t.removeItem(nl(e.name))}),O.value={take:Cs},t.removeItem(rl()),await N()}function tl(){M.value=!0,n({create:null})}let a=v(()=>zt(s.type)),U=v(()=>{var e;return a.value||(null==(e=W.value.AnyQuery)?void 0:e.dataModel.name)}),q=v(()=>s.modelTitle||U.value),al=v(()=>s.newButtonLabel||"New "+q.value),rl=()=>{var e;return s.id+"/ApiPrefs/"+(a.value||(null==(e=W.value.AnyQuery)?void 0:e.dataModel.name))},nl=e=>{var l;return`Column/${s.id}:${a.value||(null==(l=W.value.AnyQuery)?void 0:l.dataModel.name)}.`+e},{metadataApi:sl,typeOf:ol,apiOf:il,filterDefinitions:ul}=ut(),dl=Bl().invalidAccessMessage,vl=v(()=>s.filterDefinitions||ul.value),W=v(()=>{var e=Dt(s.apis);return 0<e.length?Ht.from(e.map(e=>il(e)).filter(e=>null!=e).map(e=>e)):Ht.forType(a.value,sl.value)}),pl=e=>`<span class="text-yellow-700">${e}</span>`,fl=v(()=>{var e;return sl.value?0<(e=Dt(s.apis).map(e=>null==il(e)?e:null).filter(e=>null!=e)).length?pl(`Unknown API${1<e.length?"s":""}: `+e.join(", ")):(e=W.value).empty?pl("Mising DataModel in property 'type' or AutoQuery APIs to use in property 'apis'"):e.AnyQuery?null:pl(Ae.NoQuery):pl(`AppMetadata not loaded, see <a class="${Is.blue}" href="https://docs.servicestack.net/vue/use-metadata" target="_blank">useMetadata()</a>`)}),gl=v(()=>W.value.AnyQuery&&dl(W.value.AnyQuery)),hl=v(()=>W.value.Create&&dl(W.value.Create)),yl=v(()=>W.value.AnyUpdate&&dl(W.value.AnyUpdate)),bl=v(()=>ds(W.value.Create)),wl=(v(()=>ds(W.value.AnyUpdate)),v(()=>ds(W.value.Delete)));function G(){V.value=null,S.value=null,n({edit:void 0})}function Z(){M.value=!1,n({create:void 0})}async function K(){await N(),G()}async function xl(){await N(),Z()}function kl(){k.value=new tt,xe.value=new tt,M.value=!1,S.value=null,V.value=null,T.value=!1,A.value=null,$.value=s.skip,j.value=!1,O.value={take:Cs},E.value=!1;var e,l=s.prefs||Fs(t.getItem(rl())),l=(l&&(O.value=l),x.value=w.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},Fs(t.getItem(nl(e.name))))})),isNaN(s.skip)||($.value=s.skip),null==(l=i.value)?void 0:l.name);f("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+xs(location.hash,"?"):""),typeof(e=ll(e)).create<"u"?M.value=typeof e.create<"u":!l||"string"!=typeof e.edit&&"number"!=typeof e.edit||je(l,e.edit)),!0===s.create&&(M.value=!0),l&&null!=s.edit&&je(l,s.edit)}return at(async()=>{kl(),await N()}),(t,e)=>{let a=Q("Alert"),n=Q("EnsureAccessDialog"),s=Q("AutoCreateForm"),i=Q("AutoEditForm"),u=Q("AutoViewForm"),d=Q("ErrorSummary"),v=Q("Loading"),c=Q("SettingsIcons"),p=Q("DataGrid");return fl.value?(o(),r("div",cu,[we(a,{innerHTML:fl.value},null,8,["innerHTML"])])):gl.value?(o(),r("div",fu,[we(ao,{"invalid-access":gl.value},null,8,["invalid-access"])])):(o(),r("div",vu,[m("forms")&&M.value&&W.value.Create?(o(),r("div",pu,[hl.value?(o(),ne(n,{key:0,title:"Create "+q.value,"invalid-access":hl.value,"alert-class":"text-yellow-700",onDone:Z},null,8,["title","invalid-access"])):J(b).createform?z(t.$slots,"createform",{key:1,type:W.value.Create.request.name,configure:t.configureField,done:Z,save:xl}):(o(),ne(s,{key:2,ref_key:"createForm",ref:D,type:W.value.Create.request.name,configure:t.configureField,onDone:Z,onSave:xl},{header:$e(()=>[z(t.$slots,"formheader",{form:"create",formInstance:D.value,apis:W.value,type:U.value,updateModel:Ne})]),footer:$e(()=>[z(t.$slots,"formfooter",{form:"create",formInstance:D.value,apis:W.value,type:U.value,updateModel:Ne})]),_:3},8,["type","configure"]))])):m("forms")&&V.value&&W.value.AnyUpdate?(o(),r("div",mu,[yl.value?(o(),ne(n,{key:0,title:"Update "+q.value,"invalid-access":yl.value,"alert-class":"text-yellow-700",onDone:G},null,8,["title","invalid-access"])):J(b).editform?z(t.$slots,"editform",{key:1,model:V.value,type:W.value.AnyUpdate.request.name,deleteType:wl.value?W.value.Delete.request.name:null,configure:t.configureField,done:G,save:K}):(o(),ne(i,{key:2,ref_key:"editForm",ref:R,modelValue:V.value,"onUpdate:modelValue":e[0]||(e[0]=e=>V.value=e),type:W.value.AnyUpdate.request.name,deleteType:wl.value?W.value.Delete.request.name:null,configure:t.configureField,onDone:G,onSave:K,onDelete:K},{header:$e(()=>[z(t.$slots,"formheader",{form:"edit",formInstance:R.value,apis:W.value,type:U.value,model:V.value,id:S.value,updateModel:Qe})]),footer:$e(()=>[z(t.$slots,"formfooter",{form:"edit",formInstance:R.value,apis:W.value,type:U.value,model:V.value,id:S.value,updateModel:Qe})]),_:3},8,["modelValue","type","deleteType","configure"]))])):m("forms")&&V.value?(o(),r("div",hu,[J(b).viewform?z(t.$slots,"viewform",{key:0,model:V.value,apis:W.value,done:G}):(o(),ne(u,{key:1,model:V.value,apis:W.value,deleteType:wl.value?W.value.Delete.request.name:null,done:G,onSave:K,onDelete:K},null,8,["model","apis","deleteType"]))])):L("",!0),J(b).toolbar?z(t.$slots,"toolbar",{key:3}):m("toolbar")?(o(),r("div",gu,[T.value?(o(),ne(El,{key:0,columns:w.value,prefs:O.value,onDone:e[1]||(e[1]=e=>T.value=!1),onSave:Pe},null,8,["columns","prefs"])):L("",!0),l("div",yu,[l("div",bu,[m("preferences")?(o(),r("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)},_u,8,wu)):L("",!0),m("pagingNav")?(o(),r("button",{key:1,type:"button",class:g(["pl-2",Me.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:!Me.value,onClick:e[3]||(e[3]=e=>P(-_.value))},xu,10,$u)):L("",!0),m("pagingNav")?(o(),r("button",{key:2,type:"button",class:g(["pl-2",Se.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!Se.value,onClick:e[4]||(e[4]=e=>P(-H.value))},Mu,10,Lu)):L("",!0),m("pagingNav")?(o(),r("button",{key:3,type:"button",class:g(["pl-2",Ve.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:!Ve.value,onClick:e[5]||(e[5]=e=>P(H.value))},Tu,10,Su)):L("",!0),m("pagingNav")?(o(),r("button",{key:4,type:"button",class:g(["pl-2",Te.value?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!Te.value,onClick:e[6]||(e[6]=e=>P(_.value))},Du,10,Fu)):L("",!0)]),m("pagingInfo")?(o(),r("div",ju,[l("div",Ou,[E.value?(o(),r("span",Pu,"Querying...")):L("",!0),B.value.length?(o(),r("span",Bu,[Hu,_e(" "+F($.value+1)+" - "+F(Math.min($.value+B.value.length,_.value))+" ",1),l("span",null," of "+F(_.value),1)])):k.value.completed?(o(),r("span",Ru,"No Results")):L("",!0)])])):L("",!0),l("div",Eu,[m("refresh")?(o(),r("div",Nu,[l("button",{type:"button",onClick:qe,title:"Refresh",class:g(y.value)},Uu,2)])):L("",!0),m("downloadCsv")?(o(),r("div",qu,[l("button",{type:"button",onClick:Ze,title:"Download CSV",class:g(y.value)},Ku,2)])):L("",!0),m("copyApiUrl")?(o(),r("div",Zu,[l("button",{type:"button",onClick:Ke,title:"Copy API URL",class:g(y.value)},[j.value?(o(),r("svg",Wu,Ju)):(o(),r("svg",Xu,ed)),td],2)])):L("",!0),Ce.value&&m("resetPreferences")?(o(),r("div",sd,[l("button",{type:"button",onClick:el,title:"Reset Preferences & Filters",class:g(y.value)},nd,2)])):L("",!0),m("filtersView")&&0<Le.value?(o(),r("div",od,[l("button",{type:"button",onClick:e[7]||(e[7]=e=>C.value="filters"==C.value?null:"filters"),class:g(y.value),"aria-expanded":"false"},[ad,l("span",rd,F(Le.value)+" "+F(1==Le.value?"Filter":"Filters"),1),"filters"!=C.value?(o(),r("svg",id,dd)):(o(),r("svg",cd,vd))],2)])):L("",!0),m("newItem")&&W.value.Create&&bl.value?(o(),r("div",pd,[l("button",{type:"button",onClick:tl,title:q.value,class:g(y.value)},[hd,l("span",gd,F(al.value),1)],10,md)])):L("",!0),J(b).toolbarbuttons?z(t.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:y.value}):L("",!0)])])])):L("",!0),"filters"==C.value?(o(),ne(Rl,{key:5,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:vl.value,columns:x.value,onDone:e[8]||(e[8]=e=>C.value=null),onChange:Re},null,8,["definitions","columns"])):L("",!0),xe.value.error??k.value.error?(o(),ne(d,{key:6,status:xe.value.error??k.value.error},null,8,["status"])):E.value?(o(),ne(v,{key:7,class:"p-2"})):L("",!0),A.value?(o(),r("div",yd,[we(Hl,{definitions:vl.value,column:A.value.column,"top-left":A.value.topLeft,onDone:Be,onSave:De},null,8,["definitions","column","top-left"])])):L("",!0),B.value.length?(o(),ne(p,{key:9,id:t.id,items:B.value,type:t.type,"selected-columns":be.value,class:"mt-1",onFiltersChanged:N,tableStyle:h.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:Oe,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:Ee},ml({header:$e(({column:t,label:e})=>{var a;return[f("filtering")&&ze(t)?(o(),r("div",bd,[l("span",wd,F(e),1),we(c,{column:x.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(),r("div",kd,[l("span",_d,F(e),1)]))]}),_:2},[Ie(Object.keys(J(b)),l=>({name:l,fn:$e(e=>[z(t.$slots,l,Xt(As(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):L("",!0)]))}}}),Cd={class:"flex"},xd={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Ld=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),Vd=[Ld],Md=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),Sd=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),Ad=[Md,Sd],Td={key:2,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:"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),Id=[Fd],Dd={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},jd=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),Od=[jd],Pd=ue({__name:"SettingsIcons",props:{column:{},isOpen:{type:Boolean}},setup(e){return(e,l)=>{var t;return o(),r("div",Cd,[null!=(t=null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.filters)&&t.length?(o(),r("svg",xd,Vd)):(o(),r("svg",{key:1,class:g(["w-4 h-4 transition-transform",e.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Ad,2)),"ASC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),r("svg",Td,Id)):"DESC"===(null==(t=null==(t=e.column)?void 0:t.settings)?void 0:t.sort)?(o(),r("svg",Dd,Od)):L("",!0)])}}}),Bd=ue({__name:"EnsureAccessDialog",props:{title:{},subtitle:{},invalidAccess:{},alertClass:{}},emits:["done"],setup(e){return(l,e)=>{let t=Q("EnsureAccess"),a=Q("SlideOver");return l.invalidAccess?(o(),ne(a,{key:0,title:l.title,onDone:e[0]||(e[0]=e=>l.$emit("done")),"content-class":"relative flex-1"},ml({default:$e(()=>[we(t,{alertClass:l.alertClass,invalidAccess:l.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[l.subtitle?{name:"subtitle",fn:$e(()=>[_e(F(l.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):L("",!0)}}}),Hd=["for"],Rd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],Ed={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Nd=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),zd=[Nd],Ud=["id"],qd=["id"],Qd={inheritAttrs:!1},Kd=ue({...Qd,__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()}}),I());let s=v(()=>a.type||"text"),i=v(()=>a.label??Re(ft(a.id))),u=v(()=>a.placeholder??i.value);function d(e){return"range"===a.type?e.replace("shadow-sm ",""):e}let c=Je("ApiState",void 0),p=v(()=>_t.call({responseStatus:a.status??(null==c?void 0:c.error.value)},a.id)),f=v(()=>[ct.base,p.value?ct.invalid:d(ct.valid),a.inputClass]);return(t,e)=>(o(),r("div",{class:g([t.$attrs.class])},[z(t.$slots,"header",Se({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs)),i.value?(o(),r("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},F(i.value),11,Hd)):L("",!0),l("div",{class:g(d("mt-1 relative"))},[l("input",Se({ref_key:"inputElement",ref:n,type:s.value,name:t.id,id:t.id,class:f.value,placeholder:u.value,value:J(Xn)(s.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"},J(gt)(t.$attrs,["class","value"])),null,16,Rd),p.value?(o(),r("div",Ed,zd)):L("",!0)],2),p.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},F(p.value),9,Ud)):t.help?(o(),r("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},F(t.help),9,qd)):L("",!0),z(t.$slots,"footer",Se({inputElement:n.value,id:t.id,modelValue:t.modelValue,status:t.status},t.$attrs))],2))}}),Zd=["for"],Wd={class:"mt-1 relative"},Gd=["name","id","placeholder","aria-invalid","aria-describedby"],Jd=["id"],Xd=["id"],Yd={inheritAttrs:!1},ec=ue({...Yd,__name:"TextareaInput",props:{status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{}},setup(e){let t=e,a=v(()=>t.label??Re(ft(t.id))),n=v(()=>t.placeholder??a.value),s=Je("ApiState",void 0),i=v(()=>_t.call({responseStatus:t.status??(null==s?void 0:s.error.value)},t.id)),u=v(()=>["shadow-sm "+ct.base,i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ct.valid,t.inputClass]);return(t,e)=>(o(),r("div",{class:g([t.$attrs.class])},[a.value?(o(),r("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},F(a.value),11,Zd)):L("",!0),l("div",Wd,[l("textarea",Se({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!=i.value,"aria-describedby":t.id+"-error"},J(gt)(t.$attrs,["class"])),F(t.modelValue),17,Gd)]),i.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},F(i.value),9,Jd)):t.help?(o(),r("p",{key:2,class:"mt-2 text-sm text-gray-500",id:t.id+"-description"},F(t.help),9,Xd)):L("",!0)],2))}}),tc=["for"],sc=["id","name","value","aria-invalid","aria-describedby"],lc=["value"],nc=["id"],oc={inheritAttrs:!1},ac=ue({...oc,__name:"SelectInput",props:{status:{},id:{},modelValue:{},inputClass:{},label:{},labelClass:{},options:{},values:{},entries:{}},setup(e){let t=e,a=v(()=>t.label??Re(ft(t.id))),n=Je("ApiState",void 0),s=v(()=>_t.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id)),i=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(),r("div",{class:g([t.$attrs.class])},[a.value?(o(),r("label",{key:0,for:t.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},F(a.value),11,tc)):L("",!0),l("select",Se({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 disabled:bg-slate-50 dark:disabled:bg-slate-900 disabled:text-slate-500 disabled:border-slate-200 dark:disabled:border-slate-700 disabled:shadow-none",s.value?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"shadow-sm 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!=s.value,"aria-describedby":t.id+"-error"},J(gt)(t.$attrs,["class"])),[(o(!0),r(Me,null,Ie(i.value,e=>(o(),r("option",{value:e.key},F(e.value),9,lc))),256))],16,sc),s.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:t.id+"-error"},F(s.value),9,nc)):L("",!0)],2))}}),rc={class:"flex items-center h-5"},ic=["id","name","checked"],uc={class:"ml-3 text-sm"},dc=["for"],cc={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},fc={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},vc={inheritAttrs:!1},pc=ue({...vc,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{}){let t=e,a=v(()=>t.label??Re(ft(t.id))),n=Je("ApiState",void 0),s=v(()=>_t.call({responseStatus:t.status??(null==n?void 0:n.error.value)},t.id));return(t,e)=>(o(),r("div",{class:g(["relative flex items-start",t.$attrs.class])},[l("div",rc,[l("input",Se({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]},J(gt)(t.$attrs,["class"])),null,16,ic)]),l("div",uc,[l("label",{for:t.id,class:g("font-medium text-gray-700 dark:text-gray-300 "+(t.labelClass??""))},F(a.value),11,dc),s.value?(o(),r("p",cc,F(s.value),1)):t.help?(o(),r("p",fc,F(t.help),1)):L("",!0)])],2))}}),mc=["id"],hc=["for"],gc={class:"mt-1 relative"},yc=["id","name","value"],bc={class:"flex flex-wrap pb-1.5"},wc={class:"pt-1.5 pl-1"},kc={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"},_c=["onClick"],$c=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),Cc=[$c],xc={class:"pt-1.5 pl-1 shrink"},Lc=["type","name","id","aria-invalid","aria-describedby"],Vc=["id"],Mc=["onMouseover","onClick"],Sc={class:"block truncate"},Ac={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Tc=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),Fc=[Tc],Ic=["id"],Dc=["id"],jc={inheritAttrs:!1},Oc=ue({...jc,__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 s=v(()=>{return Ge((e=a.modelValue,a.converter?a.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),i=I(),u=I(!1),d=v(()=>{let l=p.value.toLowerCase();return a.allowableValues&&0!=a.allowableValues.length?a.allowableValues.length<1e3?a.allowableValues.filter(e=>!s.value.includes(e)&&e.toLowerCase().includes(l)):a.allowableValues.filter(e=>!s.value.includes(e)&&e.startsWith(l)):[]});let c=I(null),p=I(""),f=v(()=>a.type||"text"),m=v(()=>a.label??Re(ft(a.id))),h=Je("ApiState",void 0),y=v(()=>_t.call({responseStatus:a.status??(null==h?void 0:h.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=>S(s.value.filter(e=>e!=l));function x(e){var l;document.activeElement===e.target&&null!=(l=c.value)&&l.focus()}let k=I();function C(){u.value=!0,k.value=!0}function M(){O(T()),k.value=!1,setTimeout(()=>{k.value||(u.value=!1)},200)}function S(e){var l=a.string?e.join(","):e;n("update:modelValue",l)}function V(e){var l;"Backspace"==e.key&&0==p.value.length&&0<s.value.length&&w(s.value[s.value.length-1]),a.allowableValues&&0!=a.allowableValues.length&&("Escape"==e.code||"Tab"==e.code?u.value=!1:"Home"==e.code?(i.value=d.value[0],z()):"End"==e.code?(i.value=d.value[d.value.length-1],z()):"ArrowDown"==e.code?(u.value=!0,i.value?(l=d.value.indexOf(i.value),i.value=l+1<d.value.length?d.value[l+1]:d.value[0]):i.value=d.value[0],j()):"ArrowUp"==e.code?(i.value?(l=d.value.indexOf(i.value),i.value=0<=l-1?d.value[l-1]:d.value[d.value.length-1]):i.value=d.value[d.value.length-1],j()):"Enter"==e.code?i.value&&u.value?(O(i.value),e.preventDefault()):u.value=!1:u.value=0<d.value.length)}function T(){if(0==p.value.length)return"";let e=Po(p.value.trim(),",");return 0==(e=(e=","==e[0]?e.substring(1):e).trim()).length&&u.value&&0<d.value.length?i.value:e}function A(l){var e,t=T();0<t.length&&((e=a.delimiters.some(e=>e==l.key))&&l.preventDefault(),"Enter"==l.key||"NumpadEnter"==l.key||1==l.key.length&&e)&&O(t)}let $={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function z(){setTimeout(()=>{var e=Ts(`#${a.id}-tag li.active`);e&&e.scrollIntoView($)},0)}function j(){setTimeout(()=>{var e=Ts(`#${a.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded($):e.scrollIntoView($))},0)}function O(e){var l;0!==e.length&&(-1==(l=Array.from(s.value)).indexOf(e)&&l.push(e),S(l),p.value="",u.value=!1)}function E(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(s.value);t.split(e).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),S(l),p.value=""}}return(e,t)=>(o(),r("div",{class:g([e.$attrs.class]),id:e.id+"-tag",onmousemove:"cancelBlur=true"},[m.value?(o(),r("label",{key:0,for:e.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},F(m.value),11,hc)):L("",!0),l("div",gc,[l("input",{type:"hidden",id:e.id,name:e.id,value:s.value.join(",")},null,8,yc),l("button",{class:g(b.value),onClick:Ue(x,["prevent"]),onFocus:t[2]||(t[2]=e=>u.value=!0),tabindex:"-1"},[l("div",bc,[(o(!0),r(Me,null,Ie(s.value,t=>(o(),r("div",wc,[l("span",kc,[_e(F(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"},Cc,8,_c)])]))),256)),l("div",xc,[Pt(l("input",Se({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:V,onKeypress:A,onPaste:Ue(E,["prevent","stop"]),onFocus:C,onBlur:M,onClick:t[1]||(t[1]=e=>u.value=!0)},J(gt)(e.$attrs,["class","required"])),null,16,Lc),[[wo,p.value]])])])],34),u.value&&d.value.length?(o(),r("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/5 focus:outline-none sm:text-sm",onKeydown:V,id:e.id+"-options",role:"listbox"},[(o(!0),r(Me,null,Ie(d.value.slice(0,e.maxVisibleItems),t=>(o(),r("li",{class:g([t===i.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,i.value=l},onClick:e=>O(t),role:"option",tabindex:"-1"},[l("span",Sc,F(t),1)],42,Mc))),256))],40,Vc)):L("",!0),y.value?(o(),r("div",Ac,Fc)):L("",!0)]),y.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},F(y.value),9,Ic)):e.help?(o(),r("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},F(e.help),9,Dc)):L("",!0)],10,mc))}}),Pc={class:"relative flex-grow mr-2 sm:mr-4"},Bc=["for"],Hc={class:"block mt-2"},Rc={class:"sr-only"},Ec=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Nc={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},zc=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),Uc=[zc],qc=["id"],Qc=["id"],Kc={key:0},Zc=["title"],Wc=["alt","src"],Gc={key:1,class:"mt-3"},Jc={class:"w-full"},Xc={class:"pr-6 align-bottom pb-2"},Yc=["title"],e0=["src","onError"],t0=["href"],s0={key:1,class:"overflow-hidden"},l0={class:"align-top pb-2 whitespace-nowrap"},n0={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},o0=ue({__name:"FileInput",props:{multiple:{type:Boolean},status:{},id:{},inputClass:{},label:{},labelClass:{},help:{},placeholder:{},modelValue:{},values:{},files:{}},setup(e){let t,a=e,n=I(null),{assetsPathResolver:s,fallbackPathResolver:i}=Nt(),u={},d=I(),c=I((null==(t=a.files)?void 0:t.map(p))||[]);function p(e){return e.filePath=s(e.filePath),e}a.values&&0<a.values.length&&(c.value=a.values.map(e=>{var l=e.replace(/\\/g,"/");return{fileName:vn(Bt(l,"/"),"."),filePath:l,contentType:al(l)}}).map(p));let f=v(()=>a.label??Re(ft(a.id))),m=v(()=>a.placeholder??f.value),h=Je("ApiState",void 0),y=v(()=>_t.call({responseStatus:a.status??(null==h?void 0:h.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:bl(e),contentLength:e.size,contentType:e.type||al(e.name)}))},x=()=>{var e;return null==(e=n.value)?void 0:e.click()},k=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),C=v(()=>{var e;return 0<c.value.length?c.value[0].filePath:(e="string"==typeof a.modelValue?a.modelValue:a.values&&a.values[0])&&Ft(s(e))||null}),M=e=>!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function S(e){d.value=i(C.value)}return Et(wn),(e,t)=>(o(),r("div",{class:g(["flex",e.multiple?"flex-col":"justify-between"])},[l("div",Pc,[f.value?(o(),r("label",{key:0,for:e.id,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},F(f.value),11,Bc)):L("",!0),l("div",Hc,[l("span",Rc,F(e.help??f.value),1),l("input",Se({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,Ec),y.value?(o(),r("div",Nc,Uc)):L("",!0)]),y.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},F(y.value),9,qc)):e.help?(o(),r("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},F(e.help),9,Qc)):L("",!0)]),e.multiple?(o(),r("div",Gc,[l("table",Jc,[(o(!0),r(Me,null,Ie(c.value,t=>(o(),r("tr",null,[l("td",Xc,[l("div",{class:"flex w-full",title:k(t.filePath)?"":t.filePath},[l("img",{src:u[J(Ft)(t.filePath)]||J(s)(J(Ft)(t.filePath)),class:g(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>u[J(Ft)(t.filePath)]=J(i)(J(Ft)(t.filePath))},null,42,e0),k(t.filePath)?(o(),r("span",s0,F(t.fileName),1)):(o(),r("a",{key:0,href:J(s)(t.filePath||""),target:"_blank",class:"overflow-hidden"},F(t.fileName),9,t0))],8,Yc)]),l("td",l0,[t.contentLength&&0<t.contentLength?(o(),r("span",n0,F(J(kl)(t.contentLength)),1)):L("",!0)])]))),256))])])):(o(),r("div",Kc,[C.value?(o(),r("div",{key:0,class:"shrink-0 cursor-pointer",title:k(C.value)?"":C.value},[l("img",{onClick:x,class:g(["h-16 w-16",M(C.value)]),alt:"Current "+(f.value??""),src:d.value||J(s)(C.value),onError:S},null,42,Wc)],8,Zc)):L("",!0)]))],2))}}),a0=["id"],r0=["for"],i0={class:"relative mt-1"},u0=["id","placeholder"],d0=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 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z","clip-rule":"evenodd"})],-1),c0=[d0],f0=["id"],v0=["onMouseover","onClick"],p0=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",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"})],-1),m0=[p0],h0={key:2,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",tabindex:"-1"},g0=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),y0=[g0],b0=["id"],w0=["id"],k0=ue({__name:"Autocomplete",props:{status:{},id:{},type:{},label:{},help:{},placeholder:{},multiple:{type:Boolean,default:!1},required:{type:Boolean},options:{default:()=>[]},modelValue:{},match:{},viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=I(!1),s=e,i=a;function u(e){return Array.isArray(s.modelValue)&&0<=s.modelValue.indexOf(e)}t({toggle:j});let d=v(()=>s.label??Re(ft(s.id))),c=Je("ApiState",void 0),p=v(()=>_t.call({responseStatus:s.status??(null==c?void 0:c.error.value)},s.id)),f=v(()=>[ct.base,p.value?ct.invalid:ct.valid]),m=I(null),h=I(""),y=I(null),b=I(s.viewCount),w=I([]),x=v(()=>h.value?s.options.filter(e=>s.match(e,h.value)).slice(0,b.value):s.options),k=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];let C=[",",`
|
|
2
|
-
`,"\t"];function M(e){var l=null==(t=e.clipboardData)?void 0:t.getData("Text");if(l){var t=C.some(e=>l.includes(e));if(s.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(l=>s.options.find(e=>s.match(e,l))).filter(e=>!!e);if(0<t.length){h.value="",n.value=!1,y.value=null;let e=Array.from(s.modelValue||[]);t.forEach(l=>{u(l)?e=e.filter(e=>e!=l):e.push(l)}),i("update:modelValue",e),Ms()}}}else{t=s.options.filter(e=>s.match(e,l));1==t.length&&(E(t[0]),n.value=!1,Ms())}}}function S(e){k.indexOf(e.code)||O()}function V(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<w.value.length?w.value[l+1]:w.value[0]):y.value=w.value[0],$()):"ArrowUp"==e.code?(y.value?(l=w.value.indexOf(y.value),y.value=0<=l-1?w.value[l-1]:w.value[w.value.length-1]):y.value=w.value[w.value.length-1],$()):"Enter"==e.code&&(y.value?(E(y.value),s.multiple||(e.preventDefault(),Ms())):n.value=!1):"ArrowDown"==e.code&&(n.value=!0,y.value=w.value[0]))}let T={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function A(){setTimeout(()=>{var e=Ts(`#${s.id}-autocomplete li.active`);e&&e.scrollIntoView(T)},0)}function $(){setTimeout(()=>{var e=Ts(`#${s.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(T):e.scrollIntoView(T))},0)}function j(e){var l;(n.value=e)&&(O(),null!=(l=m.value))&&l.focus()}function O(){n.value=!0,H()}function E(l){if(h.value="",n.value=!1,s.multiple){let e=Array.from(s.modelValue||[]);u(l)?e=e.filter(e=>e!=l):e.push(l),y.value=null,i("update:modelValue",e)}else{let e=l;s.modelValue==l&&(e=null),i("update:modelValue",e)}}function H(){w.value=x.value}return Lt(h,H),(e,t)=>(o(),r("div",{id:e.id+"-autocomplete"},[d.value?(o(),r("label",{key:0,for:e.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},F(d.value),9,r0)):L("",!0),l("div",i0,[Pt(l("input",Se({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=>h.value=e),class:f.value,placeholder:e.multiple||!e.modelValue?e.placeholder:"",onFocus:O,onKeydown:V,onKeyup:S,onClick:O,onPaste:M,required:!1},e.$attrs),null,16,u0),[[ko,h.value]]),l("button",{type:"button",onClick:t[1]||(t[1]=e=>j(!n.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},c0),n.value?(o(),r("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/5 focus:outline-none sm:text-sm",onKeydown:V,id:e.id+"-options",role:"listbox"},[(o(!0),r(Me,null,Ie(w.value,t=>(o(),r("li",{class:g([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+=s.viewCount,H()));var l},onClick:e=>E(t),role:"option",tabindex:"-1"},[z(e.$slots,"item",Xt(As(t))),u(t)?(o(),r("span",{key:0,class:g(["absolute inset-y-0 right-0 flex items-center pr-4",t===y.value?"text-white":"text-indigo-600"])},m0,2)):L("",!0)],42,v0))),256))],40,f0)):!e.multiple&&e.modelValue?(o(),r("div",{key:1,onKeydown:V,onClick:t[2]||(t[2]=e=>j(!n.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[z(e.$slots,"item",Xt(As(e.modelValue)))],32)):L("",!0),p.value?(o(),r("div",h0,y0)):L("",!0)]),p.value?(o(),r("p",{key:1,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},F(p.value),9,b0)):e.help?(o(),r("p",{key:2,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},F(e.help),9,w0)):L("",!0)],8,a0))}}),_0=["id","name","value"],$0={class:"block truncate"},C0=ue({__name:"Combobox",props:{id:{},modelValue:{},multiple:{type:Boolean},options:{},values:{},entries:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){let n=e,s=(t({toggle(e){var l;null!=(l=d.value)&&l.toggle(e)}}),a);function i(e){s("update:modelValue",e)}let u=v(()=>null!=n.multiple?n.multiple:Array.isArray(n.modelValue)),d=I();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=I(u.value?[]:null);at(function(){let l=n.modelValue&&"object"==typeof n.modelValue&&!Array.isArray(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=Q("Autocomplete");return o(),r(Me,null,[l("input",{type:"hidden",id:e.id,name:e.id,value:m.value},null,8,_0),we(a,Se({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),i]}),{item:$e(({value:e})=>[l("span",$0,F(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),x0=ue({__name:"DynamicInput",props:{input:{},modelValue:{},api:{}},emits:["update:modelValue"],setup(e,{emit:l}){let t=e,a=l,c=v(()=>t.input.type||"text"),r="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),p=v(()=>gt(t.input,r)),f=I("file"===c.value?null:t.modelValue[t.input.id]),m=(Lt(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:Bt(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:Bt(e,"/")}):"object"==typeof e&&l.push(e)}),l}}));return(e,l)=>{var t,a=Q("SelectInput"),r=Q("CheckboxInput"),n=Q("TagInput"),s=Q("Combobox"),i=Q("FileInput"),u=Q("TextareaInput"),d=Q("MarkdownInput"),v=Q("TextInput");return J(X).component(c.value)?(o(),ne(cn(J(X).component(c.value)),Se({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(),ne(a,Se({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(),ne(r,Se({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==(r=e.input.css)?void 0:r.label},p.value),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==c.value?(o(),ne(n,Se({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==(r=e.input.css)?void 0:r.label,allowableValues:e.input.allowableValues,string:"String"==(null==(n=e.input.prop)?void 0:n.type)},p.value),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==c.value?(o(),ne(s,Se({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==(r=e.input.css)?void 0:r.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(),ne(i,Se({key:5,id:e.input.id,status:null==(n=e.api)?void 0:n.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(),ne(u,Se({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==(r=e.input.css)?void 0:r.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(),ne(d,Se({key:7,id:e.input.id,modelValue:f.value,"onUpdate:modelValue":l[7]||(l[7]=e=>f.value=e),status:null==(n=e.api)?void 0:n.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(),ne(v,Se({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==(r=e.input.css)?void 0:r.label},p.value),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),L0={class:"lookup-field"},V0=["name","value"],M0={key:0,class:"flex justify-between"},S0=["for"],A0={key:0,class:"flex items-center"},T0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},F0=l("span",{class:"sr-only"},"Clear",-1),I0=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),D0=[F0,I0],j0={key:1,class:"mt-1 relative"},O0={class:"w-full inline-flex truncate"},P0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},B0=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),H0=["id"],R0=["id"],E0=ue({__name:"LookupInput",props:{id:{},status:{},input:{},metadataType:{},modelValue:{},label:{},labelClass:{},help:{}},emits:["update:modelValue"],setup(e,{emit:t}){let a=Nt().config,n=ut().metadataApi,s=e,i=t,u=v(()=>s.id||s.input.id),d=v(()=>s.label??Re(ft(u.value))),c=Je("ApiState",void 0),p=Je("client"),f=v(()=>_t.call({responseStatus:s.status??(null==c?void 0:c.error.value)},u.value)),m=I(""),h=I(""),y=v(()=>ke(s.modelValue,u.value)),b=v(()=>ot(s.metadataType).find(e=>e.name.toLowerCase()==u.value.toLowerCase())),w=v(()=>{var e;return(null==(e=vt(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||a.value.tableIcon});let x=v(()=>{var e,l,t,a,r;return(r=(null==(e=b.value)?void 0:e.ref)??("lookup"==s.input.type?{model:s.metadataType.name,refId:(null==(l=ss(s.metadataType))?void 0:l.name)??"id",refLabel:null==(a=null==(t=s.metadataType.properties)?void 0:t.find(e=>"String"==e.type&&!e.isPrimaryKey))?void 0:a.name}:null))?s.input.options?Object.assign({},r,qs(s.input.options,{input:s.input,$typeFields:ot(s.metadataType).map(e=>e.name),...X.config.scopeWhitelist})):r:null}),k;function C(){s.modelValue[u.value]=null,m.value=""}return at(async()=>{var e;k=Je("ModalProvider",void 0);let t=s.modelValue,a=(s.modelValue[u.value]||(s.modelValue[u.value]=null),b.value),r=x.value;if(a&&r){m.value="";let l=null==r.selfId?ke(t,a.name):ke(t,r.selfId);null!=(l=ps(l)?ke(t,r.refId):l)&&(e=null==(e=n.value)?void 0:e.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==r.model}),console.debug("LookupInput queryOp",e),null==e||ps(e=ke(t,a.name))||(m.value=""+e,h.value=a.name,null!=r.refLabel&&((e=ot(s.metadataType).filter(e=>e.type==r.model)).length||console.warn(`Could not find ${r.model} Property on `+s.metadataType.name),null!=(e=(e=e.map(e=>ke(t,e.name)).filter(e=>!!e)).length<=1?e[0]:e.find(e=>e[r.refId??"id"]==l))?(e=ke(e,r.refLabel))&&(m.value=""+e,Wt.setValue(r.model,l,r.refLabel,e)):(e=1==(null==(e=a.attributes)?void 0:e.some(e=>"Computed"==e.name)),e=await Wt.getOrFetchValue(p,n.value,r.model,r.refId,r.refLabel,e,l),m.value=e||r.model+": "+m.value))))}else console.warn(`No RefInfo for property '${u.value}'`)}),(e,t)=>{var a=Q("Icon");return o(),r("div",L0,[l("input",{type:"hidden",name:u.value,value:y.value},null,8,V0),d.value?(o(),r("div",M0,[l("label",{for:u.value,class:g("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},F(d.value),11,S0),y.value?(o(),r("div",A0,[l("span",T0,F(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"},D0)])):L("",!0)])):L("",!0),x.value?(o(),r("div",j0,[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=x.value)&&(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,Wt.setRefValue(a,e),a),e&&(l=ke(e,a.refId),m.value=Wt.setRefValue(a,e)||l,(t=J(s.modelValue))[u.value]=l,i("update:modelValue",t))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[l("span",O0,[l("span",P0,[we(a,{class:"mr-1 w-5 h-5",image:w.value},null,8,["image"]),l("span",null,F(m.value),1)])]),B0])])):L("",!0),f.value?(o(),r("p",{key:2,class:"mt-2 text-sm text-red-500",id:u.value+"-error"},F(f.value),9,H0)):e.help?(o(),r("p",{key:3,class:"mt-2 text-sm text-gray-500",id:u.value+"-description"},F(e.help),9,R0)):L("",!0)])}}}),N0=ue({__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 i=e,n=a;function s(){var e=He();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function u(e,l){i.modelValue[e]=l,n("update:modelValue",i.modelValue),s()}t({forceUpdate:s,props:i,updateValue:u});let{metadataApi:d,apiOf:c,typeOf:p,typeOfRef:f,createFormLayout:m}=ut(),h=v(()=>i.type||zt(i.modelValue)),y=v(()=>i.metaType??p(h.value)),b=v(()=>{var e;return f(null==(e=null==(e=d.value)?void 0:e.operations.find(e=>e.request.name==h.value))?void 0:e.dataModel)||y.value});function w(){var e,l=y.value;if(!l){if(i.formLayout)return e=i.formLayout.map(e=>{var l={name:e.id,type:Jo(e.type)},l=Object.assign({prop:l},e);return i.configureField&&i.configureField(l),l}),i.configureFormLayout&&i.configureFormLayout(e),e;throw new Error(`MetadataType for ${h.value} not found`)}let a=ot(l),r=b.value,t=i.formLayout?Array.from(i.formLayout):m(l),n=[],s=c(l.name);return t.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==r?void 0:r.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),i.configureField&&i.configureField(l),n.push(l))}),i.configureFormLayout&&i.configureFormLayout(n),n}return(t,a)=>{let e,n=Q("ErrorSummary"),s=Q("LookupInput"),i=Q("DynamicInput");return o(),r(Me,null,[t.hideSummary?L("",!0):(o(),ne(n,{key:0,status:null==(e=t.api)?void 0:e.error,except:w().filter(e=>"hidden"!=e.type).map(e=>e.id)},null,8,["status","except"])),l("div",{class:g(t.flexClass)},[l("div",{class:g(t.divideClass)},[l("div",{class:g(t.spaceClass)},[l("fieldset",{class:g(t.fieldsetClass)},[(o(!0),r(Me,null,Ie(w(),l=>{var e;return o(),r("div",{key:l.id,class:g(["w-full",(null==(e=l.css)?void 0:e.field)??("textarea"==l.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==l.type?" flex items-center":"")),"hidden"==l.type?"hidden":""])},["lookup"===l.type||null!=(null==(e=l.prop)?void 0:e.ref)&&"file"!=l.type&&!l.prop.isPrimaryKey?(o(),ne(s,{key:0,metadataType:b.value,input:l,modelValue:t.modelValue,"onUpdate:modelValue":e=>{u(l.id,ke(e,l.id))},status:null==(e=t.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"])):(o(),ne(i,{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"]))],2)}),128))],2)],2)],2)],2)],64)}}}),z0={key:0},U0={class:"text-red-700"},q0=l("b",null,"type",-1),Q0={key:0},K0={key:2},Z0=["innerHTML"],W0=l("input",{type:"submit",class:"hidden"},null,-1),G0={class:"flex justify-end"},J0=l("div",null,null,-1),X0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Y0=l("div",{class:"fixed inset-0"},null,-1),ef={class:"fixed inset-0 overflow-hidden"},tf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},sf={class:"flex-1"},lf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},nf={class:"flex items-start justify-between space-x-3"},of={class:"space-y-1"},af={key:0},rf={key:2},uf=["innerHTML"],df={class:"flex h-7 items-center"},cf={class:"flex justify-end"},ff=ue({__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","done","update:modelValue"],setup(e,{expose:t,emit:a}){let s=e,i=a,C=I(),M=I(1),S=I();function n(){M.value++,D.value=m();var e=He();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}ms("ModalProvider",{openModal:function(e,l){V.value=e,u.value=l}});let V=I(),u=I();async function T(e){u.value&&u.value(e),V.value=void 0,u.value=void 0}let d=ys(),c=so().getTypeName,{typeOf:p,createDto:f}=ut(),A=I(new tt),$=v(()=>s.panelClass||Ee.panelClass(s.formStyle)),j=v(()=>s.formClass||"card"==s.formStyle?"shadow sm:rounded-md":Gt.formClass),O=v(()=>s.headingClass||Ee.headingClass(s.formStyle)),E=v(()=>s.subHeadingClass||Ee.subHeadingClass(s.formStyle)),H=v(()=>("string"==typeof s.buttonsClass?s:Ee).buttonsClass),B=v(()=>{var e;return s.type?c(s.type):null!=(e=s.modelValue)&&e.getTypeName?s.modelValue.getTypeName():null}),_=v(()=>s.metaType??p(B.value)),m=()=>s.modelValue||h(),D=I(m()),R=v(()=>d.loading.value),P=v(()=>{var e;return null!=s.heading?s.heading:(null==(e=_.value)?void 0:e.description)||Re(B.value)});function h(){return"string"==typeof s.type?f(s.type):s.type?new s.type:s.modelValue}async function N(e){var l,t,a,r,n;e&&"FORM"==e.tagName?(l=h(),n=Ge(null==l?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ge(null==l?void 0:l.createResponse,e=>"function"==typeof e?e():null),a=s.jsconfig,hl.hasRequestBody(n)?(n=new l.constructor,r=new FormData(e),A.value=t?await d.apiFormVoid(n,r,{jsconfig:a}):await d.apiForm(n,r,{jsconfig:a})):(n=new l.constructor(Bo(D.value)),console.debug("AutoForm.submit",n),A.value=t?await d.apiVoid(n,{jsconfig:a}):await d.api(n,{jsconfig:a})),A.value.succeeded?(i("success",A.value.response),q()):i("error",A.value.error)):console.error("Not a valid form",e)}function U(e){i("update:modelValue",e)}function y(){i("done")}t({forceUpdate:n,props:s,setModel:async function(e){Object.assign(D.value,e),n(),await Ot(()=>null)},formFields:C,submit:async function(){N(S.value)},close:q,model:D});let b=I(!1),J=I(""),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"}};function q(){"slideOver"==s.formStyle?b.value=!1:y()}Lt(b,()=>{xt(x,J,b.value),b.value||setTimeout(y,700)}),b.value=!0;let w=e=>{"Escape"===e.key&&q()};return at(()=>window.addEventListener("keydown",w)),Et(()=>window.removeEventListener("keydown",w)),(t,e)=>{let a,n,s,i,u,d,v,c,p,f,m,h=Q("AutoFormFields"),y=Q("FormLoading"),b=Q("PrimaryButton"),w=Q("CloseButton"),x=Q("SecondaryButton"),k=Q("ModalLookup");return o(),r("div",null,[_.value?"card"==t.formStyle?(o(),r("div",{key:1,class:g($.value)},[l("form",{ref_key:"elForm",ref:S,onSubmit:e[0]||(e[0]=Ue(e=>N(e.target),["prevent"])),autocomplete:"off",class:g(t.innerFormClass)},[l("div",{class:g(t.bodyClass)},[l("div",{class:g(t.headerClass)},[t.$slots.heading?(o(),r("div",Q0,[z(t.$slots,"heading")])):(o(),r("h3",{key:1,class:g(O.value)},F(P.value),3)),t.$slots.subheading?(o(),r("div",K0,[z(t.$slots,"subheading")])):t.subHeading?(o(),r("p",{key:3,class:g(E.value)},F(t.subHeading),3)):null!=(a=_.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",E.value]),innerHTML:null==(n=_.value)?void 0:n.notes},null,10,Z0)):L("",!0)],2),z(t.$slots,"header",{instance:null==(s=He())?void 0:s.exposed,model:D.value}),W0,(o(),ne(h,{ref_key:"formFields",ref:C,key:M.value,type:t.type,modelValue:D.value,"onUpdate:modelValue":U,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),z(t.$slots,"footer",{instance:null==(i=He())?void 0:i.exposed,model:D.value})],2),z(t.$slots,"buttons",{},()=>{var e;return[l("div",{class:g(H.value)},[l("div",null,[z(t.$slots,"leftbuttons",{instance:null==(e=He())?void 0:e.exposed,model:D.value})]),l("div",null,[t.showLoading&&R.value?(o(),ne(y,{key:0})):L("",!0)]),l("div",G0,[J0,we(b,{disabled:R.value||!!t.allowSubmit&&!t.allowSubmit(D.value)},{default:$e(()=>[_e(F(t.submitLabel),1)]),_:1},8,["disabled"]),z(t.$slots,"rightbuttons",{instance:null==(e=He())?void 0:e.exposed,model:D.value})])],2)]})],34)],2)):(o(),r("div",X0,[Y0,l("div",ef,[l("div",{onMousedown:q,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",J.value])},[l("form",{ref_key:"elForm",ref:S,class:g(j.value),onSubmit:e[1]||(e[1]=Ue(e=>N(e.target),["prevent"]))},[l("div",tf,[l("div",sf,[l("div",lf,[l("div",nf,[l("div",of,[t.$slots.heading?(o(),r("div",af,[z(t.$slots,"heading")])):(o(),r("h3",{key:1,class:g(O.value)},F(P.value),3)),t.$slots.subheading?(o(),r("div",rf,[z(t.$slots,"subheading")])):t.subHeading?(o(),r("p",{key:3,class:g(E.value)},F(t.subHeading),3)):null!=(u=_.value)&&u.notes?(o(),r("p",{key:4,class:g(["notes",E.value]),innerHTML:null==(d=_.value)?void 0:d.notes},null,10,uf)):L("",!0)]),l("div",df,[we(w,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:q})])])]),z(t.$slots,"header",{instance:null==(v=He())?void 0:v.exposed,model:D.value}),(o(),ne(h,{ref_key:"formFields",ref:C,key:M.value,type:t.type,modelValue:D.value,"onUpdate:modelValue":U,api:A.value,configureField:t.configureField,configureFormLayout:t.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),z(t.$slots,"footer",{instance:null==(c=He())?void 0:c.exposed,model:D.value})])]),l("div",{class:g(H.value)},[l("div",null,[z(t.$slots,"leftbuttons",{instance:null==(p=He())?void 0:p.exposed,model:D.value})]),l("div",null,[t.showLoading&&R.value?(o(),ne(y,{key:0})):L("",!0)]),l("div",cf,[we(x,{onClick:q,disabled:R.value},{default:$e(()=>[_e("Cancel")]),_:1},8,["disabled"]),we(b,{class:"ml-4",disabled:R.value||!!t.allowSubmit&&!t.allowSubmit(D.value)},{default:$e(()=>[_e(F(t.submitLabel),1)]),_:1},8,["disabled"]),z(t.$slots,"rightbuttons",{instance:null==(f=He())?void 0:f.exposed,model:D.value})])],2)],34)],2)],32)],32)])])):(o(),r("div",z0,[l("p",U0,[_e("Could not create form for unknown "),q0,_e(" "+F(B.value),1)])])),"ModalLookup"==(null==(m=V.value)?void 0:m.name)&&V.value.ref?(o(),ne(k,{key:3,"ref-info":V.value.ref,onDone:T,configureField:t.configureField},null,8,["ref-info","configureField"])):L("",!0)])}}}),vf={key:0},pf={class:"text-red-700"},mf=l("b",null,"type",-1),hf={key:0},gf={key:2},yf=["innerHTML"],bf={class:"flex justify-end"},wf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},kf=l("div",{class:"fixed inset-0"},null,-1),_f={class:"fixed inset-0 overflow-hidden"},$f={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Cf={class:"flex-1"},xf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Lf={class:"flex items-start justify-between space-x-3"},Vf={class:"space-y-1"},Mf={key:0},Sf={key:2},Af=["innerHTML"],Tf={class:"flex h-7 items-center"},Ff={class:"flex justify-end"},If=ue({__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 n=e,s=a,c=I(),p=I(1);function i(){p.value++,null!=(e=c.value)&&e.forceUpdate();var e=He();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function f(e){}ms("ModalProvider",{openModal:function(e,l){m.value=e,u.value=l}});let m=I(),u=I();async function h(e){u.value&&u.value(e),m.value=void 0,u.value=void 0}let{typeOf:d,typeProperties:y,Crud:b,createDto:w,formValues:x}=ut(),k=v(()=>zt(n.type)),C=v(()=>d(k.value)),M=I("string"==typeof n.type?w(n.type):n.type?new n.type:null),S=(t({forceUpdate:i,props:n,setModel:function(e){Object.assign(M.value,e),i()},formFields:c,model:M}),v(()=>n.panelClass||Ee.panelClass(n.formStyle))),V=v(()=>n.formClass||Ee.formClass(n.formStyle)),T=v(()=>n.headingClass||Ee.headingClass(n.formStyle)),A=v(()=>n.subHeadingClass||Ee.subHeadingClass(n.formStyle)),$=v(()=>n.buttonsClass||Ee.buttonsClass),j=v(()=>b.model(C.value)),O=v(()=>{var e;return n.heading||(null==(e=d(k.value))?void 0:e.description)||(j.value?"New "+Re(j.value):Re(k.value))}),E=I(new tt),H=ys(),B=v(()=>H.loading.value);async function _(e){var l,t,a,r=e.target;n.autosave?(t=Ge(null==(t=M.value)?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==Ge(null==(l=M.value)?void 0:l.createResponse,e=>"function"==typeof e?e():null),hl.hasRequestBody(t)?(t=new M.value.constructor,a=new FormData(r),E.value=l?await H.apiFormVoid(t,a,{jsconfig:"eccn"}):await H.apiForm(t,a,{jsconfig:"eccn"})):(t=x(r,y(C.value)),a=new M.value.constructor(t),E.value=l?await H.apiVoid(a,{jsconfig:"eccn"}):await H.api(a,{jsconfig:"eccn"})),E.value.succeeded?(r.reset(),s("save",E.value.response)):s("error",E.value.error)):s("save",new M.value.constructor(x(r,y(C.value))))}function D(){s("done")}X.interceptors.has("AutoCreateForm.new")&&X.interceptors.invoke("AutoCreateForm.new",{props:n,model:M});let R=I(!1),P=I(""),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 N(){"slideOver"==n.formStyle?R.value=!1:D()}Lt(R,()=>{xt(q,P,R.value),R.value||setTimeout(D,700)}),R.value=!0;let U=e=>{"Escape"===e.key&&N()};return at(()=>window.addEventListener("keydown",U)),Et(()=>window.removeEventListener("keydown",U)),(e,t)=>{var a,n=Q("AutoFormFields"),s=Q("FormLoading"),i=Q("SecondaryButton"),u=Q("PrimaryButton"),d=Q("CloseButton"),v=Q("ModalLookup");return o(),r("div",null,[C.value?"card"==e.formStyle?(o(),r("div",{key:1,class:g(S.value)},[l("form",{onSubmit:Ue(_,["prevent"])},[l("div",{class:g(V.value)},[l("div",null,[e.$slots.heading?(o(),r("div",hf,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(T.value)},F(O.value),3)),e.$slots.subheading?(o(),r("div",gf,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(A.value)},F(e.subHeading),3)):null!=(a=C.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=C.value)?void 0:a.notes},null,10,yf)):L("",!0)]),z(e.$slots,"header",{formInstance:null==(a=He())?void 0:a.exposed,model:M.value}),(o(),ne(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:E.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),z(e.$slots,"footer",{formInstance:null==(a=He())?void 0:a.exposed,model:M.value})],2),l("div",{class:g($.value)},[l("div",null,[e.showLoading&&J(B)?(o(),ne(s,{key:0})):L("",!0)]),l("div",bf,[e.showCancel?(o(),ne(i,{key:0,onClick:N,disabled:J(B)},{default:$e(()=>[_e("Cancel")]),_:1},8,["disabled"])):L("",!0),we(u,{type:"submit",class:"ml-4",disabled:J(B)},{default:$e(()=>[_e("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),r("div",wf,[kf,l("div",_f,[l("div",{onMousedown:N,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",P.value])},[l("form",{class:g(V.value),onSubmit:Ue(_,["prevent"])},[l("div",$f,[l("div",Cf,[l("div",xf,[l("div",Lf,[l("div",Vf,[e.$slots.heading?(o(),r("div",Mf,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(T.value)},F(O.value),3)),e.$slots.subheading?(o(),r("div",Sf,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(A.value)},F(e.subHeading),3)):null!=(a=C.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",A.value]),innerHTML:null==(a=C.value)?void 0:a.notes},null,10,Af)):L("",!0)]),l("div",Tf,[we(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:N})])])]),z(e.$slots,"header",{formInstance:null==(a=He())?void 0:a.exposed,model:M.value}),(o(),ne(n,{ref_key:"formFields",ref:c,key:p.value,modelValue:M.value,"onUpdate:modelValue":f,api:E.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),z(e.$slots,"footer",{formInstance:null==(d=He())?void 0:d.exposed,model:M.value})])]),l("div",{class:g($.value)},[l("div",null,[e.showLoading&&J(B)?(o(),ne(s,{key:0})):L("",!0)]),l("div",Ff,[e.showCancel?(o(),ne(i,{key:0,onClick:N,disabled:J(B)},{default:$e(()=>[_e("Cancel")]),_:1},8,["disabled"])):L("",!0),we(u,{type:"submit",class:"ml-4",disabled:J(B)},{default:$e(()=>[_e("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),r("div",vf,[l("p",pf,[_e("Could not create form for unknown "),mf,_e(" "+F(k.value),1)])])),"ModalLookup"==(null==(a=m.value)?void 0:a.name)&&m.value.ref?(o(),ne(v,{key:3,"ref-info":m.value.ref,onDone:h,configureField:e.configureField},null,8,["ref-info","configureField"])):L("",!0)])}}}),Df={key:0},jf={class:"text-red-700"},Of=l("b",null,"type",-1),Pf={key:0},Bf={key:2},Hf=["innerHTML"],Rf={class:"flex justify-end"},Ef={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Nf=l("div",{class:"fixed inset-0"},null,-1),zf={class:"fixed inset-0 overflow-hidden"},Uf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},qf={class:"flex-1"},Qf={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Kf={class:"flex items-start justify-between space-x-3"},Zf={class:"space-y-1"},Wf={key:0},Gf={key:2},Jf=["innerHTML"],Xf={class:"flex h-7 items-center"},Yf={class:"flex justify-end"},ev=ue({__name:"AutoEditForm",props:{modelValue:{},deleteType:{},type:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},buttonsClass:{},heading:{},subHeading:{},autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean},configureField:{},configureFormLayout:{}},emits:["done","save","delete","error"],setup(e,{expose:t,emit:q}){let n=e,s=q,p=I(),f=I(1);function m(e){}ms("ModalProvider",{openModal:function(e,l){h.value=e,a.value=l}});let h=I(),a=I();async function W(e){a.value&&a.value(e),h.value=void 0,a.value=void 0}let{typeOf:i,apiOf:G,typeProperties:u,createFormLayout:Z,getPrimaryKey:K,Crud:c,createDto:d,formValues:y}=ut(),b=v(()=>zt(n.type)),w=v(()=>i(b.value)),x=()=>"string"==typeof n.type?d(n.type,us(n.modelValue)):n.type?new n.type(us(n.modelValue)):null,k=I(x()),Y=(t({forceUpdate:function(){f.value++,k.value=x();var e=He();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:n,setModel:function(e){Object.assign(k.value,e)},formFields:p,model:k}),v(()=>n.panelClass||Ee.panelClass(n.formStyle))),C=v(()=>n.formClass||Ee.formClass(n.formStyle)),M=v(()=>n.headingClass||Ee.headingClass(n.formStyle)),S=v(()=>n.subHeadingClass||Ee.subHeadingClass(n.formStyle)),V=v(()=>n.buttonsClass||Ee.buttonsClass),T=v(()=>c.model(w.value)),A=v(()=>{var e;return n.heading||(null==(e=i(b.value))?void 0:e.description)||(T.value?"Update "+Re(T.value):Re(b.value))}),$=I(new tt),j=Object.assign({},us(n.modelValue)),O=(X.interceptors.has("AutoEditForm.new")&&X.interceptors.invoke("AutoEditForm.new",{props:n,model:k,origModel:j}),ys()),E=v(()=>O.loading.value),H=()=>Ge(i(c.model(w.value)),e=>K(e));function ee(e){var{op:l,prop:t}=e;l&&(c.isPatch(l)||c.isUpdate(l))&&(e.disabled=null==t?void 0:t.isPrimaryKey),n.configureField&&n.configureField(e)}async function B(e){var a=e.target;if(n.autosave){let e=Ge(null==(r=k.value)?void 0:r.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==Ge(null==(r=k.value)?void 0:r.createResponse,e=>"function"==typeof e?e():null),d=H();if(hl.hasRequestBody(e)){let e=new k.value.constructor,l=ke(n.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 r=b.value&&G(b.value);if(r&&c.isPatch(r)){let s=Z(w.value),o={};if(d&&(o[d.name]=l),s.forEach(t=>{var a=t.id,r=ke(j,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var n=i.get(a);X.interceptors.has("AutoEditForm.save.formLayout")&&X.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:r,formLayout:s,input:t,newValue:n});let e=null!=n,l="checkbox"===t.type?e!=!!r:"file"===t.type?e:n!=r;(l=n||r?l:!1)&&(n?o[a]=n:"file"!==t.type&&u.push(a))}}),X.interceptors.has("AutoEditForm.save")&&X.interceptors.invoke("AutoEditForm.save",{origModel:j,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 N()}r=0<u.length?{jsconfig:"eccn",reset:u}:{jsconfig:"eccn"};$.value=t?await O.apiFormVoid(e,i,r):await O.apiForm(e,i,r)}else{r=y(a,u(w.value)),r=(d&&!ke(r,d.name)&&(r[d.name]=ke(n.modelValue,d.name)),new k.value.constructor(r));$.value=t?await O.apiVoid(r,{jsconfig:"eccn"}):await O.api(r,{jsconfig:"eccn"})}$.value.succeeded?(a.reset(),s("save",$.value.response)):s("error",$.value.error)}else s("save",new k.value.constructor(y(a,u(w.value))))}async function _(e){var l=H(),t=l?ke(n.modelValue,l.name):null;t?(l={[l.name]:t},t="string"==typeof n.deleteType?d(n.deleteType,l):n.deleteType?new n.deleteType(l):null,null==Ge(t.createResponse,e=>"function"==typeof e?e():null)?$.value=await O.apiVoid(t):$.value=await O.api(t),$.value.succeeded?s("delete",$.value.response):s("error",$.value.error)):console.error(`Could not find Primary Key for Type ${b.value} (${T.value})`)}function D(){s("done")}let R=I(!1),P=I(""),le={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 N(){"slideOver"==n.formStyle?R.value=!1:D()}Lt(R,()=>{xt(le,P,R.value),R.value||setTimeout(D,700)}),R.value=!0;let U=e=>{"Escape"===e.key&&N()};return at(()=>window.addEventListener("keydown",U)),Et(()=>window.removeEventListener("keydown",U)),(e,t)=>{var a,n=Q("AutoFormFields"),s=Q("ConfirmDelete"),i=Q("FormLoading"),u=Q("SecondaryButton"),d=Q("PrimaryButton"),v=Q("CloseButton"),c=Q("ModalLookup");return o(),r("div",null,[w.value?"card"==e.formStyle?(o(),r("div",{key:1,class:g(Y.value)},[l("form",{onSubmit:Ue(B,["prevent"])},[l("div",{class:g(C.value)},[l("div",null,[e.$slots.heading?(o(),r("div",Pf,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(M.value)},F(A.value),3)),e.$slots.subheading?(o(),r("div",Bf,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(S.value)},F(e.subHeading),3)):null!=(a=w.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=w.value)?void 0:a.notes},null,10,Hf)):L("",!0)]),z(e.$slots,"header",{formInstance:null==(a=He())?void 0:a.exposed,model:k.value}),(o(),ne(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:k.value,"onUpdate:modelValue":m,api:$.value,configureField:e.configureField,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),z(e.$slots,"footer",{formInstance:null==(a=He())?void 0:a.exposed,model:k.value})],2),l("div",{class:g(V.value)},[l("div",null,[e.deleteType?(o(),ne(s,{key:0,onDelete:_})):L("",!0)]),l("div",null,[e.showLoading&&J(E)?(o(),ne(i,{key:0})):L("",!0)]),l("div",Rf,[e.showCancel?(o(),ne(u,{key:0,onClick:N,disabled:J(E)},{default:$e(()=>[_e("Cancel")]),_:1},8,["disabled"])):L("",!0),we(d,{type:"submit",class:"ml-4",disabled:J(E)},{default:$e(()=>[_e("Save")]),_:1},8,["disabled"])])],2)],32)],2)):(o(),r("div",Ef,[Nf,l("div",zf,[l("div",{onMousedown:N,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",P.value])},[l("form",{class:g(C.value),onSubmit:Ue(B,["prevent"])},[l("div",Uf,[l("div",qf,[l("div",Qf,[l("div",Kf,[l("div",Zf,[e.$slots.heading?(o(),r("div",Wf,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(M.value)},F(A.value),3)),e.$slots.subheading?(o(),r("div",Gf,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(S.value)},F(e.subHeading),3)):null!=(a=w.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",S.value]),innerHTML:null==(a=w.value)?void 0:a.notes},null,10,Jf)):L("",!0)]),l("div",Xf,[we(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:N})])])]),z(e.$slots,"header",{formInstance:null==(a=He())?void 0:a.exposed,model:k.value}),(o(),ne(n,{ref_key:"formFields",ref:p,key:f.value,modelValue:k.value,"onUpdate:modelValue":m,api:$.value,configureField:ee,configureFormLayout:e.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),z(e.$slots,"footer",{formInstance:null==(v=He())?void 0:v.exposed,model:k.value})])]),l("div",{class:g(V.value)},[l("div",null,[e.deleteType?(o(),ne(s,{key:0,onDelete:_})):L("",!0)]),l("div",null,[e.showLoading&&J(E)?(o(),ne(i,{key:0})):L("",!0)]),l("div",Yf,[e.showCancel?(o(),ne(u,{key:0,onClick:N,disabled:J(E)},{default:$e(()=>[_e("Cancel")]),_:1},8,["disabled"])):L("",!0),we(d,{type:"submit",class:"ml-4",disabled:J(E)},{default:$e(()=>[_e("Save")]),_:1},8,["disabled"])])],2)],34)],2)],32)],32)])])):(o(),r("div",Df,[l("p",jf,[_e("Could not create form for unknown "),Of,_e(" "+F(b.value),1)])])),"ModalLookup"==(null==(a=h.value)?void 0:a.name)&&h.value.ref?(o(),ne(c,{key:3,"ref-info":h.value.ref,onDone:W,configureField:e.configureField},null,8,["ref-info","configureField"])):L("",!0)])}}}),tv={key:0},sv={class:"text-red-700"},lv=l("b",null,"type",-1),nv={key:0},ov={key:2},av=["innerHTML"],rv={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},iv=l("div",{class:"fixed inset-0"},null,-1),uv={class:"fixed inset-0 overflow-hidden"},dv={class:"flex min-h-0 flex-1 flex-col overflow-auto"},cv={class:"flex-1"},fv={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},vv={class:"flex items-start justify-between space-x-3"},pv={class:"space-y-1"},mv={key:0},hv={key:2},gv=["innerHTML"],yv={class:"flex h-7 items-center"},bv=l("div",{class:"flex justify-end"},null,-1),wv=ue({__name:"AutoViewForm",props:{model:{},apis:{},typeName:{},done:{},formStyle:{default:"slideOver"},panelClass:{},formClass:{},headingClass:{},subHeadingClass:{},heading:{},subHeading:{},showLoading:{type:Boolean},deleteType:{}},emits:["done","save","delete","error"],setup(e,{emit:t}){let a=e,n=t,{typeOf:s,getPrimaryKey:i,createDto:u}=ut(),d=v(()=>a.typeName??a.apis.dataModel.name),c=v(()=>s(d.value)),p=v(()=>a.panelClass||Ee.panelClass(a.formStyle)),f=v(()=>a.formClass||Ee.formClass(a.formStyle)),m=v(()=>a.headingClass||Ee.headingClass(a.formStyle)),h=v(()=>a.subHeadingClass||Ee.subHeadingClass(a.formStyle)),y=v(()=>{var e;return a.heading||(null==(e=s(d.value))?void 0:e.description)||(null!=(e=a.model)&&e.id?Re(d.value)+" "+a.model.id:"View "+Re(d.value))}),b=I(new tt),w=(Object.assign({},us(a.model)),X.interceptors.has("AutoViewForm.new")&&X.interceptors.invoke("AutoViewForm.new",{props:a}),ys()),x=v(()=>w.loading.value),k=v(()=>c.value);async function C(e){var l=Ge(c.value,e=>i(e)),t=l?ke(a.model,l.name):null;t?(l={[l.name]:t},t="string"==typeof a.deleteType?u(a.deleteType,l):a.deleteType?new a.deleteType(l):null,null==Ge(t.createResponse,e=>"function"==typeof e?e():null)?b.value=await w.apiVoid(t):b.value=await w.api(t),b.value.succeeded?n("delete",b.value.response):n("error",b.value.error)):console.error(`Could not find Primary Key for Type ${d.value} (${k.value})`)}function M(){a.done&&a.done()}let S=I(!1),V=I(""),T={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 A(){"slideOver"==a.formStyle?S.value=!1:M()}Lt(S,()=>{xt(T,V,S.value),S.value||setTimeout(M,700)}),S.value=!0;let $=e=>{"Escape"===e.key&&A()};return at(()=>window.addEventListener("keydown",$)),Et(()=>window.removeEventListener("keydown",$)),(e,t)=>{var a,n=Q("MarkupModel"),s=Q("CloseButton"),i=Q("ConfirmDelete"),u=Q("FormLoading");return o(),r("div",null,[d.value?"card"==e.formStyle?(o(),r("div",{key:1,class:g(p.value)},[l("div",{class:g(f.value)},[l("div",null,[e.$slots.heading?(o(),r("div",nv,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(m.value)},F(y.value),3)),e.$slots.subheading?(o(),r("div",ov,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(h.value)},F(e.subHeading),3)):null!=(a=c.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",h.value]),innerHTML:null==(a=c.value)?void 0:a.notes},null,10,av)):L("",!0)]),we(n,{value:e.model},null,8,["value"])],2)],2)):(o(),r("div",rv,[iv,l("div",uv,[l("div",{onMousedown:A,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:g(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",V.value])},[l("div",{class:g(f.value)},[l("div",dv,[l("div",cv,[l("div",fv,[l("div",vv,[l("div",pv,[e.$slots.heading?(o(),r("div",mv,[z(e.$slots,"heading")])):(o(),r("h3",{key:1,class:g(m.value)},F(y.value),3)),e.$slots.subheading?(o(),r("div",hv,[z(e.$slots,"subheading")])):e.subHeading?(o(),r("p",{key:3,class:g(h.value)},F(e.subHeading),3)):null!=(a=c.value)&&a.notes?(o(),r("p",{key:4,class:g(["notes",h.value]),innerHTML:null==(a=c.value)?void 0:a.notes},null,10,gv)):L("",!0)]),l("div",yv,[we(s,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:A})])])]),we(n,{value:e.model},null,8,["value"])])]),l("div",{class:g(J(Ee).buttonsClass)},[l("div",null,[e.deleteType?(o(),ne(i,{key:0,onDelete:C})):L("",!0)]),l("div",null,[e.showLoading&&J(x)?(o(),ne(u,{key:0})):L("",!0)]),bv],2)],2)],2)],32)],32)])])):(o(),r("div",tv,[l("p",sv,[_e("Could not create view for unknown "),lv,_e(" "+F(d.value),1)])]))])}}}),kv=l("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),_v=ue({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let a=I(!1),n=t,s=()=>{a.value&&n("delete")},i=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(),r(Me,null,[Pt(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=>un(a)?a.value=e:a=e)},null,512),[[pl,J(a)]]),kv,l("span",Se({onClick:Ue(s,["prevent"]),class:i.value},e.$attrs),[z(e.$slots,"default",{},()=>[_e("Delete")])],16)],64))}}),$v={class:"flex",title:"loading..."},Cv={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},xv=Ds('<rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3),Lv=[xv],Vv={class:"ml-2 mt-1 text-gray-400"},Mv=ue({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(e){return Je("ApiState",void 0),(e,t)=>(o(),r("div",$v,[e.icon?(o(),r("svg",Cv,Lv)):L("",!0),l("span",Vv,F(e.text),1)]))}}),Sv=["onClick"],Av={key:3,class:"flex justify-between items-center"},Tv={class:"mr-1 select-none"},Fv=["onClick"],Iv=ue({__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=I(),c=I(null),p=js(),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(()=>nl(u.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:s,typeProperties:i}=ut(),h=v(()=>zt(u.type)),y=v(()=>s(h.value)),b=v(()=>i(y.value));function w(e){var l=u.headerTitles&&ke(u.headerTitles,e)||e;return u.headerTitle?u.headerTitle(l):mn(l)}function x(e){let l=e.toLowerCase();return b.value.find(e=>e.name.toLowerCase()==l)}let k={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 C(e){var l=u.visibleFrom&&ke(u.visibleFrom,e);return l&&Ge(k[l],e=>"hidden "+e)}let M=v(()=>u.gridClass??he.getGridClass(u.tableStyle)),S=v(()=>u.grid2Class??he.getGrid2Class(u.tableStyle)),V=v(()=>u.grid3Class??he.getGrid3Class(u.tableStyle)),T=v(()=>u.grid4Class??he.getGrid4Class(u.tableStyle)),A=v(()=>u.tableClass??he.getTableClass(u.tableStyle)),$=v(()=>u.tbodyClass??he.getTbodyClass(u.tbodyClass)),j=v(()=>u.theadClass??he.getTheadClass(u.tableStyle)),O=v(()=>u.theadRowClass??he.getTheadRowClass(u.tableStyle)),E=v(()=>u.theadCellClass??he.getTheadCellClass(u.tableStyle));let H=v(()=>{let e=("string"==typeof u.selectedColumns?u.selectedColumns.split(","):u.selectedColumns)||(0<n.value.length?n.value:nl(u.items)),t=b.value.reduce((e,l)=>(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 s=Q("CellFormat"),i=Q("PreviewFormat");return n.items.length?(o(),r("div",{key:0,ref_key:"refResults",ref:a,class:g(M.value)},[l("div",{class:g(S.value)},[l("div",{class:g(V.value)},[l("div",{class:g(T.value)},[l("table",{class:g(A.value)},[l("thead",{class:g(j.value)},[l("tr",{class:g(O.value)},[(o(!0),r(Me,null,Ie(H.value,t=>{return o(),r("td",{class:g([C(t),E.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)}},[J(p)[t+"-header"]?z(n.$slots,t+"-header",{key:0,column:t}):f(t)?z(n.$slots,f(t),{key:1,column:t}):J(p).header?z(n.$slots,"header",{key:2,column:t,label:w(t)}):(o(),r("div",Av,[l("span",Tv,F(w(t)),1)]))],8,Sv)],2);var e}),256))],2)],2),l("tbody",{class:g($.value)},[(o(!0),r(Me,null,Ie(n.items,(t,e)=>{return o(),r("tr",{class:g((l=t,a=e,u.rowClass?u.rowClass(l,a):he.getTableRowClass(u.tableStyle,a,!(!u.isSelected||!u.isSelected(l)),null!=u.isSelected))),style:vl((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),r(Me,null,Ie(H.value,e=>{return o(),r("td",{class:g([C(e),J(he).tableCellClass])},[J(p)[e]?z(n.$slots,e,Xt(Se({key:0},t))):m(e)?z(n.$slots,m(e),Xt(Se({key:1},t))):x(e)?(o(),ne(s,{key:2,type:y.value,propType:x(e),modelValue:t},null,8,["type","propType","modelValue"])):(o(),ne(i,{key:3,value:J(ke)(t,e),format:null!=(l=x(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,Fv);var l,a}),256))],2)],2)],2)],2)],2)],2)):L("",!0)}}}),Dv=ue({props:{type:Object,propType:Object,modelValue:Object},setup(d,{attrs:v}){let c=ut().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=ke(d.modelValue,d.propType.name),a=Object.assign({},d,v),r=Tt("span",{innerHTML:vs(t,l,a)}),n=ps(t)&&Array.isArray(t)?Tt("span",{},[Tt("span",{class:"mr-2"},""+t.length),r]):r,s=null==(e=d.propType)?void 0:e.ref;var o,i,u;return s&&(i=ot(d.type).find(e=>e.type===s.model))&&(i=(i=ke(d.modelValue,i.name))&&s.refLabel&&ke(i,s.refLabel))?(u=(u=null==(u=c(s.model))?void 0:u.icon)?Tt(oo,{image:u,class:"w-5 h-5 mr-1"}):null,Tt("span",{class:"flex",title:s.model+" "+t},[u,i])):n}}}),jv={key:0},Ov={key:0,class:"mr-2"},Pv=["innerHTML"],Bv=["innerHTML"],Hv={inheritAttrs:!1},Rv=ue({...Hv,__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)=>J(ps)(e.value)?(o(),r("span",jv,[e.includeCount&&a.value?(o(),r("span",Ov,F(e.value.length),1)):L("",!0),l("span",{innerHTML:J(vs)(e.value,e.format,e.$attrs)},null,8,Pv)])):(o(),r("span",{key:1,innerHTML:J(vs)(e.value,e.format,e.$attrs)},null,8,Bv))}}),Ev=["innerHTML"],Nv={key:0},zv=l("b",null,null,-1),Uv={key:2},qv=ue({__name:"HtmlFormat",props:{value:{},depth:{default:0},fieldAttrs:{},classes:{type:Function,default:(e,l,t,a,r)=>a}},setup(e){let t=e,s=v(()=>Rt(t.value)),i=v(()=>Array.isArray(t.value)),u=e=>mn(e),d=e=>t.fieldAttrs?t.fieldAttrs(e):null,c=v(()=>nl(t.value));return(t,e)=>{let a=Q("HtmlFormat",!0);return o(),r("div",{class:g(0==t.depth?"prose html-format":"")},[s.value?(o(),r("div",{key:0,innerHTML:J(vs)(t.value)},null,8,Ev)):i.value?(o(),r("div",{key:1,class:g(t.classes("array","div",t.depth,J(he).gridClass))},[J(Rt)(t.value[0])?(o(),r("div",Nv,"[ "+F(t.value.join(", "))+" ]",1)):(o(),r("div",{key:1,class:g(t.classes("array","div",t.depth,J(he).grid2Class))},[l("div",{class:g(t.classes("array","div",t.depth,J(he).grid3Class))},[l("div",{class:g(t.classes("array","div",t.depth,J(he).grid4Class))},[l("table",{class:g(t.classes("object","table",t.depth,J(he).tableClass))},[l("thead",{class:g(t.classes("array","thead",t.depth,J(he).theadClass))},[l("tr",null,[(o(!0),r(Me,null,Ie(c.value,e=>(o(),r("th",{class:g(t.classes("array","th",t.depth,J(he).theadCellClass+" whitespace-nowrap"))},[zv,_e(F(u(e)),1)],2))),256))])],2),l("tbody",null,[(o(!0),r(Me,null,Ie(t.value,(l,e)=>(o(),r("tr",{class:g(t.classes("array","tr",t.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(o(!0),r(Me,null,Ie(c.value,e=>(o(),r("td",{class:g(t.classes("array","td",t.depth,J(he).tableCellClass))},[we(a,Se({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(),r("div",Uv,[l("table",{class:g(t.classes("object","table",t.depth,"table-object"))},[(o(!0),r(Me,null,Ie((n=t.value)?Object.keys(n).map(e=>({key:u(e),val:n[e]})):[],e=>(o(),r("tr",{class:g(t.classes("object","tr",t.depth,""))},[l("th",{class:g(t.classes("object","th",t.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},F(e.key),3),l("td",{class:g(t.classes("object","td",t.depth,"align-top py-2 px-4 text-sm"))},[we(a,Se({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}}}),Qv=["href"],Kv=["href","title"],Zv=ue({__name:"MarkupFormat",props:{value:{},imageClass:{default:"w-8 h-8"}},setup(e){var l=e,t=Uo().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=Q("Icon"),a=Q("HtmlFormat");return"link"==J(n)?(o(),r("a",{key:0,href:e.value,class:"text-indigo-600"},F(e.value),9,Qv)):"image"==J(n)?(o(),r("a",{key:1,href:e.value,title:e.value,class:"inline-block"},[we(t,{src:e.value,class:g(e.imageClass)},null,8,["src","class"])],8,Kv)):(o(),ne(a,{key:2,value:e.value},null,8,["value"]))}}}),Wv={class:"my-2 w-full"},Gv={class:"leading-7"},Jv={class:"px-2 text-left align-top"},Xv={colspan:"align-top"},Yv={class:"my-2 leading-7"},ep={colspan:"2",class:"px-2 bg-indigo-700 text-white"},tp={class:"leading-7"},sp={colspan:"2",class:"px-2 align-top"},lp=ue({__name:"MarkupModel",props:{value:{},imageClass:{}},setup(e){let a=e,t=Object.keys(a.value),n={},s={};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?s[e]=l:n[e]=l}),(e,t)=>{let a=Q("MarkupFormat");return o(),r("table",Wv,[(o(),r(Me,null,Ie(n,(e,t)=>l("tr",Gv,[l("th",Jv,F(J(Re)(t)),1),l("td",Xv,[we(a,{value:e},null,8,["value"])])])),64)),(o(),r(Me,null,Ie(s,(e,t)=>(o(),r(Me,null,[l("tr",Yv,[l("td",ep,F(J(Re)(t)),1)]),l("tr",tp,[l("td",sp,[we(a,{value:e},null,8,["value"])])])],64))),64))])}}}),np={class:"absolute top-0 right-0 pt-4 pr-4"},op=["title"],ap=l("span",{class:"sr-only"},"Close",-1),rp=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),ip=[ap,rp],up=ue({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"},title:{default:"Close"}},emits:["close"],setup(e,{}){return(t,e)=>(o(),r("div",np,[l("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),title:t.title,class:g([t.buttonClass,"cursor-pointer 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"])},ip,10,op)]))}}),dp=["id","aria-labelledby"],cp=l("div",{class:"fixed inset-0"},null,-1),fp={class:"fixed inset-0 overflow-hidden"},vp={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},pp={class:"flex min-h-0 flex-1 flex-col overflow-auto"},mp={class:"flex-1"},hp={class:"relative bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},gp={class:"flex items-start justify-between space-x-3"},yp={class:"space-y-1"},bp={key:0},wp=["id"],kp={key:2,class:"text-sm text-gray-500"},_p={class:"flex h-7 items-center"},$p={key:0,class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},Cp=ue({__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=I(!1),s=I(""),i={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=(Lt(n,()=>{xt(i,s,n.value),n.value||setTimeout(()=>a("done"),700)}),n.value=!0,()=>n.value=!1),d=e=>{"Escape"===e.key&&u()};return at(()=>window.addEventListener("keydown",d)),Et(()=>window.removeEventListener("keydown",d)),(e,t)=>{var a=Q("CloseButton");return o(),r("div",{id:e.id,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[cp,l("div",fp,[l("div",{onMousedown:u,class:"absolute inset-0 overflow-hidden"},[l("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[l("div",{class:g(["panel pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",s.value])},[l("div",vp,[l("div",pp,[l("div",mp,[l("div",hp,[l("div",gp,[l("div",yp,[e.$slots.title?(o(),r("div",bp,[z(e.$slots,"title")])):L("",!0),e.title?(o(),r("h2",{key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:e.id+"-title"},F(e.title),9,wp)):L("",!0),e.$slots.subtitle?(o(),r("p",kp,[z(e.$slots,"subtitle")])):L("",!0)]),l("div",_p,[we(a,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:u})])])]),l("div",{class:g(e.contentClass)},[z(e.$slots,"default")],2)])]),e.$slots.footer?(o(),r("div",$p,[z(e.$slots,"footer")])):L("",!0)])],2)],32)],32)])],8,dp)}}}),xp=["id","data-transition-for","aria-labelledby"],Lp={class:"fixed inset-0 z-10 overflow-y-auto"},Vp={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},Mp={key:1,class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},Sp=l("span",{class:"sr-only"},"Close",-1),Ap=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),Tp=[Sp,Ap],Fp=ue({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:fl.modalClass},sizeClass:{default:fl.sizeClass},closeButtonClass:{default:"bg-white dark:bg-black cursor-pointer 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"},configureField:{}},emits:["done"],setup(e,{emit:t}){let s=js(),a=t,n=I(!1),i=I(""),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=I(""),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=(Lt(n,()=>{xt(u,i,n.value),xt(v,d,n.value),n.value||setTimeout(()=>a("done"),200)}),n.value=!0,()=>n.value=!1),p=(ms("ModalProvider",{openModal:function(e,l){p.value=e,f.value=l}}),I()),f=I();async function m(e){f.value&&f.value(e),p.value=void 0,f.value=void 0}let h=e=>{"Escape"===e.key&&c()};return at(()=>window.addEventListener("keydown",h)),Et(()=>window.removeEventListener("keydown",h)),(e,t)=>{var a,n=Q("ModalLookup");return o(),r("div",{id:e.id,"data-transition-for":e.id,onMousedown:c,class:"relative z-10","aria-labelledby":e.id+"-title",role:"dialog","aria-modal":"true"},[l("div",{class:g(["fixed inset-0 bg-gray-500/75 transition-opacity",i.value])},null,2),l("div",Lp,[l("div",Vp,[l("div",{class:g([e.modalClass,e.sizeClass,d.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[l("div",null,[J(s).closebutton?z(e.$slots,"createform",{key:0}):(o(),r("div",Mp,[l("button",{type:"button",onClick:c,class:g(e.closeButtonClass),title:"Close"},Tp,2)])),z(e.$slots,"default")])],34),z(e.$slots,"bottom")])]),"ModalLookup"==(null==(a=p.value)?void 0:a.name)&&p.value.ref?(o(),ne(n,{key:0,"ref-info":p.value.ref,onDone:m,configureField:e.configureField},null,8,["ref-info","configureField"])):L("",!0)],40,xp)}}}),Ip={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Dp={class:"mt-3 pl-5 flex flex-wrap items-center"},jp={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},Op={class:"hidden md:inline"},Pp={class:"flex pb-1 sm:pb-0"},Bp=["title"],Hp=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),Rp=[Hp],Ep=["disabled"],Np=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),zp=[Np],Up=["disabled"],qp=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),Qp=[qp],Kp=["disabled"],Zp=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),Wp=[Zp],Gp=["disabled"],Jp=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),Xp=[Jp],Yp={key:0,class:"flex pb-1 sm:pb-0"},em={class:"px-4 text-lg text-black dark:text-white"},tm={key:0},sm={key:1},lm=l("span",{class:"hidden xl:inline"}," Showing Results ",-1),nm={key:2},om={key:1,class:"pl-2 mt-1"},am=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),rm={class:"whitespace-nowrap"},im={key:2,class:"pl-2"},um=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),dm=[um],cm={class:"flex pb-1 sm:pb-0"},fm={key:0,class:"pl-2"},vm=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),pm={class:"mr-1"},mm={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"},hm=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),gm=[hm],ym={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"},bm=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),wm=[bm],km={key:1},_m={key:4},$m={key:0},Cm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},xm={class:"mr-1 select-none"},Lm={key:1,class:"flex justify-between items-center"},Vm={class:"mr-1 select-none"},rn=25,Mm=ue({__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:{},type:{},modelTitle:{},newButtonLabel:{},configureField:{}},emits:["done"],setup(e,{emit:X}){let c=e,t=X,W=js(),G=Nt().config,{metadataApi:a,filterDefinitions:Z}=ut(),K=Je("client"),n=G.value.storage,p=v(()=>c.toolbarButtonClass??he.toolbarButtonClass),f=v(()=>Z.value),m=I({take:rn}),h=I(new tt),y=I(c.skip),b=I(!1),w=I(),s=e=>"string"==typeof e?e.split(","):e||[];function Y(e,l){return he.getTableRowClass("fullWidth",l,!1,!0)}let i=v(()=>vt(c.refInfo.model)),x=v(()=>{var e=(0<(e=s(c.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());let t=ot(i.value);return 0<e.length?e.map(l=>t.find(e=>e.name.toLowerCase()===l)).filter(e=>null!=e):t}),ee=v(()=>{let e=x.value.map(e=>e.name),l=s(m.value.selectedColumns).map(e=>e.toLowerCase());return 0<l.length?e.filter(e=>l.includes(e.toLowerCase())):e}),k=v(()=>m.value.take??rn),C=v(()=>h.value.response?ke(h.value.response,"results"):[]),M=v(()=>{var e;return(null==(e=h.value.response)?void 0:e.total)??C.value.length??0}),S=v(()=>0<y.value),V=v(()=>0<y.value),T=v(()=>C.value.length>=k.value),A=v(()=>C.value.length>=k.value),$=I([]),le=v(()=>$.value.some(e=>0<e.settings.filters.length||!!e.settings.sort)),j=v(()=>$.value.map(e=>e.settings.filters.length).reduce((e,l)=>e+l,0)),te=v(()=>ss(i.value)),u=v(()=>{var e;return null==(e=a.value)?void 0:e.operations.find(e=>{var l;return(null==(l=e.dataModel)?void 0:l.name)==c.refInfo.model&&We.isAnyQuery(e)})}),ae=I(),O=I(!1),E=I(),d=v(()=>zt(c.refInfo.model)),H=v(()=>Ht.forType(d.value,a.value)),B=v(()=>{var e;return d.value||(null==(e=u.value)?void 0:e.dataModel.name)}),re=v(()=>c.modelTitle||B.value),se=v(()=>c.newButtonLabel||"New "+re.value),oe=v(()=>ds(H.value.Create)),_=I(),D=I(!1);function R(){D.value=!1}async function ie(e){R(),t("done",e)}function P(e){var l;_.value&&(Object.assign(null==(l=_.value)?void 0:l.model,e),console.log("setCreate",JSON.stringify(e,null,2)),null!=(l=_.value)&&l.forceUpdate(),null!=(l=null==(l=He())?void 0:l.proxy))&&l.$forceUpdate()}let ue=()=>c.id+"/ApiPrefs/"+c.refInfo.model,N=e=>`Column/${c.id}:${c.refInfo.model}.`+e;async function U(e){y.value+=e,y.value<0&&(y.value=0);var l=Math.floor(M.value/k.value)*k.value;y.value>l&&(y.value=l),await q()}async function de(e,l){t("done",e)}function ve(){t("done",null)}function ce(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=$.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(),E.value={column:t,topLeft:{x:Math.max(Math.floor(a.x+25),343),y:Math.floor(115)}})}function pe(){E.value=null}async function fe(e){var l=null==(l=E.value)?void 0:l.column;l&&(l.settings=e,n.setItem(N(l.name),JSON.stringify(l.settings)),await q()),E.value=null}async function me(e){n.setItem(N(e.name),JSON.stringify(e.settings)),await q()}async function ge(e){O.value=!1,m.value=e,n.setItem(ue(),JSON.stringify(e)),await q()}async function q(){var a=(()=>{let a={include:"total",take:k.value},e=s(m.value.selectedColumns||c.selectedColumns);var l;0<e.length&&((l=te.value)&&e.includes(l.name)&&(e=[l.name,...e]),a.fields=e.join(","));let r=[];return $.value.forEach(t=>{t.settings.sort&&r.push(("DESC"===t.settings.sort?"-":"")+t.name),t.settings.filters.forEach(e=>{var l=e.key.replace("%",t.name);a[l]=e.value})}),"u"<typeof a.skip&&0<y.value&&(a.skip=y.value),0<r.length&&(a.orderBy=r.join(",")),a})(),r=u.value;if(r){let e=cs(r,a),l=pn(e=>{h.value.response=h.value.error=void 0,b.value=e}),t=await K.api(e);l(),Ot(()=>h.value=t);r=ke(t.response,"results")||[];t.succeeded&&r.label}else console.error("No Query API was found for "+c.refInfo.model)}async function ye(){$.value.forEach(e=>{e.settings={filters:[]},n.removeItem(N(e.name))}),await q()}return at(async()=>{var e=c.prefs||Fs(n.getItem(ue()));e&&(m.value=e),$.value=x.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},Fs(n.getItem(N(e.name))))})),isNaN(c.skip)||(y.value=c.skip),await q()}),(n,e)=>{let t=Q("AutoCreateForm"),a=Q("ErrorSummary"),s=Q("Loading"),i=Q("SettingsIcons"),u=Q("DataGrid"),d=Q("ModalDialog");return o(),r(Me,null,[n.refInfo?(o(),ne(d,{key:0,ref_key:"modalDialog",ref:ae,id:n.id,onDone:ve},{default:$e(()=>[l("div",Ip,[l("div",Dp,[l("h3",jp,[_e(" Select "),l("span",Op,F(J(Re)(n.refInfo.model)),1)]),l("div",Pp,[n.showPreferences?(o(),r("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=>O.value=!O.value)},Rp,8,Bp)):L("",!0),n.showPagingNav?(o(),r("button",{key:1,type:"button",class:g(["pl-2",S.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:!S.value,onClick:e[1]||(e[1]=e=>U(-M.value))},zp,10,Ep)):L("",!0),n.showPagingNav?(o(),r("button",{key:2,type:"button",class:g(["pl-2",V.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:!V.value,onClick:e[2]||(e[2]=e=>U(-k.value))},Qp,10,Up)):L("",!0),n.showPagingNav?(o(),r("button",{key:3,type:"button",class:g(["pl-2",T.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:!T.value,onClick:e[3]||(e[3]=e=>U(k.value))},Wp,10,Kp)):L("",!0),n.showPagingNav?(o(),r("button",{key:4,type:"button",class:g(["pl-2",A.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:!A.value,onClick:e[4]||(e[4]=e=>U(M.value))},Xp,10,Gp)):L("",!0)]),n.showPagingInfo?(o(),r("div",Yp,[l("div",em,[b.value?(o(),r("span",tm,"Querying...")):L("",!0),C.value.length?(o(),r("span",sm,[lm,_e(" "+F(y.value+1)+" - "+F(Math.min(y.value+C.value.length,M.value))+" ",1),l("span",null," of "+F(M.value),1)])):h.value.completed?(o(),r("span",nm,"No Results")):L("",!0)])])):L("",!0),H.value.Create&&oe.value?(o(),r("div",om,[l("button",{type:"button",onClick:e[5]||(e[5]=e=>{D.value=!0}),title:"modelTitle",class:g(J(he).toolbarButtonClass)},[am,l("span",rm,F(se.value),1)],2),D.value?(o(),ne(t,{key:0,ref_key:"createForm",ref:_,type:H.value.Create.request.name,configure:n.configureField,onDone:R,onSave:ie},{header:$e(()=>[z(n.$slots,"formheader",{form:"create",formInstance:_.value,apis:H.value,type:B.value,updateModel:P})]),footer:$e(()=>[z(n.$slots,"formfooter",{form:"create",formInstance:_.value,apis:H.value,type:B.value,updateModel:P})]),_:3},8,["type","configure"])):L("",!0)])):L("",!0),le.value&&n.showResetPreferences?(o(),r("div",im,[l("button",{type:"button",onClick:ye,title:"Reset Preferences & Filters",class:g(p.value)},dm,2)])):L("",!0),l("div",cm,[n.showFiltersView&&0<j.value?(o(),r("div",fm,[l("button",{type:"button",onClick:e[6]||(e[6]=e=>w.value="filters"==w.value?null:"filters"),class:g(p.value),"aria-expanded":"false"},[vm,l("span",pm,F(j.value)+" "+F(1==j.value?"Filter":"Filters"),1),"filters"!=w.value?(o(),r("svg",mm,gm)):(o(),r("svg",ym,wm))],2)])):L("",!0)])]),"filters"==w.value?(o(),ne(Rl,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:f.value,columns:$.value,onDone:e[7]||(e[7]=e=>w.value=null),onChange:me},null,8,["definitions","columns"])):L("",!0),E.value?(o(),r("div",km,[we(Hl,{definitions:f.value,column:E.value.column,"top-left":E.value.topLeft,onDone:pe,onSave:fe},null,8,["definitions","column","top-left"])])):L("",!0),h.value.error?(o(),ne(a,{key:2,status:h.value.error},null,8,["status"])):b.value?(o(),ne(s,{key:3})):(o(),r("div",_m,[C.value.length?(o(),r("div",$m,[we(u,{id:n.id,items:C.value,type:n.refInfo.model,"selected-columns":ee.value,onFiltersChanged:q,tableStyle:"fullWidth",rowClass:Y,onRowSelected:de,onHeaderSelected:ce},ml({header:$e(({column:t,label:e})=>{var a;return[!n.allowFiltering||c.canFilter&&!c.canFilter(t)?(o(),r("div",Lm,[l("span",Vm,F(e),1)])):(o(),r("div",Cm,[l("span",xm,F(e),1),we(i,{column:$.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(a=E.value)?void 0:a.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[Ie(Object.keys(J(W)),l=>({name:l,fn:$e(e=>[z(n.$slots,l,Xt(As(e)))])}))]),1032,["id","items","type","selected-columns"])])):L("",!0)]))])]),_:3},8,["id"])):L("",!0),O.value?(o(),ne(El,{key:1,columns:x.value,prefs:m.value,onDone:e[8]||(e[8]=e=>O.value=!1),onSave:ge},null,8,["columns","prefs"])):L("",!0)],64)}}}),Sm={class:"sm:hidden"},Am=["for"],Tm=["id","name"],Fm=["value"],Im={class:"hidden sm:block"},Dm={class:"border-b border-gray-200"},jm={class:"-mb-px flex","aria-label":"Tabs"},Om=["onClick"],Pm=ue({__name:"Tabs",props:{tabs:{},id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>Re(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):Re(e),s=v(()=>t.id||"tabs"),i=v(()=>t.param||"tab"),u=I();function d(e){u.value=e,t.url&&Il({tab:e===a.value[0]?void 0:e},t.clearQuery)}let c=v(()=>100/Object.keys(t.tabs).length+"%");return at(()=>{var e;u.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+xs(location.hash,"?"):""),e=ll(e)[i.value])&&(u.value=e)}),(t,e)=>(o(),r("div",null,[l("div",Sm,[l("label",{for:s.value,class:"sr-only"},"Select a tab",8,Am),l("select",{id:s.value,name:s.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),r(Me,null,Ie(a.value,e=>(o(),r("option",{key:e,value:e},F(n(e)),9,Fm))),128))],40,Tm)]),l("div",Im,[l("div",Dm,[l("nav",jm,[(o(!0),r(Me,null,Ie(a.value,l=>{return o(),r("a",{href:"#",onClick:Ue(e=>d(l),["prevent"]),style:vl({width:c.value}),class:g([(e=l,u.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),t.tabClass])},F(n(l)),15,Om);var e}),256))])])]),l("div",{class:g(t.bodyClass)},[(o(),ne(cn(t.tabs[u.value])))],2)]))}}),Bm=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),Hm=[Bm],Rm=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),Em=[Rm],Nm=ue({__name:"DarkModeToggle",setup(e){let a=typeof document<"u"?document.documentElement:null,n=()=>!(null==a||!a.classList.contains("dark")),s=I("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(o(),r("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"),s.value=n(),localStorage.setItem("color-scheme",s.value?"dark":"light")})},[l("span",{class:g(`${s.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[l("span",{class:g(`${s.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"},Hm,2),l("span",{class:g(`${s.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"},Em,2)],2)]))}}),zm={key:0},Um={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},qm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Qm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-gray-50"},Km={key:0,class:"mt-4 text-center text-sm text-gray-600 dark:text-gray-300"},Zm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Wm=["onClick"],Gm={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},Jm={class:"bg-white dark:bg-black py-8 px-4 shadow sm:rounded-lg sm:px-10"},Xm={class:"mt-8"},Ym={key:1,class:"mt-6"},e1=Ds('<div class="relative"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-300 dark:border-gray-600"></div></div><div class="relative flex justify-center text-sm"><span class="px-2 bg-white text-gray-500 dark:text-gray-400"> Or continue with </span></div></div>',1),t1={class:"mt-6 grid grid-cols-3 gap-3"},s1=["href","title"],l1={key:1,class:"h-5 w-5 text-gray-700 dark:text-gray-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},n1=l("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),o1=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),a1=[n1,o1],r1=ue({__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:s,createDto:i}=ut(),u=ys(),d=Je("client"),c=Bl().signIn,p=s({assert:!0}),f=p.plugins.auth,m=document.baseURI,h=p.app.baseUrl,y=I(i("Authenticate")),b=I(new tt),w=I(a.provider),x=(at(()=>{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))||[])),k=v(()=>x.value[0]||{}),C=v(()=>x.value[Math.max(x.value.length-1,0)]||{}),M=v(()=>(w.value?null==f?void 0:f.authProviders.find(e=>e.name===w.value):null)??k.value),S=e=>!1===e||"false"===e;function V(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(()=>!S(a.oauth)&&(null==f?void 0:f.authProviders.filter(e=>"oauth"===e.type))||[]),$=v(()=>{let e=Ho(null==f?void 0:f.authProviders.filter(e=>e.formLayout&&0<e.formLayout.length),(e,l)=>{e[V(l)||ft(l.name)]=l.name===k.value.name?"":l.name});var l=M.value;return e=l&&S(a.tabs)?{[V(l)||ft(l.name)]:l}:e}),z=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=i("Authenticate")):"basic"===M.value.name?(d.setCredentials(y.value.UserName,y.value.Password),y.value=i("Authenticate"),y.value.UserName=null,y.value.Password=null):"Bearer"!==M.value.type&&"jwt"!==M.value.name||(d.bearerToken=y.value.BearerToken,y.value=i("Authenticate")),b.value=await u.api(y.value),b.value.succeeded&&(e=b.value.response,c(e),n("login",e),b.value=new tt,y.value=i("Authenticate"))}return(e,t)=>{let a=Q("ErrorSummary"),n=Q("AutoFormFields"),s=Q("PrimaryButton"),i=Q("Icon"),u=_o("href");return J(f)?(o(),r("div",Um,[l("div",qm,[l("h2",Qm,F(e.title),1),1<Object.keys($.value).length?(o(),r("p",Km,[l("span",Zm,[(o(!0),r(Me,null,Ie($.value,(l,e)=>Pt((o(),r("a",{onClick:e=>w.value=l,class:g([""===l||l===k.value.name?"rounded-l-md":l===C.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 dark:border-gray-600 bg-white dark:bg-black text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900"])},[_e(F(e),1)],10,Wm)),[[u,{provider:l}]])),256))])])):L("",!0)]),l("div",Gm,[z.value?(o(),ne(a,{key:0,class:"mb-3",errorSummary:z.value},null,8,["errorSummary"])):L("",!0),l("div",Jm,[T.value.length?(o(),r("form",{key:0,onSubmit:Ue(j,["prevent"])},[we(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",Xm,[we(s,{class:"w-full"},{default:$e(()=>[_e("Sign In")]),_:1})])],32)):L("",!0),A.value.length?(o(),r("div",Ym,[e1,l("div",t1,[(o(!0),r(Me,null,Ie(A.value,e=>(o(),r("div",null,[l("a",{href:J(h)+e.navItem.href+"?continue="+J(m),title:V(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm bg-white dark:bg-black text-sm font-medium text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-900"},[e.icon?(o(),ne(i,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700 dark:text-gray-200"},null,8,["image"])):(o(),r("svg",l1,a1))],8,s1)]))),256))])])):L("",!0)])])])):(o(),r("div",zm,"No Auth Plugin"))}}}),i1=["for"],u1={key:1,class:"border border-gray-200 flex justify-between"},d1={class:"p-2 flex flex-wrap gap-x-4"},c1=l("title",null,"Bold text (CTRL+B)",-1),f1=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),v1=[c1,f1],p1=l("title",null,"Italics (CTRL+I)",-1),m1=l("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),h1=[p1,m1],g1=l("title",null,"Insert Link (CTRL+K)",-1),y1=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),b1=[g1,y1],w1=l("title",null,"Blockquote (CTRL+Q)",-1),k1=l("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),_1=[w1,k1],$1=l("title",null,"Insert Image (CTRL+SHIFT+L)",-1),C1=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),x1=[$1,C1],L1=l("title",null,"Insert Code (CTRL+<)",-1),V1=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),M1=[L1,V1],S1=l("title",null,"H2 Heading (CTRL+H)",-1),A1=l("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),T1=[S1,A1],F1=l("title",null,"Numbered List (ALT+1)",-1),I1=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),D1=[F1,I1],j1=l("title",null,"Bulleted List (ALT+-)",-1),O1=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),P1=[j1,O1],B1=l("title",null,"Strike Through (ALT+S)",-1),H1=l("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),R1=[B1,H1],E1=l("title",null,"Undo (CTRL+Z)",-1),N1=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),z1=[E1,N1],U1=l("title",null,"Redo (CTRL+SHIFT+Z)",-1),q1=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),Q1=[U1,q1],K1={key:0,class:"p-2 flex flex-wrap gap-x-4"},Z1=["href"],W1=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),G1=[W1],J1={class:""},X1=["name","id","label","value","rows","disabled"],Y1=["id"],eh=["id"],nt="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",th=ue({__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,s=a,h=[],y=[],i=Je("ApiState",void 0),u=v(()=>_t.call({responseStatus:n.status??(null==i?void 0:i.error.value)},n.id)),d=v(()=>n.label??Re(ft(n.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),p=v(()=>n.hide?jt(c,n.hide):jt(c,[]));function f(e){return p.value[e]}let m=v(()=>["shadow-sm font-mono"+ct.base.replace("rounded-md",""),u.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+ct.valid,n.inputClass]),b=I();function w(e){s("update:modelValue",e)}function x(){return b.value.selectionStart!==b.value.selectionEnd}function k(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function C(){var e=b.value,l=e.value,t=e.selectionStart,e=l.substring(t,e.selectionEnd)||"",a=l.substring(0,t),r=a.lastIndexOf(`
|
|
3
|
-
`);return{value:l,sel:e,selPos:t,beforeSel:a,afterSel:l.substring(t),prevCRPos:r,beforeCR:0<=r?a.substring(0,r+1):"",afterCR:0<=r?a.substring(r+1):""}}function M({value:e,selectionStart:l,selectionEnd:t}){null==t&&(t=l),w(e),Ot(()=>{b.value.focus(),b.value.setSelectionRange(l,t)})}function S(e,l,t="",{selectionAtEnd:a,offsetStart:r,offsetEnd:n,filterValue:s,filterSelection:o}={}){let i=b.value,u=i.value,d=i.selectionEnd;h.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),y=[];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,r=0,n=(null==t?void 0:t.length)||0,a&&(d+=n,n=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),r=-v.length-e.length,n=v.length):(u=f+e+v+l+m,r?d+=(e+l).length:(d=c,r=e.length,n=v.length))),w(u),Ot(()=>{i.focus(),r=d+(r||0),n=(r||0)+(n||0),i.setSelectionRange(r,n)})}t({props:n,textarea:b,updateModelValue:w,selection:k,hasSelection:x,selectionInfo:C,insert:S,replace:M});let V=()=>S("**","**","bold"),T=()=>S("_","_","italics"),A=()=>S("~~","~~","strikethrough"),$=()=>S("[","](https://)","",{offsetStart:-9,offsetEnd:8}),j=()=>S(`
|
|
4
|
-
> `,`
|
|
5
|
-
`,"Blockquote",{}),O=()=>S("");function E(e){var l,t=k();t&&!e.shiftKey?S("`","`","code"):(l=n.lang||"js",-1===t.indexOf(`
|
|
6
|
-
`)?S("\n```"+l+`
|
|
7
|
-
`,"\n```\n","// code"):S("```"+l+`
|
|
8
|
-
`,"```\n",""))}function H(){if(x()){let{sel:e,beforeSel:a,afterSel:r,prevCRPos:n,beforeCR:s,afterCR:o}=C();if(-1===e.indexOf(`
|
|
9
|
-
`))S(`
|
|
10
|
-
1. `,`
|
|
11
|
-
`);else if(e.startsWith(" 1. "))S("","","",{filterValue:(e,l)=>{var t;return 0<=n&&(t=o.replace(/^ - /,""),a=s+t,l.pos-=o.length-t.length),a+r},filterSelection:e=>e.replace(/^ 1. /g,"").replace(/\n \d+. /g,`
|
|
12
|
-
`)});else{let l=1;S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" 1. "+e.replace(/\n$/,"").replace(/\n/g,e=>`
|
|
13
|
-
${++l}. `)+`
|
|
14
|
-
`})}}else S(`
|
|
15
|
-
1. `,`
|
|
16
|
-
`,"List Item",{offsetStart:-10,offsetEnd:9})}function B(){if(x()){let{sel:e,beforeSel:a,afterSel:r,prevCRPos:n,beforeCR:s,afterCR:o}=C();-1===e.indexOf(`
|
|
17
|
-
`)?S(`
|
|
18
|
-
- `,`
|
|
19
|
-
`):e.startsWith(" - ")?S("","","",{filterValue:(e,l)=>{var t;return 0<=n&&(t=o.replace(/^ - /,""),a=s+t,l.pos-=o.length-t.length),a+r},filterSelection:e=>e.replace(/^ - /g,"").replace(/\n - /g,`
|
|
20
|
-
`)}):S("",""," - ",{selectionAtEnd:!0,filterSelection:e=>" - "+e.replace(/\n$/,"").replace(/\n/g,`
|
|
21
|
-
- `)+`
|
|
22
|
-
`})}else S(`
|
|
23
|
-
- `,`
|
|
24
|
-
`,"List Item",{offsetStart:-10,offsetEnd:9})}function _(){var e=k(),l=-1===e.indexOf(`
|
|
25
|
-
`);e?l?S(`
|
|
26
|
-
## `,`
|
|
27
|
-
`,""):S("## ","",""):S(`
|
|
28
|
-
## `,`
|
|
29
|
-
`,"Heading",{offsetStart:-8,offsetEnd:7})}function D(){var e,l;return 0!==h.length&&(e=b.value,l=h.pop(),y.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),M(l),!0)}function R(){var e,l;return 0!==y.length&&(e=b.value,l=y.pop(),h.push({value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}),M(l),!0)}let P=()=>null;return at(()=>{h=[],y=[],b.value.onkeydown=e=>{if("Escape"===e.key||27===e.keyCode)s("close");else{var l=String.fromCharCode(e.keyCode).toLowerCase();if("\t"===l)e.shiftKey?S("","","",{filterValue:(e,l)=>{let{beforeSel:t,afterSel:a,prevCRPos:r,beforeCR:n,afterCR:s}=C();var o;return 0<=r&&(o=s.replace(/\t/g," ").replace(/^ ? ? ? ?/,""),t=n+o,l.pos-=s.length-o.length),t+a},filterSelection:e=>e.replace(/\t/g," ").replace(/^ ? ? ? ?/g,"").replace(/\n /g,`
|
|
30
|
-
`)}):S("",""," ",{selectionAtEnd:!0,filterSelection:e=>" "+e.replace(/\n$/,"").replace(/\n/g,`
|
|
31
|
-
`)+`
|
|
32
|
-
`}),e.preventDefault();else if(e.ctrlKey)if("z"===l)e.shiftKey?R()&&e.preventDefault():D()&&e.preventDefault();else if("b"!==l||e.shiftKey)if("h"!==l||e.shiftKey)if("i"!==l||e.shiftKey)if("q"!==l||e.shiftKey)if("k"===l)(e.shiftKey?O:$)(),e.preventDefault();else if(","===l||"<"===e.key||">"===e.key||188===e.keyCode)E(e),e.preventDefault();else if("/"!==l&&"/"!==e.key)"?"!==l&&"?"!==e.key||!e.shiftKey||(S(`/*
|
|
33
|
-
`,`*/
|
|
34
|
-
`,""),e.preventDefault());else{{let{sel:e,selPos:l,beforeSel:a,afterSel:r,prevCRPos:n,beforeCR:s,afterCR:o}=C();e.startsWith("//")||o.startsWith("//")?S("","","",{filterValue:(e,l)=>{var t;return 0<=n&&(t=o.replace(/^\/\//,""),a=s+t,l.pos-=o.length-t.length),a+r},filterSelection:e=>e.replace(/^\/\//g,"").replace(/\n\/\//g,`
|
|
35
|
-
`)}):e?S("","","//",{selectionAtEnd:!0,filterSelection:e=>"//"+e.replace(/\n$/,"").replace(/\n/g,`
|
|
36
|
-
//`)+`
|
|
37
|
-
`}):M({value:s+"//"+o+r,selectionStart:l+2})}e.preventDefault()}else j(),e.preventDefault();else T(),e.preventDefault();else _(),e.preventDefault();else V(),e.preventDefault();else e.altKey&&("1"===e.key||"0"===e.key?(H(),e.preventDefault()):"-"===e.key?(B(),e.preventDefault()):"s"===e.key&&(A(),e.preventDefault()))}}}),(e,t)=>{var a;return o(),r("div",null,[z(e.$slots,"header",Se({inputElement:b.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs)),d.value?(o(),r("label",{key:0,for:e.id,class:g("mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300 "+(e.labelClass??""))},F(d.value),11,i1)):L("",!0),e.disabled?L("",!0):(o(),r("div",u1,[l("div",d1,[f("bold")?(o(),r("svg",{key:0,class:g(nt),onClick:V,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},v1)):L("",!0),f("italics")?(o(),r("svg",{key:1,class:g(nt),onClick:T,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},h1)):L("",!0),f("link")?(o(),r("svg",{key:2,class:g(nt),onClick:$,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},b1)):L("",!0),f("blockquote")?(o(),r("svg",{key:3,class:g(nt),onClick:j,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},_1)):L("",!0),f("image")?(o(),r("svg",{key:4,class:g(nt),onClick:O,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},x1)):L("",!0),f("code")?(o(),r("svg",{key:5,class:g(nt),onClick:E,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},M1)):L("",!0),f("heading")?(o(),r("svg",{key:6,class:g(nt),onClick:_,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},T1)):L("",!0),f("orderedList")?(o(),r("svg",{key:7,class:g(nt),icon:"",onClick:H,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},D1)):L("",!0),f("unorderedList")?(o(),r("svg",{key:8,class:g(nt),onClick:B,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},P1)):L("",!0),f("strikethrough")?(o(),r("svg",{key:9,class:g(nt),onClick:A,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},R1)):L("",!0),f("undo")?(o(),r("svg",{key:10,class:g(nt),onClick:D,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},z1)):L("",!0),f("redo")?(o(),r("svg",{key:11,class:g(nt),onClick:R,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Q1)):L("",!0),z(e.$slots,"toolbarbuttons",{instance:null==(a=He())?void 0:a.exposed})]),f("help")&&e.helpUrl?(o(),r("div",K1,[l("a",{title:"formatting help",target:"_blank",href:e.helpUrl,tabindex:"-1"},[(o(),r("svg",{class:g(nt),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},G1))],8,Z1)])):L("",!0)])),l("div",J1,[l("textarea",{ref_key:"txt",ref:b,name:e.id,id:e.id,class:g(m.value),label:e.label,value:e.modelValue,rows:e.rows||6,disabled:e.disabled,onInput:t[0]||(t[0]=e=>{var l;return w((null==(l=e.target)?void 0:l.value)||"")}),onKeydown:dn(P,["tab"])},null,42,X1)]),u.value?(o(),r("p",{key:2,class:"mt-2 text-sm text-red-500",id:e.id+"-error"},F(u.value),9,Y1)):e.help?(o(),r("p",{key:3,class:"mt-2 text-sm text-gray-500",id:e.id+"-description"},F(e.help),9,eh)):L("",!0),z(e.$slots,"footer",Se({inputElement:b.value,id:e.id,modelValue:e.modelValue,status:e.status},e.$attrs))])}}}),sh={key:0,class:"relative z-10 lg:hidden",role:"dialog","aria-modal":"true"},lh={class:"fixed inset-0 flex"},nh=l("span",{class:"sr-only"},"Close sidebar",-1),oh=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),ah=[nh,oh],rh={class:"flex grow flex-col gap-y-5 overflow-y-auto bg-white dark:bg-black px-6 pb-2"},ih={class:"hidden lg:fixed lg:inset-y-0 lg:z-10 lg:flex lg:w-72 lg:flex-col"},uh={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"},dh={class:g(["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"])},ch=l("span",{class:"sr-only"},"Open sidebar",-1),fh=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),vh=[ch,fh],ph=ue({__name:"SidebarLayout",setup(e,{expose:t}){let a=so().transition,n=I(!0),s=I(""),i={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=I(""),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=I(""),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(i,s,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(),r("div",null,[n.value?(o(),r("div",sh,[l("div",{class:g(["fixed inset-0 bg-gray-900/80",s.value])},null,2),l("div",lh,[l("div",{class:g(["relative mr-16 flex w-full max-w-xs flex-1",u.value])},[l("div",{class:g(["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"},ah)],2),l("div",rh,[z(e.$slots,"default")])],2)])])):L("",!0),l("div",ih,[l("div",uh,[z(e.$slots,"default")])]),l("div",dh,[l("button",{type:"button",onClick:f,class:"-m-2.5 p-2.5 text-gray-700 dark:text-gray-200 lg:hidden"},vh),z(e.$slots,"mobiletitlebar")])]))}}),mh=Ja,hh=ur,gh=pr,yh=hr,bh=oo,wh=_r,kh=xr,_h=Mr,$h=Tr,Ch=Fr,xh=Br,Lh=zr,Vh=Qr,Mh=li,Sh=$d,Ah=Pd,Th=Rl,Fh=Hl,Ih=El,Dh=ao,jh=Bd,Oh=Kd,Ph=ec,Bh=ac,Hh=pc,Rh=Oc,Eh=o0,Nh=k0,zh=C0,Uh=x0,qh=E0,Qh=N0,Kh=ff,Zh=If,Wh=ev,Gh=wv,Jh=_v,Xh=Mv,Yh=Iv,eg=Dv,tg=Rv,sg=qv,lg=Zv,ng=lp,og=up,ag=Cp,rg=Fp,ig=Mm,ug=Pm,dg=Nm,cg=r1,fg=th,vg=ph,pg={Alert:mh,AlertSuccess:hh,ErrorSummary:gh,InputDescription:yh,Icon:bh,Loading:wh,OutlineButton:kh,PrimaryButton:_h,SecondaryButton:$h,TextLink:Ch,Breadcrumbs:xh,Breadcrumb:Lh,NavList:Vh,NavListItem:Mh,AutoQueryGrid:Sh,SettingsIcons:Ah,FilterViews:Th,FilterColumn:Fh,QueryPrefs:Ih,EnsureAccess:Dh,EnsureAccessDialog:jh,TextInput:Oh,TextareaInput:Ph,SelectInput:Bh,CheckboxInput:Hh,TagInput:Rh,FileInput:Eh,Autocomplete:Nh,Combobox:zh,DynamicInput:Uh,LookupInput:qh,AutoFormFields:Qh,AutoForm:Kh,AutoCreateForm:Zh,AutoEditForm:Wh,AutoViewForm:Gh,ConfirmDelete:Jh,FormLoading:Xh,DataGrid:Yh,CellFormat:eg,PreviewFormat:tg,HtmlFormat:sg,MarkupFormat:lg,MarkupModel:ng,CloseButton:og,SlideOver:ag,ModalDialog:rg,ModalLookup:ig,Tabs:ug,DarkModeToggle:dg,SignIn:cg,MarkdownInput:fg,SidebarLayout:vg},tl=pg||{},wg={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(tl).forEach(e=>{l.component(e,tl[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?X.components[e]=l:X.components[e]||tl[e]||null:null}};export{mh as Alert,hh as AlertSuccess,Zh as AutoCreateForm,Wh as AutoEditForm,Kh as AutoForm,Qh as AutoFormFields,Sh as AutoQueryGrid,Gh as AutoViewForm,Nh as Autocomplete,Lh as Breadcrumb,xh as Breadcrumbs,eg as CellFormat,Hh as CheckboxInput,og as CloseButton,zh as Combobox,pg as Components,Jh as ConfirmDelete,dg as DarkModeToggle,Yh as DataGrid,Uh as DynamicInput,Dh as EnsureAccess,jh as EnsureAccessDialog,gh as ErrorSummary,Eh as FileInput,Fh as FilterColumn,Th as FilterViews,Xh as FormLoading,sg as HtmlFormat,bh as Icon,yh as InputDescription,wh as Loading,qh as LookupInput,fg as MarkdownInput,lg as MarkupFormat,ng as MarkupModel,qo as MetadataApp,rg as ModalDialog,ig as ModalLookup,Vh as NavList,Mh as NavListItem,kh as OutlineButton,tg as PreviewFormat,_h as PrimaryButton,Ih as QueryPrefs,$h as SecondaryButton,Bh as SelectInput,Ah as SettingsIcons,vg as SidebarLayout,cg as SignIn,ag as SlideOver,ug as Tabs,Rh as TagInput,Oh as TextInput,Ch as TextLink,Ph as TextareaInput,bg as css,wg as default,Bl as useAuth,ys as useClient,Nt as useConfig,Uo as useFiles,yg as useFormatters,ut as useMetadata,so as useUtils};
|